@pega/cosmos-react-social 4.0.0-dev.13.0 → 4.0.0-dev.14.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.
Files changed (61) hide show
  1. package/lib/components/Chat/Chat.types.d.ts +2 -2
  2. package/lib/components/Chat/Chat.types.js.map +1 -1
  3. package/lib/components/Chat/ChatBody.js +2 -2
  4. package/lib/components/Chat/ChatBody.js.map +1 -1
  5. package/lib/components/Chat/ChatSettingsPanel.styles.js +1 -1
  6. package/lib/components/Chat/ChatSettingsPanel.styles.js.map +1 -1
  7. package/lib/components/Chat/SuggestedReplyPicker.d.ts.map +1 -1
  8. package/lib/components/Chat/SuggestedReplyPicker.js +38 -28
  9. package/lib/components/Chat/SuggestedReplyPicker.js.map +1 -1
  10. package/lib/components/Email/Email.types.d.ts +3 -3
  11. package/lib/components/Email/Email.types.d.ts.map +1 -1
  12. package/lib/components/Email/Email.types.js.map +1 -1
  13. package/lib/components/Email/EmailCaseView.js +1 -1
  14. package/lib/components/Email/EmailCaseView.js.map +1 -1
  15. package/lib/components/Email/EmailComposer.d.ts.map +1 -1
  16. package/lib/components/Email/EmailComposer.js +46 -46
  17. package/lib/components/Email/EmailComposer.js.map +1 -1
  18. package/lib/components/Email/EmailConversation.d.ts.map +1 -1
  19. package/lib/components/Email/EmailConversation.js +0 -5
  20. package/lib/components/Email/EmailConversation.js.map +1 -1
  21. package/lib/components/Email/EmailManager.js +2 -2
  22. package/lib/components/Email/EmailManager.js.map +1 -1
  23. package/lib/components/Email/EntityList.js +1 -1
  24. package/lib/components/Email/EntityList.js.map +1 -1
  25. package/lib/components/Email/utils/EntityHighlighter.d.ts.map +1 -1
  26. package/lib/components/Email/utils/EntityHighlighter.js +4 -10
  27. package/lib/components/Email/utils/EntityHighlighter.js.map +1 -1
  28. package/lib/components/Feed/Feed.context.d.ts +3 -0
  29. package/lib/components/Feed/Feed.context.d.ts.map +1 -1
  30. package/lib/components/Feed/Feed.context.js.map +1 -1
  31. package/lib/components/Feed/Feed.d.ts.map +1 -1
  32. package/lib/components/Feed/Feed.js +6 -2
  33. package/lib/components/Feed/Feed.js.map +1 -1
  34. package/lib/components/Feed/FeedAttachments.d.ts.map +1 -1
  35. package/lib/components/Feed/FeedAttachments.js +0 -5
  36. package/lib/components/Feed/FeedAttachments.js.map +1 -1
  37. package/lib/components/Feed/FeedLikeButton.d.ts.map +1 -1
  38. package/lib/components/Feed/FeedLikeButton.js +32 -34
  39. package/lib/components/Feed/FeedLikeButton.js.map +1 -1
  40. package/lib/components/Feed/FeedModalList.js +1 -1
  41. package/lib/components/Feed/FeedModalList.js.map +1 -1
  42. package/lib/components/Feed/FeedPost.d.ts.map +1 -1
  43. package/lib/components/Feed/FeedPost.js +5 -3
  44. package/lib/components/Feed/FeedPost.js.map +1 -1
  45. package/lib/components/Feed/FeedPost.types.d.ts +1 -3
  46. package/lib/components/Feed/FeedPost.types.d.ts.map +1 -1
  47. package/lib/components/Feed/FeedPost.types.js.map +1 -1
  48. package/lib/components/Feed/FeedReply.types.d.ts +1 -3
  49. package/lib/components/Feed/FeedReply.types.d.ts.map +1 -1
  50. package/lib/components/Feed/FeedReply.types.js.map +1 -1
  51. package/lib/components/Feed/FeedReplyInput.d.ts +1 -1
  52. package/lib/components/Feed/FeedReplyInput.d.ts.map +1 -1
  53. package/lib/components/Feed/FeedReplyInput.js.map +1 -1
  54. package/lib/components/HashtagButton/HashtagButton.d.ts.map +1 -1
  55. package/lib/components/HashtagButton/HashtagButton.js +2 -2
  56. package/lib/components/HashtagButton/HashtagButton.js.map +1 -1
  57. package/lib/components/MentionButton/MentionButton.d.ts +1 -1
  58. package/lib/components/MentionButton/MentionButton.d.ts.map +1 -1
  59. package/lib/components/MentionButton/MentionButton.js +11 -13
  60. package/lib/components/MentionButton/MentionButton.js.map +1 -1
  61. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"FeedPost.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedPost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,iBAAiB,CAAC,KAAK,CAAC,CAAC;4BACzB,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;wBACzB,CAAC,GACD,GACU,CACf,CAAC,CAAC,CAAC,IAAI,EACP,iBAAiB,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,IAAI,CACxC,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,aAC5D,KAAC,MAAM,IACL,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,GAAG,EAAE;gCACZ,iBAAiB,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;gCAClC,wBAAwB,CAAC,OAAO,GAAG,IAAI,CAAC;4BAC1C,CAAC,YAEA,CAAC,CAAC,WAAW,CAAC,GACR,EACR,cAAc,IAAI,KAAC,QAAQ,IAAC,SAAS,EAAC,QAAQ,GAAG,IAC7C,CACR,IACI,GACmB,CAC7B,CAAC;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,YAAY,GAAG,YAAY,CAAC;AAErC,eAAe,QAAQ,CAAC","sourcesContent":["import {\n FC,\n useState,\n useEffect,\n MutableRefObject,\n MouseEvent,\n useRef,\n useContext,\n useMemo\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Avatar,\n Button,\n Count,\n Card,\n CardContent,\n CardHeader,\n Flex,\n Icon,\n registerIcon,\n MenuButton,\n SummaryItem,\n Text,\n defaultThemeProp,\n ForwardProps,\n useI18n,\n Progress,\n useOuterEvent,\n MetaList,\n SummaryListItem,\n ModalMethods,\n StyledVisual,\n useModalManager,\n useConfiguration,\n usePrevious,\n useElement,\n Tooltip,\n DateTimeDisplay\n} from '@pega/cosmos-react-core';\nimport { RichTextEditorState, StyledRichTextEditor } from '@pega/cosmos-react-rte';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport * as arrowMicroDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-down.icon';\nimport * as caretLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-left.icon';\nimport { formatListToLocaleString } from '@pega/cosmos-react-core/lib/utils';\nimport { parseToDate } from '@pega/cosmos-react-core/lib/components/DateTime/Input/utils';\nimport { formatDateTime } from '@pega/cosmos-react-core/lib/components/DateTime/utils';\n\nimport FeedButton from './FeedButton';\nimport FeedAttachments from './FeedAttachments';\nimport { StyledFeedReplyContainer } from './FeedReply';\nimport FeedContent from './FeedContent';\nimport FeedReplyInput from './FeedReplyInput';\nimport { FeedContext, FeedReplyContext } from './Feed.context';\nimport FeedRichText from './FeedRichText';\nimport FeedModalList, { FeedModalListProps } from './FeedModalList';\nimport { FeedLikeButton } from './FeedLikeButton';\nimport { FeedPostProps } from './FeedPost.types';\n\nregisterIcon(arrowMicroDownIcon, caretLeftIcon);\n\nconst defaultProps: Partial<FeedPostProps> = {\n info: {\n avatarSrc: '',\n fullname: '',\n username: '',\n postTimestamp: '',\n content: ''\n }\n};\n\nexport const StyledFeedPost = styled.div(\n ({ theme }) => css`\n ${StyledFeedReplyContainer}:not(:last-child) {\n margin-block-end: calc(2 * ${theme.base.spacing});\n }\n `\n);\n\nStyledFeedPost.defaultProps = defaultThemeProp;\n\nexport const StyledPostEdit = styled.div(\n ({ theme }) => css`\n ${StyledRichTextEditor} {\n padding: calc(0.5 * ${theme.base.spacing});\n }\n `\n);\n\nStyledPostEdit.defaultProps = defaultThemeProp;\n\nexport const StyledReplies = styled.div(\n ({ theme }) => css`\n border-top: 0.0625rem solid ${theme.base.palette['border-line']};\n padding: calc(1.25 * ${theme.base.spacing}) calc(2 * ${theme.base.spacing});\n `\n);\n\nStyledReplies.defaultProps = defaultThemeProp;\n\nexport const StyledPostFooter = styled.div(\n ({ theme }) => css`\n margin-block-start: ${theme.base.spacing};\n `\n);\n\nStyledPostFooter.defaultProps = defaultThemeProp;\n\nconst FullWidthSummaryItem = styled.div`\n width: 100%;\n\n ${StyledVisual} {\n align-self: start;\n }\n`;\n\nconst FeedPost: FC<ForwardProps & FeedPostProps> = (props: ForwardProps & FeedPostProps) => {\n const {\n id,\n info,\n interactionInfo,\n maxContentHeight = Infinity,\n onMouseEnter,\n onMouseLeave,\n onCommentClick,\n onLikeClick,\n onLikeCountInteraction,\n likesLoading,\n onLoadMoreLikes,\n onRecipientInteraction,\n recipientsLoading,\n onLoadMoreRecipients,\n onUserClick,\n onShowMoreClick,\n newReplyField,\n menuItems,\n onEditSubmit,\n edited = false,\n editTimestamp,\n replies = [],\n replyInput,\n replyInputShown,\n replyCount,\n repliesLoading,\n onShowLessReplies,\n onShowMoreReplies,\n ...restProps\n } = props;\n const {\n avatarSrc,\n fullname,\n username,\n postTimestamp,\n content,\n postType = 'public',\n recipients = [],\n recipientsCount = 0,\n attachments,\n liked,\n icon,\n postContext,\n userStatus\n } = info;\n const { commentLabel, interactionsEnabled = true } = interactionInfo;\n const { announce, userInfo: loggedInUser } = useContext(FeedContext);\n\n const t = useI18n();\n const { locale } = useConfiguration();\n const rteRef = useRef<RichTextEditorState>();\n const [editMode, setEditMode] = useState(false);\n const editTextAreaRef = useRef<HTMLDivElement>(null);\n const [emptyEditText, setEmptyEditText] = useState(false);\n const [postModified, setPostModified] = useState(false);\n const [replyInputOpen, setReplyInputOpen] = useState(false);\n const [replyInputRef, setReplyInputRef] = useState<MutableRefObject<\n RichTextEditorState | undefined\n > | null>(null);\n const { create } = useModalManager();\n const recipientsModalRef = useRef<ModalMethods<FeedModalListProps>>();\n const prevReplies = usePrevious(replies);\n const suppressNextAnnouncement = useRef(false);\n const [postTimestampEl, setPostTimestampEl] = useElement<HTMLSpanElement>();\n const [editTimestampEl, setEditTimestampEl] = useElement<HTMLSpanElement>();\n\n useEffect(() => {\n if (recipients.length) {\n recipientsModalRef.current?.update({\n count: recipientsCount,\n heading: t('feed_recipients'),\n listItems: recipients as SummaryListItem[],\n onLoadMore: onLoadMoreRecipients,\n loading: recipientsLoading\n });\n }\n }, [recipientsCount, recipients, onLoadMoreRecipients, recipientsLoading]);\n\n useOuterEvent('mousedown', [editTextAreaRef], () => {\n if (emptyEditText) setEditMode(false);\n });\n\n useEffect(() => {\n if ((replyInputOpen || replyInputShown) && replyInputRef) {\n replyInputRef.current?.focus();\n }\n }, [replyInputOpen, replyInputShown, replyInputRef]);\n\n const userVisual = icon ? (\n <Icon name={icon} />\n ) : (\n <Avatar name={fullname} size='l' imageSrc={avatarSrc} status={userStatus} />\n );\n\n const numReplies = replyCount || replies?.length;\n\n const postTypeAttributes = useMemo(() => {\n if (postType === 'private') {\n const recipientsList = recipients.map(x => x.primary);\n return {\n icon: 'users-solid',\n ariaLabel: `${t('feed_private_post')} ${t('feed_recipients')} ${formatListToLocaleString(\n recipientsList,\n t,\n locale,\n { count: recipientsCount }\n )}`,\n label: formatListToLocaleString(recipientsList, t, locale, {\n count: recipientsCount,\n separator: '\\n'\n })\n };\n }\n\n return {\n icon: 'globe',\n ariaLabel: t('feed_public_post'),\n label: t('feed_public_post')\n };\n }, [postType, recipients, recipientsCount]);\n\n const handleEdit = () => {\n if (!emptyEditText && postModified) {\n onEditSubmit?.({\n postId: id,\n value: rteRef.current?.getPlainText() || ''\n });\n setEditMode(false);\n }\n };\n\n useEffect(() => {\n if (prevReplies) {\n const difference = prevReplies.length - replies.length;\n if (difference > 0 && !suppressNextAnnouncement.current) {\n const timeoutId = announce(t('feed_reply_removed'));\n return () => clearTimeout(timeoutId);\n }\n suppressNextAnnouncement.current = false;\n }\n }, [replies]);\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 return (\n <FeedReplyContext.Provider value={{ onShowReplyInput: () => setReplyInputOpen(true) }}>\n <Card\n {...restProps}\n as={StyledFeedPost}\n onMouseEnter={() => {\n onMouseEnter?.({ postId: id });\n }}\n onMouseLeave={() => {\n onMouseLeave?.({ postId: id });\n }}\n >\n <CardHeader>\n <SummaryItem\n as={FullWidthSummaryItem}\n visual={\n onUserClick ? (\n <BareButton\n onClick={(event: MouseEvent) => {\n onUserClick?.({ postId: 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?.({ postId: 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: 1, alignItems: 'center' }}>\n <Button\n variant='text'\n icon\n onClick={\n recipients.length\n ? () => {\n if (recipientsCount > 10) {\n recipientsModalRef.current = create(FeedModalList, {\n count: recipientsCount,\n heading: t('feed_recipients'),\n listItems: recipients as SummaryListItem[],\n onLoadMore: onLoadMoreRecipients,\n loading: recipientsLoading\n });\n }\n }\n : onRecipientInteraction\n }\n onFocus={onRecipientInteraction}\n onMouseOver={onRecipientInteraction}\n aria-label={postTypeAttributes.ariaLabel}\n label={postTypeAttributes.label || t('feed_private_post')}\n >\n <Icon name={postTypeAttributes.icon} />\n </Button>\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 &&\n typeof content === 'string' &&\n 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 </CardHeader>\n <CardContent>\n {editMode ? (\n <>\n <StyledPostEdit ref={editTextAreaRef}>\n <FeedRichText\n label={t('feed_edit_post')}\n onChange={() => {\n setEmptyEditText(rteRef.current?.getPlainText().trim() === '');\n setPostModified(rteRef.current?.getPlainText() !== content);\n }}\n autoFocus\n onSubmit={handleEdit}\n defaultValue={content}\n ref={rteRef}\n />\n </StyledPostEdit>\n <Flex container={{ justify: 'between', pad: [2, 0, 0] }}>\n <Button\n onClick={() => setEditMode(false)}\n aria-label={`${t('cancel')} ${t('edit')} ${id}`}\n >\n {t('cancel')}\n </Button>\n <Button\n variant='primary'\n disabled={emptyEditText || !postModified}\n onClick={handleEdit}\n aria-label={`${t('update')} ${t('edit')} ${id}`}\n >\n {t('update')}\n </Button>\n </Flex>\n </>\n ) : (\n <FeedContent maxContentHeight={maxContentHeight}>{content}</FeedContent>\n )}\n <FeedAttachments attachments={attachments} readOnly />\n <Flex as={StyledPostFooter} container={{ justify: 'between', wrap: 'wrap', gap: 1 }}>\n {interactionsEnabled ? (\n <Flex container={{ gap: 2 }}>\n <Button\n variant='text'\n as={FeedButton}\n onClick={() => {\n onCommentClick?.({ postId: id });\n if (!replyInputOpen) {\n setReplyInputOpen(true);\n }\n }}\n aria-label={commentLabel}\n >\n <Icon name='chat' />\n <Text>{commentLabel}</Text>\n {numReplies > 0 && <Count>{numReplies}</Count>}\n </Button>\n <FeedLikeButton\n id={id}\n variant='post'\n onLikeClick={onLikeClick}\n onLikeCountInteraction={onLikeCountInteraction}\n onLoadMoreLikes={onLoadMoreLikes}\n likesLoading={likesLoading}\n liked={liked}\n showText\n {...interactionInfo}\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>&bull;</span>\n </>\n )}\n {onShowMoreReplies && replies.length < numReplies && (\n <Button variant='link' onClick={() => onShowMoreReplies({ postId: id })}>\n {t('show_more')}\n </Button>\n )}\n {repliesLoading && <Progress placement='inline' />}\n </Flex>\n )}\n </Flex>\n </CardContent>\n {!!replies?.length && <StyledReplies>{replies}</StyledReplies>}\n {replyInputShown || replyInputOpen ? (\n <CardContent>\n <FeedReplyInput\n onSetInputRef={({ ref }) => {\n setReplyInputRef(ref);\n }}\n id={id}\n commentLabel={replyInput.commentLabel}\n attachments={replyInput.attachments}\n placeholder={replyInput.placeholder}\n onFilesAdded={replyInput.onFilesAdded}\n onSubmit={e => {\n setReplyInputOpen(false);\n replyInput.onSubmit(e);\n }}\n />\n </CardContent>\n ) : null}\n {onShowLessReplies && !!replies.length && (\n <Flex container={{ justify: 'center', pad: [0, 0, 1], gap: 1 }}>\n <Button\n variant='link'\n onClick={() => {\n onShowLessReplies({ postId: id });\n suppressNextAnnouncement.current = true;\n }}\n >\n {t('show_less')}\n </Button>\n {repliesLoading && <Progress placement='inline' />}\n </Flex>\n )}\n </Card>\n </FeedReplyContext.Provider>\n );\n};\n\nFeedPost.defaultProps = defaultProps;\n\nexport default FeedPost;\n"]}
1
+ {"version":3,"file":"FeedPost.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedPost.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,QAAQ,EACR,SAAS,EAGT,MAAM,EACN,UAAU,EACV,OAAO,EACR,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,MAAM,EACN,KAAK,EACL,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAA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AAC,WAAW,EACnC,YAAY,EAAE,UAAU,CAAC,YAAY,EACrC,QAAQ,EAAE,CAAC,CAAC,EAAE;4BACZ,iBAAiB,CAAC,KAAK,CAAC,CAAC;4BACzB,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;wBACzB,CAAC,GACD,GACU,CACf,CAAC,CAAC,CAAC,IAAI,EACP,iBAAiB,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,IAAI,CACxC,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,aAC5D,KAAC,MAAM,IACL,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,GAAG,EAAE;gCACZ,iBAAiB,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;gCAClC,wBAAwB,CAAC,OAAO,GAAG,IAAI,CAAC;4BAC1C,CAAC,YAEA,CAAC,CAAC,WAAW,CAAC,GACR,EACR,cAAc,IAAI,KAAC,QAAQ,IAAC,SAAS,EAAC,QAAQ,GAAG,IAC7C,CACR,IACI,GACmB,CAC7B,CAAC;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,YAAY,GAAG,YAAY,CAAC;AAErC,eAAe,QAAQ,CAAC","sourcesContent":["import {\n FC,\n useState,\n useEffect,\n MutableRefObject,\n MouseEvent,\n useRef,\n useContext,\n useMemo\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Avatar,\n Button,\n Count,\n Card,\n CardContent,\n CardHeader,\n Flex,\n Icon,\n registerIcon,\n MenuButton,\n SummaryItem,\n Text,\n defaultThemeProp,\n ForwardProps,\n useI18n,\n Progress,\n useOuterEvent,\n MetaList,\n SummaryListItem,\n ModalMethods,\n StyledVisual,\n useModalManager,\n useConfiguration,\n usePrevious,\n useElement,\n Tooltip,\n DateTimeDisplay,\n useUID\n} from '@pega/cosmos-react-core';\nimport { RichTextEditorState, StyledRichTextEditor } from '@pega/cosmos-react-rte';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport * as arrowMicroDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-down.icon';\nimport * as caretLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-left.icon';\nimport { formatListToLocaleString } from '@pega/cosmos-react-core/lib/utils';\nimport { parseToDate } from '@pega/cosmos-react-core/lib/components/DateTime/Input/utils';\nimport { formatDateTime } from '@pega/cosmos-react-core/lib/components/DateTime/utils';\n\nimport FeedButton from './FeedButton';\nimport FeedAttachments from './FeedAttachments';\nimport { StyledFeedReplyContainer } from './FeedReply';\nimport FeedContent from './FeedContent';\nimport FeedReplyInput from './FeedReplyInput';\nimport { FeedContext, FeedReplyContext } from './Feed.context';\nimport FeedRichText from './FeedRichText';\nimport FeedModalList, { FeedModalListProps } from './FeedModalList';\nimport { FeedLikeButton } from './FeedLikeButton';\nimport { FeedPostProps } from './FeedPost.types';\n\nregisterIcon(arrowMicroDownIcon, caretLeftIcon);\n\nconst defaultProps: Partial<FeedPostProps> = {\n info: {\n avatarSrc: '',\n fullname: '',\n username: '',\n postTimestamp: '',\n content: ''\n }\n};\n\nexport const StyledFeedPost = styled.div(\n ({ theme }) => css`\n ${StyledFeedReplyContainer}:not(:last-child) {\n margin-block-end: calc(2 * ${theme.base.spacing});\n }\n `\n);\n\nStyledFeedPost.defaultProps = defaultThemeProp;\n\nexport const StyledPostEdit = styled.div(\n ({ theme }) => css`\n ${StyledRichTextEditor} {\n padding: calc(0.5 * ${theme.base.spacing});\n }\n `\n);\n\nStyledPostEdit.defaultProps = defaultThemeProp;\n\nexport const StyledReplies = styled.div(\n ({ theme }) => css`\n border-top: 0.0625rem solid ${theme.base.palette['border-line']};\n padding: calc(1.25 * ${theme.base.spacing}) calc(2 * ${theme.base.spacing});\n `\n);\n\nStyledReplies.defaultProps = defaultThemeProp;\n\nexport const StyledPostFooter = styled.div(\n ({ theme }) => css`\n margin-block-start: ${theme.base.spacing};\n `\n);\n\nStyledPostFooter.defaultProps = defaultThemeProp;\n\nconst FullWidthSummaryItem = styled.div`\n width: 100%;\n\n ${StyledVisual} {\n align-self: start;\n }\n`;\n\nconst FeedPost: FC<ForwardProps & FeedPostProps> = (props: ForwardProps & FeedPostProps) => {\n const {\n id,\n info,\n interactionInfo,\n maxContentHeight = Infinity,\n onMouseEnter,\n onMouseLeave,\n onCommentClick,\n onLikeClick,\n onLikeCountInteraction,\n likesLoading,\n onLoadMoreLikes,\n onRecipientInteraction,\n recipientsLoading,\n onLoadMoreRecipients,\n onUserClick,\n onShowMoreClick,\n newReplyField,\n menuItems,\n onEditSubmit,\n edited = false,\n editTimestamp,\n replies = [],\n replyInput,\n replyInputShown,\n replyCount,\n repliesLoading,\n onShowLessReplies,\n onShowMoreReplies,\n ...restProps\n } = props;\n const {\n avatarSrc,\n fullname,\n username,\n postTimestamp,\n content,\n postType = 'public',\n recipients = [],\n recipientsCount = 0,\n attachments,\n liked,\n icon,\n postContext,\n userStatus\n } = info;\n const { commentLabel, interactionsEnabled = true } = interactionInfo;\n const { announce, userInfo: loggedInUser } = useContext(FeedContext);\n\n const t = useI18n();\n const { locale } = useConfiguration();\n const rteRef = useRef<RichTextEditorState>();\n const [editMode, setEditMode] = useState(false);\n const editTextAreaRef = useRef<HTMLDivElement>(null);\n const [emptyEditText, setEmptyEditText] = useState(false);\n const [postModified, setPostModified] = useState(false);\n const [replyInputOpen, setReplyInputOpen] = useState(false);\n const [replyInputRef, setReplyInputRef] = useState<MutableRefObject<\n RichTextEditorState | undefined\n > | null>(null);\n const { create } = useModalManager();\n const recipientsModalRef = useRef<ModalMethods<FeedModalListProps>>();\n const prevReplies = usePrevious(replies);\n const suppressNextAnnouncement = useRef(false);\n const [postTimestampEl, setPostTimestampEl] = useElement<HTMLSpanElement>();\n const [editTimestampEl, setEditTimestampEl] = useElement<HTMLSpanElement>();\n const commentCountId = useUID();\n\n useEffect(() => {\n if (recipients.length) {\n recipientsModalRef.current?.update({\n count: recipientsCount,\n heading: t('feed_recipients'),\n listItems: recipients as SummaryListItem[],\n onLoadMore: onLoadMoreRecipients,\n loading: recipientsLoading\n });\n }\n }, [recipientsCount, recipients, onLoadMoreRecipients, recipientsLoading]);\n\n useOuterEvent('mousedown', [editTextAreaRef], () => {\n if (emptyEditText) setEditMode(false);\n });\n\n useEffect(() => {\n if ((replyInputOpen || replyInputShown) && replyInputRef) {\n replyInputRef.current?.focus();\n }\n }, [replyInputOpen, replyInputShown, replyInputRef]);\n\n const userVisual = icon ? (\n <Icon name={icon} />\n ) : (\n <Avatar name={fullname} size='l' imageSrc={avatarSrc} status={userStatus} />\n );\n\n const numReplies = replyCount || replies?.length;\n\n const replyCtxValue = useMemo(() => ({ onShowReplyInput: () => setReplyInputOpen(true) }), []);\n\n const postTypeAttributes = useMemo(() => {\n if (postType === 'private') {\n const recipientsList = recipients.map(x => x.primary);\n return {\n icon: 'users-solid',\n ariaLabel: `${t('feed_private_post')} ${t('feed_recipients')} ${formatListToLocaleString(\n recipientsList,\n t,\n locale,\n { count: recipientsCount }\n )}`,\n label: formatListToLocaleString(recipientsList, t, locale, {\n count: recipientsCount,\n separator: '\\n'\n })\n };\n }\n\n return {\n icon: 'globe',\n ariaLabel: t('feed_public_post'),\n label: t('feed_public_post')\n };\n }, [postType, recipients, recipientsCount]);\n\n const handleEdit = () => {\n if (!emptyEditText && postModified) {\n onEditSubmit?.({\n postId: id,\n value: rteRef.current?.getPlainText() || ''\n });\n setEditMode(false);\n }\n };\n\n useEffect(() => {\n if (prevReplies) {\n const difference = prevReplies.length - replies.length;\n if (difference > 0 && !suppressNextAnnouncement.current) {\n const timeoutId = announce(t('feed_reply_removed'));\n return () => clearTimeout(timeoutId);\n }\n suppressNextAnnouncement.current = false;\n }\n }, [replies]);\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 return (\n <FeedReplyContext.Provider value={replyCtxValue}>\n <Card\n {...restProps}\n as={StyledFeedPost}\n onMouseEnter={() => {\n onMouseEnter?.({ postId: id });\n }}\n onMouseLeave={() => {\n onMouseLeave?.({ postId: id });\n }}\n >\n <CardHeader>\n <SummaryItem\n as={FullWidthSummaryItem}\n visual={\n onUserClick ? (\n <BareButton\n onClick={(event: MouseEvent) => {\n onUserClick?.({ postId: 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?.({ postId: 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: 1, alignItems: 'center' }}>\n <Button\n variant='text'\n icon\n onClick={\n recipients.length\n ? () => {\n if (recipientsCount > 10) {\n recipientsModalRef.current = create(FeedModalList, {\n count: recipientsCount,\n heading: t('feed_recipients'),\n listItems: recipients as SummaryListItem[],\n onLoadMore: onLoadMoreRecipients,\n loading: recipientsLoading\n });\n }\n }\n : onRecipientInteraction\n }\n onFocus={onRecipientInteraction}\n onMouseOver={onRecipientInteraction}\n aria-label={postTypeAttributes.ariaLabel}\n label={postTypeAttributes.label || t('feed_private_post')}\n >\n <Icon name={postTypeAttributes.icon} />\n </Button>\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 &&\n typeof content === 'string' &&\n 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 </CardHeader>\n <CardContent>\n {editMode ? (\n <>\n <StyledPostEdit ref={editTextAreaRef}>\n <FeedRichText\n label={t('feed_edit_post')}\n onChange={() => {\n setEmptyEditText(rteRef.current?.getPlainText().trim() === '');\n setPostModified(rteRef.current?.getPlainText() !== content);\n }}\n autoFocus\n onSubmit={handleEdit}\n defaultValue={content}\n ref={rteRef}\n />\n </StyledPostEdit>\n <Flex container={{ justify: 'between', pad: [2, 0, 0] }}>\n <Button\n onClick={() => setEditMode(false)}\n aria-label={`${t('cancel')} ${t('edit')} ${id}`}\n >\n {t('cancel')}\n </Button>\n <Button\n variant='primary'\n disabled={emptyEditText || !postModified}\n onClick={handleEdit}\n aria-label={`${t('update')} ${t('edit')} ${id}`}\n >\n {t('update')}\n </Button>\n </Flex>\n </>\n ) : (\n <FeedContent maxContentHeight={maxContentHeight}>{content}</FeedContent>\n )}\n <FeedAttachments attachments={attachments} readOnly />\n <Flex as={StyledPostFooter} container={{ justify: 'between', wrap: 'wrap', gap: 1 }}>\n {interactionsEnabled ? (\n <Flex container={{ gap: 2 }}>\n <Button\n variant='text'\n as={FeedButton}\n onClick={() => {\n onCommentClick?.({ postId: id });\n if (!replyInputOpen) {\n setReplyInputOpen(true);\n }\n }}\n aria-label={commentLabel}\n aria-describedby={numReplies > 0 ? commentCountId : undefined}\n >\n <Icon name='chat' />\n <Text>{commentLabel}</Text>\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 </Button>\n <FeedLikeButton\n id={id}\n variant='post'\n onLikeClick={onLikeClick}\n onLikeCountInteraction={onLikeCountInteraction}\n onLoadMoreLikes={onLoadMoreLikes}\n likesLoading={likesLoading}\n liked={liked}\n showText\n {...interactionInfo}\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>&bull;</span>\n </>\n )}\n {onShowMoreReplies && replies.length < numReplies && (\n <Button variant='link' onClick={() => onShowMoreReplies({ postId: id })}>\n {t('show_more')}\n </Button>\n )}\n {repliesLoading && <Progress placement='inline' />}\n </Flex>\n )}\n </Flex>\n </CardContent>\n {!!replies?.length && <StyledReplies>{replies}</StyledReplies>}\n {replyInputShown || replyInputOpen ? (\n <CardContent>\n <FeedReplyInput\n onSetInputRef={({ ref }) => {\n setReplyInputRef(ref);\n }}\n id={id}\n commentLabel={replyInput.commentLabel}\n attachments={replyInput.attachments}\n placeholder={replyInput.placeholder}\n onFilesAdded={replyInput.onFilesAdded}\n onSubmit={e => {\n setReplyInputOpen(false);\n replyInput.onSubmit(e);\n }}\n />\n </CardContent>\n ) : null}\n {onShowLessReplies && !!replies.length && (\n <Flex container={{ justify: 'center', pad: [0, 0, 1], gap: 1 }}>\n <Button\n variant='link'\n onClick={() => {\n onShowLessReplies({ postId: id });\n suppressNextAnnouncement.current = true;\n }}\n >\n {t('show_less')}\n </Button>\n {repliesLoading && <Progress placement='inline' />}\n </Flex>\n )}\n </Card>\n </FeedReplyContext.Provider>\n );\n};\n\nFeedPost.defaultProps = defaultProps;\n\nexport default FeedPost;\n"]}
@@ -29,9 +29,7 @@ export interface FeedPostProps {
29
29
  likes?: SummaryListItem[];
30
30
  likeCount?: number;
31
31
  commentLabel: string;
32
- /**
33
- * @default true
34
- */
32
+ /** @default true */
35
33
  interactionsEnabled?: boolean;
36
34
  };
37
35
  /** Callback that runs when the mouse pointer hovers over the Activity. */
@@ -1 +1 @@
1
- {"version":3,"file":"FeedPost.types.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedPost.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,WAAW,aAAa;IAC5B,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,yEAAyE;IACzE,IAAI,EAAE;QACJ,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAC7C,OAAO,EAAE,YAAY,GAAG,MAAM,CAAC;QAC/B,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;QAChC,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;QAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;QAC9B,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;QACpC,UAAU,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;KACpC,CAAC;IACF,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,kBAAkB,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,mBAAmB,CAAC,aAAa,CAAC,CAAC;KACjD,CAAC;IACF,iDAAiD;IACjD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,2DAA2D;IAC3D,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACxD,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACxD,2CAA2C;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yCAAyC;IACzC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,8CAA8C;IAC9C,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"FeedPost.types.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedPost.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactElement, MouseEvent } from 'react';\n\nimport {\n AvatarProps,\n DateTimeDisplayProps,\n MenuItemProps,\n SummaryListItem\n} from '@pega/cosmos-react-core';\n\nimport { AttachedFiles } from './FeedAttachments';\nimport { FeedContentProps } from './FeedContent';\nimport { FeedReplyInputProps } from './FeedReplyInput';\n\nexport interface FeedPostProps {\n /** Unique ID for this activity */\n id: string;\n /** All of the information used to fill text portions, and avatar info */\n info: {\n avatarSrc?: string;\n fullname: string;\n username: string;\n postTimestamp: DateTimeDisplayProps['value'];\n content: ReactElement | string;\n postType?: 'public' | 'private';\n recipients?: MenuItemProps[];\n recipientsCount?: number;\n attachments?: AttachedFiles[];\n liked?: boolean;\n icon?: string;\n postContext?: ReactElement | string;\n userStatus?: AvatarProps['status'];\n };\n maxContentHeight?: FeedContentProps['maxContentHeight'];\n /** Button labels for accessibility purposes. */\n interactionInfo: {\n likeLabel: string;\n likes?: SummaryListItem[];\n likeCount?: number;\n commentLabel: string;\n /**\n * @default true\n */\n interactionsEnabled?: boolean;\n };\n /** Callback that runs when the mouse pointer hovers over the Activity. */\n onMouseEnter?: (event: { postId: string }) => void;\n /** Callback that runs when the mouse pointer leaves the Activity. */\n onMouseLeave?: (event: { postId: string }) => void;\n /** Callback that runs when the comment button has been clicked */\n onCommentClick?: (event: { postId: string }) => void;\n /** Callback that runs when the like button has been clicked */\n onLikeClick: (event: { postId: string; user: SummaryListItem }) => void;\n /** Callback that runs when the like count on a post 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 /** 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 /** Callback that runs when the user name or visual button has been clicked */\n onUserClick?: (event: { postId: string; username: string }, clickEvent?: MouseEvent) => void;\n /** MenuItems that will populate the three dot menu button */\n menuItems?: MenuItemProps[];\n /** Callback that updates the post after being edited. If undefined, the post will not be editable. */\n onEditSubmit?: (event: { postId: string; value: string }) => void;\n /**\n * Flag that indicates if a post has been previously edited.\n * @default false\n */\n edited?: boolean;\n /** Indicates how much time has passed since the last edit was made. This will only display if edited is true. */\n editTimestamp?: DateTimeDisplayProps['value'];\n /** Props that will be passed into the reply input, see FeedReplyInput for more information */\n replyInput: Pick<FeedReplyInputProps, 'onSubmit' | 'placeholder' | 'onFilesAdded'> & {\n commentLabel: FeedReplyInputProps['commentLabel'];\n attachments: FeedReplyInputProps['attachments'];\n };\n /** The default visibility for the reply input */\n replyInputShown?: boolean;\n /** An array to hold FeedReply's inside of this Activity */\n replies?: ReactElement[];\n /** A total count of all replies. */\n replyCount?: number;\n /** Callback that runs when the user clicks Show more button. */\n onShowMoreReplies?: (event: { postId: string }) => void;\n /** Callback that runs when the user clicks Show less button. */\n onShowLessReplies?: (event: { postId: string }) => void;\n /** A loading indicator for the replies. */\n repliesLoading?: boolean;\n /** A loading indicator for the likes. */\n likesLoading?: boolean;\n /** A loading indicator for the recipients. */\n recipientsLoading?: boolean;\n}\n"]}
1
+ {"version":3,"file":"FeedPost.types.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedPost.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactElement, MouseEvent } from 'react';\n\nimport {\n AvatarProps,\n DateTimeDisplayProps,\n MenuItemProps,\n SummaryListItem\n} from '@pega/cosmos-react-core';\n\nimport { AttachedFiles } from './FeedAttachments';\nimport { FeedContentProps } from './FeedContent';\nimport { FeedReplyInputProps } from './FeedReplyInput';\n\nexport interface FeedPostProps {\n /** Unique ID for this activity */\n id: string;\n /** All of the information used to fill text portions, and avatar info */\n info: {\n avatarSrc?: string;\n fullname: string;\n username: string;\n postTimestamp: DateTimeDisplayProps['value'];\n content: ReactElement | string;\n postType?: 'public' | 'private';\n recipients?: MenuItemProps[];\n recipientsCount?: number;\n attachments?: AttachedFiles[];\n liked?: boolean;\n icon?: string;\n postContext?: ReactElement | string;\n userStatus?: AvatarProps['status'];\n };\n maxContentHeight?: FeedContentProps['maxContentHeight'];\n /** Button labels for accessibility purposes. */\n interactionInfo: {\n likeLabel: string;\n likes?: SummaryListItem[];\n likeCount?: number;\n commentLabel: string;\n /** @default true */\n interactionsEnabled?: boolean;\n };\n /** Callback that runs when the mouse pointer hovers over the Activity. */\n onMouseEnter?: (event: { postId: string }) => void;\n /** Callback that runs when the mouse pointer leaves the Activity. */\n onMouseLeave?: (event: { postId: string }) => void;\n /** Callback that runs when the comment button has been clicked */\n onCommentClick?: (event: { postId: string }) => void;\n /** Callback that runs when the like button has been clicked */\n onLikeClick: (event: { postId: string; user: SummaryListItem }) => void;\n /** Callback that runs when the like count on a post 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 /** 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 /** Callback that runs when the user name or visual button has been clicked */\n onUserClick?: (event: { postId: string; username: string }, clickEvent?: MouseEvent) => void;\n /** MenuItems that will populate the three dot menu button */\n menuItems?: MenuItemProps[];\n /** Callback that updates the post after being edited. If undefined, the post will not be editable. */\n onEditSubmit?: (event: { postId: string; value: string }) => void;\n /**\n * Flag that indicates if a post has been previously edited.\n * @default false\n */\n edited?: boolean;\n /** Indicates how much time has passed since the last edit was made. This will only display if edited is true. */\n editTimestamp?: DateTimeDisplayProps['value'];\n /** Props that will be passed into the reply input, see FeedReplyInput for more information */\n replyInput: Pick<FeedReplyInputProps, 'onSubmit' | 'placeholder' | 'onFilesAdded'> & {\n commentLabel: FeedReplyInputProps['commentLabel'];\n attachments: FeedReplyInputProps['attachments'];\n };\n /** The default visibility for the reply input */\n replyInputShown?: boolean;\n /** An array to hold FeedReply's inside of this Activity */\n replies?: ReactElement[];\n /** A total count of all replies. */\n replyCount?: number;\n /** Callback that runs when the user clicks Show more button. */\n onShowMoreReplies?: (event: { postId: string }) => void;\n /** Callback that runs when the user clicks Show less button. */\n onShowLessReplies?: (event: { postId: string }) => void;\n /** A loading indicator for the replies. */\n repliesLoading?: boolean;\n /** A loading indicator for the likes. */\n likesLoading?: boolean;\n /** A loading indicator for the recipients. */\n recipientsLoading?: boolean;\n}\n"]}
@@ -20,9 +20,7 @@ export interface FeedReplyProps {
20
20
  likeCount?: number;
21
21
  likeLabel: string;
22
22
  commentLabel: string;
23
- /**
24
- * @default true
25
- */
23
+ /** @default true */
26
24
  interactionsEnabled?: boolean;
27
25
  };
28
26
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"FeedReply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OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACvE,WAAW,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,eAAe,CAAA;KAAE,KAAK,IAAI,CAAC;IACzE,wFAAwF;IACxF,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;IACpC,2HAA2H;IAC3H,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,yCAAyC;IACzC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,UAAU,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;CAC/F"}
@@ -1 +1 @@
1
- {"version":3,"file":"FeedReply.types.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedReply.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEvent, ReactElement } from 'react';\n\nimport {\n AvatarProps,\n DateTimeDisplayProps,\n MenuItemProps,\n SummaryListItem\n} from '@pega/cosmos-react-core';\n\nimport { AttachedFiles } from './FeedAttachments';\n\nexport interface FeedReplyProps {\n id: string;\n info: {\n avatarSrc?: string;\n postTimestamp: DateTimeDisplayProps['value'];\n content: ReactElement | string;\n attachments?: AttachedFiles[];\n username: string;\n fullname: string;\n fullnameLabel: string;\n liked?: boolean;\n icon?: string;\n userStatus?: AvatarProps['status'];\n };\n interactionInfo: {\n likes?: SummaryListItem[];\n likeCount?: number;\n likeLabel: string;\n commentLabel: string;\n /**\n * @default true\n */\n interactionsEnabled?: boolean;\n };\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 /** A set of menu options for actions on the reply. */\n menuItems?: MenuItemProps[];\n /** Callback that updates the reply after being edited. If undefined, the reply will not be editable. */\n onEditSubmit?: (event: { replyId: string; value: string }) => void;\n /**\n * Flag that indicates if a reply has been previously edited.\n * @default false\n */\n edited?: boolean;\n /** Indicates how much time has passed since the last edit was made. This will only display if edited is true. */\n editTimestamp?: DateTimeDisplayProps['value'];\n onMouseEnter?: (event: { replyId: string }) => void;\n onMouseLeave?: (event: { replyId: string }) => void;\n onCommentClick: (event: { replyId: string; username: string }) => void;\n onLikeClick: (event: { replyId: string; user: SummaryListItem }) => void;\n /** Callback that runs when the like count on a post 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. */\n likesLoading?: boolean;\n onUserClick?: (event: { replyId: string; username: string }, clickEvent?: MouseEvent) => void;\n}\n"]}
1
+ {"version":3,"file":"FeedReply.types.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedReply.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEvent, ReactElement } from 'react';\n\nimport {\n AvatarProps,\n DateTimeDisplayProps,\n MenuItemProps,\n SummaryListItem\n} from '@pega/cosmos-react-core';\n\nimport { AttachedFiles } from './FeedAttachments';\n\nexport interface FeedReplyProps {\n id: string;\n info: {\n avatarSrc?: string;\n postTimestamp: DateTimeDisplayProps['value'];\n content: ReactElement | string;\n attachments?: AttachedFiles[];\n username: string;\n fullname: string;\n fullnameLabel: string;\n liked?: boolean;\n icon?: string;\n userStatus?: AvatarProps['status'];\n };\n interactionInfo: {\n likes?: SummaryListItem[];\n likeCount?: number;\n likeLabel: string;\n commentLabel: string;\n /** @default true */\n interactionsEnabled?: boolean;\n };\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 /** A set of menu options for actions on the reply. */\n menuItems?: MenuItemProps[];\n /** Callback that updates the reply after being edited. If undefined, the reply will not be editable. */\n onEditSubmit?: (event: { replyId: string; value: string }) => void;\n /**\n * Flag that indicates if a reply has been previously edited.\n * @default false\n */\n edited?: boolean;\n /** Indicates how much time has passed since the last edit was made. This will only display if edited is true. */\n editTimestamp?: DateTimeDisplayProps['value'];\n onMouseEnter?: (event: { replyId: string }) => void;\n onMouseLeave?: (event: { replyId: string }) => void;\n onCommentClick: (event: { replyId: string; username: string }) => void;\n onLikeClick: (event: { replyId: string; user: SummaryListItem }) => void;\n /** Callback that runs when the like count on a post 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. */\n likesLoading?: boolean;\n onUserClick?: (event: { replyId: string; username: string }, clickEvent?: MouseEvent) => void;\n}\n"]}
@@ -3,7 +3,7 @@ import { ForwardProps } from '@pega/cosmos-react-core';
3
3
  import { RichTextEditorState } from '@pega/cosmos-react-rte';
4
4
  import { AttachedFiles } from './FeedAttachments';
5
5
  export interface FeedReplyInputProps {
6
- /** Unique ID for this Reply Input */
6
+ /** Unique ID for this Reply Input */
7
7
  id: string;
8
8
  /** Label text for the reply submit button. */
9
9
  commentLabel: string;
@@ -1 +1 @@
1
- {"version":3,"file":"FeedReplyInput.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedReplyInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA+B,gBAAgB,EAA0B,MAAM,OAAO,CAAC;AAGlG,OAAO,EAQL,YAAY,EAEb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAwB,MAAM,wBAAwB,CAAC;AAMnF,OAAwB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKnE,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,YAAY,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;IAC9B,uCAAuC;IACvC,WA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,KAAK,EAAE,YAAY,YAEnB,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,GACb,IACJ,EACP,KAAC,eAAe,IAAC,GAAG,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,GAAI,IAChE,GACF,IACF,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { FC, useRef, useState, useEffect, MutableRefObject, MouseEvent, useContext } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Avatar,\n Button,\n StyledAvatar,\n Flex,\n Icon,\n registerIcon,\n defaultThemeProp,\n ForwardProps,\n useI18n\n} from '@pega/cosmos-react-core';\nimport { RichTextEditorState, StyledRichTextEditor } from '@pega/cosmos-react-rte';\nimport * as sendIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/send.icon';\nimport * as paperClipIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/paper-clip.icon';\n\nimport FeedRichText from './FeedRichText';\nimport FeedButton from './FeedButton';\nimport FeedAttachments, { AttachedFiles } from './FeedAttachments';\nimport { FeedContext } from './Feed.context';\n\nregisterIcon(sendIcon, paperClipIcon);\n\nexport interface FeedReplyInputProps {\n /** Unique ID for this Reply Input */\n id: string;\n /** Label text for the reply submit button. */\n commentLabel: string;\n /** A set of attachment files. */\n attachments?: AttachedFiles[];\n /** Placeholder string for the input */\n placeholder: string;\n /** A callback containing a list of added files that will run whenever files are added to the post. */\n onFilesAdded?: (files: AttachedFiles[]) => void;\n /** Callback that runs when the submit button has been pressed */\n onSubmit: (event: {\n replyId: string;\n value: string;\n attachments: AttachedFiles[];\n clear: () => void;\n }) => void;\n /** Callback that sets returns a shared ref to the RTE component */\n onSetInputRef?: (event: { ref: MutableRefObject<RichTextEditorState | undefined> }) => void;\n}\n\nexport const StyledReplyInputContainer = styled.div(props => {\n const { theme } = props;\n\n return css`\n ${StyledAvatar} {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledReplyInputContainer.defaultProps = defaultThemeProp;\n\nexport const StyledFeedReply = styled.div(props => {\n const { theme } = props;\n\n return css`\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-radius: calc(2.5 * ${theme.base['border-radius']});\n padding: 0 calc(2 * ${theme.base.spacing});\n cursor: text;\n\n ${FeedButton} {\n align-self: flex-end;\n }\n `;\n});\n\nStyledFeedReply.defaultProps = defaultThemeProp;\n\nconst StyledFeedReplyInput = styled.div(props => {\n const { theme } = props;\n\n return css`\n padding-top: calc(0.75 * ${theme.base.spacing});\n\n ${StyledRichTextEditor} {\n &:focus-within {\n box-shadow: none;\n }\n }\n `;\n});\n\nStyledFeedReplyInput.defaultProps = defaultThemeProp;\n\nconst HiddenFileInput = styled.input`\n display: none;\n`;\n\nconst FeedReplyInput: FC<ForwardProps & FeedReplyInputProps> = (\n props: ForwardProps & FeedReplyInputProps\n) => {\n const rteRef = useRef<RichTextEditorState>();\n const {\n id,\n commentLabel,\n attachments = [],\n placeholder,\n onAddAttachment,\n onSubmit,\n onSetInputRef,\n onFilesAdded,\n ...restProps\n } = props;\n\n const [emptyText, setEmptyText] = useState(true);\n const hiddenInputRef = useRef<HTMLInputElement>(null);\n const attachmentListRef = useRef<HTMLUListElement>(null);\n const attachmentsButtonRef = useRef<HTMLButtonElement>(null);\n const submitButtonRef = useRef<HTMLButtonElement>(null);\n const { setShowSearchResults } = useContext(FeedContext);\n const { avatarSrc, fullname } = useContext(FeedContext).userInfo;\n\n useEffect(() => {\n onSetInputRef?.({ ref: rteRef });\n }, [rteRef]);\n\n const t = useI18n();\n\n const handleSubmit = () => {\n setShowSearchResults?.(false);\n if (!emptyText || attachments.length > 0) {\n onSubmit({\n replyId: id,\n value: rteRef.current?.getPlainText() || '',\n attachments: attachments || [],\n clear: () => {\n rteRef.current?.clear();\n }\n });\n }\n };\n\n return (\n <Flex container as={StyledReplyInputContainer} {...restProps}>\n <Avatar name={fullname} size='m' imageSrc={avatarSrc} />\n <Flex\n container={{ alignItems: 'start' }}\n item={{ grow: 1 }}\n as={StyledFeedReply}\n onClick={(event: MouseEvent) => {\n if (\n attachmentListRef.current &&\n event.target !== attachmentListRef.current &&\n attachmentListRef.current.contains(event.target as Node)\n ) {\n return;\n }\n\n if (\n attachmentsButtonRef.current?.contains(event.target as Node) ||\n submitButtonRef.current?.contains(event.target as Node)\n ) {\n return;\n }\n\n rteRef.current?.focus();\n }}\n >\n <Flex container={{ direction: 'column' }} item={{ grow: 1 }}>\n <Flex container item={{ grow: 1 }}>\n <Flex as={StyledFeedReplyInput} item={{ grow: 1 }}>\n <FeedRichText\n label={t('feed_new_reply')}\n ref={rteRef}\n placeholder={placeholder}\n onChange={() => {\n setEmptyText(rteRef.current?.getPlainText().trim() === '');\n }}\n onSubmit={handleSubmit}\n />\n </Flex>\n {onFilesAdded && (\n <>\n <HiddenFileInput\n ref={hiddenInputRef}\n type='file'\n multiple\n onChange={() => {\n if (hiddenInputRef.current?.files) {\n onFilesAdded?.(Array.from(hiddenInputRef.current?.files));\n }\n }}\n // Must trick input to believe there is no value when activated so that the same file may be added consecutively.\n onClick={(event: MouseEvent) => {\n (event.target as HTMLInputElement).value = '';\n }}\n />\n <Button\n ref={attachmentsButtonRef}\n as={FeedButton}\n variant='simple'\n onClick={() => {\n setShowSearchResults?.(false);\n hiddenInputRef.current?.click();\n }}\n icon\n label={\n attachments.length\n ? t('attachments_count', [], { count: 1 }).toUpperCase()\n : t('file_upload_text_multiple')\n }\n >\n <Icon name='paper-clip' />\n </Button>\n </>\n )}\n <Button\n ref={submitButtonRef}\n as={FeedButton}\n disabled={emptyText && attachments.length === 0}\n variant='simple'\n onClick={handleSubmit}\n icon\n label={commentLabel}\n >\n <Icon name='send' />\n </Button>\n </Flex>\n <FeedAttachments ref={attachmentListRef} attachments={attachments} />\n </Flex>\n </Flex>\n </Flex>\n );\n};\n\nexport default FeedReplyInput;\n"]}
1
+ {"version":3,"file":"FeedReplyInput.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedReplyInput.tsx"],"names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oB,EAAE,CAAC,KAAK,CAAC,CAAC;gDAC9B,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;4CAClC,CAAC,EACD,IAAI,QACJ,KAAK,EACH,WAAW,CAAC,MAAM;gDAChB,CAAC,CAAC,CAAC,CAAC,mBAAmB,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE;gDACxD,CAAC,CAAC,CAAC,CAAC,2BAA2B,CAAC,YAGpC,KAAC,IAAI,IAAC,IAAI,EAAC,YAAY,GAAG,GACnB,IACR,CACJ,EACD,KAAC,MAAM,IACL,GAAG,EAAE,eAAe,EACpB,EAAE,EAAE,UAAU,EACd,QAAQ,EAAE,SAAS,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAC/C,OAAO,EAAC,QAAQ,EAChB,OAAO,EAAE,YAAY,EACrB,IAAI,QACJ,KAAK,EAAE,YAAY,YAEnB,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,GACb,IACJ,EACP,KAAC,eAAe,IAAC,GAAG,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,GAAI,IAChE,GACF,IACF,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { FC, useRef, useState, useEffect, MutableRefObject, MouseEvent, useContext } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Avatar,\n Button,\n StyledAvatar,\n Flex,\n Icon,\n registerIcon,\n defaultThemeProp,\n ForwardProps,\n useI18n\n} from '@pega/cosmos-react-core';\nimport { RichTextEditorState, StyledRichTextEditor } from '@pega/cosmos-react-rte';\nimport * as sendIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/send.icon';\nimport * as paperClipIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/paper-clip.icon';\n\nimport FeedRichText from './FeedRichText';\nimport FeedButton from './FeedButton';\nimport FeedAttachments, { AttachedFiles } from './FeedAttachments';\nimport { FeedContext } from './Feed.context';\n\nregisterIcon(sendIcon, paperClipIcon);\n\nexport interface FeedReplyInputProps {\n /** Unique ID for this Reply Input */\n id: string;\n /** Label text for the reply submit button. */\n commentLabel: string;\n /** A set of attachment files. */\n attachments?: AttachedFiles[];\n /** Placeholder string for the input */\n placeholder: string;\n /** A callback containing a list of added files that will run whenever files are added to the post. */\n onFilesAdded?: (files: AttachedFiles[]) => void;\n /** Callback that runs when the submit button has been pressed */\n onSubmit: (event: {\n replyId: string;\n value: string;\n attachments: AttachedFiles[];\n clear: () => void;\n }) => void;\n /** Callback that sets returns a shared ref to the RTE component */\n onSetInputRef?: (event: { ref: MutableRefObject<RichTextEditorState | undefined> }) => void;\n}\n\nexport const StyledReplyInputContainer = styled.div(props => {\n const { theme } = props;\n\n return css`\n ${StyledAvatar} {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledReplyInputContainer.defaultProps = defaultThemeProp;\n\nexport const StyledFeedReply = styled.div(props => {\n const { theme } = props;\n\n return css`\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-radius: calc(2.5 * ${theme.base['border-radius']});\n padding: 0 calc(2 * ${theme.base.spacing});\n cursor: text;\n\n ${FeedButton} {\n align-self: flex-end;\n }\n `;\n});\n\nStyledFeedReply.defaultProps = defaultThemeProp;\n\nconst StyledFeedReplyInput = styled.div(props => {\n const { theme } = props;\n\n return css`\n padding-top: calc(0.75 * ${theme.base.spacing});\n\n ${StyledRichTextEditor} {\n &:focus-within {\n box-shadow: none;\n }\n }\n `;\n});\n\nStyledFeedReplyInput.defaultProps = defaultThemeProp;\n\nconst HiddenFileInput = styled.input`\n display: none;\n`;\n\nconst FeedReplyInput: FC<ForwardProps & FeedReplyInputProps> = (\n props: ForwardProps & FeedReplyInputProps\n) => {\n const rteRef = useRef<RichTextEditorState>();\n const {\n id,\n commentLabel,\n attachments = [],\n placeholder,\n onAddAttachment,\n onSubmit,\n onSetInputRef,\n onFilesAdded,\n ...restProps\n } = props;\n\n const [emptyText, setEmptyText] = useState(true);\n const hiddenInputRef = useRef<HTMLInputElement>(null);\n const attachmentListRef = useRef<HTMLUListElement>(null);\n const attachmentsButtonRef = useRef<HTMLButtonElement>(null);\n const submitButtonRef = useRef<HTMLButtonElement>(null);\n const { setShowSearchResults } = useContext(FeedContext);\n const { avatarSrc, fullname } = useContext(FeedContext).userInfo;\n\n useEffect(() => {\n onSetInputRef?.({ ref: rteRef });\n }, [rteRef]);\n\n const t = useI18n();\n\n const handleSubmit = () => {\n setShowSearchResults?.(false);\n if (!emptyText || attachments.length > 0) {\n onSubmit({\n replyId: id,\n value: rteRef.current?.getPlainText() || '',\n attachments: attachments || [],\n clear: () => {\n rteRef.current?.clear();\n }\n });\n }\n };\n\n return (\n <Flex container as={StyledReplyInputContainer} {...restProps}>\n <Avatar name={fullname} size='m' imageSrc={avatarSrc} />\n <Flex\n container={{ alignItems: 'start' }}\n item={{ grow: 1 }}\n as={StyledFeedReply}\n onClick={(event: MouseEvent) => {\n if (\n attachmentListRef.current &&\n event.target !== attachmentListRef.current &&\n attachmentListRef.current.contains(event.target as Node)\n ) {\n return;\n }\n\n if (\n attachmentsButtonRef.current?.contains(event.target as Node) ||\n submitButtonRef.current?.contains(event.target as Node)\n ) {\n return;\n }\n\n rteRef.current?.focus();\n }}\n >\n <Flex container={{ direction: 'column' }} item={{ grow: 1 }}>\n <Flex container item={{ grow: 1 }}>\n <Flex as={StyledFeedReplyInput} item={{ grow: 1 }}>\n <FeedRichText\n label={t('feed_new_reply')}\n ref={rteRef}\n placeholder={placeholder}\n onChange={() => {\n setEmptyText(rteRef.current?.getPlainText().trim() === '');\n }}\n onSubmit={handleSubmit}\n />\n </Flex>\n {onFilesAdded && (\n <>\n <HiddenFileInput\n ref={hiddenInputRef}\n type='file'\n multiple\n onChange={() => {\n if (hiddenInputRef.current?.files) {\n onFilesAdded?.(Array.from(hiddenInputRef.current?.files));\n }\n }}\n // Must trick input to believe there is no value when activated so that the same file may be added consecutively.\n onClick={(event: MouseEvent) => {\n (event.target as HTMLInputElement).value = '';\n }}\n />\n <Button\n ref={attachmentsButtonRef}\n as={FeedButton}\n variant='simple'\n onClick={() => {\n setShowSearchResults?.(false);\n hiddenInputRef.current?.click();\n }}\n icon\n label={\n attachments.length\n ? t('attachments_count', [], { count: 1 }).toUpperCase()\n : t('file_upload_text_multiple')\n }\n >\n <Icon name='paper-clip' />\n </Button>\n </>\n )}\n <Button\n ref={submitButtonRef}\n as={FeedButton}\n disabled={emptyText && attachments.length === 0}\n variant='simple'\n onClick={handleSubmit}\n icon\n label={commentLabel}\n >\n <Icon name='send' />\n </Button>\n </Flex>\n <FeedAttachments ref={attachmentListRef} attachments={attachments} />\n </Flex>\n </Flex>\n </Flex>\n );\n};\n\nexport default FeedReplyInput;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"HashtagButton.d.ts","sourceRoot":"","sources":["../../../src/components/HashtagButton/HashtagButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAGjB,YAAY,EAGb,MAAM,OAAO,CAAC;AAGf,OAAO,EAAO,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAK5D,UAAU,kBAAkB;IAC1B,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,YAAY,CAAC;IAChD,qBAAqB;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAQD,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAwBvE,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;aAKL,MAAM;;uBAQZ,MAAM;;;CAM1B,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"HashtagButton.d.ts","sourceRoot":"","sources":["../../../src/components/HashtagButton/HashtagButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAGjB,YAAY,EAGb,MAAM,OAAO,CAAC;AAGf,OAAO,EAAO,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAK5D,UAAU,kBAAkB;IAC1B,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,YAAY,CAAC;IAChD,qBAAqB;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAQD,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAsBvE,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;aAKL,MAAM;;uBAQZ,MAAM;;;CAM1B,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, isValidElement, useContext } from 'react';
3
3
  import styled from 'styled-components';
4
4
  import { Tag } from '@pega/cosmos-react-core';
@@ -19,7 +19,7 @@ const HashtagButton = forwardRef(({ children, tag: tagProp = '', ...restProps },
19
19
  else {
20
20
  tag = tagProp;
21
21
  }
22
- return (_jsx(_Fragment, { children: _jsx(StyledTag, { ...restProps, ref: ref, onClick: () => onTagClick?.(tag), spellCheck: false, children: isValidElement(children) ? children : tag }) }));
22
+ return (_jsx(StyledTag, { ...restProps, ref: ref, onClick: () => onTagClick?.(tag), spellCheck: false, children: isValidElement(children) ? children : tag }));
23
23
  });
24
24
  export const HashtagButtonConfig = {
25
25
  type: 'tag',
@@ -1 +1 @@
1
- {"version":3,"file":"HashtagButton.js","sourceRoot":"","sources":["../../../src/components/HashtagButton/HashtagButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAEV,cAAc,EAId,UAAU,EACX,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,GAAG,EAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,WAAW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C,YAAY,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAEjC,OAAO,UAAU,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,EAAE,CAAC,OAAe,EAAE,EAAE;QAC3B,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAE7C,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,GAAG;YAAE,OAAO,SAAS,CAAC;QACrD,OAAO,EAAE,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC;IACjC,CAAC;CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n isValidElement,\n PropsWithoutRef,\n ReactElement,\n Ref,\n useContext\n} from 'react';\nimport styled from 'styled-components';\n\nimport { Tag, ForwardProps } from '@pega/cosmos-react-core';\nimport { getXMLAttributes } from '@pega/cosmos-react-rte';\n\nimport { FeedContext } from '../Feed/Feed.context';\n\ninterface HashtagButtonProps {\n /** Text for the button, or an object containing all necessary props. */\n children: Record<string, string> | ReactElement;\n /** The tag value. */\n tag?: string;\n}\n\nconst StyledTag = styled(Tag)`\n cursor: pointer;\n`;\n\nconst serializer = new XMLSerializer();\n\nconst HashtagButton: FunctionComponent<HashtagButtonProps & ForwardProps> = forwardRef(\n (\n { children, tag: tagProp = '', ...restProps }: PropsWithoutRef<HashtagButtonProps>,\n ref: Ref<HTMLButtonElement>\n ) => {\n const { onTagClick } = useContext(FeedContext);\n\n let tag = '';\n\n if (!isValidElement(children)) {\n if (!children.tag) return <span>{children.rawText}</span>;\n tag = children.tag;\n } else {\n tag = tagProp;\n }\n\n return (\n <>\n <StyledTag {...restProps} ref={ref} onClick={() => onTagClick?.(tag)} spellCheck={false}>\n {isValidElement(children) ? children : tag}\n </StyledTag>\n </>\n );\n }\n);\n\nexport const HashtagButtonConfig = {\n type: 'tag',\n xmlElement: 'pega-tag',\n regexPattern: /(?:^|)<pega-tag (?:[^\\n/]|\\/(?!>))+\\/>/gm,\n component: HashtagButton,\n inject: ({ tag }: { tag: string }) => {\n if (!tag) return;\n\n const element = document.createElementNS(null, 'pega-tag');\n element.setAttribute('tag', tag);\n\n return serializer.serializeToString(element);\n },\n extract: (element: string) => {\n const attributes = getXMLAttributes(element);\n\n if (!attributes || !attributes.tag) return undefined;\n return { tag: attributes.tag };\n }\n};\n\nexport default HashtagButton;\n"]}
1
+ {"version":3,"file":"HashtagButton.js","sourceRoot":"","sources":["../../../src/components/HashtagButton/HashtagButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAEV,cAAc,EAId,UAAU,EACX,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,GAAG,EAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AASnD,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;CAE5B,CAAC;AAEF,MAAM,UAAU,GAAG,IAAI,aAAa,EAAE,CAAC;AAEvC,MAAM,aAAa,GAAyD,UAAU,CACpF,CACE,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,GAAG,SAAS,EAAuC,EAClF,GAA2B,EAC3B,EAAE;IACF,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IAE/C,IAAI,GAAG,GAAG,EAAE,CAAC;IAEb,IAAI,CAAC,cAAc,CAAM,QAAQ,CAAC,EAAE;QAClC,IAAI,CAAC,QAAQ,CAAC,GAAG;YAAE,OAAO,yBAAO,QAAQ,CAAC,OAAO,GAAQ,CAAC;QAC1D,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;KACpB;SAAM;QACL,GAAG,GAAG,OAAO,CAAC;KACf;IAED,OAAO,CACL,KAAC,SAAS,OAAK,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,UAAU,EAAE,KAAK,YACpF,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,GAChC,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,KAAK;IACX,UAAU,EAAE,UAAU;IACtB,YAAY,EAAE,0CAA0C;IACxD,SAAS,EAAE,aAAa;IACxB,MAAM,EAAE,CAAC,EAAE,GAAG,EAAmB,EAAE,EAAE;QACnC,IAAI,CAAC,GAAG;YAAE,OAAO;QAEjB,MAAM,OAAO,GAAG,QAAQ,CAAC,eAAe,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAC3D,OAAO,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAEjC,OAAO,UAAU,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,EAAE,CAAC,OAAe,EAAE,EAAE;QAC3B,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAE7C,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,GAAG;YAAE,OAAO,SAAS,CAAC;QACrD,OAAO,EAAE,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC;IACjC,CAAC;CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n isValidElement,\n PropsWithoutRef,\n ReactElement,\n Ref,\n useContext\n} from 'react';\nimport styled from 'styled-components';\n\nimport { Tag, ForwardProps } from '@pega/cosmos-react-core';\nimport { getXMLAttributes } from '@pega/cosmos-react-rte';\n\nimport { FeedContext } from '../Feed/Feed.context';\n\ninterface HashtagButtonProps {\n /** Text for the button, or an object containing all necessary props. */\n children: Record<string, string> | ReactElement;\n /** The tag value. */\n tag?: string;\n}\n\nconst StyledTag = styled(Tag)`\n cursor: pointer;\n`;\n\nconst serializer = new XMLSerializer();\n\nconst HashtagButton: FunctionComponent<HashtagButtonProps & ForwardProps> = forwardRef(\n (\n { children, tag: tagProp = '', ...restProps }: PropsWithoutRef<HashtagButtonProps>,\n ref: Ref<HTMLButtonElement>\n ) => {\n const { onTagClick } = useContext(FeedContext);\n\n let tag = '';\n\n if (!isValidElement<any>(children)) {\n if (!children.tag) return <span>{children.rawText}</span>;\n tag = children.tag;\n } else {\n tag = tagProp;\n }\n\n return (\n <StyledTag {...restProps} ref={ref} onClick={() => onTagClick?.(tag)} spellCheck={false}>\n {isValidElement(children) ? children : tag}\n </StyledTag>\n );\n }\n);\n\nexport const HashtagButtonConfig = {\n type: 'tag',\n xmlElement: 'pega-tag',\n regexPattern: /(?:^|)<pega-tag (?:[^\\n/]|\\/(?!>))+\\/>/gm,\n component: HashtagButton,\n inject: ({ tag }: { tag: string }) => {\n if (!tag) return;\n\n const element = document.createElementNS(null, 'pega-tag');\n element.setAttribute('tag', tag);\n\n return serializer.serializeToString(element);\n },\n extract: (element: string) => {\n const attributes = getXMLAttributes(element);\n\n if (!attributes || !attributes.tag) return undefined;\n return { tag: attributes.tag };\n }\n};\n\nexport default HashtagButton;\n"]}
@@ -3,7 +3,7 @@ import { ForwardProps } from '@pega/cosmos-react-core';
3
3
  interface MentionButtonProps {
4
4
  /** Text for the button, or an object containing all necessary props. */
5
5
  children: Record<string, string> | ReactElement;
6
- /** The id of the mention. */
6
+ /** The id of the mention. */
7
7
  id?: string;
8
8
  /** The text of the mention button. */
9
9
  text?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"MentionButton.d.ts","sourceRoot":"","sources":["../../../src/components/MentionButton/MentionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAGjB,YAAY,EAKb,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,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;;;uBAWxD,MAAM;;;;;;CAW1B,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, isValidElement, useContext, useRef, useState } from 'react';
2
+ import { forwardRef, isValidElement, useContext, useState } from 'react';
3
3
  import styled from 'styled-components';
4
- import { Button, Link, Popover, useConsolidatedRef, useOuterEvent } from '@pega/cosmos-react-core';
4
+ import { Button, Link, useConsolidatedRef, useElement } from '@pega/cosmos-react-core';
5
5
  import { getXMLAttributes } from '@pega/cosmos-react-rte';
6
6
  import { FeedContext } from '../Feed/Feed.context';
7
7
  const StyledButton = styled(Button) `
@@ -20,14 +20,10 @@ const StyledLink = styled(Link) `
20
20
  `;
21
21
  const serializer = new XMLSerializer();
22
22
  const MentionButton = forwardRef(({ children, id: idProp = '', text: textProp = '', type: typeProp = '', href: hrefProp = '', ...restProps }, ref) => {
23
- const { feedRef, onMentionClick, onMentionPreview } = useContext(FeedContext);
24
- const [showPopover, setShowPopover] = useState(false);
23
+ const { onMentionClick, onMentionPreview } = useContext(FeedContext);
25
24
  const [mentionContent, setMentionContent] = useState();
25
+ const [target, setTarget] = useElement(null);
26
26
  const mentionRef = useConsolidatedRef(ref);
27
- const popoverRef = useRef(null);
28
- useOuterEvent(['click', 'focusin'], [mentionRef, popoverRef], () => {
29
- setShowPopover(false);
30
- });
31
27
  let id = '';
32
28
  let text = '';
33
29
  let type = '';
@@ -46,15 +42,17 @@ const MentionButton = forwardRef(({ children, id: idProp = '', text: textProp =
46
42
  type = typeProp;
47
43
  href = hrefProp;
48
44
  }
49
- const handleClick = () => {
45
+ const handleClick = (e) => {
46
+ setTarget(e.currentTarget);
50
47
  const comp = onMentionClick?.({
51
48
  id,
52
49
  text,
53
- type
50
+ type,
51
+ target: e.currentTarget,
52
+ closeGlimpse: () => setTarget(null)
54
53
  });
55
54
  if (comp)
56
- setShowPopover(true);
57
- setMentionContent(comp);
55
+ setMentionContent(comp);
58
56
  };
59
57
  return (_jsxs(_Fragment, { children: [href ? (_jsx(StyledLink, { ...restProps, ref: mentionRef, href: href, previewable: !!onMentionPreview, onPreview: onMentionPreview
60
58
  ? () => onMentionPreview({
@@ -62,7 +60,7 @@ const MentionButton = forwardRef(({ children, id: idProp = '', text: textProp =
62
60
  text,
63
61
  type
64
62
  })
65
- : undefined, spellCheck: false, children: isValidElement(children) ? children : text })) : (_jsx(StyledButton, { ...restProps, ref: mentionRef, variant: 'link', onClick: handleClick, spellCheck: false, children: isValidElement(children) ? children : text })), _jsx(Popover, { ref: popoverRef, show: showPopover, target: mentionRef.current, placement: 'bottom-start', portal: feedRef?.current ?? undefined, hideOnTargetHidden: true, arrow: true, children: mentionContent })] }));
63
+ : undefined, spellCheck: false, children: isValidElement(children) ? children : text })) : (_jsx(StyledButton, { ...restProps, ref: mentionRef, variant: 'link', onClick: handleClick, spellCheck: false, children: isValidElement(children) ? children : text })), target && mentionContent] }));
66
64
  });
67
65
  export const MentionButtonConfig = {
68
66
  type: 'mention',
@@ -1 +1 @@
1
- {"version":3,"file":"MentionButton.js","sourceRoot":"","sources":["../../../src/components/MentionButton/MentionButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAEV,cAAc,EAId,UAAU,EACV,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,MAAM,EAEN,IAAI,EACJ,OAAO,EACP,kBAAkB,EAClB,aAAa,EACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAenD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;;;;;;CAMlC,CAAC;AAEF,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;;;C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YACrB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,IAAI,EAAE,UAAU,CAAC,IAAI;SACtB,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n isValidElement,\n PropsWithoutRef,\n ReactElement,\n Ref,\n useContext,\n useRef,\n useState\n} from 'react';\nimport styled from 'styled-components';\n\nimport {\n Button,\n ForwardProps,\n Link,\n Popover,\n useConsolidatedRef,\n useOuterEvent\n} from '@pega/cosmos-react-core';\nimport { getXMLAttributes } from '@pega/cosmos-react-rte';\n\nimport { FeedContext } from '../Feed/Feed.context';\n\ninterface MentionButtonProps {\n /** Text for the button, or an object containing all necessary props. */\n children: Record<string, string> | ReactElement;\n /** The id of the mention. */\n id?: string;\n /** The text of the mention button. */\n text?: string;\n /** Designates the type of the mention for proper handling on click. */\n type?: string;\n /** If an href is provided, render a link. Otherwise, render a button. */\n href?: string;\n}\n\nconst StyledButton = styled(Button)`\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: none;\n text-decoration: underline;\n }\n`;\n\nconst StyledLink = styled(Link)`\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: none;\n text-decoration: underline;\n }\n`;\n\nconst serializer = new XMLSerializer();\n\nconst MentionButton: FunctionComponent<MentionButtonProps & ForwardProps> = forwardRef(\n (\n {\n children,\n id: idProp = '',\n text: textProp = '',\n type: typeProp = '',\n href: hrefProp = '',\n ...restProps\n }: PropsWithoutRef<MentionButtonProps>,\n ref: Ref<HTMLButtonElement>\n ) => {\n const { feedRef, onMentionClick, onMentionPreview } = useContext(FeedContext);\n const [showPopover, setShowPopover] = useState(false);\n const [mentionContent, setMentionContent] = useState<JSX.Element | undefined>();\n const mentionRef = useConsolidatedRef(ref);\n const popoverRef = useRef(null);\n\n useOuterEvent(['click', 'focusin'], [mentionRef, popoverRef], () => {\n setShowPopover(false);\n });\n\n let id = '';\n let text = '';\n let type = '';\n let href = '';\n\n if (!isValidElement(children)) {\n if (!children.id || !children.text || !children.type) return <span>{children.rawText}</span>;\n id = children.id;\n text = children.text;\n type = children.type;\n href = children.href || '';\n } else {\n id = idProp;\n text = textProp;\n type = typeProp;\n href = hrefProp;\n }\n\n const handleClick = () => {\n const comp = onMentionClick?.({\n id,\n text,\n type\n });\n if (comp) setShowPopover(true);\n setMentionContent(comp);\n };\n\n return (\n <>\n {href ? (\n <StyledLink\n {...restProps}\n ref={mentionRef}\n href={href}\n previewable={!!onMentionPreview}\n onPreview={\n onMentionPreview\n ? () =>\n onMentionPreview({\n id,\n text,\n type\n })\n : undefined\n }\n spellCheck={false}\n >\n {isValidElement(children) ? children : text}\n </StyledLink>\n ) : (\n <StyledButton\n {...restProps}\n ref={mentionRef}\n variant='link'\n onClick={handleClick}\n spellCheck={false}\n >\n {isValidElement(children) ? children : text}\n </StyledButton>\n )}\n <Popover\n ref={popoverRef}\n show={showPopover}\n target={mentionRef.current}\n placement='bottom-start'\n portal={feedRef?.current ?? undefined}\n hideOnTargetHidden\n arrow\n >\n {mentionContent}\n </Popover>\n </>\n );\n }\n);\n\nexport const MentionButtonConfig = {\n type: 'mention',\n xmlElement: 'pega-mention',\n regexPattern: /(?:^|)<pega-mention (?:[^\\n/]|\\/(?!>))+\\/>/g,\n component: MentionButton,\n inject: ({ id, type, text, href }: { id: string; type: string; text: string; href?: string }) => {\n if (!id || !type || !text) return;\n\n const element = document.createElementNS(null, 'pega-mention');\n element.setAttribute('id', id);\n element.setAttribute('text', text);\n element.setAttribute('type', type);\n if (href) element.setAttribute('href', href);\n\n return serializer.serializeToString(element);\n },\n extract: (element: string) => {\n const attributes = getXMLAttributes(element);\n\n if (!attributes || !attributes.id || !attributes.text || !attributes.type) return undefined;\n return {\n id: attributes.id,\n text: attributes.text,\n type: attributes.type,\n href: attributes.href\n };\n }\n};\n\nexport default MentionButton;\n"]}
1
+ {"version":3,"file":"MentionButton.js","sourceRoot":"","sources":["../../../src/components/MentionButton/MentionButton.tsx"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AAU,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI;YAAE,OAAO,SAAS,CAAC;QAC5F,OAAO;YACL,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,IAAI,EAAE,UAAU,CAAC,IAAI;SACtB,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n isValidElement,\n PropsWithoutRef,\n ReactElement,\n Ref,\n useContext,\n useState,\n MouseEvent\n} from 'react';\nimport styled from 'styled-components';\n\nimport {\n Button,\n ForwardProps,\n Link,\n useConsolidatedRef,\n useElement\n} from '@pega/cosmos-react-core';\nimport { getXMLAttributes } from '@pega/cosmos-react-rte';\n\nimport { FeedContext } from '../Feed/Feed.context';\n\ninterface MentionButtonProps {\n /** Text for the button, or an object containing all necessary props. */\n children: Record<string, string> | ReactElement;\n /** The id of the mention. */\n id?: string;\n /** The text of the mention button. */\n text?: string;\n /** Designates the type of the mention for proper handling on click. */\n type?: string;\n /** If an href is provided, render a link. Otherwise, render a button. */\n href?: string;\n}\n\nconst StyledButton = styled(Button)`\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: none;\n text-decoration: underline;\n }\n`;\n\nconst StyledLink = styled(Link)`\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: none;\n text-decoration: underline;\n }\n`;\n\nconst serializer = new XMLSerializer();\n\nconst MentionButton: FunctionComponent<MentionButtonProps & ForwardProps> = forwardRef(\n (\n {\n children,\n id: idProp = '',\n text: textProp = '',\n type: typeProp = '',\n href: hrefProp = '',\n ...restProps\n }: PropsWithoutRef<MentionButtonProps>,\n ref: Ref<HTMLButtonElement>\n ) => {\n const { onMentionClick, onMentionPreview } = useContext(FeedContext);\n const [mentionContent, setMentionContent] = useState<JSX.Element | undefined>();\n const [target, setTarget] = useElement<HTMLButtonElement>(null);\n const mentionRef = useConsolidatedRef(ref);\n\n let id = '';\n let text = '';\n let type = '';\n let href = '';\n\n if (!isValidElement<any>(children)) {\n if (!children.id || !children.text || !children.type) return <span>{children.rawText}</span>;\n id = children.id;\n text = children.text;\n type = children.type;\n href = children.href || '';\n } else {\n id = idProp;\n text = textProp;\n type = typeProp;\n href = hrefProp;\n }\n\n const handleClick = (e: MouseEvent<HTMLButtonElement>) => {\n setTarget(e.currentTarget);\n const comp = onMentionClick?.({\n id,\n text,\n type,\n target: e.currentTarget,\n closeGlimpse: () => setTarget(null)\n });\n if (comp) setMentionContent(comp);\n };\n\n return (\n <>\n {href ? (\n <StyledLink\n {...restProps}\n ref={mentionRef}\n href={href}\n previewable={!!onMentionPreview}\n onPreview={\n onMentionPreview\n ? () =>\n onMentionPreview({\n id,\n text,\n type\n })\n : undefined\n }\n spellCheck={false}\n >\n {isValidElement(children) ? children : text}\n </StyledLink>\n ) : (\n <StyledButton\n {...restProps}\n ref={mentionRef}\n variant='link'\n onClick={handleClick}\n spellCheck={false}\n >\n {isValidElement(children) ? children : text}\n </StyledButton>\n )}\n {target && mentionContent}\n </>\n );\n }\n);\n\nexport const MentionButtonConfig = {\n type: 'mention',\n xmlElement: 'pega-mention',\n regexPattern: /(?:^|)<pega-mention (?:[^\\n/]|\\/(?!>))+\\/>/g,\n component: MentionButton,\n inject: ({ id, type, text, href }: { id: string; type: string; text: string; href?: string }) => {\n if (!id || !type || !text) return;\n\n const element = document.createElementNS(null, 'pega-mention');\n element.setAttribute('id', id);\n element.setAttribute('text', text);\n element.setAttribute('type', type);\n if (href) element.setAttribute('href', href);\n\n return serializer.serializeToString(element);\n },\n extract: (element: string) => {\n const attributes = getXMLAttributes(element);\n\n if (!attributes || !attributes.id || !attributes.text || !attributes.type) return undefined;\n return {\n id: attributes.id,\n text: attributes.text,\n type: attributes.type,\n href: attributes.href\n };\n }\n};\n\nexport default MentionButton;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-social",
3
- "version": "4.0.0-dev.13.0",
3
+ "version": "4.0.0-dev.14.1",
4
4
  "author": "Pegasystems",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
@@ -23,9 +23,9 @@
23
23
  "build": "tsc -b"
24
24
  },
25
25
  "dependencies": {
26
- "@pega/cosmos-react-core": "4.0.0-dev.13.0",
27
- "@pega/cosmos-react-rte": "4.0.0-dev.13.0",
28
- "@pega/cosmos-react-work": "4.0.0-dev.13.0",
26
+ "@pega/cosmos-react-core": "4.0.0-dev.14.1",
27
+ "@pega/cosmos-react-rte": "4.0.0-dev.14.1",
28
+ "@pega/cosmos-react-work": "4.0.0-dev.14.1",
29
29
  "@types/parse5": "^6.0.0",
30
30
  "@types/react": "^16.14.24 || ^17.0.38",
31
31
  "@types/react-dom": "^16.9.14 || ^17.0.11",
@@ -47,6 +47,6 @@
47
47
  "@storybook/theming": "^6.4.19",
48
48
  "@testing-library/react": "^12.1.3",
49
49
  "@testing-library/user-event": "^13.5.0",
50
- "typescript": "~4.9.5"
50
+ "typescript": "~5.0.2"
51
51
  }
52
52
  }