@pega/cosmos-react-social 4.0.0-dev.14.0 → 4.0.0-dev.14.2

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.
@@ -8,7 +8,7 @@ export interface AttachmentItemProps extends BaseProps {
8
8
  name: string;
9
9
  /**
10
10
  * A Cosmos icon name identifier to use for a attachment. Will serve as a fallback to a broken thumbnail.
11
- * @default "document-doc"
11
+ * @default 'document-doc'
12
12
  */
13
13
  icon?: string;
14
14
  /** A string to be used as an image src for a attachment thumbnail. Falls back to a provided icon or the default attachment icon. */
@@ -82,7 +82,7 @@ export interface SystemMessageProps extends Pick<MessageProps, 'ref' | 'timestam
82
82
  /** System message to be displayed */
83
83
  message: string;
84
84
  /** variant of this system message
85
- * @default "secondary"
85
+ * @default 'secondary'
86
86
  */
87
87
  variant?: 'primary' | 'secondary';
88
88
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Chat.types.js","sourceRoot":"","sources":["../../../src/components/Chat/Chat.types.ts"],"names":[],"mappings":"AA4JA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,OAA8B,EACG,EAAE;IACnC,OAAO,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,OAA8B,EACS,EAAE;IACzC,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,OAA8B,EACQ,EAAE;IACxC,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC;AACnC,CAAC,CAAC","sourcesContent":["import { ReactNode, Ref } from 'react';\nimport { DefaultTheme } from 'styled-components';\n\nimport {\n BaseProps,\n Action,\n NoChildrenProp,\n OmitStrict,\n LinkProps,\n AvatarProps\n} from '@pega/cosmos-react-core';\n\nexport interface AttachmentItemProps extends BaseProps {\n /** Unique Id for this attachment */\n id: string;\n /** Name of the attachment. */\n name: string;\n /**\n * A Cosmos icon name identifier to use for a attachment. Will serve as a fallback to a broken thumbnail.\n * @default \"document-doc\"\n */\n icon?: string;\n /** A string to be used as an image src for a attachment thumbnail. Falls back to a provided icon or the default attachment icon. */\n thumbnail?: string;\n /** Additional information about the attachment. If progress prop is passed and its value is less than 100, this region is instead used for the upload progress indicator. */\n meta?: string;\n /** When passed, previews the attachment on click */\n onPreview?: (id: string) => void;\n /** Actions list for the attachment */\n actions?: Action[];\n /** When passed, this will render a single icon button or within a MenuButton if onDelete is defined. */\n onDelete?: (id: string) => void;\n}\n\nexport type UserAvailability = 'available' | 'unavailable' | 'temporarilyUnavailable';\n\nexport interface ChatSettingsPanelProps extends NoChildrenProp {\n status?: UserAvailability;\n label: string;\n onClick: () => void;\n}\n\nexport type ColorTheme = [\n keyof OmitStrict<DefaultTheme['base']['colors'], 'white' | 'black'>,\n 'extra-light' | 'light' | 'medium' | 'dark' | 'extra-dark'\n];\n\nexport interface MediaPageLinks extends Pick<LinkProps, 'href'> {\n /** Unique id for this push link */\n id: string;\n /** A string to be used as an image src for a thumbnail. */\n thumbnail?: AttachmentItemProps['thumbnail'];\n /** Additional information about the linked resource. */\n title?: string;\n}\n\nexport type MessageHeaderProps = {\n /** message header content */\n content?: ReactNode;\n /** meta data */\n meta?: ReactNode;\n};\n\nexport interface MessageProps {\n /** Message to be displayed */\n message?: string;\n /** Attachment list */\n attachments?: AttachmentItemProps[];\n /** Message page push links list */\n mediaPageLinks?: MediaPageLinks[];\n /** timestamp of the message(Formatted) */\n timestamp?: string;\n /** Incoming message/ outgoing message */\n direction: 'in' | 'out';\n /** Avatar information, can be image and name */\n avatarInfo?: Pick<AvatarProps, 'name' | 'imageSrc'>;\n /** Message status */\n status?: 'delivered' | 'opened' | 'undeliverable';\n /** Indicates if this message is being currently typed */\n typing?: boolean;\n /** Message header */\n messageHeader?: MessageHeaderProps;\n /** Sender type */\n senderType: 'customer' | 'agent' | 'bot';\n /** Sender ID, will be helpful in deciding the colour */\n senderId: string;\n /** Number used to determine the color of agent's message */\n agentVariant?: number;\n /** ref to the message wrapper */\n ref?: Ref<HTMLLIElement>;\n}\n\nexport interface TypeIndicatorProps\n extends Pick<MessageProps, 'ref' | 'message' | 'senderId' | 'senderType' | 'agentVariant'> {\n /** Avatar information, can be image and name */\n avatarInfo: Pick<AvatarProps, 'name' | 'imageSrc'>;\n}\n\nexport interface SystemMessageProps extends Pick<MessageProps, 'ref' | 'timestamp'> {\n /** System message to be displayed */\n message: string;\n /** variant of this system message\n * @default \"secondary\"\n */\n variant?: 'primary' | 'secondary';\n}\n\nexport interface ChatBodyHandleValue {\n isScrolledToLatest: () => boolean;\n scrollToLatestMessage: () => void;\n scrollToNewMessage: () => void;\n}\n\nexport interface ChatBodyProps {\n /** Transcripts */\n transcripts: {\n /** Unique id of a chat session */\n id: string;\n /** Messages in a chat session */\n messages: ChatBodyListItemProps[];\n }[];\n /** Live chat messages */\n liveChat: ChatBodyListItemProps[];\n /** Total unread messages */\n unreadMessageCount?: number;\n /** on scroll to button */\n onScrollToButtonClick?: () => void;\n /** Indicates if the data is being currently loading */\n loading?: boolean;\n /** Offset of the row item that need to trigger the load more callback */\n offset?: number;\n /** Callback to fetch more rows */\n loadMore?: () => void;\n /** Imperative handle */\n handle?: Ref<ChatBodyHandleValue>;\n /** ref to the element */\n ref?: Ref<HTMLDivElement>;\n}\n\ntype MessageListItemProps = OmitStrict<MessageProps, 'agentVariant' | 'typing'> & {\n type: 'message';\n id: string;\n};\n\ntype SystemMessageListItemProps = SystemMessageProps & { type: 'system'; id: string };\n\ntype TypeIndicatorListItemPops = OmitStrict<TypeIndicatorProps, 'agentVariant'> & {\n type: 'typing';\n id: string;\n};\n\nexport type ChatBodyListItemProps =\n | MessageListItemProps\n | SystemMessageListItemProps\n | TypeIndicatorListItemPops;\n\nexport const isMessageListItem = (\n message: ChatBodyListItemProps\n): message is MessageListItemProps => {\n return message.type === 'message';\n};\n\nexport const isSystemMessageListItem = (\n message: ChatBodyListItemProps\n): message is SystemMessageListItemProps => {\n return message.type === 'system';\n};\n\nexport const isTypeIndicatorListItem = (\n message: ChatBodyListItemProps\n): message is TypeIndicatorListItemPops => {\n return message.type === 'typing';\n};\n"]}
1
+ {"version":3,"file":"Chat.types.js","sourceRoot":"","sources":["../../../src/components/Chat/Chat.types.ts"],"names":[],"mappings":"AA4JA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,OAA8B,EACG,EAAE;IACnC,OAAO,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,OAA8B,EACS,EAAE;IACzC,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,OAA8B,EACQ,EAAE;IACxC,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC;AACnC,CAAC,CAAC","sourcesContent":["import { ReactNode, Ref } from 'react';\nimport { DefaultTheme } from 'styled-components';\n\nimport {\n BaseProps,\n Action,\n NoChildrenProp,\n OmitStrict,\n LinkProps,\n AvatarProps\n} from '@pega/cosmos-react-core';\n\nexport interface AttachmentItemProps extends BaseProps {\n /** Unique Id for this attachment */\n id: string;\n /** Name of the attachment. */\n name: string;\n /**\n * A Cosmos icon name identifier to use for a attachment. Will serve as a fallback to a broken thumbnail.\n * @default 'document-doc'\n */\n icon?: string;\n /** A string to be used as an image src for a attachment thumbnail. Falls back to a provided icon or the default attachment icon. */\n thumbnail?: string;\n /** Additional information about the attachment. If progress prop is passed and its value is less than 100, this region is instead used for the upload progress indicator. */\n meta?: string;\n /** When passed, previews the attachment on click */\n onPreview?: (id: string) => void;\n /** Actions list for the attachment */\n actions?: Action[];\n /** When passed, this will render a single icon button or within a MenuButton if onDelete is defined. */\n onDelete?: (id: string) => void;\n}\n\nexport type UserAvailability = 'available' | 'unavailable' | 'temporarilyUnavailable';\n\nexport interface ChatSettingsPanelProps extends NoChildrenProp {\n status?: UserAvailability;\n label: string;\n onClick: () => void;\n}\n\nexport type ColorTheme = [\n keyof OmitStrict<DefaultTheme['base']['colors'], 'white' | 'black'>,\n 'extra-light' | 'light' | 'medium' | 'dark' | 'extra-dark'\n];\n\nexport interface MediaPageLinks extends Pick<LinkProps, 'href'> {\n /** Unique id for this push link */\n id: string;\n /** A string to be used as an image src for a thumbnail. */\n thumbnail?: AttachmentItemProps['thumbnail'];\n /** Additional information about the linked resource. */\n title?: string;\n}\n\nexport type MessageHeaderProps = {\n /** message header content */\n content?: ReactNode;\n /** meta data */\n meta?: ReactNode;\n};\n\nexport interface MessageProps {\n /** Message to be displayed */\n message?: string;\n /** Attachment list */\n attachments?: AttachmentItemProps[];\n /** Message page push links list */\n mediaPageLinks?: MediaPageLinks[];\n /** timestamp of the message(Formatted) */\n timestamp?: string;\n /** Incoming message/ outgoing message */\n direction: 'in' | 'out';\n /** Avatar information, can be image and name */\n avatarInfo?: Pick<AvatarProps, 'name' | 'imageSrc'>;\n /** Message status */\n status?: 'delivered' | 'opened' | 'undeliverable';\n /** Indicates if this message is being currently typed */\n typing?: boolean;\n /** Message header */\n messageHeader?: MessageHeaderProps;\n /** Sender type */\n senderType: 'customer' | 'agent' | 'bot';\n /** Sender ID, will be helpful in deciding the colour */\n senderId: string;\n /** Number used to determine the color of agent's message */\n agentVariant?: number;\n /** ref to the message wrapper */\n ref?: Ref<HTMLLIElement>;\n}\n\nexport interface TypeIndicatorProps\n extends Pick<MessageProps, 'ref' | 'message' | 'senderId' | 'senderType' | 'agentVariant'> {\n /** Avatar information, can be image and name */\n avatarInfo: Pick<AvatarProps, 'name' | 'imageSrc'>;\n}\n\nexport interface SystemMessageProps extends Pick<MessageProps, 'ref' | 'timestamp'> {\n /** System message to be displayed */\n message: string;\n /** variant of this system message\n * @default 'secondary'\n */\n variant?: 'primary' | 'secondary';\n}\n\nexport interface ChatBodyHandleValue {\n isScrolledToLatest: () => boolean;\n scrollToLatestMessage: () => void;\n scrollToNewMessage: () => void;\n}\n\nexport interface ChatBodyProps {\n /** Transcripts */\n transcripts: {\n /** Unique id of a chat session */\n id: string;\n /** Messages in a chat session */\n messages: ChatBodyListItemProps[];\n }[];\n /** Live chat messages */\n liveChat: ChatBodyListItemProps[];\n /** Total unread messages */\n unreadMessageCount?: number;\n /** on scroll to button */\n onScrollToButtonClick?: () => void;\n /** Indicates if the data is being currently loading */\n loading?: boolean;\n /** Offset of the row item that need to trigger the load more callback */\n offset?: number;\n /** Callback to fetch more rows */\n loadMore?: () => void;\n /** Imperative handle */\n handle?: Ref<ChatBodyHandleValue>;\n /** ref to the element */\n ref?: Ref<HTMLDivElement>;\n}\n\ntype MessageListItemProps = OmitStrict<MessageProps, 'agentVariant' | 'typing'> & {\n type: 'message';\n id: string;\n};\n\ntype SystemMessageListItemProps = SystemMessageProps & { type: 'system'; id: string };\n\ntype TypeIndicatorListItemPops = OmitStrict<TypeIndicatorProps, 'agentVariant'> & {\n type: 'typing';\n id: string;\n};\n\nexport type ChatBodyListItemProps =\n | MessageListItemProps\n | SystemMessageListItemProps\n | TypeIndicatorListItemPops;\n\nexport const isMessageListItem = (\n message: ChatBodyListItemProps\n): message is MessageListItemProps => {\n return message.type === 'message';\n};\n\nexport const isSystemMessageListItem = (\n message: ChatBodyListItemProps\n): message is SystemMessageListItemProps => {\n return message.type === 'system';\n};\n\nexport const isTypeIndicatorListItem = (\n message: ChatBodyListItemProps\n): message is TypeIndicatorListItemPops => {\n return message.type === 'typing';\n};\n"]}
@@ -176,7 +176,7 @@ export interface EmailComposerProps extends Pick<EmailProps, 'suggestions' | 'on
176
176
  value: EmailUser['emailAddress'][];
177
177
  error?: string;
178
178
  };
179
- /** Object to hold Cc address/addresses and field error */
179
+ /** Object to hold Cc address/addresses and field error */
180
180
  cc?: {
181
181
  value: EmailUser['emailAddress'][];
182
182
  error?: string;
@@ -196,7 +196,7 @@ export interface EmailComposerProps extends Pick<EmailProps, 'suggestions' | 'on
196
196
  defaultValue: string;
197
197
  error?: string;
198
198
  };
199
- /** Selected template id */
199
+ /** Selected template id */
200
200
  selectedTemplateId?: EmailTemplate['id'];
201
201
  /** List of attachments */
202
202
  attachments?: FileUploadItemProps[];
@@ -305,7 +305,7 @@ export interface EmailSummaryListProps extends BaseProps {
305
305
  loading?: boolean;
306
306
  /** Callback to fetch more rows */
307
307
  onLoadMore?: () => void;
308
- /** Empty message when there are no email summary items */
308
+ /** Empty message when there are no email summary items */
309
309
  emptyMessage?: EmptyStateProps['message'];
310
310
  /** Id of the EmailSummaryItem */
311
311
  currentItemId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Email.types.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kEAAkE,CAAC;AACzG,OAAO,EACL,SAAS,EACT,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE1E,MAAM,WAAW,aAAa;IAC5B,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,4BAA4B;IAC5B,SAAS,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;CACnD;AAED,MAAM,WAAW,SAAS;IACxB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,QA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MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,iBAAiB,CAAC;CAC5B"}
1
+ {"version":3,"file":"Email.types.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kEAAkE,CAAC;AACzG,OAAO,EACL,SAAS,EACT,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE1E,MAAM,WAAW,aAAa;IAC5B,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,4BAA4B;IAC5B,SAAS,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;CACnD;AAED,MAAM,WAAW,SAAS;IACxB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf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,GAAG;QAChE,aAAa,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;KACxC,CAAC;IACF,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAClD,8BAA8B;IAC9B,MAAM,CAAC,EAAE;QACP,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAClC,IAAI,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;KAClC,CAAC;IACF,qDAAqD;IACrD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,yBAAyB;IACzB,gBAAgB,CAAC,EAAE,SAAS,CAAC;CAC9B;AAED,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,kCAAkC;IAClC,MAAM,CAAC,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACrC,2CAA2C;IAC3C,OAAO,EAAE,SAAS,CAAC;IACnB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,wDAAwD;IACxD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,uFAAuF;IACvF,qBAAqB,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACvD,gCAAgC;IAChC,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,MAAM,WAAW,2BAA4B,SAAQ,SAAS;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,iBAAiB,CAAC;CAC5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"Email.types.js","sourceRoot":"","sources":["../../../src/components/Email/Email.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactNode, Ref, MouseEvent, MouseEventHandler } from 'react';\n\nimport { UtilitiesSummaryProps } from '@pega/cosmos-react-work/lib/components/CaseView/UtilitiesSummary';\nimport {\n BaseProps,\n AvatarProps,\n SentimentProps,\n FileDisplayProps,\n FileUploadItemProps,\n OmitStrict,\n MenuProps,\n MenuItemProps,\n TooltipProps,\n NoChildrenProp,\n EmptyStateProps,\n ProgressProps,\n PageTemplateProps,\n PopoverProps,\n BannerProps\n} from '@pega/cosmos-react-core';\nimport { EditorState, RichTextEditorProps } from '@pega/cosmos-react-rte';\n\nexport interface EmailTemplate {\n /** Template title */\n title: string;\n /** Template id */\n id: string;\n /** categorized templates */\n templates?: Pick<EmailTemplate, 'title' | 'id'>[];\n}\n\nexport interface EmailUser {\n /** Short name of the User */\n shortName: string;\n /** Full name of the User */\n fullName: string;\n /** Email of the User */\n emailAddress: string;\n /** Avatar props of the User */\n avatarProps?: Partial<AvatarProps>;\n}\n\nexport interface EntityHighlightMapping {\n value: string;\n type: string;\n variant: number;\n names?: string[];\n icon?: string;\n}\n\nexport interface EntityMatch extends EntityHighlightMapping, MatchRange {\n matchedText: string;\n children?: EntityMatch[];\n}\n\nexport interface MatchRange {\n start: number;\n end: number;\n}\n\nexport interface ContextMenuProps extends Pick<MenuProps, 'loading'> {\n /** Callback triggered when a menu item is clicked */\n onItemClick: (selectedValue: { fieldName: string; fieldValue: string }) => void;\n /** Menu items */\n items: MenuItemProps[];\n /** Imperative handle */\n handle: Ref<ContextMenuHandleValue>;\n}\n\nexport interface ContextMenuHandleValue {\n setItems: (contextMenuItems: ContextMenuProps['items']) => void;\n setOpen: (open: boolean) => void;\n setLoading: (loading: boolean) => void;\n}\n\nexport interface EmailProps extends BaseProps, NoChildrenProp {\n /** Ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Unique ID for this email record */\n id: string;\n /** Timestamp of this email as ISO8601 string, timestamp or native Date object. */\n timeStamp: Date | number | string;\n /** From email */\n from: EmailUser;\n /** To email */\n to: EmailUser[];\n /** Carbon copy of email users list */\n cc?: EmailUser[];\n /** Blind carbon copy of email users list */\n bcc?: EmailUser[];\n /** Sentiment */\n sentiment?: SentimentProps;\n /** Subject of the email */\n subject?: string;\n /** Body */\n body?: string;\n /** Forwarded content */\n forwardedContent?: string;\n /**\n * Entity highlight mapping\n * This requires body to be passed as a string with html tags\n */\n entityHighlightMapping?: EntityHighlightMapping[];\n /** onReply callback */\n onReply?: (id: EmailProps['id']) => void;\n /** onForward Callback */\n onForward?: (id: EmailProps['id']) => void;\n /** onReply callback */\n onReplyAll?: (id: EmailProps['id']) => void;\n /** Edit draft callback */\n onEditDraft?: (id: EmailProps['id']) => void;\n /** Delete draft Callback */\n onDeleteDraft?: (id: EmailProps['id']) => void;\n /** Show either undelivered or draft status on email */\n status?: 'undelivered' | 'draft';\n /** List of suggestions */\n suggestions?: EmailTemplate[];\n /** Callback that triggers on click of tag */\n onSuggestionClick?: (id: EmailProps['id'], suggestionId: EmailTemplate['id']) => void;\n /** Flag that indicates if email is unread\n * @default false\n */\n unRead?: boolean;\n /** Attachments list */\n attachments?: FileDisplayProps[];\n /**\n * Context menu props. Context menu is disabled if it is not provided.\n * To set the context menu items, use the setContextMenuItems method provided on handle\n */\n contextMenu?: OmitStrict<ContextMenuProps, 'items' | 'loading'> & {\n /** Callback on right click of content */\n onContextMenu: (id: EmailProps['id'], e: MouseEvent) => void;\n };\n /** Show banner for undelivered email */\n banner?: Pick<BannerProps, 'messages'>;\n}\n\nexport interface EmailConversationProps extends BaseProps {\n /** ref to the element */\n ref?: Ref<HTMLLIElement>;\n /** Unique ID for this email conversation record */\n id: string;\n /** List of mails */\n emails: EmailProps[];\n /** Sender(s) of this email conversation */\n from: EmailUser;\n /** Recipient(s) of this email conversation */\n to: EmailUser[];\n /** Count of unread emails */\n unReadEmailCount?: number;\n /** Timestamp of this conversation as ISO8601 string, timestamp or native Date object. */\n timeStamp: Date | string | number;\n /** Flag that indicates if email conversation is expanded */\n isCollapsed?: boolean;\n /** Flag to set if conversation is spun off from forwarded email */\n isForwarded?: boolean;\n /** Callback when email conversation is collapsed */\n onCollapse?: () => void;\n /** Callback when email conversation is expanded */\n onExpand?: () => void;\n /** Flag that indicates if email conversation contains drafted emails */\n drafts?: boolean;\n /** Flag that indicates if email conversation contains undelivered emails */\n undelivered?: boolean;\n}\n\nexport type EmailResponseType = 'reply' | 'replyAll' | 'forward';\n\nexport type EmailComposerFieldType =\n | 'to'\n | 'cc'\n | 'bcc'\n | 'subject'\n | 'bodyContent'\n | 'attachments'\n | 'emailAccount'\n | 'responseType'\n | 'selectedTemplateId';\n\nexport type EmailComposerValueType<T> = T extends 'to' | 'cc' | 'bcc'\n ? EmailUser['emailAddress'][]\n : T extends 'subject' | 'bodyContent'\n ? string\n : T extends 'selectedTemplateId'\n ? string\n : T extends 'attachments'\n ? FileUploadItemProps[]\n : T extends 'responseType'\n ? EmailResponseType\n : T extends 'emailAccount'\n ? string\n : never;\n\nexport interface EmailDirectRecipients {\n /** To address/addresses in case of reply response type on email. */\n reply: EmailUser['emailAddress'][];\n /** To address/addresses in case of replyAll response type on email. */\n replyAll: EmailUser['emailAddress'][];\n /** To address/addresses in case of forward response type on email. */\n forward?: EmailUser['emailAddress'][];\n}\n\nexport interface EmailComposerHandleValue {\n replaceBodyContent: (content: string) => void;\n updateImage: EditorState['appendImage'];\n activate: () => void;\n setCursorLocationToStart: EditorState['setCursorLocationToStart'];\n}\n\nexport interface EmailComposerProps\n extends Pick<EmailProps, 'suggestions' | 'onSuggestionClick'>,\n BaseProps,\n NoChildrenProp {\n /** Show loader until the background process completes */\n progress?: boolean | Pick<ProgressProps, 'message'>;\n /** Object containing full list of email participants. */\n participants: EmailUser[];\n /** Object containing full list of sender email accounts */\n senderAccounts?: EmailUser[];\n /** Data for all fields of the composer */\n data: {\n /** Object to hold selected email account and field error */\n emailAccount?: {\n value: EmailUser['emailAddress'];\n error?: string;\n };\n /** Object to hold to address/addresses and field error */\n to?: {\n value: EmailUser['emailAddress'][];\n error?: string;\n };\n /** Object to hold Cc address/addresses and field error */\n cc?: {\n value: EmailUser['emailAddress'][];\n error?: string;\n };\n /** Object to hold Bcc address/addresses and field error */\n bcc?: {\n value: EmailUser['emailAddress'][];\n error?: string;\n };\n /** Object to hold the subject value and error */\n subject: {\n value: string;\n error?: string;\n };\n /** Object containing the default body content and error */\n bodyContent: {\n defaultValue: string;\n error?: string;\n };\n /** Selected template id */\n selectedTemplateId?: EmailTemplate['id'];\n /** List of attachments */\n attachments?: FileUploadItemProps[];\n /** Email response types */\n responseType?: EmailResponseType;\n };\n /** Callback when user clicks on the send button */\n onSend: () => void;\n /** Callback when user clicks on the save button */\n onSave?: () => void;\n /** Callback when image is added */\n onImageAdded?: RichTextEditorProps['onImageAdded'];\n /** Region to show more actions in footer */\n footerMoreActions?: ReactNode;\n /** Templates for drafting email */\n templates?: EmailTemplate[];\n /** Callback when user clicks on cancel */\n onCancel: () => void;\n /**\n * Callback to handle external entry validation for to, cc and bcc fields while adding a new email to the list\n * If returned true considers the entry to be a valid entry\n */\n externalValidator?: (value: string) => boolean;\n /** Ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Imperative handle for composer */\n handle?: Ref<EmailComposerHandleValue>;\n /** Change handler to all fields */\n onChange: <T extends EmailComposerFieldType>(field: T, value: EmailComposerValueType<T>) => void;\n}\n\nexport interface EmailShellProps extends BaseProps {\n /** ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Region for header */\n headerProps?: {\n /** Region for actions */\n actions?: ReactNode;\n /** Subject of the email conversations list */\n subject?: string;\n };\n /** Email conversations */\n conversations?: EmailConversationProps[];\n /** Shows only one conversation at a time */\n autoCollapse?: boolean;\n}\n\nexport interface EmailSummaryItemProps extends BaseProps {\n /** Id of each summary item */\n id: string;\n /** List of from participant names of the conversations */\n activeParticipants: EmailUser[];\n /** Email body of last email in the email */\n message: string;\n /** Timestamp of the latest email */\n timeStamp: Date | string | number;\n /** Top topic of an email */\n topic?: string;\n /** Sentiment */\n sentiment?: SentimentProps;\n /** Urgency of an email */\n urgency?: number;\n /** Total number of unread emails in the email */\n unreadEmailCount?: number;\n /** Is the email currently active */\n active?: boolean;\n /** On click of email item */\n onSelect: (id: EmailSummaryItemProps['id']) => void;\n /** Flag that indicates if email summary item contains drafted emails */\n drafts?: EmailConversationProps['drafts'];\n /** Flag that indicates if email summary item contains undelivered emails */\n undelivered?: EmailConversationProps['undelivered'];\n /** ref to the element */\n ref?: Ref<HTMLLIElement>;\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 EmailSummaryListProps extends BaseProps {\n /** List of email categories */\n categories?: MenuProps['items'];\n /** Handles category change */\n onCategoryClick?: MenuItemProps['onClick'];\n /** List of EmailItems items */\n items: OmitStrict<EmailSummaryItemProps, 'onSelect' | 'active'>[];\n /** Total number of unread email count */\n unreadEmailCount?: number;\n /** A set of filters to apply to the email inbox. */\n filters?: Filter[];\n /** A callback that runs when a filter is clicked. */\n onFilterChange?: (filterId: Filter['id'], on: boolean) => void;\n /** onClick of list item */\n onItemClick: (id: EmailSummaryItemProps['id']) => void;\n /** Indicates if the data is being currently loading */\n loading?: boolean;\n /** Callback to fetch more rows */\n onLoadMore?: () => void;\n /** Empty message when there are no email summary items */\n emptyMessage?: EmptyStateProps['message'];\n /** Id of the EmailSummaryItem */\n currentItemId?: string;\n /** Use summary list as selectable list */\n selectable?: boolean;\n /** ref to the element */\n ref?: Ref<HTMLOListElement>;\n}\n\nexport interface EmailEntityProps extends BaseProps {\n entity: OmitStrict<EntityHighlightMapping, 'names'> & { description?: TooltipProps['children'] };\n ref?: Ref<HTMLElement>;\n}\n\nexport interface TargetProps {\n cursorPosition: { x: number; y: number };\n targetNode: Node | null;\n}\n\nexport interface ContextMenuPopoverProps extends BaseProps, TargetProps {\n contextMenu: ContextMenuProps;\n show: PopoverProps['show'];\n ref?: PopoverProps['ref'];\n}\n\nexport interface EntityListProps extends BaseProps {\n content: {\n name: string;\n value?: {\n id: string;\n entity: OmitStrict<EntityHighlightMapping, 'names'>;\n }[];\n }[];\n\n header?: {\n icon: string;\n text: string;\n };\n /**\n * Context menu props. Context menu is disabled if it is not provided.\n * To set the context menu items, use the setContextMenuItems method provided on handle\n */\n contextMenu?: OmitStrict<ContextMenuProps, 'items' | 'loading'> & {\n onContextMenu: (e: MouseEvent) => void;\n };\n ref?: Ref<HTMLDivElement>;\n}\n\nexport interface EmailManagerProps extends BaseProps {\n /** Header of the component */\n header?: {\n title: PageTemplateProps['title'];\n icon?: PageTemplateProps['icon'];\n };\n /** A region to hold an EmailSummaryList component */\n list?: ReactNode;\n /** Email case details */\n emailCaseDetails?: ReactNode;\n}\n\nexport interface EmailCaseViewProps extends BaseProps {\n /** Header of the the component */\n header?: EmailManagerProps['header'];\n /** A region to hold an Emails component */\n content: ReactNode;\n /** A region above the center column to display banners. */\n banners?: ReactNode;\n /** A region that is used to hold Utility components. */\n utilities?: ReactNode;\n /** The utilities summary array will be used to render the minimized utilities card. */\n utilitiesSummaryItems?: UtilitiesSummaryProps['items'];\n /** Expand/Collapse utilities */\n defaultUtilitiesExpanded?: boolean;\n}\n\nexport interface EmailNotificationPanelProps extends BaseProps {\n count: number;\n label: string;\n onClick: MouseEventHandler;\n}\n"]}
1
+ {"version":3,"file":"Email.types.js","sourceRoot":"","sources":["../../../src/components/Email/Email.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactNode, Ref, MouseEvent, MouseEventHandler } from 'react';\n\nimport { UtilitiesSummaryProps } from '@pega/cosmos-react-work/lib/components/CaseView/UtilitiesSummary';\nimport {\n BaseProps,\n AvatarProps,\n SentimentProps,\n FileDisplayProps,\n FileUploadItemProps,\n OmitStrict,\n MenuProps,\n MenuItemProps,\n TooltipProps,\n NoChildrenProp,\n EmptyStateProps,\n ProgressProps,\n PageTemplateProps,\n PopoverProps,\n BannerProps\n} from '@pega/cosmos-react-core';\nimport { EditorState, RichTextEditorProps } from '@pega/cosmos-react-rte';\n\nexport interface EmailTemplate {\n /** Template title */\n title: string;\n /** Template id */\n id: string;\n /** categorized templates */\n templates?: Pick<EmailTemplate, 'title' | 'id'>[];\n}\n\nexport interface EmailUser {\n /** Short name of the User */\n shortName: string;\n /** Full name of the User */\n fullName: string;\n /** Email of the User */\n emailAddress: string;\n /** Avatar props of the User */\n avatarProps?: Partial<AvatarProps>;\n}\n\nexport interface EntityHighlightMapping {\n value: string;\n type: string;\n variant: number;\n names?: string[];\n icon?: string;\n}\n\nexport interface EntityMatch extends EntityHighlightMapping, MatchRange {\n matchedText: string;\n children?: EntityMatch[];\n}\n\nexport interface MatchRange {\n start: number;\n end: number;\n}\n\nexport interface ContextMenuProps extends Pick<MenuProps, 'loading'> {\n /** Callback triggered when a menu item is clicked */\n onItemClick: (selectedValue: { fieldName: string; fieldValue: string }) => void;\n /** Menu items */\n items: MenuItemProps[];\n /** Imperative handle */\n handle: Ref<ContextMenuHandleValue>;\n}\n\nexport interface ContextMenuHandleValue {\n setItems: (contextMenuItems: ContextMenuProps['items']) => void;\n setOpen: (open: boolean) => void;\n setLoading: (loading: boolean) => void;\n}\n\nexport interface EmailProps extends BaseProps, NoChildrenProp {\n /** Ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Unique ID for this email record */\n id: string;\n /** Timestamp of this email as ISO8601 string, timestamp or native Date object. */\n timeStamp: Date | number | string;\n /** From email */\n from: EmailUser;\n /** To email */\n to: EmailUser[];\n /** Carbon copy of email users list */\n cc?: EmailUser[];\n /** Blind carbon copy of email users list */\n bcc?: EmailUser[];\n /** Sentiment */\n sentiment?: SentimentProps;\n /** Subject of the email */\n subject?: string;\n /** Body */\n body?: string;\n /** Forwarded content */\n forwardedContent?: string;\n /**\n * Entity highlight mapping\n * This requires body to be passed as a string with html tags\n */\n entityHighlightMapping?: EntityHighlightMapping[];\n /** onReply callback */\n onReply?: (id: EmailProps['id']) => void;\n /** onForward Callback */\n onForward?: (id: EmailProps['id']) => void;\n /** onReply callback */\n onReplyAll?: (id: EmailProps['id']) => void;\n /** Edit draft callback */\n onEditDraft?: (id: EmailProps['id']) => void;\n /** Delete draft Callback */\n onDeleteDraft?: (id: EmailProps['id']) => void;\n /** Show either undelivered or draft status on email */\n status?: 'undelivered' | 'draft';\n /** List of suggestions */\n suggestions?: EmailTemplate[];\n /** Callback that triggers on click of tag */\n onSuggestionClick?: (id: EmailProps['id'], suggestionId: EmailTemplate['id']) => void;\n /** Flag that indicates if email is unread\n * @default false\n */\n unRead?: boolean;\n /** Attachments list */\n attachments?: FileDisplayProps[];\n /**\n * Context menu props. Context menu is disabled if it is not provided.\n * To set the context menu items, use the setContextMenuItems method provided on handle\n */\n contextMenu?: OmitStrict<ContextMenuProps, 'items' | 'loading'> & {\n /** Callback on right click of content */\n onContextMenu: (id: EmailProps['id'], e: MouseEvent) => void;\n };\n /** Show banner for undelivered email */\n banner?: Pick<BannerProps, 'messages'>;\n}\n\nexport interface EmailConversationProps extends BaseProps {\n /** ref to the element */\n ref?: Ref<HTMLLIElement>;\n /** Unique ID for this email conversation record */\n id: string;\n /** List of mails */\n emails: EmailProps[];\n /** Sender(s) of this email conversation */\n from: EmailUser;\n /** Recipient(s) of this email conversation */\n to: EmailUser[];\n /** Count of unread emails */\n unReadEmailCount?: number;\n /** Timestamp of this conversation as ISO8601 string, timestamp or native Date object. */\n timeStamp: Date | string | number;\n /** Flag that indicates if email conversation is expanded */\n isCollapsed?: boolean;\n /** Flag to set if conversation is spun off from forwarded email */\n isForwarded?: boolean;\n /** Callback when email conversation is collapsed */\n onCollapse?: () => void;\n /** Callback when email conversation is expanded */\n onExpand?: () => void;\n /** Flag that indicates if email conversation contains drafted emails */\n drafts?: boolean;\n /** Flag that indicates if email conversation contains undelivered emails */\n undelivered?: boolean;\n}\n\nexport type EmailResponseType = 'reply' | 'replyAll' | 'forward';\n\nexport type EmailComposerFieldType =\n | 'to'\n | 'cc'\n | 'bcc'\n | 'subject'\n | 'bodyContent'\n | 'attachments'\n | 'emailAccount'\n | 'responseType'\n | 'selectedTemplateId';\n\nexport type EmailComposerValueType<T> = T extends 'to' | 'cc' | 'bcc'\n ? EmailUser['emailAddress'][]\n : T extends 'subject' | 'bodyContent'\n ? string\n : T extends 'selectedTemplateId'\n ? string\n : T extends 'attachments'\n ? FileUploadItemProps[]\n : T extends 'responseType'\n ? EmailResponseType\n : T extends 'emailAccount'\n ? string\n : never;\n\nexport interface EmailDirectRecipients {\n /** To address/addresses in case of reply response type on email. */\n reply: EmailUser['emailAddress'][];\n /** To address/addresses in case of replyAll response type on email. */\n replyAll: EmailUser['emailAddress'][];\n /** To address/addresses in case of forward response type on email. */\n forward?: EmailUser['emailAddress'][];\n}\n\nexport interface EmailComposerHandleValue {\n replaceBodyContent: (content: string) => void;\n updateImage: EditorState['appendImage'];\n activate: () => void;\n setCursorLocationToStart: EditorState['setCursorLocationToStart'];\n}\n\nexport interface EmailComposerProps\n extends Pick<EmailProps, 'suggestions' | 'onSuggestionClick'>,\n BaseProps,\n NoChildrenProp {\n /** Show loader until the background process completes */\n progress?: boolean | Pick<ProgressProps, 'message'>;\n /** Object containing full list of email participants. */\n participants: EmailUser[];\n /** Object containing full list of sender email accounts */\n senderAccounts?: EmailUser[];\n /** Data for all fields of the composer */\n data: {\n /** Object to hold selected email account and field error */\n emailAccount?: {\n value: EmailUser['emailAddress'];\n error?: string;\n };\n /** Object to hold to address/addresses and field error */\n to?: {\n value: EmailUser['emailAddress'][];\n error?: string;\n };\n /** Object to hold Cc address/addresses and field error */\n cc?: {\n value: EmailUser['emailAddress'][];\n error?: string;\n };\n /** Object to hold Bcc address/addresses and field error */\n bcc?: {\n value: EmailUser['emailAddress'][];\n error?: string;\n };\n /** Object to hold the subject value and error */\n subject: {\n value: string;\n error?: string;\n };\n /** Object containing the default body content and error */\n bodyContent: {\n defaultValue: string;\n error?: string;\n };\n /** Selected template id */\n selectedTemplateId?: EmailTemplate['id'];\n /** List of attachments */\n attachments?: FileUploadItemProps[];\n /** Email response types */\n responseType?: EmailResponseType;\n };\n /** Callback when user clicks on the send button */\n onSend: () => void;\n /** Callback when user clicks on the save button */\n onSave?: () => void;\n /** Callback when image is added */\n onImageAdded?: RichTextEditorProps['onImageAdded'];\n /** Region to show more actions in footer */\n footerMoreActions?: ReactNode;\n /** Templates for drafting email */\n templates?: EmailTemplate[];\n /** Callback when user clicks on cancel */\n onCancel: () => void;\n /**\n * Callback to handle external entry validation for to, cc and bcc fields while adding a new email to the list\n * If returned true considers the entry to be a valid entry\n */\n externalValidator?: (value: string) => boolean;\n /** Ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Imperative handle for composer */\n handle?: Ref<EmailComposerHandleValue>;\n /** Change handler to all fields */\n onChange: <T extends EmailComposerFieldType>(field: T, value: EmailComposerValueType<T>) => void;\n}\n\nexport interface EmailShellProps extends BaseProps {\n /** ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Region for header */\n headerProps?: {\n /** Region for actions */\n actions?: ReactNode;\n /** Subject of the email conversations list */\n subject?: string;\n };\n /** Email conversations */\n conversations?: EmailConversationProps[];\n /** Shows only one conversation at a time */\n autoCollapse?: boolean;\n}\n\nexport interface EmailSummaryItemProps extends BaseProps {\n /** Id of each summary item */\n id: string;\n /** List of from participant names of the conversations */\n activeParticipants: EmailUser[];\n /** Email body of last email in the email */\n message: string;\n /** Timestamp of the latest email */\n timeStamp: Date | string | number;\n /** Top topic of an email */\n topic?: string;\n /** Sentiment */\n sentiment?: SentimentProps;\n /** Urgency of an email */\n urgency?: number;\n /** Total number of unread emails in the email */\n unreadEmailCount?: number;\n /** Is the email currently active */\n active?: boolean;\n /** On click of email item */\n onSelect: (id: EmailSummaryItemProps['id']) => void;\n /** Flag that indicates if email summary item contains drafted emails */\n drafts?: EmailConversationProps['drafts'];\n /** Flag that indicates if email summary item contains undelivered emails */\n undelivered?: EmailConversationProps['undelivered'];\n /** ref to the element */\n ref?: Ref<HTMLLIElement>;\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 EmailSummaryListProps extends BaseProps {\n /** List of email categories */\n categories?: MenuProps['items'];\n /** Handles category change */\n onCategoryClick?: MenuItemProps['onClick'];\n /** List of EmailItems items */\n items: OmitStrict<EmailSummaryItemProps, 'onSelect' | 'active'>[];\n /** Total number of unread email count */\n unreadEmailCount?: number;\n /** A set of filters to apply to the email inbox. */\n filters?: Filter[];\n /** A callback that runs when a filter is clicked. */\n onFilterChange?: (filterId: Filter['id'], on: boolean) => void;\n /** onClick of list item */\n onItemClick: (id: EmailSummaryItemProps['id']) => void;\n /** Indicates if the data is being currently loading */\n loading?: boolean;\n /** Callback to fetch more rows */\n onLoadMore?: () => void;\n /** Empty message when there are no email summary items */\n emptyMessage?: EmptyStateProps['message'];\n /** Id of the EmailSummaryItem */\n currentItemId?: string;\n /** Use summary list as selectable list */\n selectable?: boolean;\n /** ref to the element */\n ref?: Ref<HTMLOListElement>;\n}\n\nexport interface EmailEntityProps extends BaseProps {\n entity: OmitStrict<EntityHighlightMapping, 'names'> & { description?: TooltipProps['children'] };\n ref?: Ref<HTMLElement>;\n}\n\nexport interface TargetProps {\n cursorPosition: { x: number; y: number };\n targetNode: Node | null;\n}\n\nexport interface ContextMenuPopoverProps extends BaseProps, TargetProps {\n contextMenu: ContextMenuProps;\n show: PopoverProps['show'];\n ref?: PopoverProps['ref'];\n}\n\nexport interface EntityListProps extends BaseProps {\n content: {\n name: string;\n value?: {\n id: string;\n entity: OmitStrict<EntityHighlightMapping, 'names'>;\n }[];\n }[];\n\n header?: {\n icon: string;\n text: string;\n };\n /**\n * Context menu props. Context menu is disabled if it is not provided.\n * To set the context menu items, use the setContextMenuItems method provided on handle\n */\n contextMenu?: OmitStrict<ContextMenuProps, 'items' | 'loading'> & {\n onContextMenu: (e: MouseEvent) => void;\n };\n ref?: Ref<HTMLDivElement>;\n}\n\nexport interface EmailManagerProps extends BaseProps {\n /** Header of the component */\n header?: {\n title: PageTemplateProps['title'];\n icon?: PageTemplateProps['icon'];\n };\n /** A region to hold an EmailSummaryList component */\n list?: ReactNode;\n /** Email case details */\n emailCaseDetails?: ReactNode;\n}\n\nexport interface EmailCaseViewProps extends BaseProps {\n /** Header of the the component */\n header?: EmailManagerProps['header'];\n /** A region to hold an Emails component */\n content: ReactNode;\n /** A region above the center column to display banners. */\n banners?: ReactNode;\n /** A region that is used to hold Utility components. */\n utilities?: ReactNode;\n /** The utilities summary array will be used to render the minimized utilities card. */\n utilitiesSummaryItems?: UtilitiesSummaryProps['items'];\n /** Expand/Collapse utilities */\n defaultUtilitiesExpanded?: boolean;\n}\n\nexport interface EmailNotificationPanelProps extends BaseProps {\n count: number;\n label: string;\n onClick: MouseEventHandler;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"EmailConversation.d.ts","sourceRoot":"","sources":["../../../src/components/Email/EmailConversation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAA8C,MAAM,OAAO,CAAC;AAKlG,OAAO,EAQL,YAAY,EAUb,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAWvD,eAAO,MAAM,2BAA2B,iLAEvC,CAAC;AAIF,eAAO,MAAM,6BAA6B,iLAGzC,CAAC;AAGF,eAAO,MAAM,wBAAwB;eAA8B,OAAO;SASzE,CAAC;AAGF,eAAO,MAAM,iBAAiB,yGAoB5B,CAAC;AAIH,eAAO,MAAM,uBAAuB;;;SAalC,CAAC;AAGH,eAAO,MAAM,yBAAyB,wKAwBpC,CAAC;AA6DH,QAAA,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,sBAAsB,GAAG,YAAY,CA6I/E,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"EmailConversation.d.ts","sourceRoot":"","sources":["../../../src/components/Email/EmailConversation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAA8C,MAAM,OAAO,CAAC;AAKlG,OAAO,EAQL,YAAY,EAUb,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAWvD,eAAO,MAAM,2BAA2B,iLAEvC,CAAC;AAIF,eAAO,MAAM,6BAA6B,iLAGzC,CAAC;AAGF,eAAO,MAAM,wBAAwB;eAA8B,OAAO;SASzE,CAAC;AAGF,eAAO,MAAM,iBAAiB,yGAe5B,CAAC;AAIH,eAAO,MAAM,uBAAuB;;;SAalC,CAAC;AAGH,eAAO,MAAM,yBAAyB,wKAwBpC,CAAC;AA6DH,QAAA,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,sBAAsB,GAAG,YAAY,CA6I/E,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -39,12 +39,7 @@ export const StyledUnReadCount = styled.div(({ theme: { base } }) => {
39
39
  color: ${readableTextColor};
40
40
  padding: 0 ${base.spacing};
41
41
  font-weight: ${base['font-weight']['semi-bold']};
42
-
43
- /* stylelint-disable declaration-block-no-duplicate-properties */
44
42
  width: fit-content;
45
- width: -moz-fit-content;
46
-
47
- /* stylelint-enable declaration-block-no-duplicate-properties */
48
43
  `;
49
44
  });
50
45
  StyledUnReadCount.defaultProps = defaultThemeProp;
@@ -1 +1 @@
1
- {"version":3,"file":"EmailConversation.js","sourceRoot":"","sources":["../../../src/components/Email/EmailConversation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAsC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAClG,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AACnG,OAAO,EACL,cAAc,EACd,IA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AAG,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,CAC9D,IAAI,IAAI,CAAC,SAAS,CAAC,CACpB,IAAI,EACL,KAAC,eAAe,IAAC,OAAO,EAAC,UAAU,EAAC,MAAM,EAAC,OAAO,EAAC,KAAK,EAAE,SAAS,GAAI,IAClE,CACR,GACI,IACF,EAEP,MAAC,cAAc,IACb,EAAE,EAAE,IAAI,EACR,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAClC,SAAS,EAAE,cAAc,EACzB,gBAAgB,EAAE,UAAU,EAC5B,cAAc,EAAE,QAAQ,EACxB,IAAI,EAAC,QAAQ,qBACI,uBAAuB,EAAE,EAAE,EAC5C,EAAE,EAAE,uBAAuB,EAAE,EAAE,aAE9B,CAAC,CAAC,gBAAgB,IAAI,CACrB,KAAC,IAAI,IAAC,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE,qBAAqB,EAAE,EAAE,EAAE,OAAO,EAAC,WAAW,YAC5E,CAAC,CAAC,kBAAkB,EAAE,CAAC,gBAAgB,CAAC,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,GAClE,CACR,EACA,MAAM;wBACL,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;4BACjB,OAAO,KAAC,yBAAyB,OAAoB,KAAK,IAAnB,KAAK,CAAC,EAAE,CAAe,CAAC;wBACjE,CAAC,CAAC,IACW,IACO,CAC3B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, useRef, useState, useMemo } from 'react';\nimport styled, { css } from 'styled-components';\nimport { mix, readableColor } from 'polished';\n\nimport * as caretDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-down.icon';\nimport {\n ExpandCollapse,\n Flex,\n Icon,\n registerIcon,\n Text,\n useI18n,\n defaultThemeProp,\n ForwardProps,\n useAfterInitialEffect,\n DateTimeDisplay,\n readableHue,\n useBreakpoint,\n useConfiguration,\n StyledIcon,\n tryCatch,\n useDirection,\n Status\n} from '@pega/cosmos-react-core';\n\nimport Email from './Email';\nimport { EmailConversationProps } from './Email.types';\n\nregisterIcon(caretDownIcon);\n\nconst EmailParticipantTextCss = css`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n`;\n\nexport const StyledEmailParticipantsText = styled(Text)`\n ${EmailParticipantTextCss}\n`;\n\nStyledEmailParticipantsText.defaultProps = defaultThemeProp;\n\nexport const StyledCompactTimeStampDisplay = styled(Text)`\n ${EmailParticipantTextCss}\n margin-top: calc(${props => props.theme.base.spacing} / 2);\n`;\nStyledCompactTimeStampDisplay.defaultProps = defaultThemeProp;\n\nexport const StyledConversationHeader = styled.header<{ collapsed: boolean }>(\n ({ theme, collapsed }) => {\n return css`\n border-bottom: ${collapsed ? 0 : '0.0625rem'} solid ${theme.base.palette['border-line']};\n position: sticky;\n top: 0;\n z-index: 1;\n `;\n }\n);\nStyledConversationHeader.defaultProps = defaultThemeProp;\n\nexport const StyledUnReadCount = styled.div(({ theme: { base } }) => {\n const readableBackground = readableHue(\n base.palette['brand-primary'],\n base.palette['primary-background']\n );\n const readableTextColor = readableColor(readableBackground);\n\n return css`\n align-self: flex-start;\n background-color: ${readableBackground};\n color: ${readableTextColor};\n padding: 0 ${base.spacing};\n font-weight: ${base['font-weight']['semi-bold']};\n\n /* stylelint-disable declaration-block-no-duplicate-properties */\n width: fit-content;\n width: -moz-fit-content;\n\n /* stylelint-enable declaration-block-no-duplicate-properties */\n `;\n});\n\nStyledUnReadCount.defaultProps = defaultThemeProp;\n\nexport const StyledEmailConversation = styled.li<{\n singleConversation?: boolean;\n showHeader?: boolean;\n}>(({ theme: { base }, singleConversation, showHeader }) => {\n return css`\n margin-bottom: ${base.spacing};\n border-radius: ${singleConversation && showHeader\n ? `0 0 ${base['border-radius']} ${base['border-radius']}`\n : base['border-radius']};\n overflow: hidden;\n background-color: ${base.palette['primary-background']};\n list-style-type: none;\n `;\n});\nStyledEmailConversation.defaultProps = defaultThemeProp;\n\nexport const StyledEmailInConversation = styled(Email)(({ unRead, theme: { base } }) => {\n const readableBackground = readableHue(\n base.palette['brand-primary'],\n base.palette['primary-background']\n );\n return css`\n padding: calc(2 * ${base.spacing}) 0;\n position: relative;\n :not(:last-child) {\n border-bottom: 0.0625rem solid ${base.palette['border-line']};\n }\n ${unRead &&\n css`\n &::before {\n content: '';\n background-color: ${readableBackground};\n position: absolute;\n inset: 0;\n height: calc(100% + 0.0625rem);\n top: -0.0625rem;\n width: 0.125rem;\n }\n `}\n `;\n});\nStyledEmailInConversation.defaultProps = defaultThemeProp;\n\nconst StyledUnreadIndicator = styled.span<{ isVisible: boolean }>(({ theme, isVisible }) => {\n const readableBackground = readableHue(\n theme.base.palette['brand-primary'],\n theme.base.palette['primary-background']\n );\n\n const diameter = '0.375rem';\n\n return css`\n width: ${isVisible ? diameter : 0};\n margin: 0 ${isVisible ? 0 : '0.188rem'};\n height: ${diameter};\n display: inline-block;\n border-radius: 50%;\n background: ${readableBackground};\n position: relative;\n top: 0.375rem;\n align-self: flex-start;\n `;\n});\nStyledUnreadIndicator.defaultProps = defaultThemeProp;\n\nconst StyledConversationButton = styled.button(({ theme }) => {\n const hoverColor = tryCatch(() =>\n mix(0.85, theme.base.palette['primary-background'], theme.base.palette['brand-primary'])\n );\n return css`\n border-width: 0;\n width: 100%;\n padding: ${theme.base.spacing};\n background: ${theme.base.palette['primary-background']};\n position: sticky;\n top: 0;\n z-index: 1;\n\n &[aria-expanded='true'] {\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n }\n\n &:focus {\n background: ${theme.base.palette['secondary-background']};\n outline: none;\n }\n\n &:hover {\n background: ${hoverColor};\n outline: none;\n }\n\n & > ${StyledIcon} {\n align-self: flex-start;\n color: ${theme.base.palette['foreground-color']};\n }\n `;\n});\n\nStyledConversationButton.defaultProps = defaultThemeProp;\n\nconst EmailConversation: FunctionComponent<EmailConversationProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<EmailConversationProps>, ref: EmailConversationProps['ref']) => {\n const {\n id,\n emails,\n from,\n to,\n unReadEmailCount,\n timeStamp,\n isForwarded = false,\n isCollapsed = false,\n onCollapse,\n onExpand,\n undelivered,\n drafts,\n ...restProps\n } = props;\n const t = useI18n();\n const [collapsedState, setCollapsedState] = useState(isCollapsed);\n useAfterInitialEffect(() => {\n setCollapsedState(isCollapsed);\n }, [isCollapsed]);\n const onExpandCollapse = () => {\n setCollapsedState(!collapsedState);\n };\n\n const headerRef = useRef<HTMLDivElement>(null);\n const isSmallOrAbove = useBreakpoint('sm', {\n breakpointRef: headerRef,\n themeProp: 'content-width'\n });\n const { locale } = useConfiguration();\n const { rtl } = useDirection();\n\n const caretDirection = rtl ? 'caret-left' : 'caret-right';\n const generateRecipientList = useMemo(() => {\n const recipientElements = to.slice(0, 2).map((recipient, i) => {\n return `${recipient.shortName}${i < to.length - 1 ? ';' : ''} `;\n });\n if (to.length > 2) {\n return [...recipientElements, `+${to.length - 2} more`];\n }\n return recipientElements;\n }, [to]);\n\n return (\n <StyledEmailConversation {...restProps} id={id} ref={ref}>\n <Flex\n as={StyledConversationButton}\n id={`conversation-heading${id}`}\n aria-controls={id}\n aria-expanded={!collapsedState}\n container={{ gap: 1, alignItems: 'center', pad: 1 }}\n onClick={onExpandCollapse}\n ref={headerRef}\n >\n <Icon name={collapsedState ? caretDirection : 'caret-down'} />\n <StyledUnreadIndicator isVisible={!!unReadEmailCount} />\n <Flex\n container={{\n wrap: 'nowrap',\n alignItems: 'start',\n direction: 'column'\n }}\n item={{\n grow: 1,\n shrink: 1\n }}\n >\n <Flex container={{ gap: 1 }}>\n <Text variant='primary' as={StyledEmailParticipantsText}>\n {`${isForwarded ? 'FW' : t('from')}: ${from.fullName}`}\n </Text>\n\n {(undelivered || drafts) && (\n <>\n {undelivered && <Status variant='urgent'>{t('undelivered')}</Status>}\n {/* Passing Infinity for count so the correct plural translation is chosen\n along with an empty tokens array so that a count is not shown. */}\n {drafts && (\n <Status variant='pending'>{t('draft', [], { count: Infinity })}</Status>\n )}\n </>\n )}\n </Flex>\n <Text variant='secondary' as={StyledEmailParticipantsText}>\n {`${t('to')}: `}\n {generateRecipientList}\n </Text>\n {!isSmallOrAbove && (\n <Text variant='secondary' as={StyledCompactTimeStampDisplay}>\n {`${new Intl.DateTimeFormat(locale, { weekday: 'short' }).format(\n new Date(timeStamp)\n )}, `}\n <DateTimeDisplay variant='datetime' format='short' value={timeStamp} />\n </Text>\n )}\n </Flex>\n <Flex\n container={{\n gap: 1,\n alignItems: 'center'\n }}\n item={{\n shrink: 0\n }}\n >\n {isSmallOrAbove && (\n <Text variant='secondary' as={StyledEmailParticipantsText}>\n {`${new Intl.DateTimeFormat(locale, { weekday: 'short' }).format(\n new Date(timeStamp)\n )}, `}\n <DateTimeDisplay variant='datetime' format='short' value={timeStamp} />\n </Text>\n )}\n </Flex>\n </Flex>\n\n <ExpandCollapse\n as={Flex}\n container={{ direction: 'column' }}\n collapsed={collapsedState}\n onBeforeCollapse={onCollapse}\n onBeforeExpand={onExpand}\n role='region'\n aria-labelledby={`conversation-heading${id}`}\n id={`conversation-content${id}`}\n >\n {!!unReadEmailCount && (\n <Text as={StyledUnReadCount} id={`unread-emailCount-${id}`} variant='secondary'>\n {t('new_emails_count', [unReadEmailCount], { count: unReadEmailCount })}\n </Text>\n )}\n {emails &&\n emails.map(email => {\n return <StyledEmailInConversation key={email.id} {...email} />;\n })}\n </ExpandCollapse>\n </StyledEmailConversation>\n );\n }\n);\n\nexport default EmailConversation;\n"]}
1
+ {"version":3,"file":"EmailConversation.js","sourceRoot":"","sources":["../../../src/components/Email/EmailConversation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAsC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAClG,OAAO,MAAM,EA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import styled, { css } from 'styled-components';\nimport { mix, readableColor } from 'polished';\n\nimport * as caretDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-down.icon';\nimport {\n ExpandCollapse,\n Flex,\n Icon,\n registerIcon,\n Text,\n useI18n,\n defaultThemeProp,\n ForwardProps,\n useAfterInitialEffect,\n DateTimeDisplay,\n readableHue,\n useBreakpoint,\n useConfiguration,\n StyledIcon,\n tryCatch,\n useDirection,\n Status\n} from '@pega/cosmos-react-core';\n\nimport Email from './Email';\nimport { EmailConversationProps } from './Email.types';\n\nregisterIcon(caretDownIcon);\n\nconst EmailParticipantTextCss = css`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n`;\n\nexport const StyledEmailParticipantsText = styled(Text)`\n ${EmailParticipantTextCss}\n`;\n\nStyledEmailParticipantsText.defaultProps = defaultThemeProp;\n\nexport const StyledCompactTimeStampDisplay = styled(Text)`\n ${EmailParticipantTextCss}\n margin-top: calc(${props => props.theme.base.spacing} / 2);\n`;\nStyledCompactTimeStampDisplay.defaultProps = defaultThemeProp;\n\nexport const StyledConversationHeader = styled.header<{ collapsed: boolean }>(\n ({ theme, collapsed }) => {\n return css`\n border-bottom: ${collapsed ? 0 : '0.0625rem'} solid ${theme.base.palette['border-line']};\n position: sticky;\n top: 0;\n z-index: 1;\n `;\n }\n);\nStyledConversationHeader.defaultProps = defaultThemeProp;\n\nexport const StyledUnReadCount = styled.div(({ theme: { base } }) => {\n const readableBackground = readableHue(\n base.palette['brand-primary'],\n base.palette['primary-background']\n );\n const readableTextColor = readableColor(readableBackground);\n\n return css`\n align-self: flex-start;\n background-color: ${readableBackground};\n color: ${readableTextColor};\n padding: 0 ${base.spacing};\n font-weight: ${base['font-weight']['semi-bold']};\n width: fit-content;\n `;\n});\n\nStyledUnReadCount.defaultProps = defaultThemeProp;\n\nexport const StyledEmailConversation = styled.li<{\n singleConversation?: boolean;\n showHeader?: boolean;\n}>(({ theme: { base }, singleConversation, showHeader }) => {\n return css`\n margin-bottom: ${base.spacing};\n border-radius: ${singleConversation && showHeader\n ? `0 0 ${base['border-radius']} ${base['border-radius']}`\n : base['border-radius']};\n overflow: hidden;\n background-color: ${base.palette['primary-background']};\n list-style-type: none;\n `;\n});\nStyledEmailConversation.defaultProps = defaultThemeProp;\n\nexport const StyledEmailInConversation = styled(Email)(({ unRead, theme: { base } }) => {\n const readableBackground = readableHue(\n base.palette['brand-primary'],\n base.palette['primary-background']\n );\n return css`\n padding: calc(2 * ${base.spacing}) 0;\n position: relative;\n :not(:last-child) {\n border-bottom: 0.0625rem solid ${base.palette['border-line']};\n }\n ${unRead &&\n css`\n &::before {\n content: '';\n background-color: ${readableBackground};\n position: absolute;\n inset: 0;\n height: calc(100% + 0.0625rem);\n top: -0.0625rem;\n width: 0.125rem;\n }\n `}\n `;\n});\nStyledEmailInConversation.defaultProps = defaultThemeProp;\n\nconst StyledUnreadIndicator = styled.span<{ isVisible: boolean }>(({ theme, isVisible }) => {\n const readableBackground = readableHue(\n theme.base.palette['brand-primary'],\n theme.base.palette['primary-background']\n );\n\n const diameter = '0.375rem';\n\n return css`\n width: ${isVisible ? diameter : 0};\n margin: 0 ${isVisible ? 0 : '0.188rem'};\n height: ${diameter};\n display: inline-block;\n border-radius: 50%;\n background: ${readableBackground};\n position: relative;\n top: 0.375rem;\n align-self: flex-start;\n `;\n});\nStyledUnreadIndicator.defaultProps = defaultThemeProp;\n\nconst StyledConversationButton = styled.button(({ theme }) => {\n const hoverColor = tryCatch(() =>\n mix(0.85, theme.base.palette['primary-background'], theme.base.palette['brand-primary'])\n );\n return css`\n border-width: 0;\n width: 100%;\n padding: ${theme.base.spacing};\n background: ${theme.base.palette['primary-background']};\n position: sticky;\n top: 0;\n z-index: 1;\n\n &[aria-expanded='true'] {\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n }\n\n &:focus {\n background: ${theme.base.palette['secondary-background']};\n outline: none;\n }\n\n &:hover {\n background: ${hoverColor};\n outline: none;\n }\n\n & > ${StyledIcon} {\n align-self: flex-start;\n color: ${theme.base.palette['foreground-color']};\n }\n `;\n});\n\nStyledConversationButton.defaultProps = defaultThemeProp;\n\nconst EmailConversation: FunctionComponent<EmailConversationProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<EmailConversationProps>, ref: EmailConversationProps['ref']) => {\n const {\n id,\n emails,\n from,\n to,\n unReadEmailCount,\n timeStamp,\n isForwarded = false,\n isCollapsed = false,\n onCollapse,\n onExpand,\n undelivered,\n drafts,\n ...restProps\n } = props;\n const t = useI18n();\n const [collapsedState, setCollapsedState] = useState(isCollapsed);\n useAfterInitialEffect(() => {\n setCollapsedState(isCollapsed);\n }, [isCollapsed]);\n const onExpandCollapse = () => {\n setCollapsedState(!collapsedState);\n };\n\n const headerRef = useRef<HTMLDivElement>(null);\n const isSmallOrAbove = useBreakpoint('sm', {\n breakpointRef: headerRef,\n themeProp: 'content-width'\n });\n const { locale } = useConfiguration();\n const { rtl } = useDirection();\n\n const caretDirection = rtl ? 'caret-left' : 'caret-right';\n const generateRecipientList = useMemo(() => {\n const recipientElements = to.slice(0, 2).map((recipient, i) => {\n return `${recipient.shortName}${i < to.length - 1 ? ';' : ''} `;\n });\n if (to.length > 2) {\n return [...recipientElements, `+${to.length - 2} more`];\n }\n return recipientElements;\n }, [to]);\n\n return (\n <StyledEmailConversation {...restProps} id={id} ref={ref}>\n <Flex\n as={StyledConversationButton}\n id={`conversation-heading${id}`}\n aria-controls={id}\n aria-expanded={!collapsedState}\n container={{ gap: 1, alignItems: 'center', pad: 1 }}\n onClick={onExpandCollapse}\n ref={headerRef}\n >\n <Icon name={collapsedState ? caretDirection : 'caret-down'} />\n <StyledUnreadIndicator isVisible={!!unReadEmailCount} />\n <Flex\n container={{\n wrap: 'nowrap',\n alignItems: 'start',\n direction: 'column'\n }}\n item={{\n grow: 1,\n shrink: 1\n }}\n >\n <Flex container={{ gap: 1 }}>\n <Text variant='primary' as={StyledEmailParticipantsText}>\n {`${isForwarded ? 'FW' : t('from')}: ${from.fullName}`}\n </Text>\n\n {(undelivered || drafts) && (\n <>\n {undelivered && <Status variant='urgent'>{t('undelivered')}</Status>}\n {/* Passing Infinity for count so the correct plural translation is chosen\n along with an empty tokens array so that a count is not shown. */}\n {drafts && (\n <Status variant='pending'>{t('draft', [], { count: Infinity })}</Status>\n )}\n </>\n )}\n </Flex>\n <Text variant='secondary' as={StyledEmailParticipantsText}>\n {`${t('to')}: `}\n {generateRecipientList}\n </Text>\n {!isSmallOrAbove && (\n <Text variant='secondary' as={StyledCompactTimeStampDisplay}>\n {`${new Intl.DateTimeFormat(locale, { weekday: 'short' }).format(\n new Date(timeStamp)\n )}, `}\n <DateTimeDisplay variant='datetime' format='short' value={timeStamp} />\n </Text>\n )}\n </Flex>\n <Flex\n container={{\n gap: 1,\n alignItems: 'center'\n }}\n item={{\n shrink: 0\n }}\n >\n {isSmallOrAbove && (\n <Text variant='secondary' as={StyledEmailParticipantsText}>\n {`${new Intl.DateTimeFormat(locale, { weekday: 'short' }).format(\n new Date(timeStamp)\n )}, `}\n <DateTimeDisplay variant='datetime' format='short' value={timeStamp} />\n </Text>\n )}\n </Flex>\n </Flex>\n\n <ExpandCollapse\n as={Flex}\n container={{ direction: 'column' }}\n collapsed={collapsedState}\n onBeforeCollapse={onCollapse}\n onBeforeExpand={onExpand}\n role='region'\n aria-labelledby={`conversation-heading${id}`}\n id={`conversation-content${id}`}\n >\n {!!unReadEmailCount && (\n <Text as={StyledUnReadCount} id={`unread-emailCount-${id}`} variant='secondary'>\n {t('new_emails_count', [unReadEmailCount], { count: unReadEmailCount })}\n </Text>\n )}\n {emails &&\n emails.map(email => {\n return <StyledEmailInConversation key={email.id} {...email} />;\n })}\n </ExpandCollapse>\n </StyledEmailConversation>\n );\n }\n);\n\nexport default EmailConversation;\n"]}
@@ -49,7 +49,7 @@ const EntityList = forwardRef(({ content, header, contextMenu }, ref) => {
49
49
  ? {
50
50
  ...data,
51
51
  value: (
52
- /* Attach the handler only when context menu is enabled */
52
+ // Attach the handler only when context menu is enabled
53
53
  _jsx(Flex, { container: { gap: 0.5, wrap: 'wrap' }, onContextMenu: onContextMenu, children: data.value.map(entityObject => {
54
54
  return _jsx(EmailEntity, { entity: entityObject.entity }, entityObject.id);
55
55
  }) }))
@@ -1 +1 @@
1
- {"version":3,"file":"EntityList.js","sourceRoot":"","sources":["../../../src/components/Email/EntityList.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAGV,QAAQ,EAER,SAAS,EACT,mBAAmB,EACpB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,aAAa,EACb,UAAU,EACX,MAAM,yBAAyB,CAAC;AAEjC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,WAAW,MAAM,eAAe,CAAC;AAGxC,MAAM,UAAU,GAAsD,UAAU,CAC9E,CACE,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAoC,EAClE,GAA2B,EAC3B,EAAE;IACF,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,EAA2B,CAAC;IAC9E,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,eAAe,EAAE,CAAC;IAC1D,oDAAoD;IACpD,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAA4B,EAAE,CAAC,CAAC;IACxF,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IAC7E,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,UAAU,EAAe,CAAC;IAE5D,aAAa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aAAa,CAAC,UAAU,EACpC,IAAI,EAAE,WAAW,GACjB,CACH,IACW,CACf,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,KAAG,CACf,IACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n useState,\n MouseEvent,\n useEffect,\n useImperativeHandle\n} from 'react';\n\nimport {\n ForwardProps,\n Text,\n Flex,\n Icon,\n Card,\n CardHeader,\n CardContent,\n useScrollToggle,\n useElement,\n useOuterEvent,\n EmptyState\n} from '@pega/cosmos-react-core';\n\nimport ContextMenuPopover from './ContextMenuPopover';\nimport { StyledEntityList } from './Email.styles';\nimport EmailEntity from './EmailEntity';\nimport { ContextMenuProps, EntityListProps, TargetProps } from './Email.types';\n\nconst EntityList: FunctionComponent<EntityListProps & ForwardProps> = forwardRef(\n (\n { content, header, contextMenu }: PropsWithoutRef<EntityListProps>,\n ref: EntityListProps['ref']\n ) => {\n const [popoverOpen, setPopoverOpen] = useState(false);\n const [currentTarget, setCurrentTarget] = useState<TargetProps | undefined>();\n const { disableScroll, enableScroll } = useScrollToggle();\n // Only way to set this is through imperative handle\n const [contextMenuItems, setContextMenuItems] = useState<ContextMenuProps['items']>([]);\n const [contextMenuLoading, setContextMenuLoading] = useState<boolean>(false);\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>();\n\n useOuterEvent('mousedown', [popoverEl], () => {\n if (popoverOpen) setPopoverOpen(false);\n });\n\n useImperativeHandle(contextMenu?.handle, () => ({\n setItems: (ctxMenuItems: ContextMenuProps['items']) => {\n setContextMenuItems(ctxMenuItems || []);\n },\n setLoading(loading) {\n setContextMenuLoading(loading);\n },\n setOpen(visible) {\n setPopoverOpen(visible);\n }\n }));\n\n // Handler for right click\n const onContextMenu = (e: MouseEvent<HTMLDivElement>) => {\n if (e.target instanceof HTMLElement && e.target.textContent?.trim()) {\n setCurrentTarget({\n targetNode: e.target,\n cursorPosition: {\n x: e.pageX - window.scrollX,\n y: e.pageY - window.scrollY\n }\n });\n contextMenu?.onContextMenu(e);\n }\n };\n\n const onItemClick: ContextMenuProps['onItemClick'] = (selectedValue: {\n fieldName: string;\n fieldValue: string;\n }) => {\n setPopoverOpen(false);\n contextMenu?.onItemClick(selectedValue);\n };\n\n const fields = content.map(data => {\n return data.value\n ? {\n ...data,\n value: (\n /* Attach the handler only when context menu is enabled */\n <Flex container={{ gap: 0.5, wrap: 'wrap' }} onContextMenu={onContextMenu}>\n {data.value.map(entityObject => {\n return <EmailEntity key={entityObject.id} entity={entityObject.entity} />;\n })}\n </Flex>\n )\n }\n : data;\n });\n\n useEffect(() => {\n if (popoverOpen) disableScroll();\n else enableScroll();\n }, [popoverOpen]);\n\n return (\n <Card ref={ref}>\n {header && (\n <CardHeader container={{ alignItems: 'center', gap: 1 }}>\n <Icon name={header.icon} />\n <Text variant='h3'>{header.text}</Text>\n </CardHeader>\n )}\n {content.length > 0 ? (\n <CardContent>\n <StyledEntityList fields={fields} variant='stacked' />\n {contextMenu && currentTarget && (\n <ContextMenuPopover\n ref={setPopoverEl}\n cursorPosition={currentTarget?.cursorPosition}\n contextMenu={{\n ...contextMenu,\n items: contextMenuItems,\n loading: contextMenuLoading,\n onItemClick\n }}\n targetNode={currentTarget.targetNode}\n show={popoverOpen}\n />\n )}\n </CardContent>\n ) : (\n <EmptyState />\n )}\n </Card>\n );\n }\n);\n\nexport default EntityList;\n"]}
1
+ {"version":3,"file":"EntityList.js","sourceRoot":"","sources":["../../../src/components/Email/EntityList.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAGV,QAAQ,EAER,SAAS,EACT,mBAAmB,EACpB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,aAAa,EACb,UAAU,EACX,MAAM,yBAAyB,CAAC;AAEjC,OA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AAW,CAAC,CAAC,CAAC;IAElB,OAAO,CACL,MAAC,IAAI,IAAC,GAAG,EAAE,GAAG,aACX,MAAM,IAAI,CACT,MAAC,UAAU,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aACrD,KAAC,IAAI,IAAC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAI,EAC3B,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,MAAM,CAAC,IAAI,GAAQ,IAC5B,CACd,EACA,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACpB,MAAC,WAAW,eACV,KAAC,gBAAgB,IAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAC,SAAS,GAAG,EACrD,WAAW,IAAI,aAAa,IAAI,CAC/B,KAAC,kBAAkB,IACjB,GAAG,EAAE,YAAY,EACjB,cAAc,EAAE,aAAa,EAAE,cAAc,EAC7C,WAAW,EAAE;4BACX,GAAG,WAAW;4BACd,KAAK,EAAE,gBAAgB;4BACvB,OAAO,EAAE,kBAAkB;4BAC3B,WAAW;yBACZ,EACD,UAAU,EAAE,aAAa,CAAC,UAAU,EACpC,IAAI,EAAE,WAAW,GACjB,CACH,IACW,CACf,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,KAAG,CACf,IACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n useState,\n MouseEvent,\n useEffect,\n useImperativeHandle\n} from 'react';\n\nimport {\n ForwardProps,\n Text,\n Flex,\n Icon,\n Card,\n CardHeader,\n CardContent,\n useScrollToggle,\n useElement,\n useOuterEvent,\n EmptyState\n} from '@pega/cosmos-react-core';\n\nimport ContextMenuPopover from './ContextMenuPopover';\nimport { StyledEntityList } from './Email.styles';\nimport EmailEntity from './EmailEntity';\nimport { ContextMenuProps, EntityListProps, TargetProps } from './Email.types';\n\nconst EntityList: FunctionComponent<EntityListProps & ForwardProps> = forwardRef(\n (\n { content, header, contextMenu }: PropsWithoutRef<EntityListProps>,\n ref: EntityListProps['ref']\n ) => {\n const [popoverOpen, setPopoverOpen] = useState(false);\n const [currentTarget, setCurrentTarget] = useState<TargetProps | undefined>();\n const { disableScroll, enableScroll } = useScrollToggle();\n // Only way to set this is through imperative handle\n const [contextMenuItems, setContextMenuItems] = useState<ContextMenuProps['items']>([]);\n const [contextMenuLoading, setContextMenuLoading] = useState<boolean>(false);\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>();\n\n useOuterEvent('mousedown', [popoverEl], () => {\n if (popoverOpen) setPopoverOpen(false);\n });\n\n useImperativeHandle(contextMenu?.handle, () => ({\n setItems: (ctxMenuItems: ContextMenuProps['items']) => {\n setContextMenuItems(ctxMenuItems || []);\n },\n setLoading(loading) {\n setContextMenuLoading(loading);\n },\n setOpen(visible) {\n setPopoverOpen(visible);\n }\n }));\n\n // Handler for right click\n const onContextMenu = (e: MouseEvent<HTMLDivElement>) => {\n if (e.target instanceof HTMLElement && e.target.textContent?.trim()) {\n setCurrentTarget({\n targetNode: e.target,\n cursorPosition: {\n x: e.pageX - window.scrollX,\n y: e.pageY - window.scrollY\n }\n });\n contextMenu?.onContextMenu(e);\n }\n };\n\n const onItemClick: ContextMenuProps['onItemClick'] = (selectedValue: {\n fieldName: string;\n fieldValue: string;\n }) => {\n setPopoverOpen(false);\n contextMenu?.onItemClick(selectedValue);\n };\n\n const fields = content.map(data => {\n return data.value\n ? {\n ...data,\n value: (\n // Attach the handler only when context menu is enabled\n <Flex container={{ gap: 0.5, wrap: 'wrap' }} onContextMenu={onContextMenu}>\n {data.value.map(entityObject => {\n return <EmailEntity key={entityObject.id} entity={entityObject.entity} />;\n })}\n </Flex>\n )\n }\n : data;\n });\n\n useEffect(() => {\n if (popoverOpen) disableScroll();\n else enableScroll();\n }, [popoverOpen]);\n\n return (\n <Card ref={ref}>\n {header && (\n <CardHeader container={{ alignItems: 'center', gap: 1 }}>\n <Icon name={header.icon} />\n <Text variant='h3'>{header.text}</Text>\n </CardHeader>\n )}\n {content.length > 0 ? (\n <CardContent>\n <StyledEntityList fields={fields} variant='stacked' />\n {contextMenu && currentTarget && (\n <ContextMenuPopover\n ref={setPopoverEl}\n cursorPosition={currentTarget?.cursorPosition}\n contextMenu={{\n ...contextMenu,\n items: contextMenuItems,\n loading: contextMenuLoading,\n onItemClick\n }}\n targetNode={currentTarget.targetNode}\n show={popoverOpen}\n />\n )}\n </CardContent>\n ) : (\n <EmptyState />\n )}\n </Card>\n );\n }\n);\n\nexport default EntityList;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FeedAttachments.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedAttachments.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA+B,GAAG,EAAyB,MAAM,OAAO,CAAC;AAGpF,OAAO,EAEL,mBAAmB,EAUpB,MAAM,yBAAyB,CAAC;AAKjC,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,IAAI,CAAC;AAEvD,UAAU,oBAAoB;IAC5B,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B;AAED,eAAO,MAAM,qBAAqB,wGAShC,CAAC;AAIH,eAAO,MAAM,kBAAkB,0QA0B7B,CAAC;AAIH,eAAO,MAAM,uBAAuB,yGAQlC,CAAC;AAIH,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAgE7C,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"FeedAttachments.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedAttachments.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA+B,GAAG,EAAyB,MAAM,OAAO,CAAC;AAGpF,OAAO,EAEL,mBAAmB,EAUpB,MAAM,yBAAyB,CAAC;AAKjC,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,IAAI,CAAC;AAEvD,UAAU,oBAAoB;IAC5B,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B;AAED,eAAO,MAAM,qBAAqB,wGAShC,CAAC;AAIH,eAAO,MAAM,kBAAkB,0QAqB7B,CAAC;AAIH,eAAO,MAAM,uBAAuB,yGAQlC,CAAC;AAIH,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAgE7C,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -18,12 +18,7 @@ StyledFeedAttachments.defaultProps = defaultThemeProp;
18
18
  export const StyledImagePreview = styled(BareButton)(({ theme }) => {
19
19
  return css `
20
20
  line-height: 0;
21
-
22
- /* stylelint-disable declaration-block-no-duplicate-properties */
23
- width: -moz-fit-content;
24
21
  width: fit-content;
25
-
26
- /* stylelint-enable declaration-block-no-duplicate-properties */
27
22
  border-radius: calc(0.5 * ${theme.base['border-radius']});
28
23
 
29
24
  & + & {
@@ -1 +1 @@
1
- {"version":3,"file":"FeedAttachments.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedAttachments.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAwB,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACpF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,cAAc,EAEd,IAAI,EACJ,KAAK,EACL,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,IAAI,EACJ,UAAU,EACV,WAAW,EACX,OAAO,EACR,MAAM,yBAAyB,CAAC;AACjC,OAAO,UAAU,MAAM,0DAA0D,CAAC;AAElF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB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import styled, { css } from 'styled-components';\n\nimport {\n FileUploadItem,\n FileUploadItemProps,\n Grid,\n Image,\n defaultThemeProp,\n getKindFromMimeType,\n getMimeTypeFromFile,\n Flex,\n StyledFlex,\n usePrevious,\n useI18n\n} from '@pega/cosmos-react-core';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\n\nimport { FeedContext } from './Feed.context';\n\nexport type AttachedFiles = FileUploadItemProps & File;\n\ninterface FeedAttachmentsProps {\n attachments?: AttachedFiles[];\n readOnly?: boolean;\n ref?: Ref<HTMLUListElement>;\n}\n\nexport const StyledFeedAttachments = styled.ul(({ theme }) => {\n return css`\n overflow-x: auto;\n\n > li {\n background-color: ${theme.base.palette['primary-background']};\n cursor: initial;\n }\n `;\n});\n\nStyledFeedAttachments.defaultProps = defaultThemeProp;\n\nexport const StyledImagePreview = styled(BareButton)(({ theme }) => {\n return css`\n line-height: 0;\n\n /* stylelint-disable declaration-block-no-duplicate-properties */\n width: -moz-fit-content;\n width: fit-content;\n\n /* stylelint-enable declaration-block-no-duplicate-properties */\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n\n & + & {\n margin: 0;\n }\n\n &:focus {\n box-shadow: ${theme.components.button['focus-shadow']};\n }\n\n img {\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n object-fit: contain;\n max-height: 32rem;\n max-width: 100%;\n }\n `;\n});\n\nStyledImagePreview.defaultProps = defaultThemeProp;\n\nexport const StyledAttachmentsRegion = styled.div(({ theme }) => {\n return css`\n margin: ${theme.base.spacing} 0;\n\n ${StyledFlex} + ${StyledFeedAttachments} {\n margin-block-start: ${theme.base.spacing};\n }\n `;\n});\n\nStyledAttachmentsRegion.defaultProps = defaultThemeProp;\n\nconst FeedAttachments: FC<FeedAttachmentsProps> = forwardRef(\n (props: PropsWithoutRef<FeedAttachmentsProps>, ref: FeedAttachmentsProps['ref']) => {\n const { attachments = [], readOnly } = props;\n const t = useI18n();\n const { announce } = useContext(FeedContext);\n const prevAttachments = usePrevious(attachments) ?? [];\n\n useEffect(() => {\n if (attachments.length !== prevAttachments?.length) {\n const difference = attachments.length - prevAttachments.length;\n const normalizedDifference = difference * (difference > 0 ? 1 : -1);\n const timeoutId = announce(\n t(`feed_attachments_${difference > 0 ? 'added' : 'removed'}`, [normalizedDifference], {\n count: normalizedDifference\n })\n );\n return () => clearTimeout(timeoutId);\n }\n }, [attachments]);\n\n if (attachments.length === 0) return null;\n\n const previewableFiles: AttachedFiles[] = [];\n const nonPreviewableFiles: AttachedFiles[] = [];\n\n attachments.forEach(file => {\n const type = getKindFromMimeType(getMimeTypeFromFile(file.name) ?? '');\n\n if (type === 'image' && file.thumbnail) previewableFiles.push(file);\n else nonPreviewableFiles.push(file);\n });\n\n return (\n <StyledAttachmentsRegion>\n {readOnly && !!previewableFiles.length && (\n <Flex container={{ direction: 'column', gap: 1 }}>\n {previewableFiles.map(({ lastModified, name, onPreview, thumbnail }) => {\n return (\n <StyledImagePreview key={lastModified} onClick={() => onPreview?.(name)}>\n <Image alt={name} src={thumbnail} />\n </StyledImagePreview>\n );\n })}\n </Flex>\n )}\n <Grid\n ref={ref}\n as={StyledFeedAttachments}\n container={{\n cols: 'repeat(auto-fill, minmax(15rem, 1fr))',\n gap: 1\n }}\n >\n {!readOnly &&\n previewableFiles.map(({ lastModified, name, size, ...restProps }) => {\n return <FileUploadItem key={lastModified} name={name} size={size} {...restProps} />;\n })}\n {nonPreviewableFiles.map(({ lastModified, name, size, ...restProps }) => {\n return <FileUploadItem key={lastModified} name={name} size={size} {...restProps} />;\n })}\n </Grid>\n </StyledAttachmentsRegion>\n );\n }\n);\n\nexport default FeedAttachments;\n"]}
1
+ {"version":3,"file":"FeedAttachments.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedAttachments.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAwB,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACpF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,m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,KAAC,cAAc,IAAoB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,KAAM,SAAS,IAAnD,YAAY,CAA2C,CAAC;oBACtF,CAAC,CAAC,IACG,IACiB,CAC3B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { FC, forwardRef, PropsWithoutRef, Ref, useEffect, useContext } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n FileUploadItem,\n FileUploadItemProps,\n Grid,\n Image,\n defaultThemeProp,\n getKindFromMimeType,\n getMimeTypeFromFile,\n Flex,\n StyledFlex,\n usePrevious,\n useI18n\n} from '@pega/cosmos-react-core';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\n\nimport { FeedContext } from './Feed.context';\n\nexport type AttachedFiles = FileUploadItemProps & File;\n\ninterface FeedAttachmentsProps {\n attachments?: AttachedFiles[];\n readOnly?: boolean;\n ref?: Ref<HTMLUListElement>;\n}\n\nexport const StyledFeedAttachments = styled.ul(({ theme }) => {\n return css`\n overflow-x: auto;\n\n > li {\n background-color: ${theme.base.palette['primary-background']};\n cursor: initial;\n }\n `;\n});\n\nStyledFeedAttachments.defaultProps = defaultThemeProp;\n\nexport const StyledImagePreview = styled(BareButton)(({ theme }) => {\n return css`\n line-height: 0;\n width: fit-content;\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n\n & + & {\n margin: 0;\n }\n\n &:focus {\n box-shadow: ${theme.components.button['focus-shadow']};\n }\n\n img {\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n object-fit: contain;\n max-height: 32rem;\n max-width: 100%;\n }\n `;\n});\n\nStyledImagePreview.defaultProps = defaultThemeProp;\n\nexport const StyledAttachmentsRegion = styled.div(({ theme }) => {\n return css`\n margin: ${theme.base.spacing} 0;\n\n ${StyledFlex} + ${StyledFeedAttachments} {\n margin-block-start: ${theme.base.spacing};\n }\n `;\n});\n\nStyledAttachmentsRegion.defaultProps = defaultThemeProp;\n\nconst FeedAttachments: FC<FeedAttachmentsProps> = forwardRef(\n (props: PropsWithoutRef<FeedAttachmentsProps>, ref: FeedAttachmentsProps['ref']) => {\n const { attachments = [], readOnly } = props;\n const t = useI18n();\n const { announce } = useContext(FeedContext);\n const prevAttachments = usePrevious(attachments) ?? [];\n\n useEffect(() => {\n if (attachments.length !== prevAttachments?.length) {\n const difference = attachments.length - prevAttachments.length;\n const normalizedDifference = difference * (difference > 0 ? 1 : -1);\n const timeoutId = announce(\n t(`feed_attachments_${difference > 0 ? 'added' : 'removed'}`, [normalizedDifference], {\n count: normalizedDifference\n })\n );\n return () => clearTimeout(timeoutId);\n }\n }, [attachments]);\n\n if (attachments.length === 0) return null;\n\n const previewableFiles: AttachedFiles[] = [];\n const nonPreviewableFiles: AttachedFiles[] = [];\n\n attachments.forEach(file => {\n const type = getKindFromMimeType(getMimeTypeFromFile(file.name) ?? '');\n\n if (type === 'image' && file.thumbnail) previewableFiles.push(file);\n else nonPreviewableFiles.push(file);\n });\n\n return (\n <StyledAttachmentsRegion>\n {readOnly && !!previewableFiles.length && (\n <Flex container={{ direction: 'column', gap: 1 }}>\n {previewableFiles.map(({ lastModified, name, onPreview, thumbnail }) => {\n return (\n <StyledImagePreview key={lastModified} onClick={() => onPreview?.(name)}>\n <Image alt={name} src={thumbnail} />\n </StyledImagePreview>\n );\n })}\n </Flex>\n )}\n <Grid\n ref={ref}\n as={StyledFeedAttachments}\n container={{\n cols: 'repeat(auto-fill, minmax(15rem, 1fr))',\n gap: 1\n }}\n >\n {!readOnly &&\n previewableFiles.map(({ lastModified, name, size, ...restProps }) => {\n return <FileUploadItem key={lastModified} name={name} size={size} {...restProps} />;\n })}\n {nonPreviewableFiles.map(({ lastModified, name, size, ...restProps }) => {\n return <FileUploadItem key={lastModified} name={name} size={size} {...restProps} />;\n })}\n </Grid>\n </StyledAttachmentsRegion>\n );\n }\n);\n\nexport default FeedAttachments;\n"]}
@@ -29,9 +29,7 @@ export interface FeedPostProps {
29
29
  likes?: SummaryListItem[];
30
30
  likeCount?: number;
31
31
  commentLabel: string;
32
- /**
33
- * @default true
34
- */
32
+ /** @default true */
35
33
  interactionsEnabled?: boolean;
36
34
  };
37
35
  /** Callback that runs when the mouse pointer hovers over the Activity. */
@@ -1 +1 @@
1
- {"version":3,"file":"FeedPost.types.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedPost.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,WAAW,aAAa;IAC5B,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,yEAAyE;IACzE,IAAI,EAAE;QACJ,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAC7C,OAAO,EAAE,YAAY,GAAG,MAAM,CAAC;QAC/B,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;QAChC,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;QAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;QAC9B,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;QACpC,UAAU,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;KACpC,CAAC;IACF,gBAAgB,CAAC,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CAAC,CAAC;QAClD,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;KACjD,CAAC;IACF,iDAAiD;IACjD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,2DAA2D;IAC3D,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACxD,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACxD,2CAA2C;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yCAAyC;IACzC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,8CAA8C;IAC9C,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"FeedPost.types.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedPost.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactElement, MouseEvent } from 'react';\n\nimport {\n AvatarProps,\n DateTimeDisplayProps,\n MenuItemProps,\n SummaryListItem\n} from '@pega/cosmos-react-core';\n\nimport { AttachedFiles } from './FeedAttachments';\nimport { FeedContentProps } from './FeedContent';\nimport { FeedReplyInputProps } from './FeedReplyInput';\n\nexport interface FeedPostProps {\n /** Unique ID for this activity */\n id: string;\n /** All of the information used to fill text portions, and avatar info */\n info: {\n avatarSrc?: string;\n fullname: string;\n username: string;\n postTimestamp: DateTimeDisplayProps['value'];\n content: ReactElement | string;\n postType?: 'public' | 'private';\n recipients?: MenuItemProps[];\n recipientsCount?: number;\n attachments?: AttachedFiles[];\n liked?: boolean;\n icon?: string;\n postContext?: ReactElement | string;\n userStatus?: AvatarProps['status'];\n };\n maxContentHeight?: FeedContentProps['maxContentHeight'];\n /** Button labels for accessibility purposes. */\n interactionInfo: {\n likeLabel: string;\n likes?: SummaryListItem[];\n likeCount?: number;\n commentLabel: string;\n /**\n * @default true\n */\n interactionsEnabled?: boolean;\n };\n /** Callback that runs when the mouse pointer hovers over the Activity. */\n onMouseEnter?: (event: { postId: string }) => void;\n /** Callback that runs when the mouse pointer leaves the Activity. */\n onMouseLeave?: (event: { postId: string }) => void;\n /** Callback that runs when the comment button has been clicked */\n onCommentClick?: (event: { postId: string }) => void;\n /** Callback that runs when the like button has been clicked */\n onLikeClick: (event: { postId: string; user: SummaryListItem }) => void;\n /** Callback that runs when the like count on a post is hovered, focused, or clicked. */\n onLikeCountInteraction?: () => void;\n /** Callback that runs when the bottom of the extended like list Modal is reached, allowing for more likes to be loaded. */\n onLoadMoreLikes?: () => void;\n /** Callback that runs when the private recipient icon on a post is hovered, focused, or clicked. */\n onRecipientInteraction?: () => void;\n /** Callback that runs when the bottom of the extended private recipient list Modal is reached, allowing for more recipients to be loaded. */\n onLoadMoreRecipients?: () => void;\n /** Callback that runs when the user name or visual button has been clicked */\n onUserClick?: (event: { postId: string; username: string }, clickEvent?: MouseEvent) => void;\n /** MenuItems that will populate the three dot menu button */\n menuItems?: MenuItemProps[];\n /** Callback that updates the post after being edited. If undefined, the post will not be editable. */\n onEditSubmit?: (event: { postId: string; value: string }) => void;\n /**\n * Flag that indicates if a post has been previously edited.\n * @default false\n */\n edited?: boolean;\n /** Indicates how much time has passed since the last edit was made. This will only display if edited is true. */\n editTimestamp?: DateTimeDisplayProps['value'];\n /** Props that will be passed into the reply input, see FeedReplyInput for more information */\n replyInput: Pick<FeedReplyInputProps, 'onSubmit' | 'placeholder' | 'onFilesAdded'> & {\n commentLabel: FeedReplyInputProps['commentLabel'];\n attachments: FeedReplyInputProps['attachments'];\n };\n /** The default visibility for the reply input */\n replyInputShown?: boolean;\n /** An array to hold FeedReply's inside of this Activity */\n replies?: ReactElement[];\n /** A total count of all replies. */\n replyCount?: number;\n /** Callback that runs when the user clicks Show more button. */\n onShowMoreReplies?: (event: { postId: string }) => void;\n /** Callback that runs when the user clicks Show less button. */\n onShowLessReplies?: (event: { postId: string }) => void;\n /** A loading indicator for the replies. */\n repliesLoading?: boolean;\n /** A loading indicator for the likes. */\n likesLoading?: boolean;\n /** A loading indicator for the recipients. */\n recipientsLoading?: boolean;\n}\n"]}
1
+ {"version":3,"file":"FeedPost.types.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedPost.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactElement, MouseEvent } from 'react';\n\nimport {\n AvatarProps,\n DateTimeDisplayProps,\n MenuItemProps,\n SummaryListItem\n} from '@pega/cosmos-react-core';\n\nimport { AttachedFiles } from './FeedAttachments';\nimport { FeedContentProps } from './FeedContent';\nimport { FeedReplyInputProps } from './FeedReplyInput';\n\nexport interface FeedPostProps {\n /** Unique ID for this activity */\n id: string;\n /** All of the information used to fill text portions, and avatar info */\n info: {\n avatarSrc?: string;\n fullname: string;\n username: string;\n postTimestamp: DateTimeDisplayProps['value'];\n content: ReactElement | string;\n postType?: 'public' | 'private';\n recipients?: MenuItemProps[];\n recipientsCount?: number;\n attachments?: AttachedFiles[];\n liked?: boolean;\n icon?: string;\n postContext?: ReactElement | string;\n userStatus?: AvatarProps['status'];\n };\n maxContentHeight?: FeedContentProps['maxContentHeight'];\n /** Button labels for accessibility purposes. */\n interactionInfo: {\n likeLabel: string;\n likes?: SummaryListItem[];\n likeCount?: number;\n commentLabel: string;\n /** @default true */\n interactionsEnabled?: boolean;\n };\n /** Callback that runs when the mouse pointer hovers over the Activity. */\n onMouseEnter?: (event: { postId: string }) => void;\n /** Callback that runs when the mouse pointer leaves the Activity. */\n onMouseLeave?: (event: { postId: string }) => void;\n /** Callback that runs when the comment button has been clicked */\n onCommentClick?: (event: { postId: string }) => void;\n /** Callback that runs when the like button has been clicked */\n onLikeClick: (event: { postId: string; user: SummaryListItem }) => void;\n /** Callback that runs when the like count on a post is hovered, focused, or clicked. */\n onLikeCountInteraction?: () => void;\n /** Callback that runs when the bottom of the extended like list Modal is reached, allowing for more likes to be loaded. */\n onLoadMoreLikes?: () => void;\n /** Callback that runs when the private recipient icon on a post is hovered, focused, or clicked. */\n onRecipientInteraction?: () => void;\n /** Callback that runs when the bottom of the extended private recipient list Modal is reached, allowing for more recipients to be loaded. */\n onLoadMoreRecipients?: () => void;\n /** Callback that runs when the user name or visual button has been clicked */\n onUserClick?: (event: { postId: string; username: string }, clickEvent?: MouseEvent) => void;\n /** MenuItems that will populate the three dot menu button */\n menuItems?: MenuItemProps[];\n /** Callback that updates the post after being edited. If undefined, the post will not be editable. */\n onEditSubmit?: (event: { postId: string; value: string }) => void;\n /**\n * Flag that indicates if a post has been previously edited.\n * @default false\n */\n edited?: boolean;\n /** Indicates how much time has passed since the last edit was made. This will only display if edited is true. */\n editTimestamp?: DateTimeDisplayProps['value'];\n /** Props that will be passed into the reply input, see FeedReplyInput for more information */\n replyInput: Pick<FeedReplyInputProps, 'onSubmit' | 'placeholder' | 'onFilesAdded'> & {\n commentLabel: FeedReplyInputProps['commentLabel'];\n attachments: FeedReplyInputProps['attachments'];\n };\n /** The default visibility for the reply input */\n replyInputShown?: boolean;\n /** An array to hold FeedReply's inside of this Activity */\n replies?: ReactElement[];\n /** A total count of all replies. */\n replyCount?: number;\n /** Callback that runs when the user clicks Show more button. */\n onShowMoreReplies?: (event: { postId: string }) => void;\n /** Callback that runs when the user clicks Show less button. */\n onShowLessReplies?: (event: { postId: string }) => void;\n /** A loading indicator for the replies. */\n repliesLoading?: boolean;\n /** A loading indicator for the likes. */\n likesLoading?: boolean;\n /** A loading indicator for the recipients. */\n recipientsLoading?: boolean;\n}\n"]}
@@ -20,9 +20,7 @@ export interface FeedReplyProps {
20
20
  likeCount?: number;
21
21
  likeLabel: string;
22
22
  commentLabel: string;
23
- /**
24
- * @default true
25
- */
23
+ /** @default true */
26
24
  interactionsEnabled?: boolean;
27
25
  };
28
26
  /**
@@ -1 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AAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACvE,WAAW,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,eAAe,CAAA;KAAE,KAAK,IAAI,CAAC;IACzE,wFAAwF;IACxF,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;IACpC,2HAA2H;IAC3H,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,yCAAyC;IACzC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,UAAU,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;CAC/F"}
@@ -1 +1 @@
1
- {"version":3,"file":"FeedReply.types.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedReply.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEvent, ReactElement } from 'react';\n\nimport {\n AvatarProps,\n DateTimeDisplayProps,\n MenuItemProps,\n SummaryListItem\n} from '@pega/cosmos-react-core';\n\nimport { AttachedFiles } from './FeedAttachments';\n\nexport interface FeedReplyProps {\n id: string;\n info: {\n avatarSrc?: string;\n postTimestamp: DateTimeDisplayProps['value'];\n content: ReactElement | string;\n attachments?: AttachedFiles[];\n username: string;\n fullname: string;\n fullnameLabel: string;\n liked?: boolean;\n icon?: string;\n userStatus?: AvatarProps['status'];\n };\n interactionInfo: {\n likes?: SummaryListItem[];\n likeCount?: number;\n likeLabel: string;\n commentLabel: string;\n /**\n * @default true\n */\n interactionsEnabled?: boolean;\n };\n /**\n * A maximum height in pixels to display post content within before prompting to expand the post.\n * @default Infinity\n */\n maxContentHeight?: number;\n /** A set of menu options for actions on the reply. */\n menuItems?: MenuItemProps[];\n /** Callback that updates the reply after being edited. If undefined, the reply will not be editable. */\n onEditSubmit?: (event: { replyId: string; value: string }) => void;\n /**\n * Flag that indicates if a reply has been previously edited.\n * @default false\n */\n edited?: boolean;\n /** Indicates how much time has passed since the last edit was made. This will only display if edited is true. */\n editTimestamp?: DateTimeDisplayProps['value'];\n onMouseEnter?: (event: { replyId: string }) => void;\n onMouseLeave?: (event: { replyId: string }) => void;\n onCommentClick: (event: { replyId: string; username: string }) => void;\n onLikeClick: (event: { replyId: string; user: SummaryListItem }) => void;\n /** Callback that runs when the like count on a post is hovered, focused, or clicked. */\n onLikeCountInteraction?: () => void;\n /** Callback that runs when the bottom of the extended like list Modal is reached, allowing for more likes to be loaded. */\n onLoadMoreLikes?: () => void;\n /** A loading indicator for the likes. */\n likesLoading?: boolean;\n onUserClick?: (event: { replyId: string; username: string }, clickEvent?: MouseEvent) => void;\n}\n"]}
1
+ {"version":3,"file":"FeedReply.types.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedReply.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEvent, ReactElement } from 'react';\n\nimport {\n AvatarProps,\n DateTimeDisplayProps,\n MenuItemProps,\n SummaryListItem\n} from '@pega/cosmos-react-core';\n\nimport { AttachedFiles } from './FeedAttachments';\n\nexport interface FeedReplyProps {\n id: string;\n info: {\n avatarSrc?: string;\n postTimestamp: DateTimeDisplayProps['value'];\n content: ReactElement | string;\n attachments?: AttachedFiles[];\n username: string;\n fullname: string;\n fullnameLabel: string;\n liked?: boolean;\n icon?: string;\n userStatus?: AvatarProps['status'];\n };\n interactionInfo: {\n likes?: SummaryListItem[];\n likeCount?: number;\n likeLabel: string;\n commentLabel: string;\n /** @default true */\n interactionsEnabled?: boolean;\n };\n /**\n * A maximum height in pixels to display post content within before prompting to expand the post.\n * @default Infinity\n */\n maxContentHeight?: number;\n /** A set of menu options for actions on the reply. */\n menuItems?: MenuItemProps[];\n /** Callback that updates the reply after being edited. If undefined, the reply will not be editable. */\n onEditSubmit?: (event: { replyId: string; value: string }) => void;\n /**\n * Flag that indicates if a reply has been previously edited.\n * @default false\n */\n edited?: boolean;\n /** Indicates how much time has passed since the last edit was made. This will only display if edited is true. */\n editTimestamp?: DateTimeDisplayProps['value'];\n onMouseEnter?: (event: { replyId: string }) => void;\n onMouseLeave?: (event: { replyId: string }) => void;\n onCommentClick: (event: { replyId: string; username: string }) => void;\n onLikeClick: (event: { replyId: string; user: SummaryListItem }) => void;\n /** Callback that runs when the like count on a post is hovered, focused, or clicked. */\n onLikeCountInteraction?: () => void;\n /** Callback that runs when the bottom of the extended like list Modal is reached, allowing for more likes to be loaded. */\n onLoadMoreLikes?: () => void;\n /** A loading indicator for the likes. */\n likesLoading?: boolean;\n onUserClick?: (event: { replyId: string; username: string }, clickEvent?: MouseEvent) => void;\n}\n"]}
@@ -3,7 +3,7 @@ import { ForwardProps } from '@pega/cosmos-react-core';
3
3
  import { RichTextEditorState } from '@pega/cosmos-react-rte';
4
4
  import { AttachedFiles } from './FeedAttachments';
5
5
  export interface FeedReplyInputProps {
6
- /** Unique ID for this Reply Input */
6
+ /** Unique ID for this Reply Input */
7
7
  id: string;
8
8
  /** Label text for the reply submit button. */
9
9
  commentLabel: string;
@@ -1 +1 @@
1
- {"version":3,"file":"FeedReplyInput.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedReplyInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA+B,gBAAgB,EAA0B,MAAM,OAAO,CAAC;AAGlG,OAAO,EAQL,YAAY,EAEb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAwB,MAAM,wBAAwB,CAAC;AAMnF,OAAwB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKnE,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,YAAY,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,WAAW,CAAC,EAAE,aAAa,EAAE,C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,EAAE,YAAY,EACrB,IAAI,QACJ,KAAK,EAAE,YAAY,YAEnB,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,GACb,IACJ,EACP,KAAC,eAAe,IAAC,GAAG,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,GAAI,IAChE,GACF,IACF,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { FC, useRef, useState, useEffect, MutableRefObject, MouseEvent, useContext } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Avatar,\n Button,\n StyledAvatar,\n Flex,\n Icon,\n registerIcon,\n defaultThemeProp,\n ForwardProps,\n useI18n\n} from '@pega/cosmos-react-core';\nimport { RichTextEditorState, StyledRichTextEditor } from '@pega/cosmos-react-rte';\nimport * as sendIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/send.icon';\nimport * as paperClipIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/paper-clip.icon';\n\nimport FeedRichText from './FeedRichText';\nimport FeedButton from './FeedButton';\nimport FeedAttachments, { AttachedFiles } from './FeedAttachments';\nimport { FeedContext } from './Feed.context';\n\nregisterIcon(sendIcon, paperClipIcon);\n\nexport interface FeedReplyInputProps {\n /** Unique ID for this Reply Input */\n id: string;\n /** Label text for the reply submit button. */\n commentLabel: string;\n /** A set of attachment files. */\n attachments?: AttachedFiles[];\n /** Placeholder string for the input */\n placeholder: string;\n /** A callback containing a list of added files that will run whenever files are added to the post. */\n onFilesAdded?: (files: AttachedFiles[]) => void;\n /** Callback that runs when the submit button has been pressed */\n onSubmit: (event: {\n replyId: string;\n value: string;\n attachments: AttachedFiles[];\n clear: () => void;\n }) => void;\n /** Callback that sets returns a shared ref to the RTE component */\n onSetInputRef?: (event: { ref: MutableRefObject<RichTextEditorState | undefined> }) => void;\n}\n\nexport const StyledReplyInputContainer = styled.div(props => {\n const { theme } = props;\n\n return css`\n ${StyledAvatar} {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledReplyInputContainer.defaultProps = defaultThemeProp;\n\nexport const StyledFeedReply = styled.div(props => {\n const { theme } = props;\n\n return css`\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-radius: calc(2.5 * ${theme.base['border-radius']});\n padding: 0 calc(2 * ${theme.base.spacing});\n cursor: text;\n\n ${FeedButton} {\n align-self: flex-end;\n }\n `;\n});\n\nStyledFeedReply.defaultProps = defaultThemeProp;\n\nconst StyledFeedReplyInput = styled.div(props => {\n const { theme } = props;\n\n return css`\n padding-top: calc(0.75 * ${theme.base.spacing});\n\n ${StyledRichTextEditor} {\n &:focus-within {\n box-shadow: none;\n }\n }\n `;\n});\n\nStyledFeedReplyInput.defaultProps = defaultThemeProp;\n\nconst HiddenFileInput = styled.input`\n display: none;\n`;\n\nconst FeedReplyInput: FC<ForwardProps & FeedReplyInputProps> = (\n props: ForwardProps & FeedReplyInputProps\n) => {\n const rteRef = useRef<RichTextEditorState>();\n const {\n id,\n commentLabel,\n attachments = [],\n placeholder,\n onAddAttachment,\n onSubmit,\n onSetInputRef,\n onFilesAdded,\n ...restProps\n } = props;\n\n const [emptyText, setEmptyText] = useState(true);\n const hiddenInputRef = useRef<HTMLInputElement>(null);\n const attachmentListRef = useRef<HTMLUListElement>(null);\n const attachmentsButtonRef = useRef<HTMLButtonElement>(null);\n const submitButtonRef = useRef<HTMLButtonElement>(null);\n const { setShowSearchResults } = useContext(FeedContext);\n const { avatarSrc, fullname } = useContext(FeedContext).userInfo;\n\n useEffect(() => {\n onSetInputRef?.({ ref: rteRef });\n }, [rteRef]);\n\n const t = useI18n();\n\n const handleSubmit = () => {\n setShowSearchResults?.(false);\n if (!emptyText || attachments.length > 0) {\n onSubmit({\n replyId: id,\n value: rteRef.current?.getPlainText() || '',\n attachments: attachments || [],\n clear: () => {\n rteRef.current?.clear();\n }\n });\n }\n };\n\n return (\n <Flex container as={StyledReplyInputContainer} {...restProps}>\n <Avatar name={fullname} size='m' imageSrc={avatarSrc} />\n <Flex\n container={{ alignItems: 'start' }}\n item={{ grow: 1 }}\n as={StyledFeedReply}\n onClick={(event: MouseEvent) => {\n if (\n attachmentListRef.current &&\n event.target !== attachmentListRef.current &&\n attachmentListRef.current.contains(event.target as Node)\n ) {\n return;\n }\n\n if (\n attachmentsButtonRef.current?.contains(event.target as Node) ||\n submitButtonRef.current?.contains(event.target as Node)\n ) {\n return;\n }\n\n rteRef.current?.focus();\n }}\n >\n <Flex container={{ direction: 'column' }} item={{ grow: 1 }}>\n <Flex container item={{ grow: 1 }}>\n <Flex as={StyledFeedReplyInput} item={{ grow: 1 }}>\n <FeedRichText\n label={t('feed_new_reply')}\n ref={rteRef}\n placeholder={placeholder}\n onChange={() => {\n setEmptyText(rteRef.current?.getPlainText().trim() === '');\n }}\n onSubmit={handleSubmit}\n />\n </Flex>\n {onFilesAdded && (\n <>\n <HiddenFileInput\n ref={hiddenInputRef}\n type='file'\n multiple\n onChange={() => {\n if (hiddenInputRef.current?.files) {\n onFilesAdded?.(Array.from(hiddenInputRef.current?.files));\n }\n }}\n // Must trick input to believe there is no value when activated so that the same file may be added consecutively.\n onClick={(event: MouseEvent) => {\n (event.target as HTMLInputElement).value = '';\n }}\n />\n <Button\n ref={attachmentsButtonRef}\n as={FeedButton}\n variant='simple'\n onClick={() => {\n setShowSearchResults?.(false);\n hiddenInputRef.current?.click();\n }}\n icon\n label={\n attachments.length\n ? t('attachments_count', [], { count: 1 }).toUpperCase()\n : t('file_upload_text_multiple')\n }\n >\n <Icon name='paper-clip' />\n </Button>\n </>\n )}\n <Button\n ref={submitButtonRef}\n as={FeedButton}\n disabled={emptyText && attachments.length === 0}\n variant='simple'\n onClick={handleSubmit}\n icon\n label={commentLabel}\n >\n <Icon name='send' />\n </Button>\n </Flex>\n <FeedAttachments ref={attachmentListRef} attachments={attachments} />\n </Flex>\n </Flex>\n </Flex>\n );\n};\n\nexport default FeedReplyInput;\n"]}
1
+ {"version":3,"file":"FeedReplyInput.js","sourceRoot":"","sources":["../../../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AAE,GAAG,EAAE;gDACZ,oBAAoB,EAAE,CAAC,KAAK,CAAC,CAAC;gDAC9B,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;4CAClC,CAAC,EACD,IAAI,QACJ,KAAK,EACH,WAAW,CAAC,MAAM;gDAChB,CAAC,CAAC,CAAC,CAAC,mBAAmB,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE;gDACxD,CAAC,CAAC,CAAC,CAAC,2BAA2B,CAAC,YAGpC,KAAC,IAAI,IAAC,IAAI,EAAC,YAAY,GAAG,GACnB,IACR,CACJ,EACD,KAAC,MAAM,IACL,GAAG,EAAE,eAAe,EACpB,EAAE,EAAE,UAAU,EACd,QAAQ,EAAE,SAAS,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAC/C,OAAO,EAAC,QAAQ,EAChB,OAAO,EAAE,YAAY,EACrB,IAAI,QACJ,KAAK,EAAE,YAAY,YAEnB,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,GACb,IACJ,EACP,KAAC,eAAe,IAAC,GAAG,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,GAAI,IAChE,GACF,IACF,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { FC, useRef, useState, useEffect, MutableRefObject, MouseEvent, useContext } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Avatar,\n Button,\n StyledAvatar,\n Flex,\n Icon,\n registerIcon,\n defaultThemeProp,\n ForwardProps,\n useI18n\n} from '@pega/cosmos-react-core';\nimport { RichTextEditorState, StyledRichTextEditor } from '@pega/cosmos-react-rte';\nimport * as sendIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/send.icon';\nimport * as paperClipIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/paper-clip.icon';\n\nimport FeedRichText from './FeedRichText';\nimport FeedButton from './FeedButton';\nimport FeedAttachments, { AttachedFiles } from './FeedAttachments';\nimport { FeedContext } from './Feed.context';\n\nregisterIcon(sendIcon, paperClipIcon);\n\nexport interface FeedReplyInputProps {\n /** Unique ID for this Reply Input */\n id: string;\n /** Label text for the reply submit button. */\n commentLabel: string;\n /** A set of attachment files. */\n attachments?: AttachedFiles[];\n /** Placeholder string for the input */\n placeholder: string;\n /** A callback containing a list of added files that will run whenever files are added to the post. */\n onFilesAdded?: (files: AttachedFiles[]) => void;\n /** Callback that runs when the submit button has been pressed */\n onSubmit: (event: {\n replyId: string;\n value: string;\n attachments: AttachedFiles[];\n clear: () => void;\n }) => void;\n /** Callback that sets returns a shared ref to the RTE component */\n onSetInputRef?: (event: { ref: MutableRefObject<RichTextEditorState | undefined> }) => void;\n}\n\nexport const StyledReplyInputContainer = styled.div(props => {\n const { theme } = props;\n\n return css`\n ${StyledAvatar} {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledReplyInputContainer.defaultProps = defaultThemeProp;\n\nexport const StyledFeedReply = styled.div(props => {\n const { theme } = props;\n\n return css`\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-radius: calc(2.5 * ${theme.base['border-radius']});\n padding: 0 calc(2 * ${theme.base.spacing});\n cursor: text;\n\n ${FeedButton} {\n align-self: flex-end;\n }\n `;\n});\n\nStyledFeedReply.defaultProps = defaultThemeProp;\n\nconst StyledFeedReplyInput = styled.div(props => {\n const { theme } = props;\n\n return css`\n padding-top: calc(0.75 * ${theme.base.spacing});\n\n ${StyledRichTextEditor} {\n &:focus-within {\n box-shadow: none;\n }\n }\n `;\n});\n\nStyledFeedReplyInput.defaultProps = defaultThemeProp;\n\nconst HiddenFileInput = styled.input`\n display: none;\n`;\n\nconst FeedReplyInput: FC<ForwardProps & FeedReplyInputProps> = (\n props: ForwardProps & FeedReplyInputProps\n) => {\n const rteRef = useRef<RichTextEditorState>();\n const {\n id,\n commentLabel,\n attachments = [],\n placeholder,\n onAddAttachment,\n onSubmit,\n onSetInputRef,\n onFilesAdded,\n ...restProps\n } = props;\n\n const [emptyText, setEmptyText] = useState(true);\n const hiddenInputRef = useRef<HTMLInputElement>(null);\n const attachmentListRef = useRef<HTMLUListElement>(null);\n const attachmentsButtonRef = useRef<HTMLButtonElement>(null);\n const submitButtonRef = useRef<HTMLButtonElement>(null);\n const { setShowSearchResults } = useContext(FeedContext);\n const { avatarSrc, fullname } = useContext(FeedContext).userInfo;\n\n useEffect(() => {\n onSetInputRef?.({ ref: rteRef });\n }, [rteRef]);\n\n const t = useI18n();\n\n const handleSubmit = () => {\n setShowSearchResults?.(false);\n if (!emptyText || attachments.length > 0) {\n onSubmit({\n replyId: id,\n value: rteRef.current?.getPlainText() || '',\n attachments: attachments || [],\n clear: () => {\n rteRef.current?.clear();\n }\n });\n }\n };\n\n return (\n <Flex container as={StyledReplyInputContainer} {...restProps}>\n <Avatar name={fullname} size='m' imageSrc={avatarSrc} />\n <Flex\n container={{ alignItems: 'start' }}\n item={{ grow: 1 }}\n as={StyledFeedReply}\n onClick={(event: MouseEvent) => {\n if (\n attachmentListRef.current &&\n event.target !== attachmentListRef.current &&\n attachmentListRef.current.contains(event.target as Node)\n ) {\n return;\n }\n\n if (\n attachmentsButtonRef.current?.contains(event.target as Node) ||\n submitButtonRef.current?.contains(event.target as Node)\n ) {\n return;\n }\n\n rteRef.current?.focus();\n }}\n >\n <Flex container={{ direction: 'column' }} item={{ grow: 1 }}>\n <Flex container item={{ grow: 1 }}>\n <Flex as={StyledFeedReplyInput} item={{ grow: 1 }}>\n <FeedRichText\n label={t('feed_new_reply')}\n ref={rteRef}\n placeholder={placeholder}\n onChange={() => {\n setEmptyText(rteRef.current?.getPlainText().trim() === '');\n }}\n onSubmit={handleSubmit}\n />\n </Flex>\n {onFilesAdded && (\n <>\n <HiddenFileInput\n ref={hiddenInputRef}\n type='file'\n multiple\n onChange={() => {\n if (hiddenInputRef.current?.files) {\n onFilesAdded?.(Array.from(hiddenInputRef.current?.files));\n }\n }}\n // Must trick input to believe there is no value when activated so that the same file may be added consecutively.\n onClick={(event: MouseEvent) => {\n (event.target as HTMLInputElement).value = '';\n }}\n />\n <Button\n ref={attachmentsButtonRef}\n as={FeedButton}\n variant='simple'\n onClick={() => {\n setShowSearchResults?.(false);\n hiddenInputRef.current?.click();\n }}\n icon\n label={\n attachments.length\n ? t('attachments_count', [], { count: 1 }).toUpperCase()\n : t('file_upload_text_multiple')\n }\n >\n <Icon name='paper-clip' />\n </Button>\n </>\n )}\n <Button\n ref={submitButtonRef}\n as={FeedButton}\n disabled={emptyText && attachments.length === 0}\n variant='simple'\n onClick={handleSubmit}\n icon\n label={commentLabel}\n >\n <Icon name='send' />\n </Button>\n </Flex>\n <FeedAttachments ref={attachmentListRef} attachments={attachments} />\n </Flex>\n </Flex>\n </Flex>\n );\n};\n\nexport default FeedReplyInput;\n"]}
@@ -3,7 +3,7 @@ import { ForwardProps } from '@pega/cosmos-react-core';
3
3
  interface MentionButtonProps {
4
4
  /** Text for the button, or an object containing all necessary props. */
5
5
  children: Record<string, string> | ReactElement;
6
- /** The id of the mention. */
6
+ /** The id of the mention. */
7
7
  id?: string;
8
8
  /** The text of the mention button. */
9
9
  text?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"MentionButton.d.ts","sourceRoot":"","sources":["../../../src/components/MentionButton/MentionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAGjB,YAAY,EAKb,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,YAAY,EAIb,MAAM,yBAAyB,CAAC;AAKjC,UAAU,kBAAkB;IAC1B,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,YAAY,CAAC;IAChD,8BAA8B;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAoBD,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAoFvE,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;YAKW,MAAM;cAAQ,MAAM;cAAQ,MAAM;;;uBAWxD,MAAM;;;;;;CAW1B,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"MentionButton.d.ts","sourceRoot":"","sources":["../../../src/components/MentionButton/MentionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAGjB,YAAY,EAKb,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,YAAY,EAIb,MAAM,yBAAyB,CAAC;AAKjC,UAAU,kBAAkB;IAC1B,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,YAAY,CAAC;IAChD,6BAA6B;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAoBD,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAoFvE,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;YAKW,MAAM;cAAQ,MAAM;cAAQ,MAAM;;;uBAWxD,MAAM;;;;;;CAW1B,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -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,QAAQ,EAET,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,MAAM,EAEN,IAAI,EACJ,kBAAkB,EA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IAAI;YACrB,IAAI,EAAE,UAAU,CAAC,IAAI;SACtB,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n isValidElement,\n PropsWithoutRef,\n ReactElement,\n Ref,\n useContext,\n useState,\n MouseEvent\n} from 'react';\nimport styled from 'styled-components';\n\nimport {\n Button,\n ForwardProps,\n Link,\n useConsolidatedRef,\n useElement\n} from '@pega/cosmos-react-core';\nimport { getXMLAttributes } from '@pega/cosmos-react-rte';\n\nimport { FeedContext } from '../Feed/Feed.context';\n\ninterface MentionButtonProps {\n /** Text for the button, or an object containing all necessary props. */\n children: Record<string, string> | ReactElement;\n /** The id of the mention. */\n id?: string;\n /** The text of the mention button. */\n text?: string;\n /** Designates the type of the mention for proper handling on click. */\n type?: string;\n /** If an href is provided, render a link. Otherwise, render a button. */\n href?: string;\n}\n\nconst StyledButton = styled(Button)`\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: none;\n text-decoration: underline;\n }\n`;\n\nconst StyledLink = styled(Link)`\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: none;\n text-decoration: underline;\n }\n`;\n\nconst serializer = new XMLSerializer();\n\nconst MentionButton: FunctionComponent<MentionButtonProps & ForwardProps> = forwardRef(\n (\n {\n children,\n id: idProp = '',\n text: textProp = '',\n type: typeProp = '',\n href: hrefProp = '',\n ...restProps\n }: PropsWithoutRef<MentionButtonProps>,\n ref: Ref<HTMLButtonElement>\n ) => {\n const { onMentionClick, onMentionPreview } = useContext(FeedContext);\n const [mentionContent, setMentionContent] = useState<JSX.Element | undefined>();\n const [target, setTarget] = useElement<HTMLButtonElement>(null);\n const mentionRef = useConsolidatedRef(ref);\n\n let id = '';\n let text = '';\n let type = '';\n let href = '';\n\n if (!isValidElement<any>(children)) {\n if (!children.id || !children.text || !children.type) return <span>{children.rawText}</span>;\n id = children.id;\n text = children.text;\n type = children.type;\n href = children.href || '';\n } else {\n id = idProp;\n text = textProp;\n type = typeProp;\n href = hrefProp;\n }\n\n const handleClick = (e: MouseEvent<HTMLButtonElement>) => {\n setTarget(e.currentTarget);\n const comp = onMentionClick?.({\n id,\n text,\n type,\n target: e.currentTarget,\n closeGlimpse: () => setTarget(null)\n });\n if (comp) setMentionContent(comp);\n };\n\n return (\n <>\n {href ? (\n <StyledLink\n {...restProps}\n ref={mentionRef}\n href={href}\n previewable={!!onMentionPreview}\n onPreview={\n onMentionPreview\n ? () =>\n onMentionPreview({\n id,\n text,\n type\n })\n : undefined\n }\n spellCheck={false}\n >\n {isValidElement(children) ? children : text}\n </StyledLink>\n ) : (\n <StyledButton\n {...restProps}\n ref={mentionRef}\n variant='link'\n onClick={handleClick}\n spellCheck={false}\n >\n {isValidElement(children) ? children : text}\n </StyledButton>\n )}\n {target && mentionContent}\n </>\n );\n }\n);\n\nexport const MentionButtonConfig = {\n type: 'mention',\n xmlElement: 'pega-mention',\n regexPattern: /(?:^|)<pega-mention (?:[^\\n/]|\\/(?!>))+\\/>/g,\n component: MentionButton,\n inject: ({ id, type, text, href }: { id: string; type: string; text: string; href?: string }) => {\n if (!id || !type || !text) return;\n\n const element = document.createElementNS(null, 'pega-mention');\n element.setAttribute('id', id);\n element.setAttribute('text', text);\n element.setAttribute('type', type);\n if (href) element.setAttribute('href', href);\n\n return serializer.serializeToString(element);\n },\n extract: (element: string) => {\n const attributes = getXMLAttributes(element);\n\n if (!attributes || !attributes.id || !attributes.text || !attributes.type) return undefined;\n return {\n id: attributes.id,\n text: attributes.text,\n type: attributes.type,\n href: attributes.href\n };\n }\n};\n\nexport default MentionButton;\n"]}
1
+ {"version":3,"file":"MentionButton.js","sourceRoot":"","sources":["../../../src/components/MentionButton/MentionButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAEV,cAAc,EAId,UAAU,EACV,QAAQ,EAET,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,MAAM,E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rB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,IAAI,EAAE,UAAU,CAAC,IAAI;SACtB,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n isValidElement,\n PropsWithoutRef,\n ReactElement,\n Ref,\n useContext,\n useState,\n MouseEvent\n} from 'react';\nimport styled from 'styled-components';\n\nimport {\n Button,\n ForwardProps,\n Link,\n useConsolidatedRef,\n useElement\n} from '@pega/cosmos-react-core';\nimport { getXMLAttributes } from '@pega/cosmos-react-rte';\n\nimport { FeedContext } from '../Feed/Feed.context';\n\ninterface MentionButtonProps {\n /** Text for the button, or an object containing all necessary props. */\n children: Record<string, string> | ReactElement;\n /** The id of the mention. */\n id?: string;\n /** The text of the mention button. */\n text?: string;\n /** Designates the type of the mention for proper handling on click. */\n type?: string;\n /** If an href is provided, render a link. Otherwise, render a button. */\n href?: string;\n}\n\nconst StyledButton = styled(Button)`\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: none;\n text-decoration: underline;\n }\n`;\n\nconst StyledLink = styled(Link)`\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: none;\n text-decoration: underline;\n }\n`;\n\nconst serializer = new XMLSerializer();\n\nconst MentionButton: FunctionComponent<MentionButtonProps & ForwardProps> = forwardRef(\n (\n {\n children,\n id: idProp = '',\n text: textProp = '',\n type: typeProp = '',\n href: hrefProp = '',\n ...restProps\n }: PropsWithoutRef<MentionButtonProps>,\n ref: Ref<HTMLButtonElement>\n ) => {\n const { onMentionClick, onMentionPreview } = useContext(FeedContext);\n const [mentionContent, setMentionContent] = useState<JSX.Element | undefined>();\n const [target, setTarget] = useElement<HTMLButtonElement>(null);\n const mentionRef = useConsolidatedRef(ref);\n\n let id = '';\n let text = '';\n let type = '';\n let href = '';\n\n if (!isValidElement<any>(children)) {\n if (!children.id || !children.text || !children.type) return <span>{children.rawText}</span>;\n id = children.id;\n text = children.text;\n type = children.type;\n href = children.href || '';\n } else {\n id = idProp;\n text = textProp;\n type = typeProp;\n href = hrefProp;\n }\n\n const handleClick = (e: MouseEvent<HTMLButtonElement>) => {\n setTarget(e.currentTarget);\n const comp = onMentionClick?.({\n id,\n text,\n type,\n target: e.currentTarget,\n closeGlimpse: () => setTarget(null)\n });\n if (comp) setMentionContent(comp);\n };\n\n return (\n <>\n {href ? (\n <StyledLink\n {...restProps}\n ref={mentionRef}\n href={href}\n previewable={!!onMentionPreview}\n onPreview={\n onMentionPreview\n ? () =>\n onMentionPreview({\n id,\n text,\n type\n })\n : undefined\n }\n spellCheck={false}\n >\n {isValidElement(children) ? children : text}\n </StyledLink>\n ) : (\n <StyledButton\n {...restProps}\n ref={mentionRef}\n variant='link'\n onClick={handleClick}\n spellCheck={false}\n >\n {isValidElement(children) ? children : text}\n </StyledButton>\n )}\n {target && mentionContent}\n </>\n );\n }\n);\n\nexport const MentionButtonConfig = {\n type: 'mention',\n xmlElement: 'pega-mention',\n regexPattern: /(?:^|)<pega-mention (?:[^\\n/]|\\/(?!>))+\\/>/g,\n component: MentionButton,\n inject: ({ id, type, text, href }: { id: string; type: string; text: string; href?: string }) => {\n if (!id || !type || !text) return;\n\n const element = document.createElementNS(null, 'pega-mention');\n element.setAttribute('id', id);\n element.setAttribute('text', text);\n element.setAttribute('type', type);\n if (href) element.setAttribute('href', href);\n\n return serializer.serializeToString(element);\n },\n extract: (element: string) => {\n const attributes = getXMLAttributes(element);\n\n if (!attributes || !attributes.id || !attributes.text || !attributes.type) return undefined;\n return {\n id: attributes.id,\n text: attributes.text,\n type: attributes.type,\n href: attributes.href\n };\n }\n};\n\nexport default MentionButton;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-social",
3
- "version": "4.0.0-dev.14.0",
3
+ "version": "4.0.0-dev.14.2",
4
4
  "author": "Pegasystems",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
@@ -23,9 +23,9 @@
23
23
  "build": "tsc -b"
24
24
  },
25
25
  "dependencies": {
26
- "@pega/cosmos-react-core": "4.0.0-dev.14.0",
27
- "@pega/cosmos-react-rte": "4.0.0-dev.14.0",
28
- "@pega/cosmos-react-work": "4.0.0-dev.14.0",
26
+ "@pega/cosmos-react-core": "4.0.0-dev.14.2",
27
+ "@pega/cosmos-react-rte": "4.0.0-dev.14.2",
28
+ "@pega/cosmos-react-work": "4.0.0-dev.14.2",
29
29
  "@types/parse5": "^6.0.0",
30
30
  "@types/react": "^16.14.24 || ^17.0.38",
31
31
  "@types/react-dom": "^16.9.14 || ^17.0.11",