@pega/cosmos-react-social 4.0.0-dev.21.0 → 4.0.0-dev.22.0

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 (86) hide show
  1. package/lib/components/Feed/Feed.context.d.ts +2 -1
  2. package/lib/components/Feed/Feed.context.d.ts.map +1 -1
  3. package/lib/components/Feed/Feed.context.js.map +1 -1
  4. package/lib/components/Feed/Feed.d.ts +3 -53
  5. package/lib/components/Feed/Feed.d.ts.map +1 -1
  6. package/lib/components/Feed/Feed.js +27 -29
  7. package/lib/components/Feed/Feed.js.map +1 -1
  8. package/lib/components/Feed/Feed.types.d.ts +330 -0
  9. package/lib/components/Feed/Feed.types.d.ts.map +1 -0
  10. package/lib/components/Feed/Feed.types.js +2 -0
  11. package/lib/components/Feed/Feed.types.js.map +1 -0
  12. package/lib/components/Feed/FeedAnnouncer.d.ts +2 -3
  13. package/lib/components/Feed/FeedAnnouncer.d.ts.map +1 -1
  14. package/lib/components/Feed/FeedAnnouncer.js.map +1 -1
  15. package/lib/components/Feed/FeedAttachments.d.ts +3 -9
  16. package/lib/components/Feed/FeedAttachments.d.ts.map +1 -1
  17. package/lib/components/Feed/FeedAttachments.js +17 -10
  18. package/lib/components/Feed/FeedAttachments.js.map +1 -1
  19. package/lib/components/Feed/FeedButton.d.ts +0 -1
  20. package/lib/components/Feed/FeedButton.d.ts.map +1 -1
  21. package/lib/components/Feed/FeedButton.js +2 -10
  22. package/lib/components/Feed/FeedButton.js.map +1 -1
  23. package/lib/components/Feed/FeedContent.d.ts +2 -10
  24. package/lib/components/Feed/FeedContent.d.ts.map +1 -1
  25. package/lib/components/Feed/FeedContent.js +8 -1
  26. package/lib/components/Feed/FeedContent.js.map +1 -1
  27. package/lib/components/Feed/FeedContentFooter.d.ts +5 -0
  28. package/lib/components/Feed/FeedContentFooter.d.ts.map +1 -0
  29. package/lib/components/Feed/FeedContentFooter.js +34 -0
  30. package/lib/components/Feed/FeedContentFooter.js.map +1 -0
  31. package/lib/components/Feed/FeedContentHeader.d.ts +5 -0
  32. package/lib/components/Feed/FeedContentHeader.d.ts.map +1 -0
  33. package/lib/components/Feed/FeedContentHeader.js +101 -0
  34. package/lib/components/Feed/FeedContentHeader.js.map +1 -0
  35. package/lib/components/Feed/FeedEditRegion.d.ts +6 -0
  36. package/lib/components/Feed/FeedEditRegion.d.ts.map +1 -0
  37. package/lib/components/Feed/FeedEditRegion.js +46 -0
  38. package/lib/components/Feed/FeedEditRegion.js.map +1 -0
  39. package/lib/components/Feed/FeedInputRegion.d.ts +8 -0
  40. package/lib/components/Feed/FeedInputRegion.d.ts.map +1 -0
  41. package/lib/components/Feed/FeedInputRegion.js +86 -0
  42. package/lib/components/Feed/FeedInputRegion.js.map +1 -0
  43. package/lib/components/Feed/FeedLikeButton.d.ts +5 -17
  44. package/lib/components/Feed/FeedLikeButton.d.ts.map +1 -1
  45. package/lib/components/Feed/FeedLikeButton.js +44 -30
  46. package/lib/components/Feed/FeedLikeButton.js.map +1 -1
  47. package/lib/components/Feed/FeedModalList.d.ts +1 -13
  48. package/lib/components/Feed/FeedModalList.d.ts.map +1 -1
  49. package/lib/components/Feed/FeedModalList.js +5 -2
  50. package/lib/components/Feed/FeedModalList.js.map +1 -1
  51. package/lib/components/Feed/FeedNewPost.d.ts +1 -30
  52. package/lib/components/Feed/FeedNewPost.d.ts.map +1 -1
  53. package/lib/components/Feed/FeedNewPost.js +7 -85
  54. package/lib/components/Feed/FeedNewPost.js.map +1 -1
  55. package/lib/components/Feed/FeedNewPostTypeMenu.d.ts +2 -28
  56. package/lib/components/Feed/FeedNewPostTypeMenu.d.ts.map +1 -1
  57. package/lib/components/Feed/FeedNewPostTypeMenu.js +2 -2
  58. package/lib/components/Feed/FeedNewPostTypeMenu.js.map +1 -1
  59. package/lib/components/Feed/FeedPost.d.ts +2 -4
  60. package/lib/components/Feed/FeedPost.d.ts.map +1 -1
  61. package/lib/components/Feed/FeedPost.js +96 -159
  62. package/lib/components/Feed/FeedPost.js.map +1 -1
  63. package/lib/components/Feed/FeedReply.d.ts +1 -4
  64. package/lib/components/Feed/FeedReply.d.ts.map +1 -1
  65. package/lib/components/Feed/FeedReply.js +56 -138
  66. package/lib/components/Feed/FeedReply.js.map +1 -1
  67. package/lib/components/Feed/FeedReplyInput.d.ts +2 -27
  68. package/lib/components/Feed/FeedReplyInput.d.ts.map +1 -1
  69. package/lib/components/Feed/FeedReplyInput.js +9 -96
  70. package/lib/components/Feed/FeedReplyInput.js.map +1 -1
  71. package/lib/components/Feed/FeedRichText.d.ts +1 -4
  72. package/lib/components/Feed/FeedRichText.d.ts.map +1 -1
  73. package/lib/components/Feed/FeedRichText.js +3 -8
  74. package/lib/components/Feed/FeedRichText.js.map +1 -1
  75. package/lib/components/Feed/index.d.ts +1 -7
  76. package/lib/components/Feed/index.d.ts.map +1 -1
  77. package/lib/components/Feed/index.js.map +1 -1
  78. package/package.json +4 -4
  79. package/lib/components/Feed/FeedPost.types.d.ts +0 -105
  80. package/lib/components/Feed/FeedPost.types.d.ts.map +0 -1
  81. package/lib/components/Feed/FeedPost.types.js +0 -2
  82. package/lib/components/Feed/FeedPost.types.js.map +0 -1
  83. package/lib/components/Feed/FeedReply.types.d.ts +0 -70
  84. package/lib/components/Feed/FeedReply.types.d.ts.map +0 -1
  85. package/lib/components/Feed/FeedReply.types.js +0 -2
  86. package/lib/components/Feed/FeedReply.types.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { Dispatch, RefObject, SetStateAction } from 'react';
2
2
  import { InteractionRenderers, MDMap } from '@pega/cosmos-react-rte';
3
- import { MenuItemProps } from '@pega/cosmos-react-core';
3
+ import { AvatarProps, MenuItemProps } from '@pega/cosmos-react-core';
4
4
  import { BaseDialogProps } from '@pega/cosmos-react-core/lib/components/Dialog/Dialog.types';
5
5
  export interface FeedContextValue {
6
6
  searchTypes?: string[];
@@ -31,6 +31,7 @@ export interface FeedContextValue {
31
31
  username: string;
32
32
  fullname: string;
33
33
  avatarSrc?: string;
34
+ userStatus?: AvatarProps['status'];
34
35
  meta?: string[];
35
36
  timeZone?: string;
36
37
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Feed.context.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/Feed.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,4DAA4D,CAAC;AAE7F,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE;QAAE,IAAI,EAAE,SAAS,GAAG,KAAK,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACzF,aAAa,CAAC,EAAE,aAAa,EAAE,CAAC;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oBAAoB,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;QACnC,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;KAC3B,KAAK,GAAG,CAAC,OAAO,GAAG,SAAS,CAAC;IAC9B,gBAAgB,CAAC,EAAE,CAAC,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;K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,WAAW,qBAAqB;IACpC,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,eAAO,MAAM,gBAAgB,gDAA2C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Feed.context.js","sourceRoot":"","sources":["../../../src/components/Feed/Feed.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAuC,MAAM,OAAO,CAAC;AAkC3E,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAmB;IACzD,WAAW,EAAE,EAAE;IACf,QAAQ,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;IACxC,QAAQ,EAAE,GAAG,EAAE;QACb,OAAO,CAAC,CAAwD,CAAC;IACnE,CAAC;CACF,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAwB,EAAE,CAAC,CAAC","sourcesContent":["import { createContext, Dispatch, RefObject, SetStateAction } from 'react';\n\nimport { InteractionRenderers, MDMap } from '@pega/cosmos-react-rte';\nimport { MenuItemProps } from '@pega/cosmos-react-core';\nimport { BaseDialogProps } from '@pega/cosmos-react-core/lib/components/Dialog/Dialog.types';\n\nexport interface FeedContextValue {\n searchTypes?: string[];\n onSearch?: (e: { type: 'mention' | 'tag'; search: string; mentionType: string }) => void;\n searchResults?: MenuItemProps[];\n showSearchResults?: boolean;\n setShowSearchResults?: Dispatch<SetStateAction<boolean>>;\n onMentionClick?: (e: {\n id: string;\n text: string;\n type: string;\n target?: BaseDialogProps['target'];\n closeGlimpse?: () => void;\n }) => JSX.Element | undefined;\n onMentionPreview?: (e: { id: string; text: string; type: string }) => void;\n onTagClick?: (tag: string) => void;\n interactionRenderers?: InteractionRenderers[];\n markdownMap?: MDMap;\n userInfo: {\n username: string;\n fullname: string;\n avatarSrc?: string;\n meta?: string[];\n timeZone?: string;\n };\n announce: (announcement: string) => ReturnType<typeof setTimeout>;\n feedRef?: RefObject<HTMLDivElement>;\n}\n\nexport const FeedContext = createContext<FeedContextValue>({\n searchTypes: [],\n userInfo: { username: '', fullname: '' },\n announce: () => {\n return -1 as unknown as ReturnType<FeedContextValue['announce']>;\n }\n});\n\nexport interface FeedReplyContextValue {\n onShowReplyInput?: () => void;\n}\n\nexport const FeedReplyContext = createContext<FeedReplyContextValue>({});\n"]}
1
+ {"version":3,"file":"Feed.context.js","sourceRoot":"","sources":["../../../src/components/Feed/Feed.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAuC,MAAM,OAAO,CAAC;AAmC3E,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAmB;IACzD,WAAW,EAAE,EAAE;IACf,QAAQ,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;IACxC,QAAQ,EAAE,GAAG,EAAE;QACb,OAAO,CAAC,CAAwD,CAAC;IACnE,CAAC;CACF,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAwB,EAAE,CAAC,CAAC","sourcesContent":["import { createContext, Dispatch, RefObject, SetStateAction } from 'react';\n\nimport { InteractionRenderers, MDMap } from '@pega/cosmos-react-rte';\nimport { AvatarProps, MenuItemProps } from '@pega/cosmos-react-core';\nimport { BaseDialogProps } from '@pega/cosmos-react-core/lib/components/Dialog/Dialog.types';\n\nexport interface FeedContextValue {\n searchTypes?: string[];\n onSearch?: (e: { type: 'mention' | 'tag'; search: string; mentionType: string }) => void;\n searchResults?: MenuItemProps[];\n showSearchResults?: boolean;\n setShowSearchResults?: Dispatch<SetStateAction<boolean>>;\n onMentionClick?: (e: {\n id: string;\n text: string;\n type: string;\n target?: BaseDialogProps['target'];\n closeGlimpse?: () => void;\n }) => JSX.Element | undefined;\n onMentionPreview?: (e: { id: string; text: string; type: string }) => void;\n onTagClick?: (tag: string) => void;\n interactionRenderers?: InteractionRenderers[];\n markdownMap?: MDMap;\n userInfo: {\n username: string;\n fullname: string;\n avatarSrc?: string;\n userStatus?: AvatarProps['status'];\n meta?: string[];\n timeZone?: string;\n };\n announce: (announcement: string) => ReturnType<typeof setTimeout>;\n feedRef?: RefObject<HTMLDivElement>;\n}\n\nexport const FeedContext = createContext<FeedContextValue>({\n searchTypes: [],\n userInfo: { username: '', fullname: '' },\n announce: () => {\n return -1 as unknown as ReturnType<FeedContextValue['announce']>;\n }\n});\n\nexport interface FeedReplyContextValue {\n onShowReplyInput?: () => void;\n}\n\nexport const FeedReplyContext = createContext<FeedReplyContextValue>({});\n"]}
@@ -1,56 +1,6 @@
1
- import { ReactNode, FC } from 'react';
2
- import { ForwardProps, NoChildrenProp } from '@pega/cosmos-react-core';
3
- import { FeedContextValue } from './Feed.context';
4
- export interface Filter {
5
- /** Sets DOM id for the control and associates label element via 'for' attribute. */
6
- id: string;
7
- /** Pass a string or a fragment with an Icon and string for the filter label. */
8
- label: ReactNode;
9
- /**
10
- * Disables the filter.
11
- * @default false
12
- */
13
- disabled?: boolean;
14
- /**
15
- * Sets on prop via onFilterChange.
16
- * @default false
17
- */
18
- on?: boolean;
19
- }
20
- export interface FeedProps extends NoChildrenProp {
21
- /** Title for the feed. */
22
- title: string;
23
- /** Information related to the user of the Feed. */
24
- userInfo: FeedContextValue['userInfo'];
25
- /** A set of search types that can be used to determine which data set to conduct a mention search on. */
26
- searchTypes?: FeedContextValue['searchTypes'];
27
- /** A callback that runs when a decorator search has been run inside of the feed. */
28
- onDecoratorSearch?: FeedContextValue['onSearch'];
29
- /** Results that will be shown in a Popover for a mention or tag search. */
30
- searchResults?: FeedContextValue['searchResults'];
31
- /** 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. */
32
- onMentionClick?: FeedContextValue['onMentionClick'];
33
- /** A callback that is triggered when a mention link is previewed. The callback sends back the id, text, and type of the mention. */
34
- onMentionPreview?: FeedContextValue['onMentionPreview'];
35
- /** A callback that is triggered when a hashtag is clicked. The callback sends back the test of the tag. */
36
- onTagClick?: FeedContextValue['onTagClick'];
37
- /** A list of configuration objects used to render custom components within Feed posts and replies based off of a given regex pattern. */
38
- interactionRenderers?: FeedContextValue['interactionRenderers'];
39
- /** A mapping for various element types to render custom components for within posts. */
40
- markdownMap?: FeedContextValue['markdownMap'];
41
- /** A set of filters to apply to the Feed. */
42
- filters?: Filter[];
43
- /** A callback that runs when the filter is toggled. */
44
- onFilterChange?: (filterId: string, on: boolean) => void;
45
- /** A callback that is triggered when the bottom of the Feed is scrolled into view so that additional posts may be displayed. */
46
- onLoadMore?: () => void;
47
- /** Indicates if the posts are being currently loading */
48
- loadingPosts?: boolean;
49
- /** A region to hold the new post component */
50
- newPostRegion?: ReactNode;
51
- /** A list of FeedPost components */
52
- posts?: ReactNode[];
53
- }
1
+ import { FC } from 'react';
2
+ import { ForwardProps } from '@pega/cosmos-react-core';
3
+ import { FeedProps } from './Feed.types';
54
4
  declare const Feed: FC<ForwardProps & FeedProps>;
55
5
  export default Feed;
56
6
  //# sourceMappingURL=Feed.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Feed.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/Feed.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,EAAE,EAOH,MAAM,OAAO,CAAC;AAGf,OAAO,EAIL,YAAY,EAQZ,cAAc,EAKf,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAAe,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAQ/D,MAAM,WAAW,MAAM;IACrB,oFAAoF;IACpF,EAAE,EAAE,MAAM,CAAC;IACX,gFAAgF;IAChF,KAAK,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,EAAE,CAAC,EAAE,OAAO,CAAC;CACd;AAED,MAAM,WAAW,SAAU,SAAQ,cAAc;IAC/C,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,QAAQ,EAAE,gBAAgB,CA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nG,OAAO,EAOL,YAAY,EAab,MAAM,yBAAyB,CAAC;AASjC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAyCzC,QAAA,MAAM,IAAI,EAAE,EAAE,CAAC,YAAY,GAAG,SAAS,CAsMtC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,30 +1,21 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState, useRef, useEffect, useCallback, forwardRef } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
- import { Button, defaultThemeProp, Flex, Icon, registerIcon, Popover, Switch, Text, Progress, usePrevious, useItemIntersection, useUID, useConsolidatedRef, getFocusables } from '@pega/cosmos-react-core';
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
5
  import { useArrows, useElement, useI18n, useOuterEvent } from '@pega/cosmos-react-core/lib/hooks';
6
6
  import * as filterIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/filter.icon';
7
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';
8
9
  import { FeedContext } from './Feed.context';
9
- import { StyledFeedNewPost } from './FeedNewPost';
10
- import { StyledFeedPost } from './FeedPost';
11
10
  import FeedButton from './FeedButton';
12
11
  import FeedAnnouncer from './FeedAnnouncer';
13
12
  registerIcon(filterIcon, filterOnIcon);
14
- const StyledFeed = styled.div(props => {
15
- return css `
16
- ${StyledFeedNewPost}:not(:last-child), ${StyledFeedPost}:not(:last-child) {
17
- margin-bottom: calc(2 * ${props.theme.base.spacing});
18
- }
19
- `;
20
- });
13
+ const StyledFeed = styled.div `
14
+ ${StyledCardHeader}:not(${StyledCard} ${StyledCard} > ${StyledCardHeader}) {
15
+ padding-bottom: 0.25rem;
16
+ }
17
+ `;
21
18
  StyledFeed.defaultProps = defaultThemeProp;
22
- const StyledHeading = styled.div(props => {
23
- return css `
24
- margin: ${props.theme.base.spacing} 0;
25
- `;
26
- });
27
- StyledHeading.defaultProps = defaultThemeProp;
28
19
  const StyledFilterMenu = styled.div(props => {
29
20
  return css `
30
21
  padding: calc(2 * ${props.theme.base.spacing});
@@ -63,7 +54,7 @@ const Feed = forwardRef((props, ref) => {
63
54
  useOuterEvent('mousedown', [popoverEl, buttonEl], () => {
64
55
  setMountPopover(false);
65
56
  });
66
- useOuterEvent('focusin', [popoverEl, buttonEl], () => {
57
+ useOuterEvent('focusin', [popoverEl], () => {
67
58
  setMountPopover(false);
68
59
  });
69
60
  const onKeydown = ({ key }) => {
@@ -79,7 +70,7 @@ const Feed = forwardRef((props, ref) => {
79
70
  const id = useUID();
80
71
  useItemIntersection({ current: null }, posts.length - 1, () => {
81
72
  onLoadMore?.();
82
- }, `#${id} > div[role='none']`);
73
+ }, `#${id} > article[role='none']`);
83
74
  const announce = useCallback((announcement) => {
84
75
  setAnnouncementText('');
85
76
  return setTimeout(() => {
@@ -103,6 +94,14 @@ const Feed = forwardRef((props, ref) => {
103
94
  return () => clearTimeout(timeoutId);
104
95
  }
105
96
  }, [posts]);
97
+ useEffect(() => {
98
+ if (mountPopover) {
99
+ setTimeout(() => {
100
+ const focusables = getFocusables(filterRef);
101
+ focusables[0]?.focus();
102
+ }, 0);
103
+ }
104
+ }, [mountPopover]);
106
105
  return (_jsx(FeedContext.Provider
107
106
  // eslint-disable-next-line react/jsx-no-constructed-context-values
108
107
  , {
@@ -124,17 +123,16 @@ const Feed = forwardRef((props, ref) => {
124
123
  userInfo,
125
124
  announce,
126
125
  feedRef
127
- }, children: _jsxs(StyledFeed, { ref: feedRef, ...restProps, children: [_jsx(FeedAnnouncer, { children: announcementText }), _jsxs(Flex, { container: { justify: 'between', alignItems: 'center' }, as: StyledHeading, 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), onKeyDown: (event) => {
128
- if (event.key === 'ArrowDown' && mountPopover) {
129
- event.preventDefault();
130
- const focusables = getFocusables(filterRef);
131
- focusables[0]?.focus();
132
- }
133
- }, label: mountPopover ? undefined : `${title} ${t('filters').toLowerCase()}`, emphasized: true, children: _jsx(Icon, { name: filters?.map(filter => !!filter.on).reduce((acc, curr) => acc || curr)
134
- ? 'filter-on'
135
- : 'filter' }) }))] }), _jsx(Popover, { show: !!filters && mountPopover, ref: setPopoverEl, target: buttonEl, as: StyledFilterMenu, portal: feedRef.current ?? undefined, hideOnTargetHidden: true, 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 => {
136
- return (_jsx("li", { children: _jsx(Switch, { ...filter, onChange: (event) => onFilterChange?.(event.target.id, event.target.checked) }) }, filter.id));
137
- }) })] }) }), _jsxs("div", { id: id, children: [newPostRegion, posts] }), loadingPosts && (_jsx(Flex, { container: { justify: 'center' }, as: StyledLoadMore, children: _jsx(Progress, { placement: 'inline' }) }))] }) }));
126
+ }, 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: `${title} ${t('filters').toLowerCase()}`, emphasized: true, children: _jsx(Icon, { name: filters?.map(filter => !!filter.on).reduce((acc, curr) => acc || curr)
127
+ ? 'filter-on'
128
+ : 'filter' }) })), _jsx(Popover, { show: !!filters && mountPopover, ref: setPopoverEl, target: buttonEl, as: StyledFilterMenu, portal: feedRef.current ?? undefined, hideOnTargetHidden: true, onKeyDown: (event) => {
129
+ if (event.key === 'Tab') {
130
+ event.preventDefault();
131
+ buttonEl?.focus();
132
+ }
133
+ }, 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 => {
134
+ return (_jsx("li", { children: _jsx(Switch, { ...filter, onChange: (event) => onFilterChange?.(event.target.id, event.target.checked) }) }, filter.id));
135
+ }) })] }) })] }), _jsx(CardContent, { children: newPostRegion })] }), _jsx("div", { id: id, children: posts }), loadingPosts && (_jsx(Flex, { container: { justify: 'center' }, as: StyledLoadMore, children: _jsx(Progress, { placement: 'inline' }) }))] }) }));
138
136
  });
139
137
  export default Feed;
140
138
  //# sourceMappingURL=Feed.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Feed.js","sourceRoot":"","sources":["../../../src/components/Feed/Feed.tsx"],"names":[],"mappings":";AAAA,OAAO,EAIL,QAAQ,EACR,MAAM,EACN,SAAS,EACT,WAAW,EACX,UAAU,EAEX,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,IAAI,EAEJ,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,WAAW,EAEX,mBAAmB,EACnB,MAAM,EACN,kBAAkB,EAClB,aAAa,EACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClG,OAAO,KAAK,UAAU,MAAM,+DAA+D,CAAC;AAC5F,OAAO,KAAK,YAAY,MAAM,kEAAkE,CAAC;AAEjG,OAAO,EAAE,WAAW,EAAoB,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,iBAA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EACP,KAAC,gBAAgB,IAAC,GAAG,EAAE,SAAS,YAC7B,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE;oCACrB,OAAO,CACL,uBACE,KAAC,MAAM,OACD,MAAM,EACV,QAAQ,EAAE,CAAC,KAAoC,EAAE,EAAE,CACjD,cAAc,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAEzD,IANK,MAAM,CAAC,EAAE,CAOb,CACN,CAAC;gCACJ,CAAC,CAAC,GACe,IACd,GACC,EAEV,eAAK,EAAE,EAAE,EAAE,aACR,aAAa,EACb,KAAK,IACF,EAEL,YAAY,IAAI,CACf,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,cAAc,YACxD,KAAC,QAAQ,IAAC,SAAS,EAAC,QAAQ,GAAG,GAC1B,CACR,IACU,GACQ,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import {\n ChangeEvent,\n ReactNode,\n FC,\n useState,\n useRef,\n useEffect,\n useCallback,\n forwardRef,\n Ref\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Button,\n defaultThemeProp,\n Flex,\n ForwardProps,\n Icon,\n registerIcon,\n Popover,\n Switch,\n Text,\n Progress,\n usePrevious,\n NoChildrenProp,\n useItemIntersection,\n useUID,\n useConsolidatedRef,\n getFocusables\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';\n\nimport { FeedContext, FeedContextValue } from './Feed.context';\nimport { StyledFeedNewPost } from './FeedNewPost';\nimport { StyledFeedPost } from './FeedPost';\nimport FeedButton from './FeedButton';\nimport FeedAnnouncer from './FeedAnnouncer';\n\nregisterIcon(filterIcon, filterOnIcon);\n\nexport interface Filter {\n /** Sets DOM id for the control and associates label element via 'for' attribute. */\n id: string;\n /** Pass a string or a fragment with an Icon and string for the filter label. */\n label: ReactNode;\n /**\n * Disables the filter.\n * @default false\n */\n disabled?: boolean;\n /**\n * Sets on prop via onFilterChange.\n * @default false\n */\n on?: boolean;\n}\n\nexport interface FeedProps extends NoChildrenProp {\n /** Title for the feed. */\n title: string;\n /** Information related to the user of the Feed. */\n userInfo: FeedContextValue['userInfo'];\n /** A set of search types that can be used to determine which data set to conduct a mention search on. */\n searchTypes?: FeedContextValue['searchTypes'];\n /** A callback that runs when a decorator search has been run inside of the feed. */\n onDecoratorSearch?: FeedContextValue['onSearch'];\n /** Results that will be shown in a Popover for a mention or tag search. */\n searchResults?: FeedContextValue['searchResults'];\n /** A callback that is triggered when a mention button is clicked. The callback sends back the id, text, and type of the mention. The callback should return a function component. */\n onMentionClick?: FeedContextValue['onMentionClick'];\n /** A callback that is triggered when a mention link is previewed. The callback sends back the id, text, and type of the mention. */\n onMentionPreview?: FeedContextValue['onMentionPreview'];\n /** A callback that is triggered when a hashtag is clicked. The callback sends back the test of the tag. */\n onTagClick?: FeedContextValue['onTagClick'];\n /** A list of configuration objects used to render custom components within Feed posts and replies based off of a given regex pattern. */\n interactionRenderers?: FeedContextValue['interactionRenderers'];\n /** A mapping for various element types to render custom components for within posts. */\n markdownMap?: FeedContextValue['markdownMap'];\n /** A set of filters to apply to the Feed. */\n filters?: Filter[];\n /** A callback that runs when the filter is toggled. */\n onFilterChange?: (filterId: string, on: boolean) => void;\n /** A callback that is triggered when the bottom of the Feed is scrolled into view so that additional posts may be displayed. */\n onLoadMore?: () => void;\n /** Indicates if the posts are being currently loading */\n loadingPosts?: boolean;\n /** A region to hold the new post component */\n newPostRegion?: ReactNode;\n /** A list of FeedPost components */\n posts?: ReactNode[];\n}\n\nconst StyledFeed = styled.div(props => {\n return css`\n ${StyledFeedNewPost}:not(:last-child), ${StyledFeedPost}:not(:last-child) {\n margin-bottom: calc(2 * ${props.theme.base.spacing});\n }\n `;\n});\n\nStyledFeed.defaultProps = defaultThemeProp;\n\nconst StyledHeading = styled.div(props => {\n return css`\n margin: ${props.theme.base.spacing} 0;\n `;\n});\n\nStyledHeading.defaultProps = defaultThemeProp;\n\nconst StyledFilterMenu = styled.div(props => {\n return css`\n padding: calc(2 * ${props.theme.base.spacing});\n\n fieldset {\n border: none;\n }\n `;\n});\n\nStyledFilterMenu.defaultProps = defaultThemeProp;\n\nconst StyledFilterList = styled.ul`\n list-style-type: none;\n min-width: 10rem;\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(\n (props: ForwardProps & FeedProps, ref: Ref<HTMLDivElement>) => {\n const {\n loadingPosts = false,\n variant,\n children,\n userInfo,\n className,\n title,\n searchTypes,\n onDecoratorSearch,\n searchResults = [],\n onMentionClick,\n onMentionPreview,\n onTagClick,\n mentionContent,\n interactionRenderers = [],\n markdownMap,\n filters,\n onFilterChange,\n onLoadMore,\n newPostRegion,\n posts = [],\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, buttonEl], () => {\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} > div[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 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 onMentionClick,\n onMentionPreview,\n onTagClick,\n interactionRenderers,\n markdownMap,\n userInfo,\n announce,\n feedRef\n }}\n >\n <StyledFeed ref={feedRef} {...restProps}>\n <FeedAnnouncer>{announcementText}</FeedAnnouncer>\n <Flex container={{ justify: 'between', alignItems: 'center' }} as={StyledHeading}>\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 onKeyDown={(event: KeyboardEvent) => {\n if (event.key === 'ArrowDown' && mountPopover) {\n event.preventDefault();\n const focusables = getFocusables(filterRef);\n focusables[0]?.focus();\n }\n }}\n label={mountPopover ? undefined : `${title} ${t('filters').toLowerCase()}`}\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 </Flex>\n <Popover\n show={!!filters && mountPopover}\n ref={setPopoverEl}\n target={buttonEl}\n as={StyledFilterMenu}\n portal={feedRef.current ?? undefined}\n hideOnTargetHidden\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\n <div id={id}>\n {newPostRegion}\n {posts}\n </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);\n\nexport default Feed;\n"]}
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,UAAU,EAAO,MAAM,OAAO,CAAC;AACnG,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,IAAI,EAEJ,aAAa,EACb,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,UAAU,EACV,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,mBAAmB,EACnB,MAAM,EACN,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAA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AAM,EACV,QAAQ,EAAE,CAAC,KAAoC,EAAE,EAAE,CACjD,cAAc,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAEzD,IANK,MAAM,CAAC,EAAE,CAOb,CACN,CAAC;gDACJ,CAAC,CAAC,GACe,IACd,GACC,IACC,EAEb,KAAC,WAAW,cAAE,aAAa,GAAe,IACrC,EAEP,cAAK,EAAE,EAAE,EAAE,YAAG,KAAK,GAAO,EAEzB,YAAY,IAAI,CACf,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,cAAc,YACxD,KAAC,QAAQ,IAAC,SAAS,EAAC,QAAQ,GAAG,GAC1B,CACR,IACU,GACQ,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { ChangeEvent, 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(props => {\n return css`\n padding: calc(2 * ${props.theme.base.spacing});\n\n fieldset {\n border: none;\n }\n `;\n});\n\nStyledFilterMenu.defaultProps = defaultThemeProp;\n\nconst StyledFilterList = styled.ul`\n list-style-type: none;\n min-width: 10rem;\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(\n (props: ForwardProps & FeedProps, ref: Ref<HTMLDivElement>) => {\n const {\n loadingPosts = false,\n variant,\n children,\n userInfo,\n className,\n title,\n searchTypes,\n onDecoratorSearch,\n searchResults = [],\n onMentionClick,\n onMentionPreview,\n onTagClick,\n mentionContent,\n interactionRenderers = [],\n markdownMap,\n filters,\n onFilterChange,\n onLoadMore,\n newPostRegion,\n posts = [],\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 onMentionClick,\n onMentionPreview,\n onTagClick,\n interactionRenderers,\n markdownMap,\n userInfo,\n announce,\n feedRef\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={`${title} ${t('filters').toLowerCase()}`}\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 portal={feedRef.current ?? undefined}\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);\n\nexport default Feed;\n"]}
@@ -0,0 +1,330 @@
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
+ /** 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. */
36
+ onMentionClick?: FeedContextValue['onMentionClick'];
37
+ /** A callback that is triggered when a mention link is previewed. The callback sends back the id, text, and type of the mention. */
38
+ onMentionPreview?: FeedContextValue['onMentionPreview'];
39
+ /** A callback that is triggered when a hashtag is clicked. The callback sends back the test of the tag. */
40
+ onTagClick?: FeedContextValue['onTagClick'];
41
+ /** A list of configuration objects used to render custom components within Feed posts and replies based off of a given regex pattern. */
42
+ interactionRenderers?: FeedContextValue['interactionRenderers'];
43
+ /** A mapping for various element types to render custom components for within posts. */
44
+ markdownMap?: FeedContextValue['markdownMap'];
45
+ /** A set of filters to apply to the Feed. */
46
+ filters?: Filter[];
47
+ /** A callback that runs when the filter is toggled. */
48
+ onFilterChange?: (filterId: string, on: boolean) => void;
49
+ /** A callback that is triggered when the bottom of the Feed is scrolled into view so that additional posts may be displayed. */
50
+ onLoadMore?: () => void;
51
+ /** Indicates if the posts are being currently loading */
52
+ loadingPosts?: boolean;
53
+ /** A region to hold the new post component */
54
+ newPostRegion?: ReactNode;
55
+ /** A list of FeedPost components */
56
+ posts?: ReactNode[];
57
+ }
58
+ export type FeedRichTextProps = Pick<RichTextEditorProps, 'label' | 'onChange' | 'onFocus' | 'onBlur' | 'height'>;
59
+ export type AttachedFiles = FileUploadItemProps & File;
60
+ export interface FeedAttachmentsProps extends SubComponentVariant {
61
+ attachments?: AttachedFiles[];
62
+ readOnly?: boolean;
63
+ ref?: Ref<HTMLUListElement>;
64
+ }
65
+ export interface FeedCompositionBaseProps {
66
+ /** A unique ID for the new message. */
67
+ id: string;
68
+ /** A set of attachment files. */
69
+ attachments?: AttachedFiles[];
70
+ /** A callback containing a list of added files that will run whenever files are added to the message. */
71
+ onFilesAdded?: (files: AttachedFiles[]) => void;
72
+ /** Callback that runs when the submit button has been clicked. */
73
+ onSubmit: (event: {
74
+ id: string;
75
+ value: string;
76
+ attachments: AttachedFiles[];
77
+ recipients?: RecipientMenuItem[];
78
+ username: string;
79
+ clear: () => void;
80
+ }) => void;
81
+ }
82
+ export interface FeedInputRegionProps extends SubComponentVariant, FeedCompositionBaseProps {
83
+ inputRegionEl: HTMLDivElement | null;
84
+ rteRef: MutableRefObject<RichTextEditorState | undefined>;
85
+ selectedRecipients?: RecipientMenuItem[];
86
+ }
87
+ export interface FeedEditRegionProps extends SubComponentVariant, Pick<FeedMessageBaseProps, 'id' | 'content' | 'onEditSubmit'> {
88
+ setEditMode: Dispatch<SetStateAction<boolean>>;
89
+ emptyEditText: boolean;
90
+ setEmptyEditText: Dispatch<SetStateAction<boolean>>;
91
+ }
92
+ export interface FeedNewPostProps extends FeedCompositionBaseProps {
93
+ /** If true, the new post input will focus on page load. */
94
+ autoFocus?: boolean;
95
+ /** Array of private recipient options. */
96
+ recipients?: PostTypeMenuProps['recipients'];
97
+ /** Handler for new search on private recipient options. */
98
+ onRecipientSearch?: (newSearch: string) => void;
99
+ }
100
+ export interface FeedReplyInputProps extends FeedCompositionBaseProps {
101
+ /** Callback that sets returns a shared ref to the RTE component */
102
+ onSetInputRef?: (event: {
103
+ ref: MutableRefObject<RichTextEditorState | undefined>;
104
+ }) => void;
105
+ }
106
+ export interface FeedModalListProps {
107
+ /** The count for the list of items. */
108
+ count: number;
109
+ /** The heading for the Modal. */
110
+ heading: string;
111
+ /** The list of MenuItems to render in the Modal. */
112
+ listItems: MenuItemProps[];
113
+ /** A callback that is triggered when the bottom of the Modal list is scrolled into view so that additional data may be displayed. */
114
+ onLoadMore?: () => void;
115
+ /** Indicates if the data is being currently loading */
116
+ loading?: boolean;
117
+ }
118
+ export type PostType = 'post' | 'private';
119
+ export interface RecipientOption {
120
+ /** Pretty printed recipient name */
121
+ primary: string;
122
+ /** Functional identifier of unique recipient */
123
+ value: string;
124
+ }
125
+ export interface RecipientMenuItem {
126
+ id: string;
127
+ selected?: boolean;
128
+ primary: RecipientOption['primary'];
129
+ value: RecipientOption['value'];
130
+ secondary?: MenuItemProps['secondary'];
131
+ visual?: MenuItemProps['visual'];
132
+ }
133
+ export interface PostTypeMenuProps {
134
+ /** Array of private recipient options */
135
+ recipients: RecipientOption[];
136
+ /** Post type update handler */
137
+ onSetPostType: (postType: PostType) => void;
138
+ /** Private post recipient list update handler */
139
+ onSelectedRecipientsUpdate: (recipients: RecipientMenuItem[]) => void;
140
+ /** Handler for new search on private recipient options */
141
+ onRecipientSearch: (newSearch: string) => void;
142
+ reset: boolean;
143
+ onReset: () => void;
144
+ }
145
+ export interface PostTypeMenuState {
146
+ postType: PostType;
147
+ itemsLoading: boolean;
148
+ showTypeMenu: boolean;
149
+ showRecipientMenu: boolean;
150
+ viewingRecipients: boolean;
151
+ searchValue: string;
152
+ typeMenuItems: {
153
+ id: string;
154
+ primary: string;
155
+ selected: boolean;
156
+ value: PostType;
157
+ }[];
158
+ recipientMenuItems: RecipientMenuItem[];
159
+ multiSelectItems: RecipientMenuItem[];
160
+ }
161
+ export interface FeedContentProps {
162
+ children: ReactElement | string;
163
+ /**
164
+ * A maximum height in pixels to display post content within before prompting to expand the post.
165
+ * @default Infinity
166
+ */
167
+ maxContentHeight?: number;
168
+ ref?: Ref<HTMLDivElement>;
169
+ }
170
+ export interface FeedMessageBaseProps {
171
+ /** Unique ID for the message. */
172
+ id: string;
173
+ /** Display name for the message author. */
174
+ fullname: string;
175
+ /** Username for the message author. */
176
+ username: string;
177
+ /** A timestamp of when the message was initially submitted. */
178
+ postTimestamp: DateTimeDisplayProps['value'];
179
+ /** The message content. */
180
+ content: ReactElement | string;
181
+ /** Attachments on the message. */
182
+ attachments?: AttachedFiles[];
183
+ /** An image source for the message author's Avatar. */
184
+ avatarSrc?: string;
185
+ /** The name of an icon to render within the Avatar. */
186
+ icon?: string;
187
+ /** The status of the message author. */
188
+ userStatus?: AvatarProps['status'];
189
+ /** Set true if the user has liked the message. */
190
+ liked?: boolean;
191
+ /** A set of users that have liked the message. */
192
+ likes?: MenuItemProps[];
193
+ /** The total count of likes on the message. */
194
+ likeCount?: number;
195
+ /**
196
+ * If true, the like and comment buttons will be enabled.
197
+ * @default true
198
+ */
199
+ interactionsEnabled?: boolean;
200
+ /**
201
+ * A maximum height in pixels to display message content within before prompting to expand the message.
202
+ * @default Infinity
203
+ */
204
+ maxContentHeight?: FeedContentProps['maxContentHeight'];
205
+ /** A set of menu options for actions on the message. */
206
+ menuItems?: MenuItemProps[];
207
+ /** Callback that updates the message after being edited. If undefined, the message will not be editable. */
208
+ onEditSubmit?: (event: {
209
+ id: string;
210
+ value: string;
211
+ }) => void;
212
+ /**
213
+ * Flag that indicates if a message has been previously edited.
214
+ * @default false
215
+ */
216
+ edited?: boolean;
217
+ /** A timestamp of when the message was last edited. This will only display if edited prop is true. */
218
+ editTimestamp?: DateTimeDisplayProps['value'];
219
+ /** Callback that runs when the mouse pointer hovers over the message. */
220
+ onMouseEnter?: (event: {
221
+ id: string;
222
+ }) => void;
223
+ /** Callback that runs when the mouse pointer leaves the message. */
224
+ onMouseLeave?: (event: {
225
+ id: string;
226
+ }) => void;
227
+ /** Callback that runs when the author's name or Avatar has been clicked. */
228
+ onUserClick?: (event: {
229
+ id: string;
230
+ username: string;
231
+ }, clickEvent?: MouseEvent) => void;
232
+ /** Callback that runs when the comment button has been clicked. */
233
+ onCommentClick: (event: {
234
+ id: string;
235
+ username: string;
236
+ }) => void;
237
+ /** Callback that runs when the like button has been clicked. */
238
+ onLikeClick: (event: {
239
+ id: string;
240
+ user: MenuItemProps;
241
+ }) => void;
242
+ /** Callback that runs when the like count on a message is hovered, focused, or clicked. */
243
+ onLikeCountInteraction?: () => void;
244
+ /** Callback that runs when the bottom of the extended like list Modal is reached, allowing for more likes to be loaded. */
245
+ onLoadMoreLikes?: () => void;
246
+ /** A loading indicator for the likes Modal. */
247
+ likesLoading?: boolean;
248
+ }
249
+ export interface FeedPostProps extends FeedMessageBaseProps {
250
+ /**
251
+ * The type of message. If private, then only the designated recipients will be able to view the message.
252
+ * @default 'public'
253
+ */
254
+ postType?: 'public' | 'private';
255
+ /** The set of recipients assigned to a private message. */
256
+ recipients?: MenuItemProps[];
257
+ /** The total number of private recipients. */
258
+ recipientsCount?: number;
259
+ /** The context of the message. */
260
+ postContext?: ReactElement | string;
261
+ /** Callback that runs when the private recipient icon on a post is hovered, focused, or clicked. */
262
+ onRecipientInteraction?: () => void;
263
+ /** Callback that runs when the bottom of the extended private recipient list Modal is reached, allowing for more recipients to be loaded. */
264
+ onLoadMoreRecipients?: () => void;
265
+ /** A loading indicator for the recipients Modal. */
266
+ recipientsLoading?: boolean;
267
+ /** Props that will be passed into the reply input, see FeedReplyInput for more information. */
268
+ replyInput: Pick<FeedReplyInputProps, 'onSubmit' | 'onFilesAdded' | 'attachments'>;
269
+ /** The default visibility for the reply input. */
270
+ replyInputShown?: boolean;
271
+ /** An array to of replies for this message. */
272
+ replies?: ReactElement[];
273
+ /** A total count of all replies. */
274
+ replyCount?: number;
275
+ /** Callback that runs when the user clicks Show more button for the replies. */
276
+ onShowMoreReplies?: (event: {
277
+ id: string;
278
+ }) => void;
279
+ /** Callback that runs when the user clicks Show less button for the replies. */
280
+ onShowLessReplies?: (event: {
281
+ id: string;
282
+ }) => void;
283
+ /** A loading indicator for the replies. */
284
+ repliesLoading?: boolean;
285
+ }
286
+ export type FeedReplyProps = FeedMessageBaseProps;
287
+ export interface FeedContentHeaderProps extends SubComponentVariant {
288
+ id: FeedMessageBaseProps['id'];
289
+ fullname: FeedMessageBaseProps['fullname'];
290
+ username: FeedMessageBaseProps['username'];
291
+ postTimestamp: FeedMessageBaseProps['postTimestamp'];
292
+ content: FeedMessageBaseProps['content'];
293
+ avatarSrc?: FeedMessageBaseProps['avatarSrc'];
294
+ icon?: FeedMessageBaseProps['icon'];
295
+ userStatus?: FeedMessageBaseProps['userStatus'];
296
+ postType?: FeedPostProps['postType'];
297
+ postContext?: FeedPostProps['postContext'];
298
+ recipients?: FeedPostProps['recipients'];
299
+ recipientsCount?: FeedPostProps['recipientsCount'];
300
+ menuItems?: FeedMessageBaseProps['menuItems'];
301
+ edited?: FeedMessageBaseProps['edited'];
302
+ editTimestamp?: FeedMessageBaseProps['editTimestamp'];
303
+ recipientsLoading?: FeedPostProps['recipientsLoading'];
304
+ onEditSubmit?: FeedMessageBaseProps['onEditSubmit'];
305
+ onLoadMoreRecipients?: FeedPostProps['onLoadMoreRecipients'];
306
+ onRecipientInteraction?: FeedPostProps['onRecipientInteraction'];
307
+ onUserClick?: FeedMessageBaseProps['onUserClick'];
308
+ setEditMode: Dispatch<SetStateAction<boolean>>;
309
+ }
310
+ export interface FeedContentFooterProps extends SubComponentVariant {
311
+ id: FeedMessageBaseProps['id'];
312
+ username: FeedMessageBaseProps['username'];
313
+ liked?: FeedMessageBaseProps['liked'];
314
+ likes?: FeedMessageBaseProps['likes'];
315
+ likeCount?: FeedMessageBaseProps['likeCount'];
316
+ interactionsEnabled?: FeedMessageBaseProps['interactionsEnabled'];
317
+ onCommentClick: FeedMessageBaseProps['onCommentClick'];
318
+ onLikeClick: FeedMessageBaseProps['onLikeClick'];
319
+ onLikeCountInteraction?: FeedMessageBaseProps['onLikeCountInteraction'];
320
+ onLoadMoreLikes?: FeedMessageBaseProps['onLoadMoreLikes'];
321
+ likesLoading?: FeedMessageBaseProps['likesLoading'];
322
+ replies?: FeedPostProps['replies'];
323
+ replyCount?: FeedPostProps['replyCount'];
324
+ onShowMoreReplies?: FeedPostProps['onShowMoreReplies'];
325
+ onShowLessReplies?: FeedPostProps['onShowMoreReplies'];
326
+ repliesLoading?: FeedPostProps['repliesLoading'];
327
+ replyInputOpen?: boolean;
328
+ setReplyInputOpen?: Dispatch<SetStateAction<boolean>>;
329
+ }
330
+ //# sourceMappingURL=Feed.types.d.ts.map