@pega/cosmos-react-social 3.0.0-dev.1.0 → 3.0.0-dev.11.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 (115) hide show
  1. package/lib/components/Chat/Chat.js +1 -1
  2. package/lib/components/Chat/Chat.js.map +1 -1
  3. package/lib/components/Chat/ChatBody.js +1 -1
  4. package/lib/components/Chat/ChatBody.js.map +1 -1
  5. package/lib/components/Chat/ChatComposer.js +6 -6
  6. package/lib/components/Chat/ChatComposer.js.map +1 -1
  7. package/lib/components/Chat/ChatHeader.d.ts.map +1 -1
  8. package/lib/components/Chat/ChatHeader.js +2 -3
  9. package/lib/components/Chat/ChatHeader.js.map +1 -1
  10. package/lib/components/Chat/ChatTranscript.js +3 -3
  11. package/lib/components/Chat/ChatTranscript.js.map +1 -1
  12. package/lib/components/Chat/Message.js +9 -9
  13. package/lib/components/Chat/Message.js.map +1 -1
  14. package/lib/components/Chat/MessageList.js +3 -3
  15. package/lib/components/Chat/MessageList.js.map +1 -1
  16. package/lib/components/Chat/RepeatingView.js +1 -1
  17. package/lib/components/Chat/RepeatingView.js.map +1 -1
  18. package/lib/components/Chat/SuggestedReplyPicker.js +6 -6
  19. package/lib/components/Chat/SuggestedReplyPicker.js.map +1 -1
  20. package/lib/components/Chat/SystemMessage.js +1 -1
  21. package/lib/components/Chat/SystemMessage.js.map +1 -1
  22. package/lib/components/Chat/TranscriptMessage.js +2 -2
  23. package/lib/components/Chat/TranscriptMessage.js.map +1 -1
  24. package/lib/components/Chat/TypeIndicator.js +1 -1
  25. package/lib/components/Chat/TypeIndicator.js.map +1 -1
  26. package/lib/components/Email/ContextMenuPopover.d.ts +5 -0
  27. package/lib/components/Email/ContextMenuPopover.d.ts.map +1 -0
  28. package/lib/components/Email/ContextMenuPopover.js +48 -0
  29. package/lib/components/Email/ContextMenuPopover.js.map +1 -0
  30. package/lib/components/Email/Email.d.ts.map +1 -1
  31. package/lib/components/Email/Email.js +64 -30
  32. package/lib/components/Email/Email.js.map +1 -1
  33. package/lib/components/Email/Email.styles.d.ts +6 -3
  34. package/lib/components/Email/Email.styles.d.ts.map +1 -1
  35. package/lib/components/Email/Email.styles.js +44 -26
  36. package/lib/components/Email/Email.styles.js.map +1 -1
  37. package/lib/components/Email/Email.types.d.ts +41 -8
  38. package/lib/components/Email/Email.types.d.ts.map +1 -1
  39. package/lib/components/Email/Email.types.js.map +1 -1
  40. package/lib/components/Email/EmailComposer.d.ts +1 -1
  41. package/lib/components/Email/EmailComposer.d.ts.map +1 -1
  42. package/lib/components/Email/EmailComposer.js +83 -60
  43. package/lib/components/Email/EmailComposer.js.map +1 -1
  44. package/lib/components/Email/EmailConversation.js +4 -4
  45. package/lib/components/Email/EmailConversation.js.map +1 -1
  46. package/lib/components/Email/EmailEntity.d.ts.map +1 -1
  47. package/lib/components/Email/EmailEntity.js +7 -3
  48. package/lib/components/Email/EmailEntity.js.map +1 -1
  49. package/lib/components/Email/EmailSelector.d.ts +2 -2
  50. package/lib/components/Email/EmailSelector.d.ts.map +1 -1
  51. package/lib/components/Email/EmailSelector.js +36 -28
  52. package/lib/components/Email/EmailSelector.js.map +1 -1
  53. package/lib/components/Email/EmailShell.d.ts.map +1 -1
  54. package/lib/components/Email/EmailShell.js +7 -5
  55. package/lib/components/Email/EmailShell.js.map +1 -1
  56. package/lib/components/Email/EmailSummaryItem.d.ts.map +1 -1
  57. package/lib/components/Email/EmailSummaryItem.js +16 -8
  58. package/lib/components/Email/EmailSummaryItem.js.map +1 -1
  59. package/lib/components/Email/EmailSummaryList.d.ts.map +1 -1
  60. package/lib/components/Email/EmailSummaryList.js +74 -33
  61. package/lib/components/Email/EmailSummaryList.js.map +1 -1
  62. package/lib/components/Email/EntityList.d.ts +6 -0
  63. package/lib/components/Email/EntityList.d.ts.map +1 -0
  64. package/lib/components/Email/{ViewAnalysis.js → EntityList.js} +6 -6
  65. package/lib/components/Email/EntityList.js.map +1 -0
  66. package/lib/components/Email/index.d.ts +2 -2
  67. package/lib/components/Email/index.d.ts.map +1 -1
  68. package/lib/components/Email/index.js +1 -1
  69. package/lib/components/Email/index.js.map +1 -1
  70. package/lib/components/Feed/Feed.d.ts +2 -0
  71. package/lib/components/Feed/Feed.d.ts.map +1 -1
  72. package/lib/components/Feed/Feed.js +22 -45
  73. package/lib/components/Feed/Feed.js.map +1 -1
  74. package/lib/components/Feed/FeedAnnouncer.js +1 -1
  75. package/lib/components/Feed/FeedAnnouncer.js.map +1 -1
  76. package/lib/components/Feed/FeedAttachments.js +3 -3
  77. package/lib/components/Feed/FeedAttachments.js.map +1 -1
  78. package/lib/components/Feed/FeedContent.js +1 -1
  79. package/lib/components/Feed/FeedContent.js.map +1 -1
  80. package/lib/components/Feed/FeedLikeButton.d.ts +1 -1
  81. package/lib/components/Feed/FeedLikeButton.d.ts.map +1 -1
  82. package/lib/components/Feed/FeedLikeButton.js +10 -8
  83. package/lib/components/Feed/FeedLikeButton.js.map +1 -1
  84. package/lib/components/Feed/FeedModalList.d.ts +2 -0
  85. package/lib/components/Feed/FeedModalList.d.ts.map +1 -1
  86. package/lib/components/Feed/FeedModalList.js +25 -38
  87. package/lib/components/Feed/FeedModalList.js.map +1 -1
  88. package/lib/components/Feed/FeedNewPost.js +4 -4
  89. package/lib/components/Feed/FeedNewPost.js.map +1 -1
  90. package/lib/components/Feed/FeedNewPostTypeMenu.js +8 -8
  91. package/lib/components/Feed/FeedNewPostTypeMenu.js.map +1 -1
  92. package/lib/components/Feed/FeedPost.d.ts.map +1 -1
  93. package/lib/components/Feed/FeedPost.js +16 -14
  94. package/lib/components/Feed/FeedPost.js.map +1 -1
  95. package/lib/components/Feed/FeedPost.types.d.ts +4 -0
  96. package/lib/components/Feed/FeedPost.types.d.ts.map +1 -1
  97. package/lib/components/Feed/FeedPost.types.js.map +1 -1
  98. package/lib/components/Feed/FeedReply.d.ts.map +1 -1
  99. package/lib/components/Feed/FeedReply.js +7 -7
  100. package/lib/components/Feed/FeedReply.js.map +1 -1
  101. package/lib/components/Feed/FeedReply.types.d.ts +2 -0
  102. package/lib/components/Feed/FeedReply.types.d.ts.map +1 -1
  103. package/lib/components/Feed/FeedReply.types.js.map +1 -1
  104. package/lib/components/Feed/FeedReplyInput.js +4 -4
  105. package/lib/components/Feed/FeedReplyInput.js.map +1 -1
  106. package/lib/components/Feed/FeedRichText.js +1 -1
  107. package/lib/components/Feed/FeedRichText.js.map +1 -1
  108. package/lib/components/HashtagButton/HashtagButton.js +2 -2
  109. package/lib/components/HashtagButton/HashtagButton.js.map +1 -1
  110. package/lib/components/MentionButton/MentionButton.js +2 -2
  111. package/lib/components/MentionButton/MentionButton.js.map +1 -1
  112. package/package.json +16 -13
  113. package/lib/components/Email/ViewAnalysis.d.ts +0 -6
  114. package/lib/components/Email/ViewAnalysis.d.ts.map +0 -1
  115. package/lib/components/Email/ViewAnalysis.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MentionButton.js","sourceRoot":"","sources":["../../../src/components/MentionButton/MentionButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAEV,cAAc,EAId,UAAU,EACV,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,MAAM,EAEN,OAAO,EACP,kBAAkB,EAClB,aAAa,EACd,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAanD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;;;;;;CAMlC,CAAC;AAEF,MAAM,aAAa,GAAyD,UAAU,CACpF,CACE,EACE,QAAQ,EACR,EAAE,EAAE,MAAM,GAAG,EAAE,EACf,IAAI,EAAE,QAAQ,GAAG,EAAE,EACnB,IAAI,EAAE,QAAQ,GAAG,EAAE,EACnB,GAAG,SAAS,EACwB,EACtC,GAA2B,EAC3B,EAAE;IACF,MAAM,EAAE,cAAc,EAAE,GA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MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;YAC5B,EAAE;YACF,IAAI;YACJ,IAAI;SACL,CAAC,CAAC;QACH,IAAI,IAAI;YAAE,cAAc,CAAC,IAAI,CAAC,CAAC;QAC/B,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO,CACL,8BACG,WAAW,IAAI,yBAAO,WAAW,WAAQ,EAC1C,KAAC,YAAY,OACP,SAAS,EACb,GAAG,EAAE,UAAU,EACf,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,KAAK,YAEhB,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,WAC9B,EACd,YAAY,IAAI,yBAAO,YAAY,WAAQ,EAC5C,KAAC,OAAO,IACN,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,UAAU,CAAC,OAAO,EAC1B,SAAS,EAAC,cAAc,EACxB,KAAK,kBAEJ,cAAc,WACP,YACT,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,SAAS;IACf,YAAY,EAAE,sEAAsE;IACpF,SAAS,EAAE,aAAa;CACzB,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n isValidElement,\n PropsWithoutRef,\n ReactElement,\n Ref,\n useContext,\n useRef,\n useState\n} from 'react';\nimport styled from 'styled-components';\n\nimport {\n Button,\n ForwardProps,\n Popover,\n useConsolidatedRef,\n useOuterEvent\n} from '@pega/cosmos-react-core';\n\nimport { FeedContext } from '../Feed/Feed.context';\n\ninterface MentionButtonProps {\n /** Text for the button, or a regex match containing all necessary props. */\n children: RegExpExecArray | ReactElement;\n /** The id of the mention. */\n id?: string;\n /** The text of the mention button. */\n text?: string;\n /** Designates the type of the mention for proper handling on click. */\n type?: string;\n}\n\nconst StyledButton = styled(Button)`\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: none;\n text-decoration: underline;\n }\n`;\n\nconst MentionButton: FunctionComponent<MentionButtonProps & ForwardProps> = forwardRef(\n (\n {\n children,\n id: idProp = '',\n text: textProp = '',\n type: typeProp = '',\n ...restProps\n }: PropsWithoutRef<MentionButtonProps>,\n ref: Ref<HTMLButtonElement>\n ) => {\n const { onMentionClick } = useContext(FeedContext);\n const [showPopover, setShowPopover] = useState(false);\n const [mentionContent, setMentionContent] = useState<JSX.Element | undefined>();\n const mentionRef = useConsolidatedRef(ref);\n const popoverRef = useRef(null);\n\n useOuterEvent(['click', 'focusin'], [mentionRef, popoverRef], () => {\n setShowPopover(false);\n });\n\n let leadingChar = '';\n let trailingChar = '';\n let id = '';\n let text = '';\n let type = '';\n\n if (!isValidElement(children)) {\n if (!children.groups) return <span>{children[0]}</span>;\n\n [leadingChar, trailingChar] = children[0].split(children.groups.match);\n id = children.groups.id;\n text = children.groups.text;\n type = children.groups.type;\n } else {\n id = idProp;\n text = textProp;\n type = typeProp;\n }\n\n const handleClick = () => {\n const comp = onMentionClick?.({\n id,\n text,\n type\n });\n if (comp) setShowPopover(true);\n setMentionContent(comp);\n };\n\n return (\n <>\n {leadingChar && <span>{leadingChar}</span>}\n <StyledButton\n {...restProps}\n ref={mentionRef}\n variant='link'\n onClick={handleClick}\n spellCheck={false}\n >\n {isValidElement(children) ? children : text}\n </StyledButton>\n {trailingChar && <span>{trailingChar}</span>}\n <Popover\n ref={popoverRef}\n show={showPopover}\n target={mentionRef.current}\n placement='bottom-start'\n arrow\n >\n {mentionContent}\n </Popover>\n </>\n );\n }\n);\n\nexport const MentionButtonConfig = {\n type: 'mention',\n regexPattern: /(?:^|)(?<match>@(?<id>[^ :]+\\w):(?<text>[^:]+\\w):(?<type>[^:]+\\w):)/g,\n component: MentionButton\n};\n\nexport default MentionButton;\n"]}
1
+ {"version":3,"file":"MentionButton.js","sourceRoot":"","sources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AO,EAC1B,SAAS,EAAC,cAAc,EACxB,KAAK,kBAEJ,cAAc,GACP,IACT,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,SAAS;IACf,YAAY,EAAE,sEAAsE;IACpF,SAAS,EAAE,aAAa;CACzB,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n isValidElement,\n PropsWithoutRef,\n ReactElement,\n Ref,\n useContext,\n useRef,\n useState\n} from 'react';\nimport styled from 'styled-components';\n\nimport {\n Button,\n ForwardProps,\n Popover,\n useConsolidatedRef,\n useOuterEvent\n} from '@pega/cosmos-react-core';\n\nimport { FeedContext } from '../Feed/Feed.context';\n\ninterface MentionButtonProps {\n /** Text for the button, or a regex match containing all necessary props. */\n children: RegExpExecArray | ReactElement;\n /** The id of the mention. */\n id?: string;\n /** The text of the mention button. */\n text?: string;\n /** Designates the type of the mention for proper handling on click. */\n type?: string;\n}\n\nconst StyledButton = styled(Button)`\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: none;\n text-decoration: underline;\n }\n`;\n\nconst MentionButton: FunctionComponent<MentionButtonProps & ForwardProps> = forwardRef(\n (\n {\n children,\n id: idProp = '',\n text: textProp = '',\n type: typeProp = '',\n ...restProps\n }: PropsWithoutRef<MentionButtonProps>,\n ref: Ref<HTMLButtonElement>\n ) => {\n const { onMentionClick } = useContext(FeedContext);\n const [showPopover, setShowPopover] = useState(false);\n const [mentionContent, setMentionContent] = useState<JSX.Element | undefined>();\n const mentionRef = useConsolidatedRef(ref);\n const popoverRef = useRef(null);\n\n useOuterEvent(['click', 'focusin'], [mentionRef, popoverRef], () => {\n setShowPopover(false);\n });\n\n let leadingChar = '';\n let trailingChar = '';\n let id = '';\n let text = '';\n let type = '';\n\n if (!isValidElement(children)) {\n if (!children.groups) return <span>{children[0]}</span>;\n\n [leadingChar, trailingChar] = children[0].split(children.groups.match);\n id = children.groups.id;\n text = children.groups.text;\n type = children.groups.type;\n } else {\n id = idProp;\n text = textProp;\n type = typeProp;\n }\n\n const handleClick = () => {\n const comp = onMentionClick?.({\n id,\n text,\n type\n });\n if (comp) setShowPopover(true);\n setMentionContent(comp);\n };\n\n return (\n <>\n {leadingChar && <span>{leadingChar}</span>}\n <StyledButton\n {...restProps}\n ref={mentionRef}\n variant='link'\n onClick={handleClick}\n spellCheck={false}\n >\n {isValidElement(children) ? children : text}\n </StyledButton>\n {trailingChar && <span>{trailingChar}</span>}\n <Popover\n ref={popoverRef}\n show={showPopover}\n target={mentionRef.current}\n placement='bottom-start'\n arrow\n >\n {mentionContent}\n </Popover>\n </>\n );\n }\n);\n\nexport const MentionButtonConfig = {\n type: 'mention',\n regexPattern: /(?:^|)(?<match>@(?<id>[^ :]+\\w):(?<text>[^:]+\\w):(?<type>[^:]+\\w):)/g,\n component: MentionButton\n};\n\nexport default MentionButton;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-social",
3
- "version": "3.0.0-dev.1.0",
3
+ "version": "3.0.0-dev.11.0",
4
4
  "author": "Pegasystems",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
@@ -20,24 +20,27 @@
20
20
  "build": "tsc -b"
21
21
  },
22
22
  "dependencies": {
23
- "@pega/cosmos-react-core": "3.0.0-dev.1.0",
24
- "@pega/cosmos-react-rte": "3.0.0-dev.1.0",
25
- "@pega/cosmos-react-work": "3.0.0-dev.1.0",
23
+ "@pega/cosmos-react-core": "3.0.0-dev.11.0",
24
+ "@pega/cosmos-react-rte": "3.0.0-dev.11.0",
25
+ "@pega/cosmos-react-work": "3.0.0-dev.11.0",
26
+ "@types/react": "^16.14.24 || ^17.0.38",
27
+ "@types/react-dom": "^16.9.14 || ^17.0.11",
28
+ "@types/styled-components": "^5.1.7",
26
29
  "polished": "^4.1.0",
27
30
  "react": "^16.14.0 || ^17.0.0",
28
31
  "react-dom": "^16.14.0 || ^17.0.0",
29
32
  "styled-components": "^5.2.0"
30
33
  },
31
34
  "devDependencies": {
32
- "@storybook/addon-a11y": "^6.4.12",
33
- "@storybook/addon-actions": "^6.4.12",
34
- "@storybook/addon-knobs": "^6.4.0",
35
- "@storybook/addon-storysource": "^6.4.12",
36
- "@storybook/addon-toolbars": "^6.4.12",
37
- "@storybook/addons": "^6.4.12",
38
- "@storybook/react": "^6.4.12",
39
- "@storybook/theming": "^6.4.12",
35
+ "@storybook/addon-a11y": "^6.4.19",
36
+ "@storybook/addon-actions": "^6.4.19",
37
+ "@storybook/addon-storysource": "^6.4.19",
38
+ "@storybook/addon-toolbars": "^6.4.19",
39
+ "@storybook/addons": "^6.4.19",
40
+ "@storybook/react": "^6.4.19",
41
+ "@storybook/testing-react": "^1.2.4",
42
+ "@storybook/theming": "^6.4.19",
40
43
  "enzyme": "^3.11.0",
41
- "typescript": "~4.5.2"
44
+ "typescript": "~4.6.2"
42
45
  }
43
46
  }
@@ -1,6 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- import { ForwardProps } from '@pega/cosmos-react-core';
3
- import { ViewAnalysisProps } from './Email.types';
4
- declare const ViewAnalysis: FunctionComponent<ViewAnalysisProps & ForwardProps>;
5
- export default ViewAnalysis;
6
- //# sourceMappingURL=ViewAnalysis.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ViewAnalysis.d.ts","sourceRoot":"","sources":["../../../src/components/Email/ViewAnalysis.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,MAAM,OAAO,CAAC;AAEvE,OAAO,EACL,YAAY,EAOb,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CA6BrE,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ViewA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,MAAM,EAAE,MAAM,EAAE,OAAO,EAAC,SAAS,WAAG,WAC1D,YACT,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef } from 'react';\n\nimport {\n ForwardProps,\n Text,\n Flex,\n Icon,\n Card,\n CardHeader,\n CardContent\n} from '@pega/cosmos-react-core';\n\nimport { StyledViewAnalysisFieldValueList } from './Email.styles';\nimport EmailEntity from './EmailEntity';\nimport { ViewAnalysisProps } from './Email.types';\n\nconst ViewAnalysis: FunctionComponent<ViewAnalysisProps & ForwardProps> = forwardRef(\n ({ content, header }: PropsWithoutRef<ViewAnalysisProps>, ref: ViewAnalysisProps['ref']) => {\n const fields = content.map(data => {\n return data.value\n ? {\n ...data,\n value: (\n <Flex container={{ gap: 0.5, wrap: 'wrap' }}>\n {data.value.map(entityObject => {\n return <EmailEntity key={entityObject.id} entity={entityObject.entity} />;\n })}\n </Flex>\n )\n }\n : data;\n });\n\n return (\n <Card ref={ref}>\n <CardHeader container={{ alignItems: 'center', gap: 1 }}>\n <Icon name={header.icon} />\n <Text variant='h3'>{header.text}</Text>\n </CardHeader>\n <CardContent>\n <StyledViewAnalysisFieldValueList fields={fields} variant='stacked' />\n </CardContent>\n </Card>\n );\n }\n);\n\nexport default ViewAnalysis;\n"]}