@pega/cosmos-react-social 5.0.0-dev.4.7 → 5.0.0-dev.4.9
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/package.json +4 -4
- package/lib/components/Autopilot/Autopilot.d.ts +0 -15
- package/lib/components/Autopilot/Autopilot.d.ts.map +0 -1
- package/lib/components/Autopilot/Autopilot.js +0 -50
- package/lib/components/Autopilot/Autopilot.js.map +0 -1
- package/lib/components/Autopilot/AutopilotAvatar.d.ts +0 -8
- package/lib/components/Autopilot/AutopilotAvatar.d.ts.map +0 -1
- package/lib/components/Autopilot/AutopilotAvatar.js +0 -11
- package/lib/components/Autopilot/AutopilotAvatar.js.map +0 -1
- package/lib/components/Autopilot/AutopilotGlimpse.d.ts +0 -9
- package/lib/components/Autopilot/AutopilotGlimpse.d.ts.map +0 -1
- package/lib/components/Autopilot/AutopilotGlimpse.js +0 -24
- package/lib/components/Autopilot/AutopilotGlimpse.js.map +0 -1
- package/lib/components/Autopilot/index.d.ts +0 -4
- package/lib/components/Autopilot/index.d.ts.map +0 -1
- package/lib/components/Autopilot/index.js +0 -3
- package/lib/components/Autopilot/index.js.map +0 -1
- package/lib/components/Chat/Chat.d.ts +0 -29
- package/lib/components/Chat/Chat.d.ts.map +0 -1
- package/lib/components/Chat/Chat.js +0 -64
- package/lib/components/Chat/Chat.js.map +0 -1
- package/lib/components/Chat/Chat.types.d.ts +0 -136
- package/lib/components/Chat/Chat.types.d.ts.map +0 -1
- package/lib/components/Chat/Chat.types.js +0 -10
- package/lib/components/Chat/Chat.types.js.map +0 -1
- package/lib/components/Chat/ChatBody.d.ts +0 -7
- package/lib/components/Chat/ChatBody.d.ts.map +0 -1
- package/lib/components/Chat/ChatBody.js +0 -292
- package/lib/components/Chat/ChatBody.js.map +0 -1
- package/lib/components/Chat/ChatComposer.d.ts +0 -50
- package/lib/components/Chat/ChatComposer.d.ts.map +0 -1
- package/lib/components/Chat/ChatComposer.js +0 -221
- package/lib/components/Chat/ChatComposer.js.map +0 -1
- package/lib/components/Chat/ChatHeader.d.ts +0 -29
- package/lib/components/Chat/ChatHeader.d.ts.map +0 -1
- package/lib/components/Chat/ChatHeader.js +0 -44
- package/lib/components/Chat/ChatHeader.js.map +0 -1
- package/lib/components/Chat/ChatSettingsPanel.d.ts +0 -7
- package/lib/components/Chat/ChatSettingsPanel.d.ts.map +0 -1
- package/lib/components/Chat/ChatSettingsPanel.js +0 -15
- package/lib/components/Chat/ChatSettingsPanel.js.map +0 -1
- package/lib/components/Chat/ChatSettingsPanel.styles.d.ts +0 -16
- package/lib/components/Chat/ChatSettingsPanel.styles.d.ts.map +0 -1
- package/lib/components/Chat/ChatSettingsPanel.styles.js +0 -47
- package/lib/components/Chat/ChatSettingsPanel.styles.js.map +0 -1
- package/lib/components/Chat/Message.d.ts +0 -6
- package/lib/components/Chat/Message.d.ts.map +0 -1
- package/lib/components/Chat/Message.js +0 -98
- package/lib/components/Chat/Message.js.map +0 -1
- package/lib/components/Chat/Message.styles.d.ts +0 -43
- package/lib/components/Chat/Message.styles.d.ts.map +0 -1
- package/lib/components/Chat/Message.styles.js +0 -270
- package/lib/components/Chat/Message.styles.js.map +0 -1
- package/lib/components/Chat/SuggestedReplyPicker.d.ts +0 -42
- package/lib/components/Chat/SuggestedReplyPicker.d.ts.map +0 -1
- package/lib/components/Chat/SuggestedReplyPicker.js +0 -143
- package/lib/components/Chat/SuggestedReplyPicker.js.map +0 -1
- package/lib/components/Chat/SystemMessage.d.ts +0 -8
- package/lib/components/Chat/SystemMessage.d.ts.map +0 -1
- package/lib/components/Chat/SystemMessage.js +0 -50
- package/lib/components/Chat/SystemMessage.js.map +0 -1
- package/lib/components/Chat/TypeIndicator.d.ts +0 -6
- package/lib/components/Chat/TypeIndicator.d.ts.map +0 -1
- package/lib/components/Chat/TypeIndicator.js +0 -12
- package/lib/components/Chat/TypeIndicator.js.map +0 -1
- package/lib/components/Chat/index.d.ts +0 -15
- package/lib/components/Chat/index.d.ts.map +0 -1
- package/lib/components/Chat/index.js +0 -10
- package/lib/components/Chat/index.js.map +0 -1
- package/lib/components/Email/ContextMenuPopover.d.ts +0 -5
- package/lib/components/Email/ContextMenuPopover.d.ts.map +0 -1
- package/lib/components/Email/ContextMenuPopover.js +0 -53
- package/lib/components/Email/ContextMenuPopover.js.map +0 -1
- package/lib/components/Email/Email.d.ts +0 -7
- package/lib/components/Email/Email.d.ts.map +0 -1
- package/lib/components/Email/Email.js +0 -244
- package/lib/components/Email/Email.js.map +0 -1
- package/lib/components/Email/Email.styles.d.ts +0 -67
- package/lib/components/Email/Email.styles.d.ts.map +0 -1
- package/lib/components/Email/Email.styles.js +0 -392
- package/lib/components/Email/Email.styles.js.map +0 -1
- package/lib/components/Email/Email.types.d.ts +0 -394
- package/lib/components/Email/Email.types.d.ts.map +0 -1
- package/lib/components/Email/Email.types.js +0 -2
- package/lib/components/Email/Email.types.js.map +0 -1
- package/lib/components/Email/EmailCaseView.d.ts +0 -6
- package/lib/components/Email/EmailCaseView.d.ts.map +0 -1
- package/lib/components/Email/EmailCaseView.js +0 -36
- package/lib/components/Email/EmailCaseView.js.map +0 -1
- package/lib/components/Email/EmailComposer.d.ts +0 -10
- package/lib/components/Email/EmailComposer.d.ts.map +0 -1
- package/lib/components/Email/EmailComposer.js +0 -255
- package/lib/components/Email/EmailComposer.js.map +0 -1
- package/lib/components/Email/EmailConversation.d.ts +0 -17
- package/lib/components/Email/EmailConversation.d.ts.map +0 -1
- package/lib/components/Email/EmailConversation.js +0 -174
- package/lib/components/Email/EmailConversation.js.map +0 -1
- package/lib/components/Email/EmailEntity.d.ts +0 -11
- package/lib/components/Email/EmailEntity.d.ts.map +0 -1
- package/lib/components/Email/EmailEntity.js +0 -51
- package/lib/components/Email/EmailEntity.js.map +0 -1
- package/lib/components/Email/EmailManager.d.ts +0 -6
- package/lib/components/Email/EmailManager.d.ts.map +0 -1
- package/lib/components/Email/EmailManager.js +0 -21
- package/lib/components/Email/EmailManager.js.map +0 -1
- package/lib/components/Email/EmailNotificationPanel.d.ts +0 -7
- package/lib/components/Email/EmailNotificationPanel.d.ts.map +0 -1
- package/lib/components/Email/EmailNotificationPanel.js +0 -15
- package/lib/components/Email/EmailNotificationPanel.js.map +0 -1
- package/lib/components/Email/EmailSelector.d.ts +0 -22
- package/lib/components/Email/EmailSelector.d.ts.map +0 -1
- package/lib/components/Email/EmailSelector.js +0 -121
- package/lib/components/Email/EmailSelector.js.map +0 -1
- package/lib/components/Email/EmailShell.d.ts +0 -6
- package/lib/components/Email/EmailShell.d.ts.map +0 -1
- package/lib/components/Email/EmailShell.js +0 -46
- package/lib/components/Email/EmailShell.js.map +0 -1
- package/lib/components/Email/EmailSummaryItem.d.ts +0 -11
- package/lib/components/Email/EmailSummaryItem.d.ts.map +0 -1
- package/lib/components/Email/EmailSummaryItem.js +0 -118
- package/lib/components/Email/EmailSummaryItem.js.map +0 -1
- package/lib/components/Email/EmailSummaryList.d.ts +0 -6
- package/lib/components/Email/EmailSummaryList.d.ts.map +0 -1
- package/lib/components/Email/EmailSummaryList.js +0 -95
- package/lib/components/Email/EmailSummaryList.js.map +0 -1
- package/lib/components/Email/EntityList.d.ts +0 -6
- package/lib/components/Email/EntityList.d.ts.map +0 -1
- package/lib/components/Email/EntityList.js +0 -74
- package/lib/components/Email/EntityList.js.map +0 -1
- package/lib/components/Email/index.d.ts +0 -13
- package/lib/components/Email/index.d.ts.map +0 -1
- package/lib/components/Email/index.js +0 -12
- package/lib/components/Email/index.js.map +0 -1
- package/lib/components/Email/utils/EntityHighlighter.d.ts +0 -10
- package/lib/components/Email/utils/EntityHighlighter.d.ts.map +0 -1
- package/lib/components/Email/utils/EntityHighlighter.js +0 -260
- package/lib/components/Email/utils/EntityHighlighter.js.map +0 -1
- package/lib/components/Feed/Feed.context.d.ts +0 -51
- package/lib/components/Feed/Feed.context.d.ts.map +0 -1
- package/lib/components/Feed/Feed.context.js +0 -10
- package/lib/components/Feed/Feed.context.js.map +0 -1
- package/lib/components/Feed/Feed.d.ts +0 -6
- package/lib/components/Feed/Feed.d.ts.map +0 -1
- package/lib/components/Feed/Feed.js +0 -149
- package/lib/components/Feed/Feed.js.map +0 -1
- package/lib/components/Feed/Feed.types.d.ts +0 -334
- package/lib/components/Feed/Feed.types.d.ts.map +0 -1
- package/lib/components/Feed/Feed.types.js +0 -2
- package/lib/components/Feed/Feed.types.js.map +0 -1
- package/lib/components/Feed/FeedAnnouncer.d.ts +0 -6
- package/lib/components/Feed/FeedAnnouncer.d.ts.map +0 -1
- package/lib/components/Feed/FeedAnnouncer.js +0 -11
- package/lib/components/Feed/FeedAnnouncer.js.map +0 -1
- package/lib/components/Feed/FeedAttachments.d.ts +0 -8
- package/lib/components/Feed/FeedAttachments.d.ts.map +0 -1
- package/lib/components/Feed/FeedAttachments.js +0 -97
- package/lib/components/Feed/FeedAttachments.js.map +0 -1
- package/lib/components/Feed/FeedButton.d.ts +0 -5
- package/lib/components/Feed/FeedButton.d.ts.map +0 -1
- package/lib/components/Feed/FeedButton.js +0 -15
- package/lib/components/Feed/FeedButton.js.map +0 -1
- package/lib/components/Feed/FeedContent.d.ts +0 -6
- package/lib/components/Feed/FeedContent.d.ts.map +0 -1
- package/lib/components/Feed/FeedContent.js +0 -46
- package/lib/components/Feed/FeedContent.js.map +0 -1
- package/lib/components/Feed/FeedContentFooter.d.ts +0 -5
- package/lib/components/Feed/FeedContentFooter.d.ts.map +0 -1
- package/lib/components/Feed/FeedContentFooter.js +0 -34
- package/lib/components/Feed/FeedContentFooter.js.map +0 -1
- package/lib/components/Feed/FeedContentHeader.d.ts +0 -5
- package/lib/components/Feed/FeedContentHeader.d.ts.map +0 -1
- package/lib/components/Feed/FeedContentHeader.js +0 -107
- package/lib/components/Feed/FeedContentHeader.js.map +0 -1
- package/lib/components/Feed/FeedEditRegion.d.ts +0 -6
- package/lib/components/Feed/FeedEditRegion.d.ts.map +0 -1
- package/lib/components/Feed/FeedEditRegion.js +0 -57
- package/lib/components/Feed/FeedEditRegion.js.map +0 -1
- package/lib/components/Feed/FeedInputRegion.d.ts +0 -8
- package/lib/components/Feed/FeedInputRegion.d.ts.map +0 -1
- package/lib/components/Feed/FeedInputRegion.js +0 -86
- package/lib/components/Feed/FeedInputRegion.js.map +0 -1
- package/lib/components/Feed/FeedLikeButton.d.ts +0 -7
- package/lib/components/Feed/FeedLikeButton.d.ts.map +0 -1
- package/lib/components/Feed/FeedLikeButton.js +0 -102
- package/lib/components/Feed/FeedLikeButton.js.map +0 -1
- package/lib/components/Feed/FeedModalList.d.ts +0 -5
- package/lib/components/Feed/FeedModalList.d.ts.map +0 -1
- package/lib/components/Feed/FeedModalList.js +0 -39
- package/lib/components/Feed/FeedModalList.js.map +0 -1
- package/lib/components/Feed/FeedNewPost.d.ts +0 -7
- package/lib/components/Feed/FeedNewPost.d.ts.map +0 -1
- package/lib/components/Feed/FeedNewPost.js +0 -30
- package/lib/components/Feed/FeedNewPost.js.map +0 -1
- package/lib/components/Feed/FeedNewPostTypeMenu.d.ts +0 -6
- package/lib/components/Feed/FeedNewPostTypeMenu.d.ts.map +0 -1
- package/lib/components/Feed/FeedNewPostTypeMenu.js +0 -375
- package/lib/components/Feed/FeedNewPostTypeMenu.js.map +0 -1
- package/lib/components/Feed/FeedPost.d.ts +0 -8
- package/lib/components/Feed/FeedPost.d.ts.map +0 -1
- package/lib/components/Feed/FeedPost.js +0 -85
- package/lib/components/Feed/FeedPost.js.map +0 -1
- package/lib/components/Feed/FeedReply.d.ts +0 -7
- package/lib/components/Feed/FeedReply.d.ts.map +0 -1
- package/lib/components/Feed/FeedReply.js +0 -36
- package/lib/components/Feed/FeedReply.js.map +0 -1
- package/lib/components/Feed/FeedReplyInput.d.ts +0 -7
- package/lib/components/Feed/FeedReplyInput.d.ts.map +0 -1
- package/lib/components/Feed/FeedReplyInput.js +0 -21
- package/lib/components/Feed/FeedReplyInput.js.map +0 -1
- package/lib/components/Feed/FeedRichText.d.ts +0 -6
- package/lib/components/Feed/FeedRichText.d.ts.map +0 -1
- package/lib/components/Feed/FeedRichText.js +0 -163
- package/lib/components/Feed/FeedRichText.js.map +0 -1
- package/lib/components/Feed/index.d.ts +0 -7
- package/lib/components/Feed/index.d.ts.map +0 -1
- package/lib/components/Feed/index.js +0 -6
- package/lib/components/Feed/index.js.map +0 -1
- package/lib/components/HashtagButton/HashtagButton.d.ts +0 -23
- package/lib/components/HashtagButton/HashtagButton.d.ts.map +0 -1
- package/lib/components/HashtagButton/HashtagButton.js +0 -44
- package/lib/components/HashtagButton/HashtagButton.js.map +0 -1
- package/lib/components/HashtagButton/index.d.ts +0 -3
- package/lib/components/HashtagButton/index.d.ts.map +0 -1
- package/lib/components/HashtagButton/index.js +0 -3
- package/lib/components/HashtagButton/index.js.map +0 -1
- package/lib/components/MentionButton/MentionButton.d.ts +0 -35
- package/lib/components/MentionButton/MentionButton.d.ts.map +0 -1
- package/lib/components/MentionButton/MentionButton.js +0 -94
- package/lib/components/MentionButton/MentionButton.js.map +0 -1
- package/lib/components/MentionButton/index.d.ts +0 -3
- package/lib/components/MentionButton/index.d.ts.map +0 -1
- package/lib/components/MentionButton/index.js +0 -3
- package/lib/components/MentionButton/index.js.map +0 -1
- package/lib/index.d.ts +0 -12
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -13
- package/lib/index.js.map +0 -1
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useRef, useEffect, useCallback, forwardRef } from 'react';
|
|
3
|
-
import styled, { css } from 'styled-components';
|
|
4
|
-
import { Button, Card, CardContent, CardHeader, defaultThemeProp, Flex, getFocusables, Icon, registerIcon, Popover, StyledCard, Switch, Text, Progress, usePrevious, useItemIntersection, useUID, useConsolidatedRef } from '@pega/cosmos-react-core';
|
|
5
|
-
import { useArrows, useElement, useI18n, useOuterEvent } from '@pega/cosmos-react-core/lib/hooks';
|
|
6
|
-
import * as filterIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/filter.icon';
|
|
7
|
-
import * as filterOnIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/filter-on.icon';
|
|
8
|
-
import { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';
|
|
9
|
-
import { FeedContext } from './Feed.context';
|
|
10
|
-
import FeedButton from './FeedButton';
|
|
11
|
-
import FeedAnnouncer from './FeedAnnouncer';
|
|
12
|
-
registerIcon(filterIcon, filterOnIcon);
|
|
13
|
-
const StyledFeed = styled.div `
|
|
14
|
-
${StyledCardHeader}:not(${StyledCard} ${StyledCard} > ${StyledCardHeader}) {
|
|
15
|
-
padding-bottom: 0.25rem;
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
StyledFeed.defaultProps = defaultThemeProp;
|
|
19
|
-
const StyledFilterMenu = styled.div(({ theme }) => {
|
|
20
|
-
return css `
|
|
21
|
-
fieldset {
|
|
22
|
-
padding-block-end: calc(2 * ${theme.base.spacing});
|
|
23
|
-
border: none;
|
|
24
|
-
max-height: inherit;
|
|
25
|
-
|
|
26
|
-
legend {
|
|
27
|
-
padding-block-start: calc(2 * ${theme.base.spacing});
|
|
28
|
-
padding-inline: calc(2 * ${theme.base.spacing});
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
`;
|
|
32
|
-
});
|
|
33
|
-
StyledFilterMenu.defaultProps = defaultThemeProp;
|
|
34
|
-
const StyledFilterList = styled.ul(({ theme }) => {
|
|
35
|
-
return css `
|
|
36
|
-
list-style-type: none;
|
|
37
|
-
min-width: ${theme.base['content-width'].xs};
|
|
38
|
-
padding-inline: calc(2 * ${theme.base.spacing});
|
|
39
|
-
overflow: auto;
|
|
40
|
-
`;
|
|
41
|
-
});
|
|
42
|
-
StyledFilterList.defaultProps = defaultThemeProp;
|
|
43
|
-
const StyledLoadMore = styled.div(({ theme }) => {
|
|
44
|
-
return css `
|
|
45
|
-
margin-top: ${theme.base.spacing};
|
|
46
|
-
min-height: 2rem;
|
|
47
|
-
min-width: 2rem;
|
|
48
|
-
`;
|
|
49
|
-
});
|
|
50
|
-
StyledLoadMore.defaultProps = defaultThemeProp;
|
|
51
|
-
const Feed = forwardRef(function Feed(props, ref) {
|
|
52
|
-
const { loadingPosts = false, variant, children, userInfo, className, title, searchTypes, onDecoratorSearch, searchResults = [], onAutopilotClick, onMentionClick, onMentionPreview, onTagClick, mentionContent, interactionRenderers = [], markdownMap, filters, onFilterChange, onLoadMore, newPostRegion, posts = [], enableAutopilot, ...restProps } = props;
|
|
53
|
-
const t = useI18n();
|
|
54
|
-
const [popoverEl, setPopoverEl] = useElement();
|
|
55
|
-
const [buttonEl, setButtonEl] = useElement();
|
|
56
|
-
const [mountPopover, setMountPopover] = useState(false);
|
|
57
|
-
const [showSearchResults, setShowSearchResults] = useState(false);
|
|
58
|
-
const prevPosts = usePrevious(posts);
|
|
59
|
-
const [announcementText, setAnnouncementText] = useState('');
|
|
60
|
-
const feedRef = useConsolidatedRef(ref);
|
|
61
|
-
const filterRef = useRef(null);
|
|
62
|
-
useArrows(filterRef);
|
|
63
|
-
useOuterEvent('mousedown', [popoverEl, buttonEl], () => {
|
|
64
|
-
setMountPopover(false);
|
|
65
|
-
});
|
|
66
|
-
useOuterEvent('focusin', [popoverEl], () => {
|
|
67
|
-
setMountPopover(false);
|
|
68
|
-
});
|
|
69
|
-
const onKeydown = ({ key }) => {
|
|
70
|
-
if (key === 'Escape')
|
|
71
|
-
setMountPopover(false);
|
|
72
|
-
};
|
|
73
|
-
useEffect(() => {
|
|
74
|
-
document.addEventListener('keydown', onKeydown);
|
|
75
|
-
return () => {
|
|
76
|
-
document.removeEventListener('keydown', onKeydown);
|
|
77
|
-
};
|
|
78
|
-
}, []);
|
|
79
|
-
const id = useUID();
|
|
80
|
-
useItemIntersection({ current: null }, posts.length - 1, () => {
|
|
81
|
-
onLoadMore?.();
|
|
82
|
-
}, `#${id} > article[role='none']`);
|
|
83
|
-
const announce = useCallback((announcement) => {
|
|
84
|
-
setAnnouncementText('');
|
|
85
|
-
return setTimeout(() => {
|
|
86
|
-
setAnnouncementText(announcement);
|
|
87
|
-
}, 0);
|
|
88
|
-
}, []);
|
|
89
|
-
useEffect(() => {
|
|
90
|
-
if (loadingPosts) {
|
|
91
|
-
const timeoutId = announce(t('loading_post'));
|
|
92
|
-
return () => clearTimeout(timeoutId);
|
|
93
|
-
}
|
|
94
|
-
}, [loadingPosts]);
|
|
95
|
-
useEffect(() => {
|
|
96
|
-
if (prevPosts) {
|
|
97
|
-
let timeoutId;
|
|
98
|
-
const difference = posts.length - prevPosts.length;
|
|
99
|
-
if (difference < 0)
|
|
100
|
-
announce(t('feed_post_removed'));
|
|
101
|
-
else if (difference > 0)
|
|
102
|
-
announce(t('feed_new_post_added', [difference], { count: difference }));
|
|
103
|
-
return () => clearTimeout(timeoutId);
|
|
104
|
-
}
|
|
105
|
-
}, [posts]);
|
|
106
|
-
useEffect(() => {
|
|
107
|
-
if (mountPopover) {
|
|
108
|
-
setTimeout(() => {
|
|
109
|
-
const focusables = getFocusables(filterRef);
|
|
110
|
-
focusables[0]?.focus();
|
|
111
|
-
}, 0);
|
|
112
|
-
}
|
|
113
|
-
}, [mountPopover]);
|
|
114
|
-
return (_jsx(FeedContext.Provider
|
|
115
|
-
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
116
|
-
, {
|
|
117
|
-
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
118
|
-
value: {
|
|
119
|
-
searchTypes,
|
|
120
|
-
onSearch: e => {
|
|
121
|
-
if (onDecoratorSearch)
|
|
122
|
-
onDecoratorSearch(e);
|
|
123
|
-
},
|
|
124
|
-
searchResults,
|
|
125
|
-
showSearchResults,
|
|
126
|
-
setShowSearchResults,
|
|
127
|
-
onAutopilotClick,
|
|
128
|
-
onMentionClick,
|
|
129
|
-
onMentionPreview,
|
|
130
|
-
onTagClick,
|
|
131
|
-
interactionRenderers,
|
|
132
|
-
markdownMap,
|
|
133
|
-
userInfo,
|
|
134
|
-
announce,
|
|
135
|
-
feedRef,
|
|
136
|
-
enableAutopilot
|
|
137
|
-
}, children: _jsxs(StyledFeed, { ref: feedRef, ...restProps, children: [_jsx(FeedAnnouncer, { children: announcementText }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(Text, { variant: 'h2', children: title }), filters && filters.length > 0 && (_jsx(Button, { as: FeedButton, ref: setButtonEl, variant: 'simple', icon: true, onClick: () => setMountPopover(curr => !curr), label: t('filters'), emphasized: true, children: _jsx(Icon, { name: filters?.map(filter => !!filter.on).reduce((acc, curr) => acc || curr)
|
|
138
|
-
? 'filter-on'
|
|
139
|
-
: 'filter' }) })), _jsx(Popover, { show: !!filters && mountPopover, ref: setPopoverEl, target: buttonEl, as: StyledFilterMenu, hideOnTargetHidden: true, onKeyDown: (event) => {
|
|
140
|
-
if (event.key === 'Tab') {
|
|
141
|
-
event.preventDefault();
|
|
142
|
-
buttonEl?.focus();
|
|
143
|
-
}
|
|
144
|
-
}, children: _jsxs(Flex, { container: { direction: 'column', gap: 2 }, as: 'fieldset', children: [_jsx(Text, { variant: 'h3', as: 'legend', children: t('filters') }), _jsx(StyledFilterList, { ref: filterRef, children: filters?.map(filter => {
|
|
145
|
-
return (_jsx("li", { children: _jsx(Switch, { ...filter, onChange: (event) => onFilterChange?.(event.target.id, event.target.checked) }) }, filter.id));
|
|
146
|
-
}) })] }) })] }), _jsx(CardContent, { children: newPostRegion })] }), _jsx("div", { id: id, children: posts }), loadingPosts && (_jsx(Flex, { container: { justify: 'center' }, as: StyledLoadMore, children: _jsx(Progress, { placement: 'inline' }) }))] }) }));
|
|
147
|
-
});
|
|
148
|
-
export default Feed;
|
|
149
|
-
//# sourceMappingURL=Feed.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Feed.js","sourceRoot":"","sources":["../../../src/components/Feed/Feed.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAmB,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE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FC, useState, useRef, useEffect, useCallback, forwardRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Button,\n Card,\n CardContent,\n CardHeader,\n defaultThemeProp,\n Flex,\n ForwardProps,\n getFocusables,\n Icon,\n registerIcon,\n Popover,\n StyledCard,\n Switch,\n Text,\n Progress,\n usePrevious,\n useItemIntersection,\n useUID,\n useConsolidatedRef\n} from '@pega/cosmos-react-core';\nimport { useArrows, useElement, useI18n, useOuterEvent } from '@pega/cosmos-react-core/lib/hooks';\nimport * as filterIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/filter.icon';\nimport * as filterOnIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/filter-on.icon';\nimport { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';\n\nimport { FeedContext } from './Feed.context';\nimport FeedButton from './FeedButton';\nimport FeedAnnouncer from './FeedAnnouncer';\nimport { FeedProps } from './Feed.types';\n\nregisterIcon(filterIcon, filterOnIcon);\n\nconst StyledFeed = styled.div`\n ${StyledCardHeader}:not(${StyledCard} ${StyledCard} > ${StyledCardHeader}) {\n padding-bottom: 0.25rem;\n }\n`;\n\nStyledFeed.defaultProps = defaultThemeProp;\n\nconst StyledFilterMenu = styled.div(({ theme }) => {\n return css`\n fieldset {\n padding-block-end: calc(2 * ${theme.base.spacing});\n border: none;\n max-height: inherit;\n\n legend {\n padding-block-start: calc(2 * ${theme.base.spacing});\n padding-inline: calc(2 * ${theme.base.spacing});\n }\n }\n `;\n});\n\nStyledFilterMenu.defaultProps = defaultThemeProp;\n\nconst StyledFilterList = styled.ul(({ theme }) => {\n return css`\n list-style-type: none;\n min-width: ${theme.base['content-width'].xs};\n padding-inline: calc(2 * ${theme.base.spacing});\n overflow: auto;\n `;\n});\n\nStyledFilterList.defaultProps = defaultThemeProp;\n\nconst StyledLoadMore = styled.div(({ theme }) => {\n return css`\n margin-top: ${theme.base.spacing};\n min-height: 2rem;\n min-width: 2rem;\n `;\n});\n\nStyledLoadMore.defaultProps = defaultThemeProp;\n\nconst Feed: FC<ForwardProps & FeedProps> = forwardRef(function Feed(\n props: ForwardProps & FeedProps,\n ref: Ref<HTMLDivElement>\n) {\n const {\n loadingPosts = false,\n variant,\n children,\n userInfo,\n className,\n title,\n searchTypes,\n onDecoratorSearch,\n searchResults = [],\n onAutopilotClick,\n onMentionClick,\n onMentionPreview,\n onTagClick,\n mentionContent,\n interactionRenderers = [],\n markdownMap,\n filters,\n onFilterChange,\n onLoadMore,\n newPostRegion,\n posts = [],\n enableAutopilot,\n ...restProps\n } = props;\n const t = useI18n();\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>();\n const [buttonEl, setButtonEl] = useElement<HTMLElement>();\n const [mountPopover, setMountPopover] = useState(false);\n const [showSearchResults, setShowSearchResults] = useState(false);\n const prevPosts = usePrevious(posts);\n const [announcementText, setAnnouncementText] = useState('');\n\n const feedRef = useConsolidatedRef(ref);\n\n const filterRef = useRef(null);\n useArrows(filterRef);\n\n useOuterEvent('mousedown', [popoverEl, buttonEl], () => {\n setMountPopover(false);\n });\n\n useOuterEvent('focusin', [popoverEl], () => {\n setMountPopover(false);\n });\n\n const onKeydown = ({ key }: KeyboardEvent) => {\n if (key === 'Escape') setMountPopover(false);\n };\n\n useEffect(() => {\n document.addEventListener('keydown', onKeydown);\n return () => {\n document.removeEventListener('keydown', onKeydown);\n };\n }, []);\n\n const id = useUID();\n useItemIntersection(\n { current: null },\n posts.length - 1,\n () => {\n onLoadMore?.();\n },\n `#${id} > article[role='none']`\n );\n\n const announce = useCallback((announcement: string) => {\n setAnnouncementText('');\n return setTimeout(() => {\n setAnnouncementText(announcement);\n }, 0);\n }, []);\n\n useEffect(() => {\n if (loadingPosts) {\n const timeoutId = announce(t('loading_post'));\n return () => clearTimeout(timeoutId);\n }\n }, [loadingPosts]);\n\n useEffect(() => {\n if (prevPosts) {\n let timeoutId: ReturnType<typeof setTimeout>;\n const difference = posts.length - prevPosts.length;\n if (difference < 0) announce(t('feed_post_removed'));\n else if (difference > 0)\n announce(t('feed_new_post_added', [difference], { count: difference }));\n\n return () => clearTimeout(timeoutId);\n }\n }, [posts]);\n\n useEffect(() => {\n if (mountPopover) {\n setTimeout(() => {\n const focusables = getFocusables(filterRef);\n focusables[0]?.focus();\n }, 0);\n }\n }, [mountPopover]);\n\n return (\n <FeedContext.Provider\n // eslint-disable-next-line react/jsx-no-constructed-context-values\n value={{\n searchTypes,\n onSearch: e => {\n if (onDecoratorSearch) onDecoratorSearch(e);\n },\n searchResults,\n showSearchResults,\n setShowSearchResults,\n onAutopilotClick,\n onMentionClick,\n onMentionPreview,\n onTagClick,\n interactionRenderers,\n markdownMap,\n userInfo,\n announce,\n feedRef,\n enableAutopilot\n }}\n >\n <StyledFeed ref={feedRef} {...restProps}>\n <FeedAnnouncer>{announcementText}</FeedAnnouncer>\n <Card>\n <CardHeader>\n <Text variant='h2'>{title}</Text>\n {filters && filters.length > 0 && (\n <Button\n as={FeedButton}\n ref={setButtonEl}\n variant='simple'\n icon\n onClick={() => setMountPopover(curr => !curr)}\n label={t('filters')}\n emphasized\n >\n <Icon\n name={\n filters?.map(filter => !!filter.on).reduce((acc, curr) => acc || curr)\n ? 'filter-on'\n : 'filter'\n }\n />\n </Button>\n )}\n\n <Popover\n show={!!filters && mountPopover}\n ref={setPopoverEl}\n target={buttonEl}\n as={StyledFilterMenu}\n hideOnTargetHidden\n onKeyDown={(event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n event.preventDefault();\n buttonEl?.focus();\n }\n }}\n >\n <Flex container={{ direction: 'column', gap: 2 }} as='fieldset'>\n <Text variant='h3' as='legend'>\n {t('filters')}\n </Text>\n <StyledFilterList ref={filterRef}>\n {filters?.map(filter => {\n return (\n <li key={filter.id}>\n <Switch\n {...filter}\n onChange={(event: ChangeEvent<HTMLInputElement>) =>\n onFilterChange?.(event.target.id, event.target.checked)\n }\n />\n </li>\n );\n })}\n </StyledFilterList>\n </Flex>\n </Popover>\n </CardHeader>\n\n <CardContent>{newPostRegion}</CardContent>\n </Card>\n\n <div id={id}>{posts}</div>\n\n {loadingPosts && (\n <Flex container={{ justify: 'center' }} as={StyledLoadMore}>\n <Progress placement='inline' />\n </Flex>\n )}\n </StyledFeed>\n </FeedContext.Provider>\n );\n});\n\nexport default Feed;\n"]}
|
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
import { Dispatch, MouseEvent, MutableRefObject, ReactElement, ReactNode, Ref, SetStateAction } from 'react';
|
|
2
|
-
import { AvatarProps, DateTimeDisplayProps, FileUploadItemProps, MenuItemProps, NoChildrenProp } from '@pega/cosmos-react-core';
|
|
3
|
-
import { RichTextEditorProps, RichTextEditorState } from '@pega/cosmos-react-rte';
|
|
4
|
-
import { FeedContextValue } from './Feed.context';
|
|
5
|
-
export interface SubComponentVariant {
|
|
6
|
-
variant: 'post' | 'reply';
|
|
7
|
-
}
|
|
8
|
-
export interface Filter {
|
|
9
|
-
/** Sets DOM id for the control and associates label element via 'for' attribute. */
|
|
10
|
-
id: string;
|
|
11
|
-
/** Pass a string or a fragment with an Icon and string for the filter label. */
|
|
12
|
-
label: ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* Disables the filter.
|
|
15
|
-
* @default false
|
|
16
|
-
*/
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Sets on prop via onFilterChange.
|
|
20
|
-
* @default false
|
|
21
|
-
*/
|
|
22
|
-
on?: boolean;
|
|
23
|
-
}
|
|
24
|
-
export interface FeedProps extends NoChildrenProp {
|
|
25
|
-
/** Title for the feed. */
|
|
26
|
-
title: string;
|
|
27
|
-
/** Information related to the user of the Feed. */
|
|
28
|
-
userInfo: FeedContextValue['userInfo'];
|
|
29
|
-
/** A set of search types that can be used to determine which data set to conduct a mention search on. */
|
|
30
|
-
searchTypes?: FeedContextValue['searchTypes'];
|
|
31
|
-
/** A callback that runs when a decorator search has been run inside of the feed. */
|
|
32
|
-
onDecoratorSearch?: FeedContextValue['onSearch'];
|
|
33
|
-
/** Results that will be shown in a Popover for a mention or tag search. */
|
|
34
|
-
searchResults?: FeedContextValue['searchResults'];
|
|
35
|
-
/** If true, the Autopilot feature will be enabled for all posts and replies. */
|
|
36
|
-
enableAutopilot?: boolean;
|
|
37
|
-
/** A callback that is triggered when an Autopilot mention is clicked. The callback sends back the target of the element. The callback should return a function component. */
|
|
38
|
-
onAutopilotClick?: FeedContextValue['onAutopilotClick'];
|
|
39
|
-
/** 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. */
|
|
40
|
-
onMentionClick?: FeedContextValue['onMentionClick'];
|
|
41
|
-
/** A callback that is triggered when a mention link is previewed. The callback sends back the id, text, and type of the mention. */
|
|
42
|
-
onMentionPreview?: FeedContextValue['onMentionPreview'];
|
|
43
|
-
/** A callback that is triggered when a hashtag is clicked. The callback sends back the test of the tag. */
|
|
44
|
-
onTagClick?: FeedContextValue['onTagClick'];
|
|
45
|
-
/** A list of configuration objects used to render custom components within Feed posts and replies based off of a given regex pattern. */
|
|
46
|
-
interactionRenderers?: FeedContextValue['interactionRenderers'];
|
|
47
|
-
/** A mapping for various element types to render custom components for within posts. */
|
|
48
|
-
markdownMap?: FeedContextValue['markdownMap'];
|
|
49
|
-
/** A set of filters to apply to the Feed. */
|
|
50
|
-
filters?: Filter[];
|
|
51
|
-
/** A callback that runs when the filter is toggled. */
|
|
52
|
-
onFilterChange?: (filterId: string, on: boolean) => void;
|
|
53
|
-
/** A callback that is triggered when the bottom of the Feed is scrolled into view so that additional posts may be displayed. */
|
|
54
|
-
onLoadMore?: () => void;
|
|
55
|
-
/** Indicates if the posts are being currently loading */
|
|
56
|
-
loadingPosts?: boolean;
|
|
57
|
-
/** A region to hold the new post component */
|
|
58
|
-
newPostRegion?: ReactNode;
|
|
59
|
-
/** A list of FeedPost components */
|
|
60
|
-
posts?: ReactNode[];
|
|
61
|
-
}
|
|
62
|
-
export type FeedRichTextProps = Pick<RichTextEditorProps, 'label' | 'onChange' | 'onFocus' | 'onBlur' | 'height'>;
|
|
63
|
-
export type AttachedFiles = FileUploadItemProps & File;
|
|
64
|
-
export interface FeedAttachmentsProps extends SubComponentVariant {
|
|
65
|
-
attachments?: AttachedFiles[];
|
|
66
|
-
readOnly?: boolean;
|
|
67
|
-
ref?: Ref<HTMLUListElement>;
|
|
68
|
-
}
|
|
69
|
-
export interface FeedCompositionBaseProps {
|
|
70
|
-
/** A unique ID for the new message. */
|
|
71
|
-
id: string;
|
|
72
|
-
/** A set of attachment files. */
|
|
73
|
-
attachments?: AttachedFiles[];
|
|
74
|
-
/** A callback containing a list of added files that will run whenever files are added to the message. */
|
|
75
|
-
onFilesAdded?: (files: AttachedFiles[]) => void;
|
|
76
|
-
/** Callback that runs when the submit button has been clicked. */
|
|
77
|
-
onSubmit: (event: {
|
|
78
|
-
id: string;
|
|
79
|
-
value: string;
|
|
80
|
-
attachments: AttachedFiles[];
|
|
81
|
-
recipients?: RecipientMenuItem[];
|
|
82
|
-
username: string;
|
|
83
|
-
clear: () => void;
|
|
84
|
-
}) => void;
|
|
85
|
-
}
|
|
86
|
-
export interface FeedInputRegionProps extends SubComponentVariant, FeedCompositionBaseProps {
|
|
87
|
-
inputRegionEl: HTMLDivElement | null;
|
|
88
|
-
rteRef: MutableRefObject<RichTextEditorState | undefined>;
|
|
89
|
-
selectedRecipients?: RecipientMenuItem[];
|
|
90
|
-
}
|
|
91
|
-
export interface FeedEditRegionProps extends SubComponentVariant, Pick<FeedMessageBaseProps, 'id' | 'content' | 'onEditSubmit'> {
|
|
92
|
-
setEditMode: Dispatch<SetStateAction<boolean>>;
|
|
93
|
-
emptyEditText: boolean;
|
|
94
|
-
setEmptyEditText: Dispatch<SetStateAction<boolean>>;
|
|
95
|
-
}
|
|
96
|
-
export interface FeedNewPostProps extends FeedCompositionBaseProps {
|
|
97
|
-
/** If true, the new post input will focus on page load. */
|
|
98
|
-
autoFocus?: boolean;
|
|
99
|
-
/** Array of private recipient options. */
|
|
100
|
-
recipients?: PostTypeMenuProps['recipients'];
|
|
101
|
-
/** Handler for new search on private recipient options. */
|
|
102
|
-
onRecipientSearch?: (newSearch: string) => void;
|
|
103
|
-
}
|
|
104
|
-
export interface FeedReplyInputProps extends FeedCompositionBaseProps {
|
|
105
|
-
/** Callback that sets returns a shared ref to the RTE component */
|
|
106
|
-
onSetInputRef?: (event: {
|
|
107
|
-
ref: MutableRefObject<RichTextEditorState | undefined>;
|
|
108
|
-
}) => void;
|
|
109
|
-
}
|
|
110
|
-
export interface FeedModalListProps {
|
|
111
|
-
/** The count for the list of items. */
|
|
112
|
-
count: number;
|
|
113
|
-
/** The heading for the Modal. */
|
|
114
|
-
heading: string;
|
|
115
|
-
/** The list of MenuItems to render in the Modal. */
|
|
116
|
-
listItems: MenuItemProps[];
|
|
117
|
-
/** A callback that is triggered when the bottom of the Modal list is scrolled into view so that additional data may be displayed. */
|
|
118
|
-
onLoadMore?: () => void;
|
|
119
|
-
/** Indicates if the data is being currently loading */
|
|
120
|
-
loading?: boolean;
|
|
121
|
-
}
|
|
122
|
-
export type PostType = 'post' | 'private';
|
|
123
|
-
export interface RecipientOption {
|
|
124
|
-
/** Pretty printed recipient name */
|
|
125
|
-
primary: string;
|
|
126
|
-
/** Functional identifier of unique recipient */
|
|
127
|
-
value: string;
|
|
128
|
-
}
|
|
129
|
-
export interface RecipientMenuItem {
|
|
130
|
-
id: string;
|
|
131
|
-
selected?: boolean;
|
|
132
|
-
primary: RecipientOption['primary'];
|
|
133
|
-
value: RecipientOption['value'];
|
|
134
|
-
secondary?: MenuItemProps['secondary'];
|
|
135
|
-
visual?: MenuItemProps['visual'];
|
|
136
|
-
}
|
|
137
|
-
export interface PostTypeMenuProps {
|
|
138
|
-
/** Array of private recipient options */
|
|
139
|
-
recipients: RecipientOption[];
|
|
140
|
-
/** Post type update handler */
|
|
141
|
-
onSetPostType: (postType: PostType) => void;
|
|
142
|
-
/** Private post recipient list update handler */
|
|
143
|
-
onSelectedRecipientsUpdate: (recipients: RecipientMenuItem[]) => void;
|
|
144
|
-
/** Handler for new search on private recipient options */
|
|
145
|
-
onRecipientSearch: (newSearch: string) => void;
|
|
146
|
-
reset: boolean;
|
|
147
|
-
onReset: () => void;
|
|
148
|
-
}
|
|
149
|
-
export interface PostTypeMenuState {
|
|
150
|
-
postType: PostType;
|
|
151
|
-
itemsLoading: boolean;
|
|
152
|
-
showTypeMenu: boolean;
|
|
153
|
-
showRecipientMenu: boolean;
|
|
154
|
-
viewingRecipients: boolean;
|
|
155
|
-
searchValue: string;
|
|
156
|
-
typeMenuItems: {
|
|
157
|
-
id: string;
|
|
158
|
-
primary: string;
|
|
159
|
-
selected: boolean;
|
|
160
|
-
value: PostType;
|
|
161
|
-
}[];
|
|
162
|
-
recipientMenuItems: RecipientMenuItem[];
|
|
163
|
-
multiSelectItems: RecipientMenuItem[];
|
|
164
|
-
}
|
|
165
|
-
export interface FeedContentProps {
|
|
166
|
-
children: ReactElement | string;
|
|
167
|
-
/**
|
|
168
|
-
* A maximum height in pixels to display post content within before prompting to expand the post.
|
|
169
|
-
* @default Infinity
|
|
170
|
-
*/
|
|
171
|
-
maxContentHeight?: number;
|
|
172
|
-
ref?: Ref<HTMLDivElement>;
|
|
173
|
-
}
|
|
174
|
-
export interface FeedMessageBaseProps {
|
|
175
|
-
/** Unique ID for the message. */
|
|
176
|
-
id: string;
|
|
177
|
-
/** Display name for the message author. */
|
|
178
|
-
fullname: string;
|
|
179
|
-
/** Username for the message author. */
|
|
180
|
-
username: string;
|
|
181
|
-
/** A timestamp of when the message was initially submitted. */
|
|
182
|
-
postTimestamp: DateTimeDisplayProps['value'];
|
|
183
|
-
/** The message content. */
|
|
184
|
-
content: ReactElement | string;
|
|
185
|
-
/** Attachments on the message. */
|
|
186
|
-
attachments?: AttachedFiles[];
|
|
187
|
-
/** An image source for the message author's Avatar. */
|
|
188
|
-
avatarSrc?: string;
|
|
189
|
-
/** The name of an icon to render within the Avatar. */
|
|
190
|
-
icon?: string;
|
|
191
|
-
/** The status of the message author. */
|
|
192
|
-
userStatus?: AvatarProps['status'];
|
|
193
|
-
/** Set true if the user has liked the message. */
|
|
194
|
-
liked?: boolean;
|
|
195
|
-
/** A set of users that have liked the message. */
|
|
196
|
-
likes?: MenuItemProps[];
|
|
197
|
-
/** The total count of likes on the message. */
|
|
198
|
-
likeCount?: number;
|
|
199
|
-
/**
|
|
200
|
-
* If true, the like and comment buttons will be enabled.
|
|
201
|
-
* @default true
|
|
202
|
-
*/
|
|
203
|
-
interactionsEnabled?: boolean;
|
|
204
|
-
/**
|
|
205
|
-
* A maximum height in pixels to display message content within before prompting to expand the message.
|
|
206
|
-
* @default Infinity
|
|
207
|
-
*/
|
|
208
|
-
maxContentHeight?: FeedContentProps['maxContentHeight'];
|
|
209
|
-
/** A set of menu options for actions on the message. */
|
|
210
|
-
menuItems?: MenuItemProps[];
|
|
211
|
-
/** Callback that updates the message after being edited. If undefined, the message will not be editable. */
|
|
212
|
-
onEditSubmit?: (event: {
|
|
213
|
-
id: string;
|
|
214
|
-
value: string;
|
|
215
|
-
}) => void;
|
|
216
|
-
/**
|
|
217
|
-
* Flag that indicates if a message has been previously edited.
|
|
218
|
-
* @default false
|
|
219
|
-
*/
|
|
220
|
-
edited?: boolean;
|
|
221
|
-
/** A timestamp of when the message was last edited. This will only display if edited prop is true. */
|
|
222
|
-
editTimestamp?: DateTimeDisplayProps['value'];
|
|
223
|
-
/** Callback that runs when the mouse pointer hovers over the message. */
|
|
224
|
-
onMouseEnter?: (event: {
|
|
225
|
-
id: string;
|
|
226
|
-
}) => void;
|
|
227
|
-
/** Callback that runs when the mouse pointer leaves the message. */
|
|
228
|
-
onMouseLeave?: (event: {
|
|
229
|
-
id: string;
|
|
230
|
-
}) => void;
|
|
231
|
-
/** Callback that runs when the author's name or Avatar has been clicked. */
|
|
232
|
-
onUserClick?: (event: {
|
|
233
|
-
id: string;
|
|
234
|
-
username: string;
|
|
235
|
-
}, clickEvent?: MouseEvent) => void;
|
|
236
|
-
/** Callback that runs when the comment button has been clicked. */
|
|
237
|
-
onCommentClick: (event: {
|
|
238
|
-
id: string;
|
|
239
|
-
username: string;
|
|
240
|
-
}) => void;
|
|
241
|
-
/** Callback that runs when the like button has been clicked. */
|
|
242
|
-
onLikeClick: (event: {
|
|
243
|
-
id: string;
|
|
244
|
-
user: MenuItemProps;
|
|
245
|
-
}) => void;
|
|
246
|
-
/** Callback that runs when the like count on a message is hovered, focused, or clicked. */
|
|
247
|
-
onLikeCountInteraction?: () => void;
|
|
248
|
-
/** Callback that runs when the bottom of the extended like list Modal is reached, allowing for more likes to be loaded. */
|
|
249
|
-
onLoadMoreLikes?: () => void;
|
|
250
|
-
/** A loading indicator for the likes Modal. */
|
|
251
|
-
likesLoading?: boolean;
|
|
252
|
-
}
|
|
253
|
-
export interface FeedPostProps extends FeedMessageBaseProps {
|
|
254
|
-
/**
|
|
255
|
-
* The type of message. If private, then only the designated recipients will be able to view the message.
|
|
256
|
-
* @default 'public'
|
|
257
|
-
*/
|
|
258
|
-
postType?: 'public' | 'private';
|
|
259
|
-
/** The set of recipients assigned to a private message. */
|
|
260
|
-
recipients?: MenuItemProps[];
|
|
261
|
-
/** The total number of private recipients. */
|
|
262
|
-
recipientsCount?: number;
|
|
263
|
-
/** The context of the message. */
|
|
264
|
-
postContext?: ReactElement | string;
|
|
265
|
-
/** Callback that runs when the private recipient icon on a post is hovered, focused, or clicked. */
|
|
266
|
-
onRecipientInteraction?: () => void;
|
|
267
|
-
/** Callback that runs when the bottom of the extended private recipient list Modal is reached, allowing for more recipients to be loaded. */
|
|
268
|
-
onLoadMoreRecipients?: () => void;
|
|
269
|
-
/** A loading indicator for the recipients Modal. */
|
|
270
|
-
recipientsLoading?: boolean;
|
|
271
|
-
/** Props that will be passed into the reply input, see FeedReplyInput for more information. */
|
|
272
|
-
replyInput: Pick<FeedReplyInputProps, 'onSubmit' | 'onFilesAdded' | 'attachments'>;
|
|
273
|
-
/** The default visibility for the reply input. */
|
|
274
|
-
replyInputShown?: boolean;
|
|
275
|
-
/** An array to of replies for this message. */
|
|
276
|
-
replies?: ReactElement[];
|
|
277
|
-
/** A total count of all replies. */
|
|
278
|
-
replyCount?: number;
|
|
279
|
-
/** Callback that runs when the user clicks Show more button for the replies. */
|
|
280
|
-
onShowMoreReplies?: (event: {
|
|
281
|
-
id: string;
|
|
282
|
-
}) => void;
|
|
283
|
-
/** Callback that runs when the user clicks Show less button for the replies. */
|
|
284
|
-
onShowLessReplies?: (event: {
|
|
285
|
-
id: string;
|
|
286
|
-
}) => void;
|
|
287
|
-
/** A loading indicator for the replies. */
|
|
288
|
-
repliesLoading?: boolean;
|
|
289
|
-
}
|
|
290
|
-
export type FeedReplyProps = FeedMessageBaseProps;
|
|
291
|
-
export interface FeedContentHeaderProps extends SubComponentVariant {
|
|
292
|
-
id: FeedMessageBaseProps['id'];
|
|
293
|
-
fullname: FeedMessageBaseProps['fullname'];
|
|
294
|
-
username: FeedMessageBaseProps['username'];
|
|
295
|
-
postTimestamp: FeedMessageBaseProps['postTimestamp'];
|
|
296
|
-
content: FeedMessageBaseProps['content'];
|
|
297
|
-
avatarSrc?: FeedMessageBaseProps['avatarSrc'];
|
|
298
|
-
icon?: FeedMessageBaseProps['icon'];
|
|
299
|
-
userStatus?: FeedMessageBaseProps['userStatus'];
|
|
300
|
-
postType?: FeedPostProps['postType'];
|
|
301
|
-
postContext?: FeedPostProps['postContext'];
|
|
302
|
-
recipients?: FeedPostProps['recipients'];
|
|
303
|
-
recipientsCount?: FeedPostProps['recipientsCount'];
|
|
304
|
-
menuItems?: FeedMessageBaseProps['menuItems'];
|
|
305
|
-
edited?: FeedMessageBaseProps['edited'];
|
|
306
|
-
editTimestamp?: FeedMessageBaseProps['editTimestamp'];
|
|
307
|
-
recipientsLoading?: FeedPostProps['recipientsLoading'];
|
|
308
|
-
onEditSubmit?: FeedMessageBaseProps['onEditSubmit'];
|
|
309
|
-
onLoadMoreRecipients?: FeedPostProps['onLoadMoreRecipients'];
|
|
310
|
-
onRecipientInteraction?: FeedPostProps['onRecipientInteraction'];
|
|
311
|
-
onUserClick?: FeedMessageBaseProps['onUserClick'];
|
|
312
|
-
setEditMode: Dispatch<SetStateAction<boolean>>;
|
|
313
|
-
}
|
|
314
|
-
export interface FeedContentFooterProps extends SubComponentVariant {
|
|
315
|
-
id: FeedMessageBaseProps['id'];
|
|
316
|
-
username: FeedMessageBaseProps['username'];
|
|
317
|
-
liked?: FeedMessageBaseProps['liked'];
|
|
318
|
-
likes?: FeedMessageBaseProps['likes'];
|
|
319
|
-
likeCount?: FeedMessageBaseProps['likeCount'];
|
|
320
|
-
interactionsEnabled?: FeedMessageBaseProps['interactionsEnabled'];
|
|
321
|
-
onCommentClick: FeedMessageBaseProps['onCommentClick'];
|
|
322
|
-
onLikeClick: FeedMessageBaseProps['onLikeClick'];
|
|
323
|
-
onLikeCountInteraction?: FeedMessageBaseProps['onLikeCountInteraction'];
|
|
324
|
-
onLoadMoreLikes?: FeedMessageBaseProps['onLoadMoreLikes'];
|
|
325
|
-
likesLoading?: FeedMessageBaseProps['likesLoading'];
|
|
326
|
-
replies?: FeedPostProps['replies'];
|
|
327
|
-
replyCount?: FeedPostProps['replyCount'];
|
|
328
|
-
onShowMoreReplies?: FeedPostProps['onShowMoreReplies'];
|
|
329
|
-
onShowLessReplies?: FeedPostProps['onShowMoreReplies'];
|
|
330
|
-
repliesLoading?: FeedPostProps['repliesLoading'];
|
|
331
|
-
replyInputOpen?: boolean;
|
|
332
|
-
setReplyInputOpen?: Dispatch<SetStateAction<boolean>>;
|
|
333
|
-
}
|
|
334
|
-
//# sourceMappingURL=Feed.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AA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O,CAAC,CAAC;IACtC,SAAS,CAAC,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAC;IAC9C,mBAAmB,CAAC,EAAE,oBAAoB,CAAC,qBAAqB,CAAC,CAAC;IAClE,cAAc,EAAE,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IACvD,WAAW,EAAE,oBAAoB,CAAC,aAAa,CAAC,CAAC;IACjD,sBAAsB,CAAC,EAAE,oBAAoB,CAAC,wBAAwB,CAAC,CAAC;IACxE,eAAe,CAAC,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;IAC1D,YAAY,CAAC,EAAE,oBAAoB,CAAC,cAAc,CAAC,CAAC;IACpD,OAAO,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,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"}
|
|
@@ -1 +0,0 @@
|
|
|
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 /** If true, the Autopilot feature will be enabled for all posts and replies. */\n enableAutopilot?: boolean;\n /** A callback that is triggered when an Autopilot mention is clicked. The callback sends back the target of the element. The callback should return a function component. */\n onAutopilotClick?: FeedContextValue['onAutopilotClick'];\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 +0,0 @@
|
|
|
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,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { hideVisually } from 'polished';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
const StyledFeedAnnouncer = styled.span `
|
|
5
|
-
${hideVisually}
|
|
6
|
-
`;
|
|
7
|
-
const FeedAnnouncer = ({ children }) => {
|
|
8
|
-
return _jsx(StyledFeedAnnouncer, { "aria-live": 'polite', children: children });
|
|
9
|
-
};
|
|
10
|
-
export default FeedAnnouncer;
|
|
11
|
-
//# sourceMappingURL=FeedAnnouncer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,8 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { FeedAttachmentsProps } from './Feed.types';
|
|
3
|
-
export declare const StyledFeedAttachments: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, {}, never>;
|
|
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>;
|
|
5
|
-
export declare const StyledAttachmentsRegion: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, FeedAttachmentsProps, never>;
|
|
6
|
-
declare const FeedAttachments: FC<FeedAttachmentsProps>;
|
|
7
|
-
export default FeedAttachments;
|
|
8
|
-
//# sourceMappingURL=FeedAttachments.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,CAiE5C,CAAC;AAEH,eAAe,eAAe,CAAC"}
|