@pega/cosmos-react-social 4.0.0-dev.21.0 → 4.0.0-dev.22.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/Feed/Feed.context.d.ts +2 -1
- package/lib/components/Feed/Feed.context.d.ts.map +1 -1
- package/lib/components/Feed/Feed.context.js.map +1 -1
- package/lib/components/Feed/Feed.d.ts +3 -53
- package/lib/components/Feed/Feed.d.ts.map +1 -1
- package/lib/components/Feed/Feed.js +27 -29
- package/lib/components/Feed/Feed.js.map +1 -1
- package/lib/components/Feed/Feed.types.d.ts +330 -0
- package/lib/components/Feed/Feed.types.d.ts.map +1 -0
- package/lib/components/Feed/Feed.types.js +2 -0
- package/lib/components/Feed/Feed.types.js.map +1 -0
- package/lib/components/Feed/FeedAnnouncer.d.ts +2 -3
- package/lib/components/Feed/FeedAnnouncer.d.ts.map +1 -1
- package/lib/components/Feed/FeedAnnouncer.js.map +1 -1
- package/lib/components/Feed/FeedAttachments.d.ts +3 -9
- package/lib/components/Feed/FeedAttachments.d.ts.map +1 -1
- package/lib/components/Feed/FeedAttachments.js +17 -10
- package/lib/components/Feed/FeedAttachments.js.map +1 -1
- package/lib/components/Feed/FeedButton.d.ts +0 -1
- package/lib/components/Feed/FeedButton.d.ts.map +1 -1
- package/lib/components/Feed/FeedButton.js +2 -10
- package/lib/components/Feed/FeedButton.js.map +1 -1
- package/lib/components/Feed/FeedContent.d.ts +2 -10
- package/lib/components/Feed/FeedContent.d.ts.map +1 -1
- package/lib/components/Feed/FeedContent.js +8 -1
- package/lib/components/Feed/FeedContent.js.map +1 -1
- package/lib/components/Feed/FeedContentFooter.d.ts +5 -0
- package/lib/components/Feed/FeedContentFooter.d.ts.map +1 -0
- package/lib/components/Feed/FeedContentFooter.js +34 -0
- package/lib/components/Feed/FeedContentFooter.js.map +1 -0
- package/lib/components/Feed/FeedContentHeader.d.ts +5 -0
- package/lib/components/Feed/FeedContentHeader.d.ts.map +1 -0
- package/lib/components/Feed/FeedContentHeader.js +101 -0
- package/lib/components/Feed/FeedContentHeader.js.map +1 -0
- package/lib/components/Feed/FeedEditRegion.d.ts +6 -0
- package/lib/components/Feed/FeedEditRegion.d.ts.map +1 -0
- package/lib/components/Feed/FeedEditRegion.js +46 -0
- package/lib/components/Feed/FeedEditRegion.js.map +1 -0
- package/lib/components/Feed/FeedInputRegion.d.ts +8 -0
- package/lib/components/Feed/FeedInputRegion.d.ts.map +1 -0
- package/lib/components/Feed/FeedInputRegion.js +86 -0
- package/lib/components/Feed/FeedInputRegion.js.map +1 -0
- package/lib/components/Feed/FeedLikeButton.d.ts +5 -17
- package/lib/components/Feed/FeedLikeButton.d.ts.map +1 -1
- package/lib/components/Feed/FeedLikeButton.js +44 -30
- package/lib/components/Feed/FeedLikeButton.js.map +1 -1
- package/lib/components/Feed/FeedModalList.d.ts +1 -13
- package/lib/components/Feed/FeedModalList.d.ts.map +1 -1
- package/lib/components/Feed/FeedModalList.js +5 -2
- package/lib/components/Feed/FeedModalList.js.map +1 -1
- package/lib/components/Feed/FeedNewPost.d.ts +1 -30
- package/lib/components/Feed/FeedNewPost.d.ts.map +1 -1
- package/lib/components/Feed/FeedNewPost.js +7 -85
- package/lib/components/Feed/FeedNewPost.js.map +1 -1
- package/lib/components/Feed/FeedNewPostTypeMenu.d.ts +2 -28
- package/lib/components/Feed/FeedNewPostTypeMenu.d.ts.map +1 -1
- package/lib/components/Feed/FeedNewPostTypeMenu.js +2 -2
- package/lib/components/Feed/FeedNewPostTypeMenu.js.map +1 -1
- package/lib/components/Feed/FeedPost.d.ts +2 -4
- package/lib/components/Feed/FeedPost.d.ts.map +1 -1
- package/lib/components/Feed/FeedPost.js +96 -159
- package/lib/components/Feed/FeedPost.js.map +1 -1
- package/lib/components/Feed/FeedReply.d.ts +1 -4
- package/lib/components/Feed/FeedReply.d.ts.map +1 -1
- package/lib/components/Feed/FeedReply.js +56 -138
- package/lib/components/Feed/FeedReply.js.map +1 -1
- package/lib/components/Feed/FeedReplyInput.d.ts +2 -27
- package/lib/components/Feed/FeedReplyInput.d.ts.map +1 -1
- package/lib/components/Feed/FeedReplyInput.js +9 -96
- package/lib/components/Feed/FeedReplyInput.js.map +1 -1
- package/lib/components/Feed/FeedRichText.d.ts +1 -4
- package/lib/components/Feed/FeedRichText.d.ts.map +1 -1
- package/lib/components/Feed/FeedRichText.js +3 -8
- package/lib/components/Feed/FeedRichText.js.map +1 -1
- package/lib/components/Feed/index.d.ts +1 -7
- package/lib/components/Feed/index.d.ts.map +1 -1
- package/lib/components/Feed/index.js.map +1 -1
- package/package.json +4 -4
- package/lib/components/Feed/FeedPost.types.d.ts +0 -105
- package/lib/components/Feed/FeedPost.types.d.ts.map +0 -1
- package/lib/components/Feed/FeedPost.types.js +0 -2
- package/lib/components/Feed/FeedPost.types.js.map +0 -1
- package/lib/components/Feed/FeedReply.types.d.ts +0 -70
- package/lib/components/Feed/FeedReply.types.d.ts.map +0 -1
- package/lib/components/Feed/FeedReply.types.js +0 -2
- package/lib/components/Feed/FeedReply.types.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Feed.types.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/Feed.types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,GAAG,EACH,cAAc,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,MAAM;IACrB,oFAAoF;IAC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C,CAAC;IACnC,UAAU,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACzC,iBAAiB,CAAC,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;IACvD,iBAAiB,CAAC,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;IACvD,cAAc,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CACvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Feed.types.js","sourceRoot":"","sources":["../../../src/components/Feed/Feed.types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n Dispatch,\n MouseEvent,\n MutableRefObject,\n ReactElement,\n ReactNode,\n Ref,\n SetStateAction\n} from 'react';\n\nimport {\n AvatarProps,\n DateTimeDisplayProps,\n FileUploadItemProps,\n MenuItemProps,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\nimport { RichTextEditorProps, RichTextEditorState } from '@pega/cosmos-react-rte';\n\nimport { FeedContextValue } from './Feed.context';\n\nexport interface SubComponentVariant {\n variant: 'post' | 'reply';\n}\n\nexport interface Filter {\n /** Sets DOM id for the control and associates label element via 'for' attribute. */\n id: string;\n /** Pass a string or a fragment with an Icon and string for the filter label. */\n label: ReactNode;\n /**\n * Disables the filter.\n * @default false\n */\n disabled?: boolean;\n /**\n * Sets on prop via onFilterChange.\n * @default false\n */\n on?: boolean;\n}\n\nexport interface FeedProps extends NoChildrenProp {\n /** Title for the feed. */\n title: string;\n /** Information related to the user of the Feed. */\n userInfo: FeedContextValue['userInfo'];\n /** A set of search types that can be used to determine which data set to conduct a mention search on. */\n searchTypes?: FeedContextValue['searchTypes'];\n /** A callback that runs when a decorator search has been run inside of the feed. */\n onDecoratorSearch?: FeedContextValue['onSearch'];\n /** Results that will be shown in a Popover for a mention or tag search. */\n searchResults?: FeedContextValue['searchResults'];\n /** A callback that is triggered when a mention button is clicked. The callback sends back the id, text, and type of the mention. The callback should return a function component. */\n onMentionClick?: FeedContextValue['onMentionClick'];\n /** A callback that is triggered when a mention link is previewed. The callback sends back the id, text, and type of the mention. */\n onMentionPreview?: FeedContextValue['onMentionPreview'];\n /** A callback that is triggered when a hashtag is clicked. The callback sends back the test of the tag. */\n onTagClick?: FeedContextValue['onTagClick'];\n /** A list of configuration objects used to render custom components within Feed posts and replies based off of a given regex pattern. */\n interactionRenderers?: FeedContextValue['interactionRenderers'];\n /** A mapping for various element types to render custom components for within posts. */\n markdownMap?: FeedContextValue['markdownMap'];\n /** A set of filters to apply to the Feed. */\n filters?: Filter[];\n /** A callback that runs when the filter is toggled. */\n onFilterChange?: (filterId: string, on: boolean) => void;\n /** A callback that is triggered when the bottom of the Feed is scrolled into view so that additional posts may be displayed. */\n onLoadMore?: () => void;\n /** Indicates if the posts are being currently loading */\n loadingPosts?: boolean;\n /** A region to hold the new post component */\n newPostRegion?: ReactNode;\n /** A list of FeedPost components */\n posts?: ReactNode[];\n}\n\nexport type FeedRichTextProps = Pick<\n RichTextEditorProps,\n 'label' | 'onChange' | 'onFocus' | 'onBlur' | 'height'\n>;\n\nexport type AttachedFiles = FileUploadItemProps & File;\n\nexport interface FeedAttachmentsProps extends SubComponentVariant {\n attachments?: AttachedFiles[];\n readOnly?: boolean;\n ref?: Ref<HTMLUListElement>;\n}\nexport interface FeedCompositionBaseProps {\n /** A unique ID for the new message. */\n id: string;\n /** A set of attachment files. */\n attachments?: AttachedFiles[];\n /** A callback containing a list of added files that will run whenever files are added to the message. */\n onFilesAdded?: (files: AttachedFiles[]) => void;\n /** Callback that runs when the submit button has been clicked. */\n onSubmit: (event: {\n id: string;\n value: string;\n attachments: AttachedFiles[];\n recipients?: RecipientMenuItem[];\n username: string;\n clear: () => void;\n }) => void;\n}\n\nexport interface FeedInputRegionProps extends SubComponentVariant, FeedCompositionBaseProps {\n inputRegionEl: HTMLDivElement | null;\n rteRef: MutableRefObject<RichTextEditorState | undefined>;\n selectedRecipients?: RecipientMenuItem[];\n}\n\nexport interface FeedEditRegionProps\n extends SubComponentVariant,\n Pick<FeedMessageBaseProps, 'id' | 'content' | 'onEditSubmit'> {\n setEditMode: Dispatch<SetStateAction<boolean>>;\n emptyEditText: boolean;\n setEmptyEditText: Dispatch<SetStateAction<boolean>>;\n}\n\nexport interface FeedNewPostProps extends FeedCompositionBaseProps {\n /** If true, the new post input will focus on page load. */\n autoFocus?: boolean;\n /** Array of private recipient options. */\n recipients?: PostTypeMenuProps['recipients'];\n /** Handler for new search on private recipient options. */\n onRecipientSearch?: (newSearch: string) => void;\n}\n\nexport interface FeedReplyInputProps extends FeedCompositionBaseProps {\n /** Callback that sets returns a shared ref to the RTE component */\n onSetInputRef?: (event: { ref: MutableRefObject<RichTextEditorState | undefined> }) => void;\n}\n\nexport interface FeedModalListProps {\n /** The count for the list of items. */\n count: number;\n /** The heading for the Modal. */\n heading: string;\n /** The list of MenuItems to render in the Modal. */\n listItems: MenuItemProps[];\n /** A callback that is triggered when the bottom of the Modal list is scrolled into view so that additional data may be displayed. */\n onLoadMore?: () => void;\n /** Indicates if the data is being currently loading */\n loading?: boolean;\n}\n\nexport type PostType = 'post' | 'private';\n\nexport interface RecipientOption {\n /** Pretty printed recipient name */\n primary: string;\n /** Functional identifier of unique recipient */\n value: string;\n}\n\nexport interface RecipientMenuItem {\n id: string;\n selected?: boolean;\n primary: RecipientOption['primary'];\n value: RecipientOption['value'];\n secondary?: MenuItemProps['secondary'];\n visual?: MenuItemProps['visual'];\n}\nexport interface PostTypeMenuProps {\n /** Array of private recipient options */\n recipients: RecipientOption[];\n /** Post type update handler */\n onSetPostType: (postType: PostType) => void;\n /** Private post recipient list update handler */\n onSelectedRecipientsUpdate: (recipients: RecipientMenuItem[]) => void;\n /** Handler for new search on private recipient options */\n onRecipientSearch: (newSearch: string) => void;\n reset: boolean;\n onReset: () => void;\n}\n\nexport interface PostTypeMenuState {\n postType: PostType;\n itemsLoading: boolean;\n showTypeMenu: boolean;\n showRecipientMenu: boolean;\n viewingRecipients: boolean;\n searchValue: string;\n typeMenuItems: {\n id: string;\n primary: string;\n selected: boolean;\n value: PostType;\n }[];\n recipientMenuItems: RecipientMenuItem[];\n multiSelectItems: RecipientMenuItem[];\n}\n\nexport interface FeedContentProps {\n children: ReactElement | string;\n /**\n * A maximum height in pixels to display post content within before prompting to expand the post.\n * @default Infinity\n */\n maxContentHeight?: number;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport interface FeedMessageBaseProps {\n /** Unique ID for the message. */\n id: string;\n /** Display name for the message author. */\n fullname: string;\n /** Username for the message author. */\n username: string;\n /** A timestamp of when the message was initially submitted. */\n postTimestamp: DateTimeDisplayProps['value'];\n /** The message content. */\n content: ReactElement | string;\n /** Attachments on the message. */\n attachments?: AttachedFiles[];\n /** An image source for the message author's Avatar. */\n avatarSrc?: string;\n /** The name of an icon to render within the Avatar. */\n icon?: string;\n /** The status of the message author. */\n userStatus?: AvatarProps['status'];\n /** Set true if the user has liked the message. */\n liked?: boolean;\n /** A set of users that have liked the message. */\n likes?: MenuItemProps[];\n /** The total count of likes on the message. */\n likeCount?: number;\n /**\n * If true, the like and comment buttons will be enabled.\n * @default true\n */\n interactionsEnabled?: boolean;\n /**\n * A maximum height in pixels to display message content within before prompting to expand the message.\n * @default Infinity\n */\n maxContentHeight?: FeedContentProps['maxContentHeight'];\n /** A set of menu options for actions on the message. */\n menuItems?: MenuItemProps[];\n /** Callback that updates the message after being edited. If undefined, the message will not be editable. */\n onEditSubmit?: (event: { id: string; value: string }) => void;\n /**\n * Flag that indicates if a message has been previously edited.\n * @default false\n */\n edited?: boolean;\n /** A timestamp of when the message was last edited. This will only display if edited prop is true. */\n editTimestamp?: DateTimeDisplayProps['value'];\n /** Callback that runs when the mouse pointer hovers over the message. */\n onMouseEnter?: (event: { id: string }) => void;\n /** Callback that runs when the mouse pointer leaves the message. */\n onMouseLeave?: (event: { id: string }) => void;\n /** Callback that runs when the author's name or Avatar has been clicked. */\n onUserClick?: (event: { id: string; username: string }, clickEvent?: MouseEvent) => void;\n /** Callback that runs when the comment button has been clicked. */\n onCommentClick: (event: { id: string; username: string }) => void;\n /** Callback that runs when the like button has been clicked. */\n onLikeClick: (event: { id: string; user: MenuItemProps }) => void;\n /** Callback that runs when the like count on a message is hovered, focused, or clicked. */\n onLikeCountInteraction?: () => void;\n /** Callback that runs when the bottom of the extended like list Modal is reached, allowing for more likes to be loaded. */\n onLoadMoreLikes?: () => void;\n /** A loading indicator for the likes Modal. */\n likesLoading?: boolean;\n}\n\nexport interface FeedPostProps extends FeedMessageBaseProps {\n /**\n * The type of message. If private, then only the designated recipients will be able to view the message.\n * @default 'public'\n */\n postType?: 'public' | 'private';\n /** The set of recipients assigned to a private message. */\n recipients?: MenuItemProps[];\n /** The total number of private recipients. */\n recipientsCount?: number;\n /** The context of the message. */\n postContext?: ReactElement | string;\n /** Callback that runs when the private recipient icon on a post is hovered, focused, or clicked. */\n onRecipientInteraction?: () => void;\n /** Callback that runs when the bottom of the extended private recipient list Modal is reached, allowing for more recipients to be loaded. */\n onLoadMoreRecipients?: () => void;\n /** A loading indicator for the recipients Modal. */\n recipientsLoading?: boolean;\n /** Props that will be passed into the reply input, see FeedReplyInput for more information. */\n replyInput: Pick<FeedReplyInputProps, 'onSubmit' | 'onFilesAdded' | 'attachments'>;\n /** The default visibility for the reply input. */\n replyInputShown?: boolean;\n /** An array to of replies for this message. */\n replies?: ReactElement[];\n /** A total count of all replies. */\n replyCount?: number;\n /** Callback that runs when the user clicks Show more button for the replies. */\n onShowMoreReplies?: (event: { id: string }) => void;\n /** Callback that runs when the user clicks Show less button for the replies. */\n onShowLessReplies?: (event: { id: string }) => void;\n /** A loading indicator for the replies. */\n repliesLoading?: boolean;\n}\n\nexport type FeedReplyProps = FeedMessageBaseProps;\n\nexport interface FeedContentHeaderProps extends SubComponentVariant {\n id: FeedMessageBaseProps['id'];\n fullname: FeedMessageBaseProps['fullname'];\n username: FeedMessageBaseProps['username'];\n postTimestamp: FeedMessageBaseProps['postTimestamp'];\n content: FeedMessageBaseProps['content'];\n avatarSrc?: FeedMessageBaseProps['avatarSrc'];\n icon?: FeedMessageBaseProps['icon'];\n userStatus?: FeedMessageBaseProps['userStatus'];\n postType?: FeedPostProps['postType'];\n postContext?: FeedPostProps['postContext'];\n recipients?: FeedPostProps['recipients'];\n recipientsCount?: FeedPostProps['recipientsCount'];\n menuItems?: FeedMessageBaseProps['menuItems'];\n edited?: FeedMessageBaseProps['edited'];\n editTimestamp?: FeedMessageBaseProps['editTimestamp'];\n recipientsLoading?: FeedPostProps['recipientsLoading'];\n onEditSubmit?: FeedMessageBaseProps['onEditSubmit'];\n onLoadMoreRecipients?: FeedPostProps['onLoadMoreRecipients'];\n onRecipientInteraction?: FeedPostProps['onRecipientInteraction'];\n onUserClick?: FeedMessageBaseProps['onUserClick'];\n setEditMode: Dispatch<SetStateAction<boolean>>;\n}\n\nexport interface FeedContentFooterProps extends SubComponentVariant {\n id: FeedMessageBaseProps['id'];\n username: FeedMessageBaseProps['username'];\n liked?: FeedMessageBaseProps['liked'];\n likes?: FeedMessageBaseProps['likes'];\n likeCount?: FeedMessageBaseProps['likeCount'];\n interactionsEnabled?: FeedMessageBaseProps['interactionsEnabled'];\n onCommentClick: FeedMessageBaseProps['onCommentClick'];\n onLikeClick: FeedMessageBaseProps['onLikeClick'];\n onLikeCountInteraction?: FeedMessageBaseProps['onLikeCountInteraction'];\n onLoadMoreLikes?: FeedMessageBaseProps['onLoadMoreLikes'];\n likesLoading?: FeedMessageBaseProps['likesLoading'];\n replies?: FeedPostProps['replies'];\n replyCount?: FeedPostProps['replyCount'];\n onShowMoreReplies?: FeedPostProps['onShowMoreReplies'];\n onShowLessReplies?: FeedPostProps['onShowMoreReplies'];\n repliesLoading?: FeedPostProps['repliesLoading'];\n replyInputOpen?: boolean;\n setReplyInputOpen?: Dispatch<SetStateAction<boolean>>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedAnnouncer.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedAnnouncer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FeedAnnouncer.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedAnnouncer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAO3B,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAE3C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedAnnouncer.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedAnnouncer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,MAAM,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"FeedAnnouncer.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedAnnouncer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAA;IACnC,YAAY;CACf,CAAC;AAEF,MAAM,aAAa,GAA6B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/D,OAAO,KAAC,mBAAmB,iBAAW,QAAQ,YAAE,QAAQ,GAAuB,CAAC;AAClF,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { hideVisually } from 'polished';\nimport { FC } from 'react';\nimport styled from 'styled-components';\n\nconst StyledFeedAnnouncer = styled.span`\n ${hideVisually}\n`;\n\nconst FeedAnnouncer: FC<{ children: string }> = ({ children }) => {\n return <StyledFeedAnnouncer aria-live='polite'>{children}</StyledFeedAnnouncer>;\n};\n\nexport default FeedAnnouncer;\n"]}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import { FC
|
|
2
|
-
import {
|
|
3
|
-
export type AttachedFiles = FileUploadItemProps & File;
|
|
4
|
-
interface FeedAttachmentsProps {
|
|
5
|
-
attachments?: AttachedFiles[];
|
|
6
|
-
readOnly?: boolean;
|
|
7
|
-
ref?: Ref<HTMLUListElement>;
|
|
8
|
-
}
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { FeedAttachmentsProps } from './Feed.types';
|
|
9
3
|
export declare const StyledFeedAttachments: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, {}, never>;
|
|
10
4
|
export declare const StyledImagePreview: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core/lib/components/Button/BareButton").BareButtonProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
11
|
-
export declare const StyledAttachmentsRegion: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme,
|
|
5
|
+
export declare const StyledAttachmentsRegion: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, FeedAttachmentsProps, never>;
|
|
12
6
|
declare const FeedAttachments: FC<FeedAttachmentsProps>;
|
|
13
7
|
export default FeedAttachments;
|
|
14
8
|
//# sourceMappingURL=FeedAttachments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedAttachments.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedAttachments.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"FeedAttachments.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedAttachments.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAsD,MAAM,OAAO,CAAC;AAiB/E,OAAO,EAAiB,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEnE,eAAO,MAAM,qBAAqB,wGAShC,CAAC;AAIH,eAAO,MAAM,kBAAkB,0QAqB7B,CAAC;AAIH,eAAO,MAAM,uBAAuB,2HAiBnC,CAAC;AAIF,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAgE7C,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useEffect, useContext } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
|
-
import { FileUploadItem, Grid, Image, defaultThemeProp, getKindFromMimeType, getMimeTypeFromFile, Flex,
|
|
4
|
+
import { FileUploadItem, Grid, Image, defaultThemeProp, getKindFromMimeType, getMimeTypeFromFile, Flex, usePrevious, useI18n } from '@pega/cosmos-react-core';
|
|
5
5
|
import BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';
|
|
6
6
|
import { FeedContext } from './Feed.context';
|
|
7
7
|
export const StyledFeedAttachments = styled.ul(({ theme }) => {
|
|
@@ -32,24 +32,31 @@ export const StyledImagePreview = styled(BareButton)(({ theme }) => {
|
|
|
32
32
|
img {
|
|
33
33
|
border-radius: calc(0.5 * ${theme.base['border-radius']});
|
|
34
34
|
object-fit: contain;
|
|
35
|
-
max-height:
|
|
35
|
+
max-height: 10rem;
|
|
36
36
|
max-width: 100%;
|
|
37
37
|
}
|
|
38
38
|
`;
|
|
39
39
|
});
|
|
40
40
|
StyledImagePreview.defaultProps = defaultThemeProp;
|
|
41
|
-
export const StyledAttachmentsRegion = styled.div(({ theme }) => {
|
|
41
|
+
export const StyledAttachmentsRegion = styled.div(({ variant, readOnly, theme }) => {
|
|
42
42
|
return css `
|
|
43
|
-
|
|
43
|
+
margin: ${theme.base.spacing} calc(5 * ${theme.base.spacing}) 0
|
|
44
|
+
calc(${variant === 'post' ? 6 : 5} * ${theme.base.spacing});
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
${readOnly &&
|
|
47
|
+
css `
|
|
48
|
+
margin-block-start: ${theme.base.spacing};
|
|
49
|
+
margin-inline: 0;
|
|
50
|
+
|
|
51
|
+
div + ul {
|
|
52
|
+
margin-block-start: ${theme.base.spacing};
|
|
53
|
+
}
|
|
54
|
+
`}
|
|
55
|
+
`;
|
|
49
56
|
});
|
|
50
57
|
StyledAttachmentsRegion.defaultProps = defaultThemeProp;
|
|
51
58
|
const FeedAttachments = forwardRef((props, ref) => {
|
|
52
|
-
const { attachments = [], readOnly } = props;
|
|
59
|
+
const { variant, attachments = [], readOnly } = props;
|
|
53
60
|
const t = useI18n();
|
|
54
61
|
const { announce } = useContext(FeedContext);
|
|
55
62
|
const prevAttachments = usePrevious(attachments) ?? [];
|
|
@@ -74,7 +81,7 @@ const FeedAttachments = forwardRef((props, ref) => {
|
|
|
74
81
|
else
|
|
75
82
|
nonPreviewableFiles.push(file);
|
|
76
83
|
});
|
|
77
|
-
return (_jsxs(StyledAttachmentsRegion, { children: [readOnly && !!previewableFiles.length && (_jsx(Flex, { container: { gap: 1, wrap: 'wrap' }, children: previewableFiles.map(({ lastModified, name, onPreview, thumbnail }) => {
|
|
84
|
+
return (_jsxs(StyledAttachmentsRegion, { variant: variant, readOnly: readOnly, children: [readOnly && !!previewableFiles.length && (_jsx(Flex, { container: { gap: 1, wrap: 'wrap' }, children: previewableFiles.map(({ lastModified, name, onPreview, thumbnail }) => {
|
|
78
85
|
return (_jsx(StyledImagePreview, { onClick: () => onPreview?.(name), children: _jsx(Image, { alt: name, src: thumbnail }) }, lastModified));
|
|
79
86
|
}) })), _jsxs(Grid, { ref: ref, as: StyledFeedAttachments, container: {
|
|
80
87
|
cols: 'repeat(auto-fill, minmax(15rem, 1fr))',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedAttachments.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedAttachments.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"FeedAttachments.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedAttachments.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAmB,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC/E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,cAAc,EACd,IAAI,EACJ,KAAK,EACL,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,IAAI,EACJ,WAAW,EACX,OAAO,EACR,MAAM,yBAAyB,CAAC;AACjC,OAAO,UAAU,MAAM,0DAA0D,CAAC;AAElF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3D,OAAO,GAAG,CAAA;;;;0BAIc,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;;;GAG/D,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACjE,OAAO,GAAG,CAAA;;;gCAGoB,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;;;;;;oBAOvC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC;;;;kCAIzB,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;;;;GAK1D,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAC/C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EhB,CACtB,CAAC;gBACJ,CAAC,CAAC,GACG,CACR,EACD,MAAC,IAAI,IACH,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,qBAAqB,EACzB,SAAS,EAAE;oBACT,IAAI,EAAE,uCAAuC;oBAC7C,GAAG,EAAE,CAAC;iBACP,aAEA,CAAC,QAAQ;wBACR,gBAAgB,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,SAAS,EAAE,EAAE,EAAE;4BAClE,OAAO,KAAC,cAAc,IAAoB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,KAAM,SAAS,IAAnD,YAAY,CAA2C,CAAC;wBACtF,CAAC,CAAC,EACH,mBAAmB,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,SAAS,EAAE,EAAE,EAAE;wBACtE,OAAO,KAAC,cAAc,IAAoB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,KAAM,SAAS,IAAnD,YAAY,CAA2C,CAAC;oBACtF,CAAC,CAAC,IACG,IACiB,CAC3B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { FC, forwardRef, PropsWithoutRef, useEffect, useContext } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n FileUploadItem,\n Grid,\n Image,\n defaultThemeProp,\n getKindFromMimeType,\n getMimeTypeFromFile,\n Flex,\n usePrevious,\n useI18n\n} from '@pega/cosmos-react-core';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\n\nimport { FeedContext } from './Feed.context';\nimport { AttachedFiles, FeedAttachmentsProps } from './Feed.types';\n\nexport const StyledFeedAttachments = styled.ul(({ theme }) => {\n return css`\n overflow-x: auto;\n\n > li {\n background-color: ${theme.base.palette['primary-background']};\n cursor: initial;\n }\n `;\n});\n\nStyledFeedAttachments.defaultProps = defaultThemeProp;\n\nexport const StyledImagePreview = styled(BareButton)(({ theme }) => {\n return css`\n line-height: 0;\n width: fit-content;\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n\n & + & {\n margin: 0;\n }\n\n &:focus {\n box-shadow: ${theme.components.button['focus-shadow']};\n }\n\n img {\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n object-fit: contain;\n max-height: 10rem;\n max-width: 100%;\n }\n `;\n});\n\nStyledImagePreview.defaultProps = defaultThemeProp;\n\nexport const StyledAttachmentsRegion = styled.div<FeedAttachmentsProps>(\n ({ variant, readOnly, theme }) => {\n return css`\n margin: ${theme.base.spacing} calc(5 * ${theme.base.spacing}) 0\n calc(${variant === 'post' ? 6 : 5} * ${theme.base.spacing});\n\n ${readOnly &&\n css`\n margin-block-start: ${theme.base.spacing};\n margin-inline: 0;\n\n div + ul {\n margin-block-start: ${theme.base.spacing};\n }\n `}\n `;\n }\n);\n\nStyledAttachmentsRegion.defaultProps = defaultThemeProp;\n\nconst FeedAttachments: FC<FeedAttachmentsProps> = forwardRef(\n (props: PropsWithoutRef<FeedAttachmentsProps>, ref: FeedAttachmentsProps['ref']) => {\n const { variant, attachments = [], readOnly } = props;\n const t = useI18n();\n const { announce } = useContext(FeedContext);\n const prevAttachments = usePrevious(attachments) ?? [];\n\n useEffect(() => {\n if (!readOnly && attachments.length !== prevAttachments?.length) {\n const difference = attachments.length - prevAttachments.length;\n const normalizedDifference = difference * (difference > 0 ? 1 : -1);\n const timeoutId = announce(\n t(`feed_attachments_${difference > 0 ? 'added' : 'removed'}`, [normalizedDifference], {\n count: normalizedDifference\n })\n );\n return () => clearTimeout(timeoutId);\n }\n }, [attachments, readOnly]);\n\n if (attachments.length === 0) return null;\n\n const previewableFiles: AttachedFiles[] = [];\n const nonPreviewableFiles: AttachedFiles[] = [];\n\n attachments.forEach(file => {\n const type = getKindFromMimeType(getMimeTypeFromFile(file.name) ?? '');\n\n if (type === 'image' && file.thumbnail) previewableFiles.push(file);\n else nonPreviewableFiles.push(file);\n });\n\n return (\n <StyledAttachmentsRegion variant={variant} readOnly={readOnly}>\n {readOnly && !!previewableFiles.length && (\n <Flex container={{ gap: 1, wrap: 'wrap' }}>\n {previewableFiles.map(({ lastModified, name, onPreview, thumbnail }) => {\n return (\n <StyledImagePreview key={lastModified} onClick={() => onPreview?.(name)}>\n <Image alt={name} src={thumbnail} />\n </StyledImagePreview>\n );\n })}\n </Flex>\n )}\n <Grid\n ref={ref}\n as={StyledFeedAttachments}\n container={{\n cols: 'repeat(auto-fill, minmax(15rem, 1fr))',\n gap: 1\n }}\n >\n {!readOnly &&\n previewableFiles.map(({ lastModified, name, size, ...restProps }) => {\n return <FileUploadItem key={lastModified} name={name} size={size} {...restProps} />;\n })}\n {nonPreviewableFiles.map(({ lastModified, name, size, ...restProps }) => {\n return <FileUploadItem key={lastModified} name={name} size={size} {...restProps} />;\n })}\n </Grid>\n </StyledAttachmentsRegion>\n );\n }\n);\n\nexport default FeedAttachments;\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
declare const FeedButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
2
2
|
emphasized?: boolean | undefined;
|
|
3
|
-
icon?: boolean | undefined;
|
|
4
3
|
}, never>;
|
|
5
4
|
export default FeedButton;
|
|
6
5
|
//# sourceMappingURL=FeedButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedButton.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedButton.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"FeedButton.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedButton.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,UAAU;;SAUd,CAAC;AAIH,eAAe,UAAU,CAAC"}
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { defaultThemeProp } from '@pega/cosmos-react-core';
|
|
3
3
|
const FeedButton = styled.button(props => {
|
|
4
|
-
const { emphasized,
|
|
4
|
+
const { emphasized, theme } = props;
|
|
5
5
|
return css `
|
|
6
6
|
color: ${emphasized ? theme.base.palette.interactive : theme.base.palette['foreground-color']};
|
|
7
|
-
vertical-align: top;
|
|
8
7
|
|
|
9
8
|
span {
|
|
10
|
-
margin-inline-start:
|
|
9
|
+
margin-inline-start: ${theme.base.spacing};
|
|
11
10
|
}
|
|
12
|
-
|
|
13
|
-
${icon &&
|
|
14
|
-
css `
|
|
15
|
-
display: inline-flex;
|
|
16
|
-
flex-direction: row;
|
|
17
|
-
align-items: center;
|
|
18
|
-
`}
|
|
19
11
|
`;
|
|
20
12
|
});
|
|
21
13
|
FeedButton.defaultProps = defaultThemeProp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedButton.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedButton.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"FeedButton.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedButton.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAA2B,KAAK,CAAC,EAAE;IACjE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAEpC,OAAO,GAAG,CAAA;aACC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;;;6BAGpE,KAAK,CAAC,IAAI,CAAC,OAAO;;GAE5C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,eAAe,UAAU,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '@pega/cosmos-react-core';\n\nconst FeedButton = styled.button<{ emphasized?: boolean }>(props => {\n const { emphasized, theme } = props;\n\n return css`\n color: ${emphasized ? theme.base.palette.interactive : theme.base.palette['foreground-color']};\n\n span {\n margin-inline-start: ${theme.base.spacing};\n }\n `;\n});\n\nFeedButton.defaultProps = defaultThemeProp;\n\nexport default FeedButton;\n"]}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
import { FC
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
import { ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
-
|
|
4
|
-
children: ReactElement | string;
|
|
5
|
-
/**
|
|
6
|
-
* A maximum height in pixels to display post content within before prompting to expand the post.
|
|
7
|
-
* @default Infinity
|
|
8
|
-
*/
|
|
9
|
-
maxContentHeight?: number;
|
|
10
|
-
ref?: Ref<HTMLDivElement>;
|
|
11
|
-
}
|
|
3
|
+
import { FeedContentProps } from './Feed.types';
|
|
12
4
|
declare const FeedContent: FC<FeedContentProps & ForwardProps>;
|
|
13
5
|
export default FeedContent;
|
|
14
6
|
//# sourceMappingURL=FeedContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedContent.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,EAAE,
|
|
1
|
+
{"version":3,"file":"FeedContent.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,EAAE,EAQH,MAAM,OAAO,CAAC;AAGf,OAAO,EAAgC,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAKrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAQhD,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,GAAG,YAAY,CAsEpD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useState, useMemo, useRef, useEffect, useContext } from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
3
4
|
import { Button, ExpandCollapse, Flex } from '@pega/cosmos-react-core';
|
|
4
5
|
import { RichTextViewer } from '@pega/cosmos-react-rte';
|
|
6
|
+
import { StyledEditorContainer } from '@pega/cosmos-react-rte/lib/components/RichTextEditor/RichTextEditor.styles';
|
|
5
7
|
import { FeedContext } from './Feed.context';
|
|
8
|
+
const StyledContent = styled.div `
|
|
9
|
+
${StyledEditorContainer} {
|
|
10
|
+
padding: 0;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
6
13
|
const FeedContent = forwardRef(({ children, maxContentHeight = Infinity, ...restProps }, ref) => {
|
|
7
14
|
const { interactionRenderers, markdownMap } = useContext(FeedContext);
|
|
8
15
|
const [collapsed, setCollapsed] = useState(true);
|
|
@@ -24,7 +31,7 @@ const FeedContent = forwardRef(({ children, maxContentHeight = Infinity, ...rest
|
|
|
24
31
|
observer.disconnect();
|
|
25
32
|
};
|
|
26
33
|
}, [rtvRef.current, maxContentHeight]);
|
|
27
|
-
return useMemo(() => typeof children === 'string' ? (_jsxs(Flex, { ref: ref, container: { direction: 'column', gap: 1 }, children: [_jsx(ExpandCollapse, { collapsed: collapsed, min: exceedsMaxHeight ? `${maxContentHeight}px` : 'max-content', ...restProps, children: _jsx(RichTextViewer, { ref: rtvRef, content: children, type: 'markdown', interactionRenderers: interactionRenderers, markdownMap: markdownMap }) }), exceedsMaxHeight && (_jsx(Flex, { container: { justify: 'center' }, children: _jsx(Button, { variant: 'link', onClick: () => setCollapsed(current => !current), children: collapsed ? 'Show more' : 'Show less' }) }))] })) : (children), [
|
|
34
|
+
return useMemo(() => typeof children === 'string' ? (_jsxs(Flex, { as: StyledContent, ref: ref, container: { direction: 'column', gap: 1 }, children: [_jsx(ExpandCollapse, { collapsed: collapsed, min: exceedsMaxHeight ? `${maxContentHeight}px` : 'max-content', ...restProps, children: _jsx(RichTextViewer, { ref: rtvRef, content: children, type: 'markdown', interactionRenderers: interactionRenderers, markdownMap: markdownMap }) }), exceedsMaxHeight && (_jsx(Flex, { container: { justify: 'center' }, children: _jsx(Button, { variant: 'link', onClick: () => setCollapsed(current => !current), children: collapsed ? 'Show more' : 'Show less' }) }))] })) : (children), [
|
|
28
35
|
children,
|
|
29
36
|
collapsed,
|
|
30
37
|
exceedsMaxHeight,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedContent.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedContent.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"FeedContent.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EACV,QAAQ,EACR,OAAO,EACP,MAAM,EACN,SAAS,EAET,UAAU,EACX,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAgB,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4EAA4E,CAAC;AAEnH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;IAC5B,qBAAqB;;;CAGxB,CAAC;AAEF,MAAM,WAAW,GAAwC,UAAU,CACjE,CACE,EAAE,QAAQ,EAAE,gBAAgB,GAAG,QAAQ,EAA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3E,KAAC,cAAc,IACb,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,gBAAgB,IAAI,CAAC,CAAC,CAAC,aAAa,KAC3D,SAAS,YAEb,KAAC,cAAc,IACb,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAC,UAAU,EACf,oBAAoB,EAAE,oBAAoB,EAC1C,WAAW,EAAE,WAAW,GACxB,GACa,EAChB,gBAAgB,IAAI,CACnB,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,YACpC,KAAC,MAAM,IAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,YACpE,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,GAC/B,GACJ,CACR,IACI,CACR,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,EACH;QACE,QAAQ;QACR,SAAS;QACT,gBAAgB;QAChB,oBAAoB;QACpB,WAAW;QACX,gBAAgB;QAChB,GAAG;QACH,SAAS;KACV,CACF,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n FC,\n forwardRef,\n useState,\n useMemo,\n useRef,\n useEffect,\n PropsWithoutRef,\n useContext\n} from 'react';\nimport styled from 'styled-components';\n\nimport { Button, ExpandCollapse, Flex, ForwardProps } from '@pega/cosmos-react-core';\nimport { RichTextViewer } from '@pega/cosmos-react-rte';\nimport { StyledEditorContainer } from '@pega/cosmos-react-rte/lib/components/RichTextEditor/RichTextEditor.styles';\n\nimport { FeedContext } from './Feed.context';\nimport { FeedContentProps } from './Feed.types';\n\nconst StyledContent = styled.div`\n ${StyledEditorContainer} {\n padding: 0;\n }\n`;\n\nconst FeedContent: FC<FeedContentProps & ForwardProps> = forwardRef(\n (\n { children, maxContentHeight = Infinity, ...restProps }: PropsWithoutRef<FeedContentProps>,\n ref: FeedContentProps['ref']\n ) => {\n const { interactionRenderers, markdownMap } = useContext(FeedContext);\n const [collapsed, setCollapsed] = useState(true);\n const [exceedsMaxHeight, setExceedsMaxHeight] = useState(true);\n const rtvRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!rtvRef.current) return;\n\n const observer = new ResizeObserver(entries => {\n const exceedsHeight = entries.some(({ target, contentRect }) => {\n if (target !== rtvRef.current) return;\n\n return contentRect.height > maxContentHeight;\n });\n\n setExceedsMaxHeight(exceedsHeight);\n });\n\n observer.observe(rtvRef.current);\n\n return () => {\n observer.disconnect();\n };\n }, [rtvRef.current, maxContentHeight]);\n\n return useMemo(\n () =>\n typeof children === 'string' ? (\n <Flex as={StyledContent} ref={ref} container={{ direction: 'column', gap: 1 }}>\n <ExpandCollapse\n collapsed={collapsed}\n min={exceedsMaxHeight ? `${maxContentHeight}px` : 'max-content'}\n {...restProps}\n >\n <RichTextViewer\n ref={rtvRef}\n content={children}\n type='markdown'\n interactionRenderers={interactionRenderers}\n markdownMap={markdownMap}\n />\n </ExpandCollapse>\n {exceedsMaxHeight && (\n <Flex container={{ justify: 'center' }}>\n <Button variant='link' onClick={() => setCollapsed(current => !current)}>\n {collapsed ? 'Show more' : 'Show less'}\n </Button>\n </Flex>\n )}\n </Flex>\n ) : (\n children\n ),\n [\n children,\n collapsed,\n exceedsMaxHeight,\n interactionRenderers,\n markdownMap,\n maxContentHeight,\n ref,\n restProps\n ]\n );\n }\n);\n\nexport default FeedContent;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeedContentFooter.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedContentFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAc,MAAM,OAAO,CAAC;AAkBvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAWtD,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAkGjD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useContext } from 'react';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import { Button, Count, defaultThemeProp, Flex, Icon, Progress, Text, useI18n, useUID } from '@pega/cosmos-react-core';
|
|
5
|
+
import FeedButton from './FeedButton';
|
|
6
|
+
import FeedLikeButton from './FeedLikeButton';
|
|
7
|
+
import { FeedReplyContext } from './Feed.context';
|
|
8
|
+
const StyledFeedContentFooter = styled.div(({ theme }) => {
|
|
9
|
+
return css `
|
|
10
|
+
margin-block-start: ${theme.base.spacing};
|
|
11
|
+
margin-inline-end: calc(2 * ${theme.base.spacing});
|
|
12
|
+
`;
|
|
13
|
+
});
|
|
14
|
+
StyledFeedContentFooter.defaultProps = defaultThemeProp;
|
|
15
|
+
const FeedContentFooter = (props) => {
|
|
16
|
+
const { variant, id, username, liked, likes, likeCount, interactionsEnabled = true, likesLoading, replies = [], replyCount, repliesLoading, onCommentClick, onLikeClick, onLikeCountInteraction, onLoadMoreLikes, onShowMoreReplies, onShowLessReplies, replyInputOpen, setReplyInputOpen } = props;
|
|
17
|
+
const t = useI18n();
|
|
18
|
+
const commentCountId = useUID();
|
|
19
|
+
const { onShowReplyInput } = useContext(FeedReplyContext);
|
|
20
|
+
const numReplies = replyCount || replies.length;
|
|
21
|
+
return (_jsxs(Flex, { as: StyledFeedContentFooter, container: { justify: 'between', alignItems: 'center', wrap: 'wrap', gap: 1 }, children: [interactionsEnabled ? (_jsxs(Flex, { container: { gap: 2 }, children: [_jsxs(Flex, { container: { gap: 0.5, alignItems: 'center' }, children: [_jsx(Button, { variant: 'simple', as: FeedButton, icon: true, compact: true, onClick: () => {
|
|
22
|
+
onCommentClick?.({ id, username });
|
|
23
|
+
if (variant === 'post') {
|
|
24
|
+
if (!replyInputOpen) {
|
|
25
|
+
setReplyInputOpen?.(true);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
onShowReplyInput?.();
|
|
30
|
+
}
|
|
31
|
+
}, label: t('feed_comment_label'), "aria-describedby": variant === 'post' && numReplies > 0 ? commentCountId : undefined, children: _jsx(Icon, { name: 'chat' }) }), numReplies > 0 && (_jsx(Count, { "aria-label": t('feed_post_comments', [numReplies], { count: numReplies }), id: commentCountId, children: numReplies }))] }), _jsx(FeedLikeButton, { id: id, onLikeClick: onLikeClick, onLikeCountInteraction: onLikeCountInteraction, onLoadMoreLikes: onLoadMoreLikes, likesLoading: likesLoading, liked: liked, likes: likes, likeCount: likeCount })] })) : (_jsx("div", {})), (onShowLessReplies || onShowMoreReplies) && (_jsxs(Flex, { container: { gap: 0.5 }, children: [replies.length !== numReplies && (_jsxs(_Fragment, { children: [_jsx(Text, { children: t('showing_num_of_num', [replies.length, numReplies]) }), _jsx("span", { children: "\u2022" })] })), onShowMoreReplies && replies.length < numReplies && (_jsx(Button, { variant: 'link', onClick: () => onShowMoreReplies({ id }), children: t('show_more') })), repliesLoading && _jsx(Progress, { placement: 'inline' })] }))] }));
|
|
32
|
+
};
|
|
33
|
+
export default FeedContentFooter;
|
|
34
|
+
//# sourceMappingURL=FeedContentFooter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeedContentFooter.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedContentFooter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,KAAK,EACL,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,MAAM,EACP,MAAM,yBAAyB,CAAC;AAEjC,OAAO,UAAU,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AAM,KAAK,UAAU,IAAI,CAChC,8BACE,KAAC,IAAI,cAAE,CAAC,CAAC,oBAAoB,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,GAAQ,EACpE,oCAAmB,IAClB,CACJ,EACA,iBAAiB,IAAI,OAAO,CAAC,MAAM,GAAG,UAAU,IAAI,CACnD,KAAC,MAAM,IAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,EAAE,EAAE,EAAE,CAAC,YAC5D,CAAC,CAAC,WAAW,CAAC,GACR,CACV,EACA,cAAc,IAAI,KAAC,QAAQ,IAAC,SAAS,EAAC,QAAQ,GAAG,IAC7C,CACR,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { FC, useContext } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Button,\n Count,\n defaultThemeProp,\n Flex,\n Icon,\n Progress,\n Text,\n useI18n,\n useUID\n} from '@pega/cosmos-react-core';\n\nimport FeedButton from './FeedButton';\nimport FeedLikeButton from './FeedLikeButton';\nimport { FeedReplyContext } from './Feed.context';\nimport { FeedContentFooterProps } from './Feed.types';\n\nconst StyledFeedContentFooter = styled.div(({ theme }) => {\n return css`\n margin-block-start: ${theme.base.spacing};\n margin-inline-end: calc(2 * ${theme.base.spacing});\n `;\n});\n\nStyledFeedContentFooter.defaultProps = defaultThemeProp;\n\nconst FeedContentFooter: FC<FeedContentFooterProps> = (props: FeedContentFooterProps) => {\n const {\n variant,\n id,\n username,\n liked,\n likes,\n likeCount,\n interactionsEnabled = true,\n likesLoading,\n replies = [],\n replyCount,\n repliesLoading,\n onCommentClick,\n onLikeClick,\n onLikeCountInteraction,\n onLoadMoreLikes,\n onShowMoreReplies,\n onShowLessReplies,\n replyInputOpen,\n setReplyInputOpen\n } = props;\n\n const t = useI18n();\n const commentCountId = useUID();\n const { onShowReplyInput } = useContext(FeedReplyContext);\n\n const numReplies = replyCount || replies.length;\n\n return (\n <Flex\n as={StyledFeedContentFooter}\n container={{ justify: 'between', alignItems: 'center', wrap: 'wrap', gap: 1 }}\n >\n {interactionsEnabled ? (\n <Flex container={{ gap: 2 }}>\n <Flex container={{ gap: 0.5, alignItems: 'center' }}>\n <Button\n variant='simple'\n as={FeedButton}\n icon\n compact\n onClick={() => {\n onCommentClick?.({ id, username });\n if (variant === 'post') {\n if (!replyInputOpen) {\n setReplyInputOpen?.(true);\n }\n } else {\n onShowReplyInput?.();\n }\n }}\n label={t('feed_comment_label')}\n aria-describedby={variant === 'post' && numReplies > 0 ? commentCountId : undefined}\n >\n <Icon name='chat' />\n </Button>\n {numReplies > 0 && (\n <Count\n aria-label={t('feed_post_comments', [numReplies], { count: numReplies })}\n id={commentCountId}\n >\n {numReplies}\n </Count>\n )}\n </Flex>\n <FeedLikeButton\n id={id}\n onLikeClick={onLikeClick}\n onLikeCountInteraction={onLikeCountInteraction}\n onLoadMoreLikes={onLoadMoreLikes}\n likesLoading={likesLoading}\n liked={liked}\n likes={likes}\n likeCount={likeCount}\n />\n </Flex>\n ) : (\n <div />\n )}\n {(onShowLessReplies || onShowMoreReplies) && (\n <Flex container={{ gap: 0.5 }}>\n {replies.length !== numReplies && (\n <>\n <Text>{t('showing_num_of_num', [replies.length, numReplies])}</Text>\n <span>•</span>\n </>\n )}\n {onShowMoreReplies && replies.length < numReplies && (\n <Button variant='link' onClick={() => onShowMoreReplies({ id })}>\n {t('show_more')}\n </Button>\n )}\n {repliesLoading && <Progress placement='inline' />}\n </Flex>\n )}\n </Flex>\n );\n};\n\nexport default FeedContentFooter;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeedContentHeader.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedContentHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA6C,MAAM,OAAO,CAAC;AA8BtE,OAAO,EAAE,sBAAsB,EAAsB,MAAM,cAAc,CAAC;AAkB1E,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAsMjD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useContext, useEffect, useRef } from 'react';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import { Avatar, Button, DateTimeDisplay, defaultThemeProp, Flex, Icon, MenuButton, MetaList, StyledSecondary, SummaryItem, Text, Tooltip, useConfiguration, useElement, useI18n, useModalManager } from '@pega/cosmos-react-core';
|
|
5
|
+
import BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';
|
|
6
|
+
import { parseToDate } from '@pega/cosmos-react-core/lib/components/DateTime/Input/utils';
|
|
7
|
+
import { formatDateTime } from '@pega/cosmos-react-core/lib/components/DateTime/utils';
|
|
8
|
+
import { formatListToLocaleString } from '@pega/cosmos-react-core/lib/utils';
|
|
9
|
+
import { FeedContext } from './Feed.context';
|
|
10
|
+
import FeedModalList from './FeedModalList';
|
|
11
|
+
import FeedButton from './FeedButton';
|
|
12
|
+
const StyledFeedContentHeader = styled.div(({ theme }) => {
|
|
13
|
+
return css `
|
|
14
|
+
margin-block-end: ${theme.base.spacing};
|
|
15
|
+
column-gap: ${theme.base.spacing};
|
|
16
|
+
|
|
17
|
+
${StyledSecondary} {
|
|
18
|
+
${FeedButton} {
|
|
19
|
+
/* Negative margin needed to align the icon with the author name on the line above. */
|
|
20
|
+
margin-inline-start: calc(-0.75 * ${theme.base.spacing});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
});
|
|
25
|
+
StyledFeedContentHeader.defaultProps = defaultThemeProp;
|
|
26
|
+
const FeedContentHeader = (props) => {
|
|
27
|
+
const { variant, id, fullname, username, postTimestamp, content, avatarSrc, icon, userStatus, postType, postContext, recipients = [], recipientsCount = 0, menuItems, edited, editTimestamp, recipientsLoading, onEditSubmit, onLoadMoreRecipients, onRecipientInteraction, onUserClick, setEditMode } = props;
|
|
28
|
+
const { userInfo: loggedInUser } = useContext(FeedContext);
|
|
29
|
+
const t = useI18n();
|
|
30
|
+
const { locale } = useConfiguration();
|
|
31
|
+
const { create } = useModalManager();
|
|
32
|
+
const recipientsModalRef = useRef();
|
|
33
|
+
const [postTimestampEl, setPostTimestampEl] = useElement();
|
|
34
|
+
const [editTimestampEl, setEditTimestampEl] = useElement();
|
|
35
|
+
const timestamps = [
|
|
36
|
+
_jsxs(_Fragment, { children: [_jsx(DateTimeDisplay, { ref: setPostTimestampEl, value: postTimestamp, variant: 'relative' }), postTimestamp && (_jsx(Tooltip, { target: postTimestampEl, children: formatDateTime(parseToDate(postTimestamp), {
|
|
37
|
+
t,
|
|
38
|
+
locale,
|
|
39
|
+
format: 'short',
|
|
40
|
+
variant: 'datetime',
|
|
41
|
+
timeZone: loggedInUser.timeZone
|
|
42
|
+
}) }))] })
|
|
43
|
+
];
|
|
44
|
+
if (edited) {
|
|
45
|
+
timestamps.push(_jsxs(_Fragment, { children: [_jsx(Text, { ref: setEditTimestampEl, variant: 'secondary', children: t('edited', [_jsx(DateTimeDisplay, { value: editTimestamp, variant: 'relative' })]) }), editTimestamp && (_jsx(Tooltip, { target: editTimestampEl, children: formatDateTime(parseToDate(editTimestamp), {
|
|
46
|
+
t,
|
|
47
|
+
locale,
|
|
48
|
+
format: 'short',
|
|
49
|
+
variant: 'datetime',
|
|
50
|
+
timeZone: loggedInUser.timeZone
|
|
51
|
+
}) }))] }));
|
|
52
|
+
}
|
|
53
|
+
const userVisual = (_jsx(Avatar, { name: fullname, size: variant === 'post' ? 'l' : 'm', imageSrc: avatarSrc, icon: icon, status: userStatus }));
|
|
54
|
+
const recipientsList = recipients.map(x => x.primary);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (recipients.length) {
|
|
57
|
+
recipientsModalRef.current?.update({
|
|
58
|
+
count: recipientsCount,
|
|
59
|
+
heading: t('feed_recipients'),
|
|
60
|
+
listItems: recipients,
|
|
61
|
+
onLoadMore: onLoadMoreRecipients,
|
|
62
|
+
loading: recipientsLoading
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}, [recipientsCount, recipients, onLoadMoreRecipients, recipientsLoading]);
|
|
66
|
+
return (_jsx(SummaryItem, { as: StyledFeedContentHeader, visual: onUserClick ? (_jsx(BareButton, { onClick: (event) => {
|
|
67
|
+
onUserClick?.({ id, username }, event);
|
|
68
|
+
}, children: userVisual })) : (userVisual), primary: _jsxs("div", { children: [onUserClick ? (_jsx(Button, { variant: 'text', onClick: (event) => {
|
|
69
|
+
onUserClick?.({ id, username }, event);
|
|
70
|
+
}, children: _jsx(Text, { variant: 'h3', children: fullname }) })) : (_jsx(Text, { variant: 'h3', children: fullname })), postContext && _jsxs(Text, { variant: 'primary', children: [" ", t('feed_context', [postContext])] })] }), secondary: _jsxs(Flex, { container: { gap: 0.5, alignItems: 'center' }, children: [postType === 'private' && (_jsx(Button, { variant: 'simple', as: FeedButton, icon: true, compact: true, onClick: recipients.length
|
|
71
|
+
? () => {
|
|
72
|
+
if (recipientsCount > 2) {
|
|
73
|
+
recipientsModalRef.current = create(FeedModalList, {
|
|
74
|
+
count: recipientsCount,
|
|
75
|
+
heading: t('feed_recipients'),
|
|
76
|
+
listItems: recipients,
|
|
77
|
+
onLoadMore: onLoadMoreRecipients,
|
|
78
|
+
loading: recipientsLoading
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
: onRecipientInteraction, onFocus: onRecipientInteraction, onMouseOver: onRecipientInteraction, "aria-label": `${t('feed_private_post')} ${t('feed_recipients')} ${formatListToLocaleString(recipientsList.slice(0, 2), t, locale, {
|
|
83
|
+
count: recipientsCount
|
|
84
|
+
})}`, label: `${t('feed_private_post')}:\n${formatListToLocaleString(recipientsList.slice(0, 2), t, locale, {
|
|
85
|
+
count: recipientsCount,
|
|
86
|
+
separator: '\n'
|
|
87
|
+
}) || t('feed_private_post')}`, children: _jsx(Icon, { name: 'lock-closed-solid' }) })), _jsx(MetaList, { items: timestamps })] }), actions: menuItems ? (_jsx(MenuButton, { text: t('feed_post_actions_menu'), menu: {
|
|
88
|
+
items: onEditSubmit && typeof content === 'string' && username === loggedInUser.username
|
|
89
|
+
? [
|
|
90
|
+
{
|
|
91
|
+
primary: t('edit'),
|
|
92
|
+
id: 'edit',
|
|
93
|
+
onClick: () => setEditMode(true)
|
|
94
|
+
},
|
|
95
|
+
...menuItems
|
|
96
|
+
]
|
|
97
|
+
: menuItems
|
|
98
|
+
}, icon: 'more', iconOnly: true, variant: 'simple' })) : undefined }));
|
|
99
|
+
};
|
|
100
|
+
export default FeedContentHeader;
|
|
101
|
+
//# sourceMappingURL=FeedContentHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeedContentHeader.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedContentHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,MAAM,EACN,eAAe,EACf,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,QAAQ,EAER,eAAe,EACf,WAAW,EACX,IAAI,EACJ,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,OAAO,EACP,eAAe,EAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,UAAU,MAAM,0DAA0D,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,6DAA6D,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,uDAAuD,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,MAAM,gBA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,CACV,KAAC,UAAU,IACT,IAAI,EAAE,CAAC,CAAC,wBAAwB,CAAC,EACjC,IAAI,EAAE;gBACJ,KAAK,EACH,YAAY,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,QAAQ,KAAK,YAAY,CAAC,QAAQ;oBAC/E,CAAC,CAAC;wBACE;4BACE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;4BAClB,EAAE,EAAE,MAAM;4BACV,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC;yBACjC;wBACD,GAAG,SAAS;qBACb;oBACH,CAAC,CAAC,SAAS;aAChB,EACD,IAAI,EAAC,MAAM,EACX,QAAQ,QACR,OAAO,EAAC,QAAQ,GAChB,CACH,CAAC,CAAC,CAAC,SAAS,GAEf,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { FC, MouseEvent, useContext, useEffect, useRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Avatar,\n Button,\n DateTimeDisplay,\n defaultThemeProp,\n Flex,\n Icon,\n MenuButton,\n MetaList,\n ModalMethods,\n StyledSecondary,\n SummaryItem,\n Text,\n Tooltip,\n useConfiguration,\n useElement,\n useI18n,\n useModalManager\n} from '@pega/cosmos-react-core';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport { parseToDate } from '@pega/cosmos-react-core/lib/components/DateTime/Input/utils';\nimport { formatDateTime } from '@pega/cosmos-react-core/lib/components/DateTime/utils';\nimport { formatListToLocaleString } from '@pega/cosmos-react-core/lib/utils';\n\nimport { FeedContext } from './Feed.context';\nimport FeedModalList from './FeedModalList';\nimport FeedButton from './FeedButton';\nimport { FeedContentHeaderProps, FeedModalListProps } from './Feed.types';\n\nconst StyledFeedContentHeader = styled.div(({ theme }) => {\n return css`\n margin-block-end: ${theme.base.spacing};\n column-gap: ${theme.base.spacing};\n\n ${StyledSecondary} {\n ${FeedButton} {\n /* Negative margin needed to align the icon with the author name on the line above. */\n margin-inline-start: calc(-0.75 * ${theme.base.spacing});\n }\n }\n `;\n});\n\nStyledFeedContentHeader.defaultProps = defaultThemeProp;\n\nconst FeedContentHeader: FC<FeedContentHeaderProps> = (props: FeedContentHeaderProps) => {\n const {\n variant,\n id,\n fullname,\n username,\n postTimestamp,\n content,\n avatarSrc,\n icon,\n userStatus,\n postType,\n postContext,\n recipients = [],\n recipientsCount = 0,\n menuItems,\n edited,\n editTimestamp,\n recipientsLoading,\n onEditSubmit,\n onLoadMoreRecipients,\n onRecipientInteraction,\n onUserClick,\n setEditMode\n } = props;\n\n const { userInfo: loggedInUser } = useContext(FeedContext);\n const t = useI18n();\n const { locale } = useConfiguration();\n const { create } = useModalManager();\n\n const recipientsModalRef = useRef<ModalMethods<FeedModalListProps>>();\n const [postTimestampEl, setPostTimestampEl] = useElement<HTMLSpanElement>();\n const [editTimestampEl, setEditTimestampEl] = useElement<HTMLSpanElement>();\n\n const timestamps = [\n <>\n <DateTimeDisplay ref={setPostTimestampEl} value={postTimestamp} variant='relative' />\n {postTimestamp && (\n <Tooltip target={postTimestampEl}>\n {formatDateTime(parseToDate(postTimestamp), {\n t,\n locale,\n format: 'short',\n variant: 'datetime',\n timeZone: loggedInUser.timeZone\n })}\n </Tooltip>\n )}\n </>\n ];\n\n if (edited) {\n timestamps.push(\n <>\n <Text ref={setEditTimestampEl} variant='secondary'>\n {t('edited', [<DateTimeDisplay value={editTimestamp} variant='relative' />])}\n </Text>\n {editTimestamp && (\n <Tooltip target={editTimestampEl}>\n {formatDateTime(parseToDate(editTimestamp), {\n t,\n locale,\n format: 'short',\n variant: 'datetime',\n timeZone: loggedInUser.timeZone\n })}\n </Tooltip>\n )}\n </>\n );\n }\n\n const userVisual = (\n <Avatar\n name={fullname}\n size={variant === 'post' ? 'l' : 'm'}\n imageSrc={avatarSrc}\n icon={icon}\n status={userStatus}\n />\n );\n\n const recipientsList = recipients.map(x => x.primary);\n\n useEffect(() => {\n if (recipients.length) {\n recipientsModalRef.current?.update({\n count: recipientsCount,\n heading: t('feed_recipients'),\n listItems: recipients,\n onLoadMore: onLoadMoreRecipients,\n loading: recipientsLoading\n });\n }\n }, [recipientsCount, recipients, onLoadMoreRecipients, recipientsLoading]);\n\n return (\n <SummaryItem\n as={StyledFeedContentHeader}\n visual={\n onUserClick ? (\n <BareButton\n onClick={(event: MouseEvent) => {\n onUserClick?.({ id, username }, event);\n }}\n >\n {userVisual}\n </BareButton>\n ) : (\n userVisual\n )\n }\n primary={\n <div>\n {onUserClick ? (\n <Button\n variant='text'\n onClick={(event: MouseEvent) => {\n onUserClick?.({ id, username }, event);\n }}\n >\n <Text variant='h3'>{fullname}</Text>\n </Button>\n ) : (\n <Text variant='h3'>{fullname}</Text>\n )}\n {postContext && <Text variant='primary'> {t('feed_context', [postContext])}</Text>}\n </div>\n }\n secondary={\n <Flex container={{ gap: 0.5, alignItems: 'center' }}>\n {postType === 'private' && (\n <Button\n variant='simple'\n as={FeedButton}\n icon\n compact\n onClick={\n recipients.length\n ? () => {\n if (recipientsCount > 2) {\n recipientsModalRef.current = create(FeedModalList, {\n count: recipientsCount,\n heading: t('feed_recipients'),\n listItems: recipients,\n onLoadMore: onLoadMoreRecipients,\n loading: recipientsLoading\n });\n }\n }\n : onRecipientInteraction\n }\n onFocus={onRecipientInteraction}\n onMouseOver={onRecipientInteraction}\n aria-label={`${t('feed_private_post')} ${t(\n 'feed_recipients'\n )} ${formatListToLocaleString(recipientsList.slice(0, 2), t, locale, {\n count: recipientsCount\n })}`}\n label={`${t('feed_private_post')}:\\n${\n formatListToLocaleString(recipientsList.slice(0, 2), t, locale, {\n count: recipientsCount,\n separator: '\\n'\n }) || t('feed_private_post')\n }`}\n >\n <Icon name='lock-closed-solid' />\n </Button>\n )}\n <MetaList items={timestamps} />\n </Flex>\n }\n actions={\n menuItems ? (\n <MenuButton\n text={t('feed_post_actions_menu')}\n menu={{\n items:\n onEditSubmit && typeof content === 'string' && username === loggedInUser.username\n ? [\n {\n primary: t('edit'),\n id: 'edit',\n onClick: () => setEditMode(true)\n },\n ...menuItems\n ]\n : menuItems\n }}\n icon='more'\n iconOnly\n variant='simple'\n />\n ) : undefined\n }\n />\n );\n};\n\nexport default FeedContentHeader;\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
+
import { FeedEditRegionProps } from './Feed.types';
|
|
4
|
+
declare const FeedEditRegion: FC<ForwardProps & FeedEditRegionProps>;
|
|
5
|
+
export default FeedEditRegion;
|
|
6
|
+
//# sourceMappingURL=FeedEditRegion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeedEditRegion.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedEditRegion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AAGxD,OAAO,EAAgB,YAAY,EAAgC,MAAM,yBAAyB,CAAC;AAInG,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAQnD,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,YAAY,GAAG,mBAAmB,CA6E1D,CAAC;AAEF,eAAe,cAAc,CAAC"}
|