@weavy/uikit-react 13.0.0 → 14.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +30 -0
- package/dist/cjs/{types/client → client}/WeavyClient.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Attachment.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Avatar.d.ts +0 -0
- package/dist/{esm/types → cjs}/components/Chat.d.ts +1 -1
- package/dist/cjs/{types/components → components}/Conversation.d.ts +0 -0
- package/dist/cjs/{types/components → components}/ConversationBadge.d.ts +0 -0
- package/dist/cjs/{types/components → components}/ConversationForm.d.ts +0 -0
- package/dist/cjs/{types/components → components}/ConversationList.d.ts +0 -0
- package/dist/cjs/{types/components → components}/ConversationListItem.d.ts +0 -0
- package/dist/cjs/{types/components → components}/File.d.ts +0 -0
- package/dist/cjs/{types/components → components}/FileBrowser.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Image.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Meeting.d.ts +0 -0
- package/dist/cjs/{types/components → components}/MeetingCard.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Meetings.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Message.d.ts +0 -0
- package/dist/{esm/types → cjs}/components/Messages.d.ts +3 -1
- package/dist/cjs/{types/components → components}/Messenger.d.ts +0 -0
- package/dist/cjs/{types/components → components}/NewConversation.d.ts +0 -0
- package/dist/cjs/{types/components → components}/PdfViewer.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Presence.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Preview.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Reactions.d.ts +0 -0
- package/dist/cjs/{types/components → components}/SearchUsers.d.ts +0 -0
- package/dist/cjs/{types/components → components}/SeenBy.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Typing.d.ts +0 -0
- package/dist/cjs/{types/contexts → contexts}/MessengerContext.d.ts +0 -0
- package/dist/cjs/{types/contexts → contexts}/PreviewContext.d.ts +0 -0
- package/dist/cjs/{types/contexts → contexts}/UserContext.d.ts +0 -0
- package/dist/cjs/{types/contexts → contexts}/WeavyContext.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useBadge.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useChat.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useConversation.d.ts +0 -0
- package/dist/cjs/hooks/useConversations.d.ts +1 -0
- package/dist/cjs/{types/hooks → hooks}/useDebounce.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useEvents.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useFileUploader.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMembers.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMessages.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateChat.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateConversation.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateConversationName.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateDeleteReaction.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateExternalBlobs.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateMeeting.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateMembers.d.ts +0 -0
- package/dist/{esm/types → cjs}/hooks/useMutateMessage.d.ts +1 -1
- package/dist/cjs/{types/hooks → hooks}/useMutatePinned.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateReaction.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateRead.d.ts +1 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateRemoveMembers.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateTyping.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/usePresence.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/usePreview.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useReactions.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useSearchUsers.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useThrottle.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useUser.d.ts +0 -0
- package/dist/cjs/{types/index.d.ts → index.d.ts} +0 -0
- package/dist/cjs/index.js +6 -28
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/{types/Chat.d.ts → Chat.d.ts} +1 -0
- package/dist/cjs/types/{types/Conversation.d.ts → Conversation.d.ts} +0 -0
- package/dist/cjs/types/{types/ConversationListItem.d.ts → ConversationListItem.d.ts} +0 -0
- package/dist/{esm/types → cjs}/types/Message.d.ts +2 -0
- package/dist/cjs/types/{types/Messenger.d.ts → Messenger.d.ts} +0 -0
- package/dist/cjs/types/{types/types.d.ts → types.d.ts} +47 -4
- package/dist/cjs/{types/ui → ui}/Button.d.ts +0 -0
- package/dist/cjs/{types/ui → ui}/Dropdown.d.ts +0 -0
- package/dist/cjs/{types/ui → ui}/Icon.d.ts +0 -0
- package/dist/cjs/{types/ui → ui}/Overlay.d.ts +0 -0
- package/dist/cjs/{types/ui → ui}/Spinner.d.ts +2 -1
- package/dist/cjs/{types/utils → utils}/fileUtilities.d.ts +0 -0
- package/dist/css/weavy-chat.css +1543 -959
- package/dist/css/weavy-messenger.css +1903 -1302
- package/dist/css/weavy.css +1703 -1102
- package/dist/esm/{types/client → client}/WeavyClient.d.ts +0 -0
- package/dist/esm/{types/components → components}/Attachment.d.ts +0 -0
- package/dist/esm/{types/components → components}/Avatar.d.ts +0 -0
- package/dist/{cjs/types → esm}/components/Chat.d.ts +1 -1
- package/dist/esm/{types/components → components}/Conversation.d.ts +0 -0
- package/dist/esm/{types/components → components}/ConversationBadge.d.ts +0 -0
- package/dist/esm/{types/components → components}/ConversationForm.d.ts +0 -0
- package/dist/esm/{types/components → components}/ConversationList.d.ts +0 -0
- package/dist/esm/{types/components → components}/ConversationListItem.d.ts +0 -0
- package/dist/esm/{types/components → components}/File.d.ts +0 -0
- package/dist/esm/{types/components → components}/FileBrowser.d.ts +0 -0
- package/dist/esm/{types/components → components}/Image.d.ts +0 -0
- package/dist/esm/{types/components → components}/Meeting.d.ts +0 -0
- package/dist/esm/{types/components → components}/MeetingCard.d.ts +0 -0
- package/dist/esm/{types/components → components}/Meetings.d.ts +0 -0
- package/dist/esm/{types/components → components}/Message.d.ts +0 -0
- package/dist/{cjs/types → esm}/components/Messages.d.ts +3 -1
- package/dist/esm/{types/components → components}/Messenger.d.ts +0 -0
- package/dist/esm/{types/components → components}/NewConversation.d.ts +0 -0
- package/dist/esm/{types/components → components}/PdfViewer.d.ts +0 -0
- package/dist/esm/{types/components → components}/Presence.d.ts +0 -0
- package/dist/esm/{types/components → components}/Preview.d.ts +0 -0
- package/dist/esm/{types/components → components}/Reactions.d.ts +0 -0
- package/dist/esm/{types/components → components}/SearchUsers.d.ts +0 -0
- package/dist/esm/{types/components → components}/SeenBy.d.ts +0 -0
- package/dist/esm/{types/components → components}/Typing.d.ts +0 -0
- package/dist/esm/{types/contexts → contexts}/MessengerContext.d.ts +0 -0
- package/dist/esm/{types/contexts → contexts}/PreviewContext.d.ts +0 -0
- package/dist/esm/{types/contexts → contexts}/UserContext.d.ts +0 -0
- package/dist/esm/{types/contexts → contexts}/WeavyContext.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useBadge.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useChat.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useConversation.d.ts +0 -0
- package/dist/esm/hooks/useConversations.d.ts +1 -0
- package/dist/esm/{types/hooks → hooks}/useDebounce.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useEvents.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useFileUploader.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMembers.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMessages.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateChat.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateConversation.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateConversationName.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateDeleteReaction.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateExternalBlobs.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateMeeting.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateMembers.d.ts +0 -0
- package/dist/{cjs/types → esm}/hooks/useMutateMessage.d.ts +1 -1
- package/dist/esm/{types/hooks → hooks}/useMutatePinned.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateReaction.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateRead.d.ts +1 -0
- package/dist/esm/{types/hooks → hooks}/useMutateRemoveMembers.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateTyping.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/usePresence.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/usePreview.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useReactions.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useSearchUsers.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useThrottle.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useUser.d.ts +0 -0
- package/dist/esm/{types/index.d.ts → index.d.ts} +0 -0
- package/dist/esm/index.js +6 -28
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/{types/Chat.d.ts → Chat.d.ts} +1 -0
- package/dist/esm/types/{types/Conversation.d.ts → Conversation.d.ts} +0 -0
- package/dist/esm/types/{types/ConversationListItem.d.ts → ConversationListItem.d.ts} +0 -0
- package/dist/{cjs/types → esm}/types/Message.d.ts +2 -0
- package/dist/esm/types/{types/Messenger.d.ts → Messenger.d.ts} +0 -0
- package/dist/esm/types/{types/types.d.ts → types.d.ts} +47 -4
- package/dist/esm/{types/ui → ui}/Button.d.ts +0 -0
- package/dist/esm/{types/ui → ui}/Dropdown.d.ts +0 -0
- package/dist/esm/{types/ui → ui}/Icon.d.ts +0 -0
- package/dist/esm/{types/ui → ui}/Overlay.d.ts +0 -0
- package/dist/esm/{types/ui → ui}/Spinner.d.ts +2 -1
- package/dist/esm/{types/utils → utils}/fileUtilities.d.ts +0 -0
- package/dist/index.d.ts +2 -1
- package/package.json +18 -15
- package/{rollup.config.js → rollup.config.mjs} +10 -3
- package/src/client/WeavyClient.ts +12 -17
- package/src/components/Attachment.tsx +5 -5
- package/src/components/Chat.tsx +6 -5
- package/src/components/Conversation.tsx +26 -20
- package/src/components/ConversationBadge.tsx +7 -5
- package/src/components/ConversationForm.tsx +1 -1
- package/src/components/ConversationList.tsx +59 -11
- package/src/components/ConversationListItem.tsx +94 -58
- package/src/components/FileBrowser.tsx +53 -50
- package/src/components/Image.tsx +2 -1
- package/src/components/MeetingCard.tsx +35 -13
- package/src/components/Meetings.tsx +1 -1
- package/src/components/Message.tsx +41 -42
- package/src/components/Messages.tsx +61 -60
- package/src/components/Messenger.tsx +7 -2
- package/src/components/NewConversation.tsx +1 -1
- package/src/components/PdfViewer.tsx +5 -5
- package/src/components/Preview.tsx +2 -2
- package/src/components/Reactions.tsx +11 -5
- package/src/components/SearchUsers.tsx +19 -9
- package/src/components/SeenBy.tsx +13 -7
- package/src/components/Typing.tsx +11 -12
- package/src/contexts/UserContext.tsx +1 -1
- package/src/contexts/WeavyContext.tsx +3 -3
- package/src/hooks/useConversations.ts +15 -5
- package/src/hooks/useMutateMessage.ts +1 -5
- package/src/hooks/useMutateRead.ts +5 -3
- package/src/hooks/usePresence.ts +2 -3
- package/src/hooks/useReactions.ts +11 -12
- package/src/scss/theme/_alert.scss +61 -63
- package/src/scss/theme/_appbar.scss +105 -30
- package/src/scss/theme/_avatar.scss +23 -28
- package/src/scss/theme/_badge.scss +26 -18
- package/src/scss/theme/_buttons.scss +107 -52
- package/src/scss/theme/_card.scss +102 -4
- package/src/scss/theme/_checkbox.scss +16 -20
- package/src/scss/theme/_code-vscode-dark.scss +3 -3
- package/src/scss/theme/_code-vscode-light.scss +3 -3
- package/src/scss/theme/_code.scss +0 -2
- package/src/scss/theme/_comment-editor-cm.scss +97 -0
- package/src/scss/theme/_comment-editor.scss +129 -0
- package/src/scss/theme/_comments.scss +66 -0
- package/src/scss/theme/_content.scss +33 -5
- package/src/scss/theme/_conversations.scss +19 -78
- package/src/scss/theme/_dropdown.scss +102 -15
- package/src/scss/theme/_embed.scss +135 -0
- package/src/scss/theme/_facepile.scss +11 -0
- package/src/scss/theme/_filebrowser.scss +1 -1
- package/src/scss/theme/_files.scss +76 -47
- package/src/scss/theme/_grid.scss +8 -0
- package/src/scss/theme/_icons.scss +155 -19
- package/src/scss/theme/_image-grid.scss +7 -12
- package/src/scss/theme/_input.scss +160 -0
- package/src/scss/theme/_item.scss +169 -0
- package/src/scss/theme/_list.scss +57 -0
- package/src/scss/theme/_meeting.scss +11 -0
- package/src/scss/theme/_message-editor-cm.scss +95 -0
- package/src/scss/theme/_message-editor.scss +65 -19
- package/src/scss/theme/_messages.scss +51 -105
- package/src/scss/theme/_meta.scss +12 -0
- package/src/scss/theme/_overlays.scss +31 -76
- package/src/scss/theme/_pager.scss +5 -1
- package/src/scss/theme/_pane.scss +13 -2
- package/src/scss/theme/_panels.scss +33 -28
- package/src/scss/theme/_picker-list.scss +5 -3
- package/src/scss/theme/_placeholder.scss +19 -0
- package/src/scss/theme/_poll.scss +49 -0
- package/src/scss/theme/_post-editor-cm.scss +100 -0
- package/src/scss/theme/_post-editor.scss +127 -0
- package/src/scss/theme/_post.scss +83 -0
- package/src/scss/theme/_preview-code.scss +11 -2
- package/src/scss/theme/_preview-embed.scss +8 -2
- package/src/scss/theme/_preview-image.scss +8 -26
- package/src/scss/theme/_preview-media.scss +1 -0
- package/src/scss/theme/_preview-pdf.scss +10 -15
- package/src/scss/theme/_preview.scss +57 -79
- package/src/scss/theme/_reactions.scss +48 -17
- package/src/scss/theme/_sheet.scss +59 -0
- package/src/scss/theme/_sidebar.scss +86 -0
- package/src/scss/theme/_spinner.scss +11 -7
- package/src/scss/theme/_tab.scss +72 -0
- package/src/scss/theme/_tables.scss +70 -23
- package/src/scss/theme/_toasts.scss +56 -26
- package/src/scss/theme/_type.scss +41 -0
- package/src/scss/theme/{mixins → base}/_backdrop.scss +0 -0
- package/src/scss/theme/{bootstrap/mixins → base}/_breakpoints.scss +9 -0
- package/src/scss/theme/base/_colors.scss +315 -0
- package/src/scss/theme/base/_md.scss +19 -0
- package/src/scss/theme/base/_palette.scss +130 -0
- package/src/scss/theme/{mixins → base}/_position.scss +5 -5
- package/src/scss/theme/base/_reboot.scss +51 -0
- package/src/scss/theme/base/_scroll.scss +180 -0
- package/src/scss/theme/base/_svg.scss +49 -0
- package/src/scss/theme/base/_text.scss +23 -0
- package/src/scss/theme/base/_vars.scss +203 -0
- package/src/scss/theme/{fonts → base/fonts}/_fontmapping-roboto.scss +0 -0
- package/src/scss/theme/{fonts → base/fonts}/_fontmapping-segoe-ui.scss +0 -0
- package/src/scss/theme/base/fonts/_index.scss +2 -0
- package/src/scss/weavy-chat.scss +10 -4
- package/src/scss/weavy-messenger.scss +37 -21
- package/src/types/Chat.ts +2 -1
- package/src/types/Message.ts +3 -1
- package/src/types/types.ts +56 -5
- package/src/ui/Icon.tsx +1 -1
- package/src/ui/Spinner.tsx +3 -2
- package/src/utils/infiniteScroll.js +12 -3
- package/src/utils/postal-parent.js +398 -0
- package/src/utils/promise.js +187 -0
- package/src/utils/scrollbarDetection.js +71 -9
- package/src/utils/utils.js +547 -0
- package/dist/cjs/types/hooks/useConversations.d.ts +0 -1
- package/dist/esm/types/hooks/useConversations.d.ts +0 -1
- package/src/scss/theme/_attachments.scss +0 -74
- package/src/scss/theme/_cm-editor.scss +0 -42
- package/src/scss/theme/_colors.scss +0 -520
- package/src/scss/theme/_config.scss +0 -6
- package/src/scss/theme/_inputs.scss +0 -28
- package/src/scss/theme/_nav.scss +0 -52
- package/src/scss/theme/_palette.scss +0 -165
- package/src/scss/theme/_preview-icon.scss +0 -41
- package/src/scss/theme/_reboot.scss +0 -41
- package/src/scss/theme/_root.scss +0 -2
- package/src/scss/theme/_scroll.scss +0 -55
- package/src/scss/theme/_search.scss +0 -68
- package/src/scss/theme/_turbo.scss +0 -17
- package/src/scss/theme/_variables.scss +0 -139
- package/src/scss/theme/bootstrap/_accordion.scss +0 -146
- package/src/scss/theme/bootstrap/_alert.scss +0 -71
- package/src/scss/theme/bootstrap/_badge.scss +0 -38
- package/src/scss/theme/bootstrap/_breadcrumb.scss +0 -40
- package/src/scss/theme/bootstrap/_button-group.scss +0 -142
- package/src/scss/theme/bootstrap/_buttons.scss +0 -186
- package/src/scss/theme/bootstrap/_card.scss +0 -234
- package/src/scss/theme/bootstrap/_carousel.scss +0 -229
- package/src/scss/theme/bootstrap/_close.scss +0 -40
- package/src/scss/theme/bootstrap/_containers.scss +0 -41
- package/src/scss/theme/bootstrap/_dropdown.scss +0 -248
- package/src/scss/theme/bootstrap/_forms.scss +0 -9
- package/src/scss/theme/bootstrap/_functions.scss +0 -302
- package/src/scss/theme/bootstrap/_grid.scss +0 -33
- package/src/scss/theme/bootstrap/_helpers.scss +0 -10
- package/src/scss/theme/bootstrap/_images.scss +0 -42
- package/src/scss/theme/bootstrap/_list-group.scss +0 -191
- package/src/scss/theme/bootstrap/_maps.scss +0 -54
- package/src/scss/theme/bootstrap/_mixins.scss +0 -43
- package/src/scss/theme/bootstrap/_modal.scss +0 -237
- package/src/scss/theme/bootstrap/_nav.scss +0 -172
- package/src/scss/theme/bootstrap/_navbar.scss +0 -276
- package/src/scss/theme/bootstrap/_offcanvas.scss +0 -143
- package/src/scss/theme/bootstrap/_pagination.scss +0 -109
- package/src/scss/theme/bootstrap/_placeholders.scss +0 -51
- package/src/scss/theme/bootstrap/_popover.scss +0 -196
- package/src/scss/theme/bootstrap/_progress.scss +0 -59
- package/src/scss/theme/bootstrap/_reboot.scss +0 -610
- package/src/scss/theme/bootstrap/_root.scss +0 -73
- package/src/scss/theme/bootstrap/_spinners.scss +0 -85
- package/src/scss/theme/bootstrap/_tables.scss +0 -164
- package/src/scss/theme/bootstrap/_toasts.scss +0 -70
- package/src/scss/theme/bootstrap/_tooltip.scss +0 -120
- package/src/scss/theme/bootstrap/_transitions.scss +0 -27
- package/src/scss/theme/bootstrap/_type.scss +0 -106
- package/src/scss/theme/bootstrap/_utilities.scss +0 -647
- package/src/scss/theme/bootstrap/_variables.scss +0 -1633
- package/src/scss/theme/bootstrap/forms/_floating-labels.scss +0 -74
- package/src/scss/theme/bootstrap/forms/_form-check.scss +0 -175
- package/src/scss/theme/bootstrap/forms/_form-control.scss +0 -194
- package/src/scss/theme/bootstrap/forms/_form-range.scss +0 -91
- package/src/scss/theme/bootstrap/forms/_form-select.scss +0 -71
- package/src/scss/theme/bootstrap/forms/_form-text.scss +0 -11
- package/src/scss/theme/bootstrap/forms/_input-group.scss +0 -129
- package/src/scss/theme/bootstrap/forms/_labels.scss +0 -36
- package/src/scss/theme/bootstrap/forms/_validation.scss +0 -12
- package/src/scss/theme/bootstrap/helpers/_clearfix.scss +0 -3
- package/src/scss/theme/bootstrap/helpers/_color-bg.scss +0 -10
- package/src/scss/theme/bootstrap/helpers/_colored-links.scss +0 -12
- package/src/scss/theme/bootstrap/helpers/_position.scss +0 -36
- package/src/scss/theme/bootstrap/helpers/_ratio.scss +0 -26
- package/src/scss/theme/bootstrap/helpers/_stacks.scss +0 -15
- package/src/scss/theme/bootstrap/helpers/_stretched-link.scss +0 -15
- package/src/scss/theme/bootstrap/helpers/_text-truncation.scss +0 -7
- package/src/scss/theme/bootstrap/helpers/_visually-hidden.scss +0 -8
- package/src/scss/theme/bootstrap/helpers/_vr.scss +0 -8
- package/src/scss/theme/bootstrap/mixins/_alert.scss +0 -15
- package/src/scss/theme/bootstrap/mixins/_backdrop.scss +0 -14
- package/src/scss/theme/bootstrap/mixins/_banner.scss +0 -9
- package/src/scss/theme/bootstrap/mixins/_border-radius.scss +0 -78
- package/src/scss/theme/bootstrap/mixins/_box-shadow.scss +0 -18
- package/src/scss/theme/bootstrap/mixins/_buttons.scss +0 -70
- package/src/scss/theme/bootstrap/mixins/_caret.scss +0 -64
- package/src/scss/theme/bootstrap/mixins/_clearfix.scss +0 -9
- package/src/scss/theme/bootstrap/mixins/_color-scheme.scss +0 -7
- package/src/scss/theme/bootstrap/mixins/_container.scss +0 -11
- package/src/scss/theme/bootstrap/mixins/_deprecate.scss +0 -10
- package/src/scss/theme/bootstrap/mixins/_forms.scss +0 -152
- package/src/scss/theme/bootstrap/mixins/_gradients.scss +0 -47
- package/src/scss/theme/bootstrap/mixins/_grid.scss +0 -151
- package/src/scss/theme/bootstrap/mixins/_image.scss +0 -16
- package/src/scss/theme/bootstrap/mixins/_list-group.scss +0 -24
- package/src/scss/theme/bootstrap/mixins/_lists.scss +0 -7
- package/src/scss/theme/bootstrap/mixins/_pagination.scss +0 -10
- package/src/scss/theme/bootstrap/mixins/_reset-text.scss +0 -17
- package/src/scss/theme/bootstrap/mixins/_resize.scss +0 -6
- package/src/scss/theme/bootstrap/mixins/_table-variants.scss +0 -24
- package/src/scss/theme/bootstrap/mixins/_text-truncate.scss +0 -8
- package/src/scss/theme/bootstrap/mixins/_transition.scss +0 -26
- package/src/scss/theme/bootstrap/mixins/_utilities.scss +0 -97
- package/src/scss/theme/bootstrap/mixins/_visually-hidden.scss +0 -29
- package/src/scss/theme/bootstrap/utilities/_api.scss +0 -47
- package/src/scss/theme/bootstrap/vendor/_rfs.scss +0 -354
- package/src/scss/theme/bs/_badge.scss +0 -20
- package/src/scss/theme/bs/_buttons.scss +0 -185
- package/src/scss/theme/bs/_dropdown.scss +0 -86
- package/src/scss/theme/bs/_forms.scss +0 -161
- package/src/scss/theme/bs/_list-group.scss +0 -73
- package/src/scss/theme/bs/_tables.scss +0 -46
- package/src/scss/theme/fonts/_index.scss +0 -2
- package/src/scss/theme/mixins/_palette.scss +0 -165
- package/src/scss/theme/mixins/_scrollbar.scss +0 -110
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { useCallback, useContext, useEffect } from 'react';
|
|
2
|
-
import joypixels from 'emoji-toolkit';
|
|
3
2
|
import dayjs from 'dayjs';
|
|
4
3
|
import { MessengerContext } from '../contexts/MessengerContext';
|
|
5
4
|
import { WeavyContext } from '../contexts/WeavyContext';
|
|
@@ -25,24 +24,62 @@ const ConversationListItem = ({ item, refetchConversations }: ConversationListIt
|
|
|
25
24
|
const removeMembers = useMutateRemoveMembers();
|
|
26
25
|
const date = dayjs.utc(item.last_message?.created_at).tz(dayjs.tz.guess());
|
|
27
26
|
|
|
27
|
+
|
|
28
|
+
// extract and keep all emojis
|
|
29
|
+
const emojiHtml = item.last_message?.html || '';
|
|
30
|
+
const emojiRegexp = /<img[^>]+wy-emoji.+>/g;
|
|
31
|
+
const emojiShortcodeRegexp = /title=\"(:[^:\s]+:)\"/;
|
|
32
|
+
const messageEmojis: { [index: string]: string } = {};
|
|
33
|
+
|
|
34
|
+
emojiHtml.match(emojiRegexp)?.forEach((imgEmoji) => {
|
|
35
|
+
let shortCode = imgEmoji.match(emojiShortcodeRegexp)![1];
|
|
36
|
+
|
|
37
|
+
if (shortCode) {
|
|
38
|
+
messageEmojis[shortCode] = imgEmoji;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// replace text shortcodes with extracted emojis
|
|
43
|
+
const shortCodeRegexp = /:[^:\s]*(?:::[^:\s]*)*:/gi;
|
|
44
|
+
const itemSnippet = (item.last_message?.text || '').replace(shortCodeRegexp, (shortCode) => messageEmojis[shortCode]);
|
|
45
|
+
|
|
46
|
+
|
|
28
47
|
const ChatRoom = "edb400ac-839b-45a7-b2a8-6a01820d1c44";
|
|
29
48
|
|
|
30
|
-
const handleClick = (e: React.MouseEvent<
|
|
31
|
-
e.
|
|
32
|
-
|
|
49
|
+
const handleClick = (e: React.MouseEvent<HTMLDivElement>, id: any) => {
|
|
50
|
+
if (!e.defaultPrevented) {
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
setSelectedConversationId(id);
|
|
53
|
+
}
|
|
33
54
|
}
|
|
34
55
|
|
|
35
|
-
const handleAppUpdated = useCallback((
|
|
36
|
-
if (
|
|
56
|
+
const handleAppUpdated = useCallback((realtimeEvent: RealtimeApp) => {
|
|
57
|
+
if (realtimeEvent.app.id !== item.id) return;
|
|
37
58
|
refetchConversations();
|
|
38
59
|
|
|
39
|
-
}, [item.id])
|
|
60
|
+
}, [item.id]);
|
|
61
|
+
|
|
62
|
+
const handleMessageCreated = useCallback((realtimeEvent: RealtimeMessage) => {
|
|
63
|
+
if (realtimeEvent.message.app_id !== item.id) return;
|
|
64
|
+
refetchConversations();
|
|
65
|
+
|
|
66
|
+
}, [item.id]);
|
|
67
|
+
|
|
68
|
+
const handleMemberAdded = useCallback((realtimeEvent: RealtimeMember) => {
|
|
69
|
+
if (realtimeEvent.app.id !== item.id) return;
|
|
70
|
+
refetchConversations();
|
|
71
|
+
|
|
72
|
+
}, [item.id]);
|
|
40
73
|
|
|
41
74
|
useEffect(() => {
|
|
42
|
-
client?.subscribe(`a${item.id}`, "
|
|
75
|
+
client?.subscribe(`a${item.id}`, "app_updated", handleAppUpdated);
|
|
76
|
+
client?.subscribe(`a${item.id}`, "message_created", handleMessageCreated);
|
|
77
|
+
client?.subscribe(`a${item.id}`, "member_added", handleMemberAdded);
|
|
43
78
|
|
|
44
79
|
return () => {
|
|
45
|
-
client?.unsubscribe(`a${item.id}`, "
|
|
80
|
+
client?.unsubscribe(`a${item.id}`, "app_updated", handleAppUpdated);
|
|
81
|
+
client?.unsubscribe(`a${item.id}`, "message_created", handleMessageCreated);
|
|
82
|
+
client?.unsubscribe(`a${item.id}`, "member_added", handleMemberAdded);
|
|
46
83
|
}
|
|
47
84
|
}, [item.id])
|
|
48
85
|
|
|
@@ -50,12 +87,12 @@ const ConversationListItem = ({ item, refetchConversations }: ConversationListIt
|
|
|
50
87
|
|
|
51
88
|
const handleUnread = (e: React.MouseEvent<HTMLAnchorElement>) => {
|
|
52
89
|
e.preventDefault();
|
|
53
|
-
readMutation.mutate({ id: item.id, read: false });
|
|
90
|
+
readMutation.mutate({ id: item.id, read: false, messageId: null });
|
|
54
91
|
}
|
|
55
92
|
|
|
56
93
|
const handleRead = (e: React.MouseEvent<HTMLAnchorElement>) => {
|
|
57
94
|
e.preventDefault();
|
|
58
|
-
readMutation.mutate({ id: item.id, read: true });
|
|
95
|
+
readMutation.mutate({ id: item.id, read: true, messageId: item.last_message.id });
|
|
59
96
|
}
|
|
60
97
|
|
|
61
98
|
const handlePin = (e: React.MouseEvent<HTMLAnchorElement>) => {
|
|
@@ -78,24 +115,24 @@ const ConversationListItem = ({ item, refetchConversations }: ConversationListIt
|
|
|
78
115
|
// }
|
|
79
116
|
|
|
80
117
|
return (
|
|
81
|
-
<div className={classNames('wy-conversation', {"wy-unread": item.is_unread})} key={item.id}>
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
<div className="wy-
|
|
86
|
-
<div className="wy-
|
|
87
|
-
|
|
88
|
-
{item.last_message
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<div className="wy-
|
|
118
|
+
<div className={classNames('wy-item wy-item-lg wy-item-hover wy-conversation', {"wy-unread": item.is_unread, "wy-active": selectedConversationId === item.id})} key={item.id} onClick={(e) => handleClick(e, item.id)}>
|
|
119
|
+
<Avatar src={item.avatar_url} id={otherId || -1} presence={item.type !== ChatRoom ? "away" : ""} name={item.display_name} />
|
|
120
|
+
|
|
121
|
+
<div className="wy-item-body">
|
|
122
|
+
<div className="wy-item-row">
|
|
123
|
+
<div className="wy-item-title">{item.display_name}</div>
|
|
124
|
+
{item.last_message &&
|
|
125
|
+
<time className="wy-meta" dateTime={item.last_message.created_at.toString()} title={date.format('LLLL')}>{date.fromNow()}</time>
|
|
126
|
+
}
|
|
127
|
+
</div>
|
|
128
|
+
<div className="wy-item-row">
|
|
129
|
+
<div className="wy-item-text">
|
|
93
130
|
<Typing id={item.id} context="listitem">
|
|
94
131
|
|
|
95
|
-
{
|
|
96
|
-
<span className="wy-typing-hide" dangerouslySetInnerHTML={{ __html:
|
|
132
|
+
{itemSnippet &&
|
|
133
|
+
<span className="wy-typing-hide" dangerouslySetInnerHTML={{ __html: itemSnippet }}></span>
|
|
97
134
|
}
|
|
98
|
-
{!
|
|
135
|
+
{!itemSnippet &&
|
|
99
136
|
<span className="wy-typing-hide">
|
|
100
137
|
{item.last_message?.attachment_ids?.length > 0 &&
|
|
101
138
|
<Icon.UI name="attachment" size={1} />
|
|
@@ -108,44 +145,43 @@ const ConversationListItem = ({ item, refetchConversations }: ConversationListIt
|
|
|
108
145
|
|
|
109
146
|
</Typing>
|
|
110
147
|
</div>
|
|
111
|
-
|
|
112
|
-
</a>
|
|
113
|
-
|
|
114
|
-
<div className="wy-conversation-actions">
|
|
115
|
-
{item.is_pinned &&
|
|
116
|
-
<Button.UI onClick={handleUnpin}>
|
|
117
|
-
<Icon.UI name="pin" size={.75} />
|
|
118
|
-
</Button.UI>
|
|
148
|
+
|
|
119
149
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
<>
|
|
124
|
-
{item.is_unread &&
|
|
125
|
-
<Dropdown.Item onClick={handleRead}>Mark as read</Dropdown.Item>
|
|
126
|
-
}
|
|
127
|
-
{!item.is_unread &&
|
|
128
|
-
<Dropdown.Item onClick={handleUnread}>Mark as unread</Dropdown.Item>
|
|
129
|
-
}
|
|
130
|
-
</>
|
|
131
|
-
<>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
<div className="wy-item-actions wy-item-actions-bottom">
|
|
132
153
|
{item.is_pinned &&
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
<Dropdown.Item onClick={handlePin}>Pin</Dropdown.Item>
|
|
137
|
-
}
|
|
138
|
-
</>
|
|
139
|
-
{item.type === ChatRoom &&
|
|
140
|
-
<Dropdown.Item onClick={handleLeaveConversation}>Leave conversation</Dropdown.Item>
|
|
141
|
-
}
|
|
154
|
+
<Button.UI onClick={handleUnpin}>
|
|
155
|
+
<Icon.UI name="pin" size={1/1.5} />
|
|
156
|
+
</Button.UI>
|
|
142
157
|
|
|
143
|
-
|
|
144
|
-
</Dropdown.UI>
|
|
158
|
+
}
|
|
145
159
|
|
|
160
|
+
<Dropdown.UI directionX='left'>
|
|
161
|
+
<>
|
|
162
|
+
{item.is_unread &&
|
|
163
|
+
<Dropdown.Item onClick={handleRead}>Mark as read</Dropdown.Item>
|
|
164
|
+
}
|
|
165
|
+
{!item.is_unread &&
|
|
166
|
+
<Dropdown.Item onClick={handleUnread}>Mark as unread</Dropdown.Item>
|
|
167
|
+
}
|
|
168
|
+
</>
|
|
169
|
+
<>
|
|
170
|
+
{item.is_pinned &&
|
|
171
|
+
<Dropdown.Item onClick={handleUnpin}>Unpin</Dropdown.Item>
|
|
172
|
+
}
|
|
173
|
+
{!item.is_pinned &&
|
|
174
|
+
<Dropdown.Item onClick={handlePin}>Pin</Dropdown.Item>
|
|
175
|
+
}
|
|
176
|
+
</>
|
|
177
|
+
{item.type === ChatRoom &&
|
|
178
|
+
<Dropdown.Item onClick={handleLeaveConversation}>Leave conversation</Dropdown.Item>
|
|
179
|
+
}
|
|
146
180
|
|
|
181
|
+
{/* <li><Button.UI onClick={handleStar}>Star</Button.UI></li> */}
|
|
182
|
+
</Dropdown.UI>
|
|
147
183
|
|
|
148
|
-
|
|
184
|
+
</div>
|
|
149
185
|
</div>
|
|
150
186
|
)
|
|
151
187
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import React, { useContext, useEffect } from "react";
|
|
1
|
+
import React, { useContext, useEffect, useState, useRef, useCallback } from "react";
|
|
2
2
|
import { WeavyContext } from "../contexts/WeavyContext";
|
|
3
3
|
import Button from '../ui/Button';
|
|
4
|
+
import Spinner from '../ui/Spinner';
|
|
4
5
|
import Icon from '../ui/Icon';
|
|
5
6
|
import useMutateExternalBlobs from '../hooks/useMutateExternalBlobs';
|
|
6
|
-
import
|
|
7
|
+
import Overlay from '../ui/Overlay';
|
|
8
|
+
import WeavyPostal from "../utils/postal-parent";
|
|
7
9
|
|
|
8
10
|
type Props = {
|
|
9
11
|
onFileAdded: Function
|
|
@@ -12,72 +14,73 @@ type Props = {
|
|
|
12
14
|
const FileBrowser = ({ onFileAdded }: Props) => {
|
|
13
15
|
|
|
14
16
|
const { options } = useContext(WeavyContext);
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
+
const [modalOpen, setModalOpen] = useState(false);
|
|
18
|
+
const [visible, setVisible] = useState(false);
|
|
19
|
+
const [frameSrc, setFrameSrc] = useState("");
|
|
17
20
|
const addExternalBlobs = useMutateExternalBlobs();
|
|
21
|
+
const fileBrowserUrl = options?.filebrowserUrl || "";
|
|
22
|
+
|
|
23
|
+
const frameRef = useCallback((node: HTMLIFrameElement | null) => {
|
|
24
|
+
if (node !== null && node.contentWindow != null) {
|
|
25
|
+
WeavyPostal.registerContentWindow(node.contentWindow.self, "weavy-filebrowser", "wy-filebrowser", new URL(fileBrowserUrl).origin);
|
|
26
|
+
}
|
|
27
|
+
}, []);
|
|
18
28
|
|
|
19
29
|
useEffect(() => {
|
|
20
|
-
window.
|
|
30
|
+
const origin = window.top?.document.location.origin;
|
|
31
|
+
|
|
32
|
+
const filebrowserSrc = fileBrowserUrl + "?origin=" + origin + "&v=X&t=" + Date.now().toString() + "&weavyId=wy-filebrowser";
|
|
21
33
|
|
|
34
|
+
setFrameSrc(filebrowserSrc)
|
|
35
|
+
|
|
36
|
+
WeavyPostal.on("add-external-blobs", handleFiles);
|
|
37
|
+
WeavyPostal.on("request:file-browser-close", handleClose);
|
|
22
38
|
|
|
23
39
|
return () => {
|
|
24
|
-
|
|
40
|
+
WeavyPostal.off("add-external-blobs", handleFiles);
|
|
41
|
+
WeavyPostal.off("request:file-browser-close", handleClose);
|
|
25
42
|
}
|
|
26
|
-
}, []);
|
|
43
|
+
}, [onFileAdded]);
|
|
27
44
|
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
switch (messageData.name) {
|
|
32
|
-
case "addExternalBlobs":
|
|
33
|
-
var result = await addExternalBlobs.mutateAsync({ blobs: messageData.blobs });
|
|
34
|
-
onFileAdded(result);
|
|
35
|
-
closeFilebrowser();
|
|
36
|
-
break;
|
|
37
|
-
case "file-browser-close":
|
|
38
|
-
closeFilebrowser();
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
45
|
+
const toggleModal = (open: boolean) => {
|
|
46
|
+
setModalOpen(open);
|
|
41
47
|
}
|
|
42
48
|
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
49
|
+
const handleFiles = async (e: Event, message: any) => {
|
|
50
|
+
var result = await addExternalBlobs.mutateAsync({ blobs: message.blobs });
|
|
51
|
+
onFileAdded(result);
|
|
52
|
+
closeFilebrowser();
|
|
48
53
|
}
|
|
49
54
|
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (!fb) {
|
|
54
|
-
const origin = window.top?.document.location.origin;
|
|
55
|
-
const fileBrowserUrl = options?.filebrowserUrl;
|
|
56
|
-
const filebrowserSrc = fileBrowserUrl + "?origin=" + origin + "&v=X&t=" + Date.now().toString() + "&weavyId=-1";
|
|
57
|
-
|
|
58
|
-
let $filebrowserFrame = document.createElement("iframe");
|
|
59
|
-
$filebrowserFrame.id = "weavy-filebrowser";
|
|
60
|
-
$filebrowserFrame.name = "weavy-filebrowser";
|
|
61
|
-
$filebrowserFrame.src = filebrowserSrc;
|
|
62
|
-
$filebrowserFrame.className = "wy-filebrowser-frame";
|
|
63
|
-
$filebrowserFrame.style.cssText = "position: fixed; top: 0; left: 0; height: 100%; width: 100%; background: rgba(1,1,1,.4); z-index: 10000; display:none"
|
|
64
|
-
|
|
65
|
-
window.top?.document.body.appendChild($filebrowserFrame);
|
|
55
|
+
const handleClose = () => {
|
|
56
|
+
closeFilebrowser();
|
|
57
|
+
}
|
|
66
58
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
59
|
+
const closeFilebrowser = () => {
|
|
60
|
+
setModalOpen(false);
|
|
61
|
+
setVisible(false);
|
|
62
|
+
}
|
|
70
63
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
64
|
+
const handleFrameLoad = () => {
|
|
65
|
+
setVisible(true);
|
|
74
66
|
}
|
|
75
67
|
|
|
76
68
|
return (
|
|
77
69
|
<>
|
|
78
|
-
{options?.enableCloudFiles &&
|
|
79
|
-
|
|
80
|
-
|
|
70
|
+
{options?.enableCloudFiles &&
|
|
71
|
+
<>
|
|
72
|
+
<Button.UI onClick={() => toggleModal(true)} title="Add file from cloud"><Icon.UI name="cloud" /></Button.UI>
|
|
73
|
+
|
|
74
|
+
<Overlay.UI isOpen={modalOpen} className="wy-modal wy-panel wy-loaded">
|
|
75
|
+
{!visible &&
|
|
76
|
+
<Spinner.UI overlay={true} />
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
<iframe ref={frameRef} onLoad={handleFrameLoad} src={frameSrc} className="wy-panel-frame" id="weavy-filebrowser" name="weavy-filebrowser"></iframe>
|
|
80
|
+
|
|
81
|
+
</Overlay.UI>
|
|
82
|
+
</>
|
|
83
|
+
}
|
|
81
84
|
</>
|
|
82
85
|
)
|
|
83
86
|
}
|
package/src/components/Image.tsx
CHANGED
|
@@ -84,8 +84,9 @@ export const ImageGrid = ({ children, limit = 3}: ImageGridProps) => {
|
|
|
84
84
|
let lastChild = firstImages[firstImages.length - 1];
|
|
85
85
|
|
|
86
86
|
if (React.isValidElement(lastChild)) {
|
|
87
|
+
let lastChildProps: { more: number } = { more };
|
|
87
88
|
// Set more property on last image
|
|
88
|
-
firstImages[firstImages.length - 1] = React.cloneElement(lastChild,
|
|
89
|
+
firstImages[firstImages.length - 1] = React.cloneElement(lastChild, lastChildProps);
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
return (
|
|
@@ -1,27 +1,49 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Button from '../ui/Button';
|
|
3
3
|
import Icon from '../ui/Icon';
|
|
4
|
-
|
|
4
|
+
import dayjs from 'dayjs';
|
|
5
5
|
type Props = {
|
|
6
6
|
meeting: MeetingCardType
|
|
7
7
|
|
|
8
8
|
}
|
|
9
9
|
const MeetingCard = ({ meeting }: Props) => {
|
|
10
10
|
|
|
11
|
-
const handleJoin = () => {
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
11
|
return (
|
|
16
|
-
<div className="wy-
|
|
17
|
-
|
|
18
|
-
<div className="wy-
|
|
19
|
-
|
|
20
|
-
<div className="wy-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
<div className="wy-list">
|
|
13
|
+
{meeting.ended_at &&
|
|
14
|
+
<div className="wy-item wy-meeting">
|
|
15
|
+
<Icon.UI name="zoom" size={4} color="#cccccc"/>
|
|
16
|
+
<div className="wy-item-body">
|
|
17
|
+
<div className="wy-item-title">Zoom meeting</div>
|
|
18
|
+
<div className="wy-item-body">
|
|
19
|
+
<div>Ended {dayjs.utc(meeting.ended_at).tz(dayjs.tz.guess()).fromNow()}</div>
|
|
20
|
+
{meeting.recording_url &&
|
|
21
|
+
<div className="wy-meeting-actions">
|
|
22
|
+
<a href={meeting.recording_url} target="_blank" className="wy-button wy-button-primary">Play recording</a>
|
|
23
|
+
</div>
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
23
28
|
</div>
|
|
24
|
-
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
{!meeting.ended_at &&
|
|
32
|
+
<a className="wy-item wy-meeting" href={meeting.join_url} target="_blank">
|
|
33
|
+
<Icon.UI name="zoom" color="#4a8cff" size={4} />
|
|
34
|
+
<div className="wy-item-body">
|
|
35
|
+
<div className="wy-item-title">Zoom meeting</div>
|
|
36
|
+
<div className="wy-item-body">
|
|
37
|
+
<div>ID: {`${meeting.provider_id.substring(0, 3)}-${meeting.provider_id.substring(3, 6)}-${meeting.provider_id.substring(6)}`}</div>
|
|
38
|
+
<div className="wy-meeting-actions">
|
|
39
|
+
<Button.UI className="wy-button-primary">Join meeting</Button.UI>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</a>
|
|
45
|
+
}
|
|
46
|
+
|
|
25
47
|
</div>
|
|
26
48
|
|
|
27
49
|
)
|
|
@@ -3,7 +3,6 @@ import dayjs from 'dayjs';
|
|
|
3
3
|
import { MessageProps } from "../types/Message"
|
|
4
4
|
import Attachment from './Attachment';
|
|
5
5
|
import { ReactionsMenu, ReactionsList } from './Reactions';
|
|
6
|
-
import joypixels from 'emoji-toolkit';
|
|
7
6
|
import { Image, ImageGrid } from "./Image"
|
|
8
7
|
import SeenBy from './SeenBy';
|
|
9
8
|
import Avatar from "./Avatar";
|
|
@@ -11,12 +10,12 @@ import MeetingCard from './MeetingCard';
|
|
|
11
10
|
import usePreview from '../hooks/usePreview';
|
|
12
11
|
import classNames from 'classnames';
|
|
13
12
|
|
|
14
|
-
const Message: FC<MessageProps> = ({ id, html, temp, me, avatar, name, created_at, attachments, meeting, parentId, reactions, seenBy }) => {
|
|
13
|
+
const Message: FC<MessageProps> = ({ id, html, temp, me, avatar, name, created_at, created_by, attachments, meeting, parentId, reactions, seenBy, chatRoom }) => {
|
|
15
14
|
|
|
16
15
|
const { open, close } = usePreview(attachments);
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
let images = attachments?.filter((a: AttachmentType) => a.kind === "image" && a.thumbnail_url);
|
|
18
|
+
let files = attachments?.filter((a: AttachmentType) => a.kind !== "image" || !a.thumbnail_url);
|
|
20
19
|
|
|
21
20
|
const date = dayjs.utc(created_at).tz(dayjs.tz.guess());
|
|
22
21
|
|
|
@@ -35,50 +34,50 @@ const Message: FC<MessageProps> = ({ id, html, temp, me, avatar, name, created_a
|
|
|
35
34
|
)}
|
|
36
35
|
<div className="wy-message-content">
|
|
37
36
|
<div className="wy-message-meta">
|
|
37
|
+
{chatRoom && !me &&
|
|
38
|
+
<span>{created_by} · </span>
|
|
39
|
+
}
|
|
38
40
|
<time dateTime={created_at} title={date.format('LLLL')}>{date.fromNow()}</time>
|
|
39
41
|
</div>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
42
|
+
|
|
43
|
+
<div className="wy-message-bubble">
|
|
44
|
+
{temp &&
|
|
45
|
+
<div className="wy-content">{html}</div>
|
|
46
|
+
}
|
|
47
|
+
{!temp &&
|
|
48
|
+
<>
|
|
49
|
+
{images && !!images.length && <ImageGrid>
|
|
50
|
+
{images.map((a: AttachmentType) =>
|
|
51
|
+
<Image onClick={(e) => handlePreviewClick(e, a.id)} key={a.id} src={a.download_url} previewSrc={a.preview_url} width={a.width} height={a.height} />
|
|
52
|
+
)}
|
|
53
|
+
</ImageGrid>}
|
|
54
|
+
|
|
55
|
+
{html && <div className="wy-content" dangerouslySetInnerHTML={{ __html: html || "" }}></div>}
|
|
56
|
+
|
|
57
|
+
{meeting &&
|
|
58
|
+
<MeetingCard meeting={meeting} />
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
{files && !!files.length && <div className="wy-list-items wy-attachments">
|
|
62
|
+
{files.map((a: AttachmentType) =>
|
|
63
|
+
<Attachment key={a.id} onClick={(e) => handlePreviewClick(e, a.id)} name={a.name} previewFormat={a.kind} provider={a.provider} url={a.download_url} previewUrl={a.provider ? a.external_url : a.preview_url} mediaType={a.media_type} kind={a.kind} size={a.size} />
|
|
64
|
+
)}
|
|
65
|
+
</div>}
|
|
66
|
+
<div className="wy-reactions-line">
|
|
67
|
+
<div className="wy-reactions">
|
|
68
|
+
<ReactionsList id={id} parentId={parentId} reactions={reactions} />
|
|
69
|
+
</div>
|
|
70
|
+
{!temp && <ReactionsMenu id={id} reactions={reactions} />}
|
|
71
|
+
</div>
|
|
72
|
+
</>
|
|
73
|
+
}
|
|
71
74
|
</div>
|
|
72
75
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
<ReactionsList id={id} parentId={parentId} reactions={reactions} />
|
|
76
|
-
</div>
|
|
77
|
-
)}
|
|
78
|
-
|
|
76
|
+
|
|
77
|
+
|
|
79
78
|
</div>
|
|
80
79
|
|
|
81
|
-
|
|
80
|
+
|
|
82
81
|
</div>
|
|
83
82
|
<SeenBy id={id} parentId={parentId} seenBy={seenBy} createdAt={created_at} />
|
|
84
83
|
</>
|