@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
|
File without changes
|
|
File without changes
|
|
@@ -6,10 +6,12 @@ export interface MessageProps {
|
|
|
6
6
|
avatar?: string;
|
|
7
7
|
name: string;
|
|
8
8
|
created_at: string;
|
|
9
|
+
created_by: string;
|
|
9
10
|
attachments: AttachmentType[];
|
|
10
11
|
meeting: MeetingCardType;
|
|
11
12
|
parentId: number | null;
|
|
12
13
|
reactions: ReactableType[];
|
|
13
14
|
reactions_count?: number;
|
|
14
15
|
seenBy: MemberType[];
|
|
16
|
+
chatRoom: boolean;
|
|
15
17
|
}
|
|
File without changes
|
|
@@ -78,9 +78,14 @@ declare type MemberType = {
|
|
|
78
78
|
name: string;
|
|
79
79
|
display_name: string;
|
|
80
80
|
avatar_url: string;
|
|
81
|
-
delivered_at
|
|
82
|
-
read_at
|
|
81
|
+
delivered_at?: string;
|
|
82
|
+
read_at?: string;
|
|
83
83
|
presence: string;
|
|
84
|
+
marked_id?: number;
|
|
85
|
+
marked_at?: string;
|
|
86
|
+
};
|
|
87
|
+
declare type MemberTypingType = MemberType & {
|
|
88
|
+
time: number;
|
|
84
89
|
};
|
|
85
90
|
declare type MessageType = {
|
|
86
91
|
id: number;
|
|
@@ -90,6 +95,7 @@ declare type MessageType = {
|
|
|
90
95
|
temp?: boolean;
|
|
91
96
|
created_at: string;
|
|
92
97
|
created_by: MemberType;
|
|
98
|
+
created_by_id: number;
|
|
93
99
|
attachments: AttachmentType[];
|
|
94
100
|
attachment_ids: number[];
|
|
95
101
|
meeting: MeetingCardType;
|
|
@@ -98,10 +104,11 @@ declare type MessageType = {
|
|
|
98
104
|
};
|
|
99
105
|
declare type UserType = {
|
|
100
106
|
id: number;
|
|
107
|
+
uid: string;
|
|
108
|
+
name: string;
|
|
101
109
|
username: string;
|
|
102
110
|
email: string;
|
|
103
|
-
|
|
104
|
-
title: string;
|
|
111
|
+
display_name: string;
|
|
105
112
|
avatar_url: string;
|
|
106
113
|
presence: string;
|
|
107
114
|
};
|
|
@@ -164,3 +171,39 @@ declare type BadgeType = {
|
|
|
164
171
|
rooms: number;
|
|
165
172
|
chat: number;
|
|
166
173
|
};
|
|
174
|
+
declare type EntityType = {
|
|
175
|
+
id: number;
|
|
176
|
+
type: string;
|
|
177
|
+
};
|
|
178
|
+
declare type RealtimeMessage = {
|
|
179
|
+
action: string;
|
|
180
|
+
id: number;
|
|
181
|
+
actor: UserType;
|
|
182
|
+
message: MessageType;
|
|
183
|
+
};
|
|
184
|
+
declare type RealtimeReaction = {
|
|
185
|
+
action: string;
|
|
186
|
+
id: number;
|
|
187
|
+
actor: UserType;
|
|
188
|
+
entity: EntityType;
|
|
189
|
+
reaction: string;
|
|
190
|
+
};
|
|
191
|
+
declare type RealtimeApp = {
|
|
192
|
+
action: string;
|
|
193
|
+
id: number;
|
|
194
|
+
actor: UserType;
|
|
195
|
+
app: ConversationType;
|
|
196
|
+
};
|
|
197
|
+
declare type RealtimeMember = {
|
|
198
|
+
action: string;
|
|
199
|
+
id: number;
|
|
200
|
+
actor: UserType;
|
|
201
|
+
app: ConversationType;
|
|
202
|
+
member: MemberType;
|
|
203
|
+
};
|
|
204
|
+
declare type RealtimeTyping = {
|
|
205
|
+
action: string;
|
|
206
|
+
id: number;
|
|
207
|
+
actor: MemberTypingType;
|
|
208
|
+
conversation: ConversationType;
|
|
209
|
+
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
declare type SpinnerProps = {
|
|
3
3
|
size?: number;
|
|
4
4
|
spin?: boolean;
|
|
5
|
+
overlay?: boolean;
|
|
5
6
|
};
|
|
6
7
|
declare const UISpinner: {
|
|
7
|
-
UI: ({ spin, size }: SpinnerProps) => JSX.Element;
|
|
8
|
+
UI: ({ spin, size, overlay }: SpinnerProps) => JSX.Element;
|
|
8
9
|
};
|
|
9
10
|
export default UISpinner;
|
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
@@ -56,9 +56,10 @@ declare const _default: React.MemoExoticComponent<({ id, showBackButton }: Conve
|
|
|
56
56
|
|
|
57
57
|
interface ChatProps {
|
|
58
58
|
uid: string;
|
|
59
|
+
className?: string;
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
declare const Chat: ({ uid }: ChatProps) => JSX.Element;
|
|
62
|
+
declare const Chat: ({ uid, className }: ChatProps) => JSX.Element;
|
|
62
63
|
|
|
63
64
|
declare const UIButton: {
|
|
64
65
|
UI: any;
|
package/package.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weavy/uikit-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.1",
|
|
4
4
|
"author": "Weavy",
|
|
5
5
|
"description": "React UI-kit for Weavy",
|
|
6
6
|
"homepage": "https://github.com/weavy/weavy-uikit-react",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/cjs/index.js",
|
|
9
9
|
"module": "dist/esm/index.js",
|
|
10
|
-
"types": "./dist/cjs/types/
|
|
10
|
+
"types": "./dist/cjs/types/types.d.ts",
|
|
11
11
|
"style": "dist/css/weavy-react.css",
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@rollup/plugin-commonjs": "^
|
|
14
|
-
"@rollup/plugin-node-resolve": "^
|
|
15
|
-
"@rollup/plugin-
|
|
13
|
+
"@rollup/plugin-commonjs": "^23.0.2",
|
|
14
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
15
|
+
"@rollup/plugin-terser": "^0.1.0",
|
|
16
|
+
"@rollup/plugin-typescript": "^9.0.2",
|
|
16
17
|
"@types/lodash.debounce": "^4.0.7",
|
|
17
18
|
"@types/lodash.throttle": "^4.1.7",
|
|
18
|
-
"@types/react": "^18.0.
|
|
19
|
-
"@types/react-dom": "^18.0.
|
|
19
|
+
"@types/react": "^18.0.25",
|
|
20
|
+
"@types/react-dom": "^18.0.8",
|
|
20
21
|
"@types/react-modal": "^3.13.1",
|
|
21
22
|
"npm-run-all": "^4.1.5",
|
|
22
23
|
"rimraf": "^3.0.2",
|
|
23
|
-
"rollup": "^2.
|
|
24
|
-
"rollup-plugin-dts": "^
|
|
24
|
+
"rollup": "^3.2.5",
|
|
25
|
+
"rollup-plugin-dts": "^5.0.0",
|
|
25
26
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"typescript": "^4.6.4"
|
|
27
|
+
"sass": "^1.56.0",
|
|
28
|
+
"tslib": "^2.4.1",
|
|
29
|
+
"typescript": "^4.8.4"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": "^18.1.0",
|
|
@@ -47,11 +47,14 @@
|
|
|
47
47
|
"@microsoft/signalr": "^6.0.3",
|
|
48
48
|
"classnames": "^2.3.1",
|
|
49
49
|
"dayjs": "^1.11.1",
|
|
50
|
-
"emoji-toolkit": "^6.6.0",
|
|
51
50
|
"lodash.debounce": "^4.0.8",
|
|
52
51
|
"lodash.throttle": "^4.1.1",
|
|
53
|
-
"pdfjs-dist": "^2.
|
|
52
|
+
"pdfjs-dist": "^2.16.105",
|
|
54
53
|
"react-modal": "^3.14.4",
|
|
55
54
|
"react-query": "^3.34.16"
|
|
55
|
+
},
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=18.0.0",
|
|
58
|
+
"npm": ">=8.0.0"
|
|
56
59
|
}
|
|
57
60
|
}
|
|
@@ -2,10 +2,17 @@ import resolve from "@rollup/plugin-node-resolve";
|
|
|
2
2
|
import commonjs from "@rollup/plugin-commonjs";
|
|
3
3
|
import typescript from "@rollup/plugin-typescript";
|
|
4
4
|
import dts from "rollup-plugin-dts";
|
|
5
|
-
import
|
|
5
|
+
import terser from "@rollup/plugin-terser";
|
|
6
6
|
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
//import packageJson from `./package.json` assert { type: `json` };
|
|
9
|
+
|
|
10
|
+
//const packageJson = require("./package.json");
|
|
11
|
+
const { default: packageJson } = await import("./package.json", {
|
|
12
|
+
assert: {
|
|
13
|
+
type: "json",
|
|
14
|
+
},
|
|
15
|
+
});
|
|
9
16
|
|
|
10
17
|
export default [
|
|
11
18
|
{
|
|
@@ -34,7 +41,7 @@ export default [
|
|
|
34
41
|
external: ["react", "react-dom"]
|
|
35
42
|
},
|
|
36
43
|
{
|
|
37
|
-
input: "dist/esm/
|
|
44
|
+
input: "dist/esm/index.d.ts",
|
|
38
45
|
output: [{ file: "dist/index.d.ts", format: "esm" }],
|
|
39
46
|
plugins: [dts()],
|
|
40
47
|
},
|
|
@@ -83,27 +83,22 @@ export default class WeavyClient {
|
|
|
83
83
|
return response;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
async getToken(refresh: boolean) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
this.token = await this.tokenFactory(true);
|
|
91
|
-
//return await this.tokenFactory(refresh);
|
|
92
|
-
}
|
|
93
|
-
//this.tokenPromise = null;
|
|
94
|
-
console.log("Resolve new token...")
|
|
86
|
+
async getToken(refresh: boolean) {
|
|
87
|
+
if (!this.token || refresh) {
|
|
88
|
+
this.token = await this.tokenFactory(true);
|
|
89
|
+
}
|
|
95
90
|
return this.token;
|
|
96
91
|
}
|
|
97
92
|
|
|
98
93
|
async tokenFactoryInternal(refresh: boolean = false, fromSR: boolean = false): Promise<string> {
|
|
99
|
-
|
|
94
|
+
|
|
100
95
|
if(this.token && !refresh) return this.token;
|
|
101
96
|
|
|
102
97
|
if(!this.tokenPromise){
|
|
103
|
-
|
|
98
|
+
|
|
104
99
|
this.tokenPromise = this.tokenFactory(refresh);
|
|
105
100
|
let token = await this.tokenPromise;
|
|
106
|
-
|
|
101
|
+
|
|
107
102
|
this.tokenPromise = null;
|
|
108
103
|
this.token = token;
|
|
109
104
|
return this.token;
|
|
@@ -118,11 +113,11 @@ export default class WeavyClient {
|
|
|
118
113
|
|
|
119
114
|
try {
|
|
120
115
|
var name = group ? group + ":" + event : event;
|
|
121
|
-
await this.connection.invoke("
|
|
116
|
+
await this.connection.invoke("Subscribe", name);
|
|
122
117
|
this.groups.push(name);
|
|
123
118
|
this.connection.on(name, callback);
|
|
124
119
|
} catch (err: any) {
|
|
125
|
-
console.warn("Error in
|
|
120
|
+
console.warn("Error in Subscribe:", err)
|
|
126
121
|
}
|
|
127
122
|
|
|
128
123
|
}
|
|
@@ -139,11 +134,11 @@ export default class WeavyClient {
|
|
|
139
134
|
try {
|
|
140
135
|
// if no more groups, remove from server
|
|
141
136
|
if (!this.groups.find(e => e === name)) {
|
|
142
|
-
await this.connection.invoke("
|
|
137
|
+
await this.connection.invoke("Unsubscribe", name);
|
|
143
138
|
}
|
|
144
139
|
|
|
145
140
|
} catch (err: any) {
|
|
146
|
-
console.warn("Error in
|
|
141
|
+
console.warn("Error in Unsubscribe:", err)
|
|
147
142
|
}
|
|
148
143
|
}
|
|
149
144
|
|
|
@@ -169,7 +164,7 @@ export default class WeavyClient {
|
|
|
169
164
|
if (name === this.EVENT_RECONNECTED + this.EVENT_NAMESPACE) {
|
|
170
165
|
// re-add to signalr groups after reconnect
|
|
171
166
|
for (var i = 0; i < this.groups.length; i++) {
|
|
172
|
-
this.connection.invoke("
|
|
167
|
+
this.connection.invoke("Subscribe", this.groups[i]);
|
|
173
168
|
}
|
|
174
169
|
}
|
|
175
170
|
}
|
|
@@ -18,12 +18,12 @@ const Attachment = ({ previewFormat, url, previewUrl, mediaType, name, kind, siz
|
|
|
18
18
|
let fileSize = size > 0 ? fileSizeAsString(size) : null;
|
|
19
19
|
let { icon, color } = getIcon(name, mediaType)
|
|
20
20
|
return (
|
|
21
|
-
<a href={previewUrl || url} className="wy-attachment" target={"_blank"} title={name} onClick={onClick ? (e) => onClick(e) : undefined}>
|
|
22
|
-
<
|
|
23
|
-
<div className="wy-attachment-content">
|
|
24
|
-
<div className="wy-attachment-title">{name}</div>
|
|
21
|
+
<a href={previewUrl || url} className="wy-item wy-item-hover wy-item-lg wy-attachment" target={"_blank"} title={name} onClick={onClick ? (e) => onClick(e) : undefined}>
|
|
22
|
+
<Icon.UI name={icon} color={color} size={2} />
|
|
23
|
+
<div className="wy-item-body wy-attachment-content">
|
|
24
|
+
<div className="wy-item-title wy-attachment-title">{name}</div>
|
|
25
25
|
{fileSize &&
|
|
26
|
-
<div className="wy-attachment-meta" title={fileSize}>{fileSize}</div>
|
|
26
|
+
<div className="wy-item-text wy-attachment-meta" title={fileSize}>{fileSize}</div>
|
|
27
27
|
}
|
|
28
28
|
</div>
|
|
29
29
|
</a>
|
package/src/components/Chat.tsx
CHANGED
|
@@ -6,8 +6,9 @@ import Messages from './Messages';
|
|
|
6
6
|
import useMembers from '../hooks/useMembers';
|
|
7
7
|
import Typing from './Typing';
|
|
8
8
|
import useConversation from '../hooks/useConversation';
|
|
9
|
+
import classNames from 'classnames';
|
|
9
10
|
|
|
10
|
-
const Chat = ({ uid }: ChatProps) => {
|
|
11
|
+
const Chat = ({ uid, className }: ChatProps) => {
|
|
11
12
|
const { client } = useContext(WeavyContext);
|
|
12
13
|
const [selectedId, setSelectedId] = useState<number | null>(null)
|
|
13
14
|
|
|
@@ -36,8 +37,8 @@ const Chat = ({ uid }: ChatProps) => {
|
|
|
36
37
|
}, [dataChat]);
|
|
37
38
|
|
|
38
39
|
return (
|
|
39
|
-
<div className="wy-messenger-conversation wy-scroll-y">
|
|
40
|
-
<header className="wy-appbars">
|
|
40
|
+
<div className={classNames("wy-messenger-conversation wy-scroll-y", className)}>
|
|
41
|
+
<header className="wy-appbars" data-adjust-scrollbar-top>
|
|
41
42
|
<nav className="wy-appbar">
|
|
42
43
|
<div></div>
|
|
43
44
|
{selectedId && dataConversation &&
|
|
@@ -54,8 +55,8 @@ const Chat = ({ uid }: ChatProps) => {
|
|
|
54
55
|
<div>No chat with the contextual id <strong>{uid}</strong></div>
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
{selectedId && dataMembers &&
|
|
58
|
-
<Messages id={selectedId} members={dataMembers} />
|
|
58
|
+
{selectedId && dataMembers && dataChat &&
|
|
59
|
+
<Messages id={selectedId} chatRoom={true} members={dataMembers} lastMessageId={dataChat.last_message?.id} />
|
|
59
60
|
}
|
|
60
61
|
</div>
|
|
61
62
|
)
|
|
@@ -27,8 +27,10 @@ const Conversation = ({ id, showBackButton }: ConversationProps) => {
|
|
|
27
27
|
const [modalAddOpen, setModalAddOpen] = useState(false);
|
|
28
28
|
const [modalDetailsOpen, setModalDetailsOpen] = useState(false);
|
|
29
29
|
const [title, setTitle] = useState<string>("");
|
|
30
|
+
const [isRoomOrChat, setIsRoomOrChat] = useState<boolean>(false);
|
|
30
31
|
|
|
31
32
|
const ChatRoom = "edb400ac-839b-45a7-b2a8-6a01820d1c44";
|
|
33
|
+
const Chat = "d65dd4bc-418e-403c-9f56-f9cf4da931ed";
|
|
32
34
|
|
|
33
35
|
if (!client) {
|
|
34
36
|
throw new Error('Weavy Conversation component must be used within an WeavyProvider');
|
|
@@ -50,8 +52,8 @@ const Conversation = ({ id, showBackButton }: ConversationProps) => {
|
|
|
50
52
|
const updateNameMutation = useMutateConversationName();
|
|
51
53
|
const removeMembers = useMutateRemoveMembers();
|
|
52
54
|
|
|
53
|
-
const handleRealtimeAppUpdated = useCallback((
|
|
54
|
-
if (
|
|
55
|
+
const handleRealtimeAppUpdated = useCallback((realtimeEvent: RealtimeApp) => {
|
|
56
|
+
if (realtimeEvent.app.id !== selectedConversationId) return;
|
|
55
57
|
queryClient.invalidateQueries(['conversation', selectedConversationId]);
|
|
56
58
|
}, [selectedConversationId]);
|
|
57
59
|
|
|
@@ -93,14 +95,14 @@ const Conversation = ({ id, showBackButton }: ConversationProps) => {
|
|
|
93
95
|
useEffect(() => {
|
|
94
96
|
|
|
95
97
|
if (selectedConversationId) {
|
|
96
|
-
client.subscribe(`a${selectedConversationId}`, "
|
|
98
|
+
client.subscribe(`a${selectedConversationId}`, "app_updated", handleRealtimeAppUpdated);
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
return () => {
|
|
100
102
|
|
|
101
103
|
if (selectedConversationId) {
|
|
102
104
|
|
|
103
|
-
client.unsubscribe(`a${selectedConversationId}`, "
|
|
105
|
+
client.unsubscribe(`a${selectedConversationId}`, "app_updated", handleRealtimeAppUpdated);
|
|
104
106
|
}
|
|
105
107
|
}
|
|
106
108
|
}, [selectedConversationId]);
|
|
@@ -109,11 +111,14 @@ const Conversation = ({ id, showBackButton }: ConversationProps) => {
|
|
|
109
111
|
if (dataConversation && dataConversation.type === ChatRoom) {
|
|
110
112
|
setTitle(dataConversation?.display_name);
|
|
111
113
|
}
|
|
114
|
+
if(dataConversation && (dataConversation.type === ChatRoom || dataConversation.type === Chat)){
|
|
115
|
+
setIsRoomOrChat(true)
|
|
116
|
+
}
|
|
112
117
|
}, [dataConversation]);
|
|
113
118
|
|
|
114
119
|
return (
|
|
115
120
|
<>
|
|
116
|
-
<header className="wy-appbars">
|
|
121
|
+
<header className="wy-appbars" data-adjust-scrollbar-top>
|
|
117
122
|
<nav className="wy-appbar">
|
|
118
123
|
<div>
|
|
119
124
|
{showBackButton &&
|
|
@@ -146,17 +151,17 @@ const Conversation = ({ id, showBackButton }: ConversationProps) => {
|
|
|
146
151
|
|
|
147
152
|
{!selectedConversationId &&
|
|
148
153
|
<div className="wy-avatar-header">
|
|
149
|
-
<Avatar src={user.avatar_url} name={user.
|
|
150
|
-
<h2>Welcome {user.name}!</h2>
|
|
154
|
+
<Avatar src={user.avatar_url} name={user.display_name} presence={user.presence} id={user.id} size={256} />
|
|
155
|
+
<h2 className='wy-title'>Welcome {user.name}!</h2>
|
|
151
156
|
Create or select a conversation to get started
|
|
152
157
|
</div>
|
|
153
158
|
}
|
|
154
|
-
{selectedConversationId && dataMembers &&
|
|
155
|
-
<Messages id={selectedConversationId} members={dataMembers} displayName={dataConversation?.display_name} avatarUrl={dataConversation?.avatar_url} />
|
|
159
|
+
{selectedConversationId && dataMembers && dataConversation &&
|
|
160
|
+
<Messages id={selectedConversationId} chatRoom={isRoomOrChat} members={dataMembers} displayName={dataConversation?.display_name} avatarUrl={dataConversation?.avatar_url} lastMessageId={dataConversation?.last_message?.id}/>
|
|
156
161
|
}
|
|
157
162
|
|
|
158
163
|
<Overlay.UI isOpen={modalAddOpen} className="wy-modal">
|
|
159
|
-
<header className="wy-appbars">
|
|
164
|
+
<header className="wy-appbars" data-adjust-scrollbar-top>
|
|
160
165
|
<nav className="wy-appbar">
|
|
161
166
|
<Button.UI onClick={() => toggleAddModal(false)}><Icon.UI name='close' /></Button.UI>
|
|
162
167
|
<div className="wy-appbar-text">Add people</div>
|
|
@@ -172,11 +177,13 @@ const Conversation = ({ id, showBackButton }: ConversationProps) => {
|
|
|
172
177
|
<div className="wy-appbar-text">Conversation details</div>
|
|
173
178
|
</nav>
|
|
174
179
|
</header>
|
|
175
|
-
<div>
|
|
176
|
-
{dataConversation && <div className="wy-avatar-header"
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
+
<div className='wy-scroll-y'>
|
|
181
|
+
{dataConversation && <div className="wy-avatar-header">
|
|
182
|
+
<Avatar src={dataConversation?.avatar_url} name={title} size={128} />
|
|
183
|
+
{dataConversation?.type !== ChatRoom &&
|
|
184
|
+
<h3 className="wy-headline">{dataConversation?.display_name}</h3>
|
|
185
|
+
}
|
|
186
|
+
</div>}
|
|
180
187
|
|
|
181
188
|
{dataConversation?.type === ChatRoom && (
|
|
182
189
|
<>
|
|
@@ -184,14 +191,13 @@ const Conversation = ({ id, showBackButton }: ConversationProps) => {
|
|
|
184
191
|
<input className="wy-input" value={title} onChange={(e) => handleUpdateTitle(e)} />
|
|
185
192
|
</div>
|
|
186
193
|
<div className="wy-pane-group">
|
|
187
|
-
<table className="wy-search-result-table">
|
|
194
|
+
<table className="wy-table wy-search-result-table">
|
|
188
195
|
<tbody>
|
|
189
196
|
{dataMembers && dataMembers.data && dataMembers.data.map((m: MemberType) => {
|
|
190
197
|
return (
|
|
191
|
-
<tr key={m.id}
|
|
192
|
-
<td className="wy-search-result-table-icon"><Avatar src={m.avatar_url} name={m.display_name} id={m.id} size={24} presence={m.presence} /></td>
|
|
193
|
-
<td>{m.display_name}</td>
|
|
194
|
-
<td></td>
|
|
198
|
+
<tr key={m.id}>
|
|
199
|
+
<td className="wy-table-cell-icon wy-search-result-table-icon"><Avatar src={m.avatar_url} name={m.display_name} id={m.id} size={24} presence={m.presence} /></td>
|
|
200
|
+
<td className='wy-table-cell-text'>{m.display_name}</td>
|
|
195
201
|
</tr>
|
|
196
202
|
)
|
|
197
203
|
})}
|
|
@@ -10,10 +10,10 @@ const ConversationBadge = () => {
|
|
|
10
10
|
throw new Error('Weavy Badge component must be used within an WeavyProvider');
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const { isLoading, data } = useBadge();
|
|
13
|
+
const { isLoading, data, refetch } = useBadge();
|
|
14
14
|
|
|
15
|
-
const handleBadge = (data: BadgeType) => {
|
|
16
|
-
|
|
15
|
+
const handleBadge = (data: BadgeType) => {
|
|
16
|
+
refetch();
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
useEffect(() => {
|
|
@@ -23,10 +23,12 @@ const ConversationBadge = () => {
|
|
|
23
23
|
}, [data])
|
|
24
24
|
|
|
25
25
|
useEffect(() => {
|
|
26
|
-
client.subscribe(null, "
|
|
26
|
+
client.subscribe(null, "message_created", handleBadge);
|
|
27
|
+
client.subscribe(null, "conversation_marked", handleBadge);
|
|
27
28
|
|
|
28
29
|
return () => {
|
|
29
|
-
client.unsubscribe(null, "
|
|
30
|
+
client.unsubscribe(null, "message_created", handleBadge);
|
|
31
|
+
client.unsubscribe(null, "conversation_marked", handleBadge);
|
|
30
32
|
}
|
|
31
33
|
}, [])
|
|
32
34
|
|
|
@@ -199,7 +199,7 @@ const ConversationForm = ({ conversationId, handleInsert }: Props) => {
|
|
|
199
199
|
<textarea rows={1} ref={textInput} className="wy-message-editor-textfield wy-message-editor-textcontent" value={text} onChange={handleChange} onKeyDown={handleInsertMessage} onKeyPress={useThrottle(handleKeyPress, 4000)}></textarea>
|
|
200
200
|
</div>
|
|
201
201
|
<div className="wy-message-editor-buttons">
|
|
202
|
-
<Button.UI type="button" onClick={handleInsertMessage} ><Icon.UI name="send"/></Button.UI>
|
|
202
|
+
<Button.UI type="button" onClick={handleInsertMessage} ><Icon.UI color="primary" name="send"/></Button.UI>
|
|
203
203
|
</div>
|
|
204
204
|
</div>
|
|
205
205
|
</form>
|
|
@@ -1,28 +1,63 @@
|
|
|
1
|
-
import React, { useContext, useEffect } from 'react';
|
|
1
|
+
import React, { useState, useContext, useEffect, useLayoutEffect, useRef } from 'react';
|
|
2
2
|
import { WeavyContext } from '../contexts/WeavyContext';
|
|
3
3
|
import useConversations from '../hooks/useConversations';
|
|
4
4
|
import ConversationListItem from './ConversationListItem';
|
|
5
5
|
import NewConversation from './NewConversation';
|
|
6
6
|
import Avatar from './Avatar';
|
|
7
7
|
import { UserContext } from '../contexts/UserContext';
|
|
8
|
+
import Button from '../ui/Button';
|
|
9
|
+
import { createScroller } from "../utils/infiniteScroll";
|
|
8
10
|
|
|
9
11
|
const ConversationList = () => {
|
|
10
12
|
const { client } = useContext(WeavyContext);
|
|
11
13
|
const { user } = useContext(UserContext);
|
|
12
|
-
const { data, isLoading, refetch } = useConversations();
|
|
14
|
+
const { data, isLoading, refetch, fetchNextPage, hasNextPage, isFetchingNextPage } = useConversations({});
|
|
15
|
+
const loadMoreRef = useRef<any>();
|
|
16
|
+
const [resolveScrollerFetch, setResolveScrollerFetch] = useState<Function | null>()
|
|
17
|
+
let scroller: IntersectionObserver | null;
|
|
13
18
|
|
|
14
19
|
if (!client) {
|
|
15
20
|
throw new Error('Weavy ConversationList component must be used within an WeavyProvider');
|
|
16
21
|
}
|
|
17
22
|
|
|
23
|
+
|
|
24
|
+
useLayoutEffect(() => {
|
|
25
|
+
if(!isLoading){
|
|
26
|
+
scroller?.disconnect();
|
|
27
|
+
|
|
28
|
+
scroller = createScroller(loadMoreRef.current, () => {
|
|
29
|
+
if (hasNextPage) {
|
|
30
|
+
return fetchNextPage().then(() => {
|
|
31
|
+
// Wait for useLayoutEffect before resolving
|
|
32
|
+
return new Promise((resolve: Function) => setResolveScrollerFetch(resolve))
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return () => {
|
|
39
|
+
scroller?.disconnect();
|
|
40
|
+
scroller = null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
}, [isLoading]);
|
|
44
|
+
|
|
45
|
+
useLayoutEffect(() => {
|
|
46
|
+
// Resolve fetchNextPage after layout has been painted
|
|
47
|
+
if (!isFetchingNextPage && resolveScrollerFetch) {
|
|
48
|
+
resolveScrollerFetch()
|
|
49
|
+
setResolveScrollerFetch(null);
|
|
50
|
+
}
|
|
51
|
+
}, [data]);
|
|
52
|
+
|
|
18
53
|
useEffect(() => {
|
|
19
54
|
|
|
20
|
-
client.subscribe(null, "
|
|
21
|
-
client.subscribe(null, "
|
|
55
|
+
client.subscribe(null, "app_created", handleAppInserted);
|
|
56
|
+
client.subscribe(null, "member_added", handleAppInserted);
|
|
22
57
|
|
|
23
58
|
return () => {
|
|
24
|
-
client.unsubscribe(null, "
|
|
25
|
-
client.unsubscribe(null, "
|
|
59
|
+
client.unsubscribe(null, "app_created", handleAppInserted);
|
|
60
|
+
client.unsubscribe(null, "member_added", handleAppInserted);
|
|
26
61
|
}
|
|
27
62
|
}, []);
|
|
28
63
|
|
|
@@ -37,21 +72,34 @@ const ConversationList = () => {
|
|
|
37
72
|
)
|
|
38
73
|
}
|
|
39
74
|
|
|
75
|
+
let loadMoreButton = <Button.UI onClick={() => fetchNextPage()} disabled={!hasNextPage || isFetchingNextPage} className="wy-message-readmore">Load more</Button.UI>;
|
|
76
|
+
|
|
40
77
|
return (
|
|
41
78
|
<>
|
|
42
|
-
<header className="wy-appbars">
|
|
79
|
+
<header className="wy-appbars" data-adjust-scrollbar-top>
|
|
43
80
|
<nav className="wy-appbar">
|
|
44
|
-
<Avatar src={user.avatar_url} name={user.
|
|
81
|
+
<Avatar src={user.avatar_url} name={user.display_name} presence={user.presence} id={user.id} size={24} />
|
|
45
82
|
<div>Messenger</div>
|
|
46
83
|
<NewConversation />
|
|
47
84
|
</nav>
|
|
48
85
|
</header>
|
|
49
86
|
<div className="wy-conversations">
|
|
50
|
-
{data && data.data
|
|
51
|
-
|
|
87
|
+
{data && data.pages && data.pages.map((group, i) => {
|
|
88
|
+
return group.data?.map((item) => {
|
|
89
|
+
return < ConversationListItem key={item.id} refetchConversations={refetch} item={item} />
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
}
|
|
93
|
+
|
|
52
94
|
)}
|
|
95
|
+
<div className="wy-message-readmore" ref={loadMoreRef}>
|
|
96
|
+
{isFetchingNextPage
|
|
97
|
+
? 'Loading more...'
|
|
98
|
+
: hasNextPage
|
|
99
|
+
? loadMoreButton
|
|
100
|
+
: ""}
|
|
53
101
|
|
|
54
|
-
|
|
102
|
+
</div>
|
|
55
103
|
</div>
|
|
56
104
|
</>
|
|
57
105
|
)
|