@weavy/uikit-react 14.0.3 → 15.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +2 -0
- package/changelog.md +10 -0
- package/dist/cjs/client/WeavyClient.d.ts +1 -0
- package/dist/cjs/components/Attachment.d.ts +5 -5
- package/dist/cjs/components/Blob.d.ts +9 -0
- package/dist/cjs/components/Comment.d.ts +18 -0
- package/dist/cjs/components/CommentCount.d.ts +7 -0
- package/dist/cjs/components/CommentEdit.d.ts +16 -0
- package/dist/cjs/components/CommentPlaceholder.d.ts +8 -0
- package/dist/cjs/components/CommentTrashed.d.ts +15 -0
- package/dist/cjs/components/CommentView.d.ts +18 -0
- package/dist/cjs/components/Comments.d.ts +8 -0
- package/dist/cjs/components/ConversationListItem.d.ts +1 -1
- package/dist/cjs/components/Dropzone.d.ts +10 -0
- package/dist/cjs/components/Editor.d.ts +25 -0
- package/dist/cjs/components/Embed.d.ts +8 -0
- package/dist/cjs/components/FileItem.d.ts +41 -0
- package/dist/cjs/components/FileList.d.ts +11 -0
- package/dist/cjs/components/FileVersions.d.ts +9 -0
- package/dist/cjs/components/Files.d.ts +4 -0
- package/dist/cjs/components/Image.d.ts +3 -3
- package/dist/cjs/components/MeetingCard.d.ts +1 -1
- package/dist/cjs/components/Meetings.d.ts +2 -1
- package/dist/cjs/components/Poll.d.ts +8 -0
- package/dist/cjs/components/PollOption.d.ts +10 -0
- package/dist/cjs/components/Post.d.ts +21 -0
- package/dist/cjs/components/PostEdit.d.ts +17 -0
- package/dist/cjs/components/PostList.d.ts +6 -0
- package/dist/cjs/components/PostPlaceholder.d.ts +8 -0
- package/dist/cjs/components/PostTrashed.d.ts +14 -0
- package/dist/cjs/components/PostView.d.ts +21 -0
- package/dist/cjs/components/Posts.d.ts +4 -0
- package/dist/cjs/components/Preview.d.ts +1 -3
- package/dist/cjs/components/PreviewFiles.d.ts +10 -0
- package/dist/cjs/components/Reactions.d.ts +6 -2
- package/dist/cjs/components/SearchUsers.d.ts +2 -1
- package/dist/cjs/contexts/CloudFilesContext.d.ts +9 -0
- package/dist/cjs/hooks/useApps.d.ts +1 -0
- package/dist/cjs/hooks/useCloudFiles.d.ts +3 -0
- package/dist/cjs/hooks/useCommentList.d.ts +1 -0
- package/dist/cjs/hooks/useEmbeds.d.ts +5 -0
- package/dist/cjs/hooks/useFileList.d.ts +1 -0
- package/dist/cjs/hooks/useFileUploader.d.ts +8 -0
- package/dist/cjs/hooks/useFileVersions.d.ts +2 -0
- package/dist/cjs/hooks/useInfiniteScroll.d.ts +4 -0
- package/dist/cjs/hooks/useIsFirstRender.d.ts +2 -0
- package/dist/cjs/hooks/useMutateApps.d.ts +5 -0
- package/dist/cjs/hooks/useMutateComment.d.ts +10 -0
- package/dist/cjs/hooks/useMutateConversationName.d.ts +1 -1
- package/dist/cjs/hooks/useMutateDeleteReaction.d.ts +3 -1
- package/dist/cjs/hooks/useMutateEditComment.d.ts +10 -0
- package/dist/cjs/hooks/useMutateEditPost.d.ts +10 -0
- package/dist/cjs/hooks/useMutateExternalBlobs.d.ts +2 -2
- package/dist/cjs/hooks/useMutateFile.d.ts +26 -0
- package/dist/cjs/hooks/useMutateFileRename.d.ts +5 -0
- package/dist/cjs/hooks/useMutateFileSubscribe.d.ts +7 -0
- package/dist/cjs/hooks/useMutateFileTrash.d.ts +10 -0
- package/dist/cjs/hooks/useMutateFileVersion.d.ts +7 -0
- package/dist/cjs/hooks/useMutateFiles.d.ts +2 -0
- package/dist/cjs/hooks/useMutateLeaveConversation.d.ts +4 -0
- package/dist/cjs/hooks/useMutateMessage.d.ts +2 -2
- package/dist/cjs/hooks/useMutatePost.d.ts +10 -0
- package/dist/cjs/hooks/useMutateReaction.d.ts +3 -1
- package/dist/cjs/hooks/useMutateRead.d.ts +1 -1
- package/dist/cjs/hooks/useMutateReplaceReaction.d.ts +6 -0
- package/dist/cjs/hooks/useMutateRestoreComment.d.ts +5 -0
- package/dist/cjs/hooks/useMutateRestorePost.d.ts +4 -0
- package/dist/cjs/hooks/useMutateStarred.d.ts +4 -0
- package/dist/cjs/hooks/useMutateSubscribe.d.ts +4 -0
- package/dist/cjs/hooks/useMutateTrashComment.d.ts +5 -0
- package/dist/cjs/hooks/useMutateTrashPost.d.ts +4 -0
- package/dist/cjs/hooks/useMutateTyping.d.ts +2 -0
- package/dist/cjs/hooks/useMutateUnsubscribe.d.ts +4 -0
- package/dist/cjs/hooks/useMutateVote.d.ts +5 -0
- package/dist/cjs/hooks/usePost.d.ts +1 -0
- package/dist/cjs/hooks/usePosts.d.ts +1 -0
- package/dist/cjs/hooks/usePostsList.d.ts +1 -0
- package/dist/cjs/hooks/useReactionList.d.ts +1 -0
- package/dist/cjs/hooks/useSessionState.d.ts +2 -0
- package/dist/cjs/hooks/useUnload.d.ts +2 -0
- package/dist/cjs/hooks/useUpdateEffect.d.ts +3 -0
- package/dist/cjs/hooks/useVotes.d.ts +1 -0
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/index.js +28 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/ConversationListItem.d.ts +1 -0
- package/dist/cjs/types/Files.d.ts +7 -0
- package/dist/cjs/types/Message.d.ts +2 -2
- package/dist/cjs/types/Posts.d.ts +4 -0
- package/dist/cjs/types/interfaces.d.ts +9 -0
- package/dist/cjs/types/types.d.ts +138 -22
- package/dist/cjs/ui/Dropdown.d.ts +18 -2
- package/dist/cjs/ui/Icon.d.ts +10 -2
- package/dist/cjs/ui/Overlay.d.ts +3 -1
- package/dist/cjs/ui/Sheet.d.ts +14 -0
- package/dist/cjs/ui/Spinner.d.ts +2 -1
- package/dist/cjs/utils/cacheUtils.d.ts +14 -0
- package/dist/cjs/utils/fileUtilities.d.ts +10 -1
- package/dist/cjs/utils/mentions.d.ts +6 -0
- package/dist/cjs/utils/openUrl.d.ts +1 -0
- package/dist/css/weavy-chat.css +637 -218
- package/dist/css/weavy-files.css +3046 -0
- package/dist/css/weavy-messenger.css +643 -213
- package/dist/css/weavy-posts.css +2773 -0
- package/dist/css/weavy.css +1749 -308
- package/dist/esm/client/WeavyClient.d.ts +1 -0
- package/dist/esm/components/Attachment.d.ts +5 -5
- package/dist/esm/components/Blob.d.ts +9 -0
- package/dist/esm/components/Comment.d.ts +18 -0
- package/dist/esm/components/CommentCount.d.ts +7 -0
- package/dist/esm/components/CommentEdit.d.ts +16 -0
- package/dist/esm/components/CommentPlaceholder.d.ts +8 -0
- package/dist/esm/components/CommentTrashed.d.ts +15 -0
- package/dist/esm/components/CommentView.d.ts +18 -0
- package/dist/esm/components/Comments.d.ts +8 -0
- package/dist/esm/components/ConversationListItem.d.ts +1 -1
- package/dist/esm/components/Dropzone.d.ts +10 -0
- package/dist/esm/components/Editor.d.ts +25 -0
- package/dist/esm/components/Embed.d.ts +8 -0
- package/dist/esm/components/FileItem.d.ts +41 -0
- package/dist/esm/components/FileList.d.ts +11 -0
- package/dist/esm/components/FileVersions.d.ts +9 -0
- package/dist/esm/components/Files.d.ts +4 -0
- package/dist/esm/components/Image.d.ts +3 -3
- package/dist/esm/components/MeetingCard.d.ts +1 -1
- package/dist/esm/components/Meetings.d.ts +2 -1
- package/dist/esm/components/Poll.d.ts +8 -0
- package/dist/esm/components/PollOption.d.ts +10 -0
- package/dist/esm/components/Post.d.ts +21 -0
- package/dist/esm/components/PostEdit.d.ts +17 -0
- package/dist/esm/components/PostList.d.ts +6 -0
- package/dist/esm/components/PostPlaceholder.d.ts +8 -0
- package/dist/esm/components/PostTrashed.d.ts +14 -0
- package/dist/esm/components/PostView.d.ts +21 -0
- package/dist/esm/components/Posts.d.ts +4 -0
- package/dist/esm/components/Preview.d.ts +1 -3
- package/dist/esm/components/PreviewFiles.d.ts +10 -0
- package/dist/esm/components/Reactions.d.ts +6 -2
- package/dist/esm/components/SearchUsers.d.ts +2 -1
- package/dist/esm/contexts/CloudFilesContext.d.ts +9 -0
- package/dist/esm/hooks/useApps.d.ts +1 -0
- package/dist/esm/hooks/useCloudFiles.d.ts +3 -0
- package/dist/esm/hooks/useCommentList.d.ts +1 -0
- package/dist/esm/hooks/useEmbeds.d.ts +5 -0
- package/dist/esm/hooks/useFileList.d.ts +1 -0
- package/dist/esm/hooks/useFileUploader.d.ts +8 -0
- package/dist/esm/hooks/useFileVersions.d.ts +2 -0
- package/dist/esm/hooks/useInfiniteScroll.d.ts +4 -0
- package/dist/esm/hooks/useIsFirstRender.d.ts +2 -0
- package/dist/esm/hooks/useMutateApps.d.ts +5 -0
- package/dist/esm/hooks/useMutateComment.d.ts +10 -0
- package/dist/esm/hooks/useMutateConversationName.d.ts +1 -1
- package/dist/esm/hooks/useMutateDeleteReaction.d.ts +3 -1
- package/dist/esm/hooks/useMutateEditComment.d.ts +10 -0
- package/dist/esm/hooks/useMutateEditPost.d.ts +10 -0
- package/dist/esm/hooks/useMutateExternalBlobs.d.ts +2 -2
- package/dist/esm/hooks/useMutateFile.d.ts +26 -0
- package/dist/esm/hooks/useMutateFileRename.d.ts +5 -0
- package/dist/esm/hooks/useMutateFileSubscribe.d.ts +7 -0
- package/dist/esm/hooks/useMutateFileTrash.d.ts +10 -0
- package/dist/esm/hooks/useMutateFileVersion.d.ts +7 -0
- package/dist/esm/hooks/useMutateFiles.d.ts +2 -0
- package/dist/esm/hooks/useMutateLeaveConversation.d.ts +4 -0
- package/dist/esm/hooks/useMutateMessage.d.ts +2 -2
- package/dist/esm/hooks/useMutatePost.d.ts +10 -0
- package/dist/esm/hooks/useMutateReaction.d.ts +3 -1
- package/dist/esm/hooks/useMutateRead.d.ts +1 -1
- package/dist/esm/hooks/useMutateReplaceReaction.d.ts +6 -0
- package/dist/esm/hooks/useMutateRestoreComment.d.ts +5 -0
- package/dist/esm/hooks/useMutateRestorePost.d.ts +4 -0
- package/dist/esm/hooks/useMutateStarred.d.ts +4 -0
- package/dist/esm/hooks/useMutateSubscribe.d.ts +4 -0
- package/dist/esm/hooks/useMutateTrashComment.d.ts +5 -0
- package/dist/esm/hooks/useMutateTrashPost.d.ts +4 -0
- package/dist/esm/hooks/useMutateTyping.d.ts +2 -0
- package/dist/esm/hooks/useMutateUnsubscribe.d.ts +4 -0
- package/dist/esm/hooks/useMutateVote.d.ts +5 -0
- package/dist/esm/hooks/usePost.d.ts +1 -0
- package/dist/esm/hooks/usePosts.d.ts +1 -0
- package/dist/esm/hooks/usePostsList.d.ts +1 -0
- package/dist/esm/hooks/useReactionList.d.ts +1 -0
- package/dist/esm/hooks/useSessionState.d.ts +2 -0
- package/dist/esm/hooks/useUnload.d.ts +2 -0
- package/dist/esm/hooks/useUpdateEffect.d.ts +3 -0
- package/dist/esm/hooks/useVotes.d.ts +1 -0
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js +28 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/ConversationListItem.d.ts +1 -0
- package/dist/esm/types/Files.d.ts +7 -0
- package/dist/esm/types/Message.d.ts +2 -2
- package/dist/esm/types/Posts.d.ts +4 -0
- package/dist/esm/types/interfaces.d.ts +9 -0
- package/dist/esm/types/types.d.ts +138 -22
- package/dist/esm/ui/Dropdown.d.ts +18 -2
- package/dist/esm/ui/Icon.d.ts +10 -2
- package/dist/esm/ui/Overlay.d.ts +3 -1
- package/dist/esm/ui/Sheet.d.ts +14 -0
- package/dist/esm/ui/Spinner.d.ts +2 -1
- package/dist/esm/utils/cacheUtils.d.ts +14 -0
- package/dist/esm/utils/fileUtilities.d.ts +10 -1
- package/dist/esm/utils/mentions.d.ts +6 -0
- package/dist/esm/utils/openUrl.d.ts +1 -0
- package/dist/index.d.ts +50 -6
- package/package.json +8 -2
- package/src/client/WeavyClient.ts +35 -1
- package/src/components/Attachment.tsx +20 -13
- package/src/components/Blob.tsx +28 -0
- package/src/components/Comment.tsx +43 -0
- package/src/components/CommentCount.tsx +15 -0
- package/src/components/CommentEdit.tsx +48 -0
- package/src/components/CommentPlaceholder.tsx +34 -0
- package/src/components/CommentTrashed.tsx +45 -0
- package/src/components/CommentView.tsx +142 -0
- package/src/components/Comments.tsx +78 -0
- package/src/components/Conversation.tsx +85 -31
- package/src/components/ConversationList.tsx +12 -41
- package/src/components/ConversationListItem.tsx +125 -74
- package/src/components/Dropzone.tsx +26 -0
- package/src/components/Editor.tsx +700 -0
- package/src/components/Embed.tsx +80 -0
- package/src/components/FileItem.tsx +391 -0
- package/src/components/FileList.tsx +166 -0
- package/src/components/FileVersions.tsx +100 -0
- package/src/components/Files.tsx +294 -0
- package/src/components/Image.tsx +11 -10
- package/src/components/Meeting.tsx +1 -2
- package/src/components/MeetingCard.tsx +1 -1
- package/src/components/Meetings.tsx +13 -5
- package/src/components/Message.tsx +14 -19
- package/src/components/Messages.tsx +38 -64
- package/src/components/NewConversation.tsx +8 -6
- package/src/components/PdfViewer.tsx +2 -2
- package/src/components/Poll.tsx +45 -0
- package/src/components/PollOption.tsx +65 -0
- package/src/components/Post.tsx +45 -0
- package/src/components/PostEdit.tsx +49 -0
- package/src/components/PostList.tsx +95 -0
- package/src/components/PostPlaceholder.tsx +32 -0
- package/src/components/PostTrashed.tsx +35 -0
- package/src/components/PostView.tsx +194 -0
- package/src/components/Posts.tsx +59 -0
- package/src/components/Preview.tsx +16 -23
- package/src/components/PreviewFiles.tsx +336 -0
- package/src/components/Reactions.tsx +142 -38
- package/src/components/SearchUsers.tsx +77 -37
- package/src/components/Typing.tsx +1 -1
- package/src/{components/FileBrowser.tsx → contexts/CloudFilesContext.tsx} +46 -30
- package/src/contexts/PreviewContext.tsx +102 -85
- package/src/contexts/WeavyContext.tsx +10 -6
- package/src/hooks/useApps.ts +23 -0
- package/src/hooks/useCloudFiles.ts +12 -0
- package/src/hooks/useCommentList.ts +30 -0
- package/src/hooks/useEmbeds.ts +126 -0
- package/src/hooks/useEvents.ts +3 -1
- package/src/hooks/useFileList.ts +84 -0
- package/src/hooks/useFileUploader.ts +38 -1
- package/src/hooks/useFileVersions.ts +20 -0
- package/src/hooks/useInfiniteScroll.ts +45 -0
- package/src/hooks/useIsFirstRender.ts +15 -0
- package/src/hooks/useMembers.ts +3 -3
- package/src/hooks/useMutateApps.ts +48 -0
- package/src/hooks/useMutateComment.ts +60 -0
- package/src/hooks/useMutateConversationName.ts +1 -1
- package/src/hooks/useMutateDeleteReaction.ts +17 -4
- package/src/hooks/useMutateEditComment.ts +63 -0
- package/src/hooks/useMutateEditPost.ts +64 -0
- package/src/hooks/useMutateExternalBlobs.ts +5 -9
- package/src/hooks/useMutateFile.ts +311 -0
- package/src/hooks/useMutateFileRename.ts +51 -0
- package/src/hooks/useMutateFileSubscribe.ts +80 -0
- package/src/hooks/useMutateFileTrash.ts +115 -0
- package/src/hooks/useMutateFileVersion.ts +85 -0
- package/src/hooks/useMutateFiles.ts +23 -0
- package/src/hooks/useMutateLeaveConversation.ts +38 -0
- package/src/hooks/useMutateMessage.ts +23 -62
- package/src/hooks/useMutatePost.ts +60 -0
- package/src/hooks/useMutateReaction.ts +21 -6
- package/src/hooks/useMutateRead.ts +8 -2
- package/src/hooks/useMutateRemoveMembers.ts +2 -9
- package/src/hooks/useMutateReplaceReaction.ts +59 -0
- package/src/hooks/useMutateRestoreComment.ts +37 -0
- package/src/hooks/useMutateRestorePost.ts +36 -0
- package/src/hooks/useMutateStarred.ts +35 -0
- package/src/hooks/useMutateSubscribe.ts +36 -0
- package/src/hooks/useMutateTrashComment.ts +37 -0
- package/src/hooks/useMutateTrashPost.ts +36 -0
- package/src/hooks/useMutateTyping.ts +5 -3
- package/src/hooks/useMutateUnsubscribe.ts +36 -0
- package/src/hooks/useMutateVote.ts +59 -0
- package/src/hooks/usePost.ts +20 -0
- package/src/hooks/usePosts.ts +21 -0
- package/src/hooks/usePostsList.ts +31 -0
- package/src/hooks/useReactionList.ts +21 -0
- package/src/hooks/useSearchUsers.ts +2 -2
- package/src/hooks/useSessionState.ts +23 -0
- package/src/hooks/useUnload.ts +19 -0
- package/src/hooks/useUpdateEffect.ts +16 -0
- package/src/hooks/useVotes.ts +21 -0
- package/src/index.ts +5 -1
- package/src/scss/theme/_appbar.scss +8 -4
- package/src/scss/theme/_card.scss +2 -0
- package/src/scss/theme/_comment-editor-cm.scss +5 -1
- package/src/scss/theme/_comments.scss +9 -8
- package/src/scss/theme/_conversations.scss +4 -0
- package/src/scss/theme/_files.scss +2 -81
- package/src/scss/theme/_icons.scss +21 -3
- package/src/scss/theme/_input.scss +13 -7
- package/src/scss/theme/_item.scss +23 -1
- package/src/scss/theme/_message-editor-cm.scss +5 -1
- package/src/scss/theme/_pager.scss +1 -1
- package/src/scss/theme/_post-editor-cm.scss +2 -2
- package/src/scss/theme/_post.scss +3 -10
- package/src/scss/theme/_preview-pdf-viewer.scss +996 -0
- package/src/scss/theme/_preview-pdf.scss +57 -783
- package/src/scss/theme/_sheet.scss +4 -1
- package/src/scss/theme/_spinner.scss +10 -1
- package/src/scss/theme/_tables.scss +2 -0
- package/src/scss/theme/base/_scroll.scss +3 -0
- package/src/scss/weavy-chat.scss +3 -1
- package/src/scss/weavy-files.scss +31 -0
- package/src/scss/weavy-messenger.scss +3 -1
- package/src/scss/weavy-posts.scss +35 -0
- package/src/scss/weavy.scss +2 -0
- package/src/types/ConversationListItem.ts +1 -0
- package/src/types/Files.ts +7 -0
- package/src/types/Message.ts +2 -2
- package/src/types/Posts.ts +4 -0
- package/src/types/interfaces.ts +13 -0
- package/src/types/types.ts +157 -28
- package/src/ui/Button.tsx +6 -5
- package/src/ui/Dropdown.tsx +67 -16
- package/src/ui/Icon.tsx +112 -15
- package/src/ui/Overlay.tsx +6 -2
- package/src/ui/Sheet.tsx +87 -0
- package/src/ui/Spinner.tsx +7 -4
- package/src/utils/cacheUtils.ts +246 -0
- package/src/utils/fileUtilities.ts +208 -24
- package/src/utils/infinite-scroll.js +103 -0
- package/src/utils/mentions.ts +50 -0
- package/src/utils/openUrl.ts +41 -0
- package/src/utils/{scrollToBottom.js → scroll-position.js} +50 -9
- package/src/utils/{scrollbarDetection.js → scrollbar-detection.js} +0 -0
- package/src/utils/utils.js +15 -1
- package/tsconfig.json +1 -1
- package/dist/cjs/components/ConversationForm.d.ts +0 -7
- package/dist/cjs/components/File.d.ts +0 -9
- package/dist/cjs/components/FileBrowser.d.ts +0 -6
- package/dist/cjs/hooks/usePreview.d.ts +0 -4
- package/dist/cjs/hooks/useReactions.d.ts +0 -3
- package/dist/esm/components/ConversationForm.d.ts +0 -7
- package/dist/esm/components/File.d.ts +0 -9
- package/dist/esm/components/FileBrowser.d.ts +0 -6
- package/dist/esm/hooks/usePreview.d.ts +0 -4
- package/dist/esm/hooks/useReactions.d.ts +0 -3
- package/src/components/ConversationForm.tsx +0 -210
- package/src/components/File.tsx +0 -21
- package/src/hooks/usePreview.ts +0 -21
- package/src/hooks/useReactions.ts +0 -51
- package/src/utils/infiniteScroll.js +0 -184
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { useMutation, useQueryClient } from "react-query";
|
|
3
|
+
import { WeavyContext } from "../contexts/WeavyContext";
|
|
4
|
+
import { updateCacheItem } from "../utils/cacheUtils";
|
|
5
|
+
|
|
6
|
+
/// DELETE to trash a Comment
|
|
7
|
+
export default function useMutateTrashComment() {
|
|
8
|
+
|
|
9
|
+
const { client } = useContext(WeavyContext);
|
|
10
|
+
const queryClient = useQueryClient();
|
|
11
|
+
|
|
12
|
+
if (!client) {
|
|
13
|
+
throw new Error('useMutateTrashComment must be used within an WeavyProvider');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type MutateProps = {
|
|
17
|
+
id: number | null,
|
|
18
|
+
appId: number | null,
|
|
19
|
+
parentId: number | null,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const trashPost = async ({ id }: MutateProps) => {
|
|
23
|
+
const response = await client.post(`/api/comments/${id}/trash`, "POST", "");
|
|
24
|
+
return response.json();
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return useMutation(trashPost, {
|
|
28
|
+
onSuccess: (data: any, variables: any, context: any) => {
|
|
29
|
+
updateCacheItem(queryClient, ['comments', variables.parentId], variables.id, (item: MessageType) => {
|
|
30
|
+
item.is_trashed = data.is_trashed;
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
onMutate: async (variables: any) => {
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { useMutation, useQueryClient } from "react-query";
|
|
3
|
+
import { WeavyContext } from "../contexts/WeavyContext";
|
|
4
|
+
import { updateCacheItem } from "../utils/cacheUtils";
|
|
5
|
+
|
|
6
|
+
/// DELETE to trash a Post
|
|
7
|
+
export default function useMutateTrashPost() {
|
|
8
|
+
|
|
9
|
+
const { client } = useContext(WeavyContext);
|
|
10
|
+
const queryClient = useQueryClient();
|
|
11
|
+
|
|
12
|
+
if (!client) {
|
|
13
|
+
throw new Error('useMutateTrashPost must be used within an WeavyProvider');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type MutateProps = {
|
|
17
|
+
id: number | null,
|
|
18
|
+
appId: number | null,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const trashPost = async ({ id }: MutateProps) => {
|
|
22
|
+
const response = await client.post(`/api/posts/${id}/trash`, "POST", "");
|
|
23
|
+
return response.json();
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return useMutation(trashPost, {
|
|
27
|
+
onSuccess: (data: any, variables: any, context: any) => {
|
|
28
|
+
updateCacheItem(queryClient, ['posts', variables.appId], variables.id, (item: MessageType) => {
|
|
29
|
+
item.is_trashed = data.is_trashed;
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
onMutate: async (variables: any) => {
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -13,12 +13,14 @@ export default function useMutateTyping() {
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
type MutateProps = {
|
|
16
|
-
id: number | null
|
|
16
|
+
id: number | null,
|
|
17
|
+
type: "posts" | "comments" | "messages",
|
|
18
|
+
location: "apps" | "posts" | "messages" | "files"
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
const mutateTyping = async ({ id }: MutateProps) => {
|
|
21
|
+
const mutateTyping = async ({ id, type, location }: MutateProps) => {
|
|
20
22
|
|
|
21
|
-
const response = await client.post(
|
|
23
|
+
const response = await client.post(`/api/${location}/${id}/${type}/typing`,
|
|
22
24
|
"PUT",
|
|
23
25
|
JSON.stringify({}));
|
|
24
26
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { useMutation, useQueryClient } from "react-query";
|
|
3
|
+
import { WeavyContext } from "../contexts/WeavyContext";
|
|
4
|
+
import { updateCacheItem } from "../utils/cacheUtils";
|
|
5
|
+
|
|
6
|
+
/// POST to unsubscribe
|
|
7
|
+
export default function useMutateUnsubscribe() {
|
|
8
|
+
|
|
9
|
+
const { client } = useContext(WeavyContext);
|
|
10
|
+
const queryClient = useQueryClient();
|
|
11
|
+
|
|
12
|
+
if (!client) {
|
|
13
|
+
throw new Error('useMutateUnsubscribe must be used within an WeavyProvider');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type MutateProps = {
|
|
17
|
+
id: number | null,
|
|
18
|
+
appId: number | null,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const unsubscribe = async ({ id }: MutateProps) => {
|
|
22
|
+
const response = await client.post(`/api/posts/${id}/unsubscribe`, "POST", "");
|
|
23
|
+
return response.json();
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return useMutation(unsubscribe, {
|
|
27
|
+
onSuccess: (data: any, variables: any, context: any) => {
|
|
28
|
+
updateCacheItem(queryClient, ['posts', variables.appId], variables.id, (item: MessageType) => {
|
|
29
|
+
item.is_subscribed = data.is_subscribed;
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
onMutate: async (variables: any) => {
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { useMutation, useQueryClient } from "react-query";
|
|
3
|
+
import { UserContext } from "../contexts/UserContext";
|
|
4
|
+
import { WeavyContext } from "../contexts/WeavyContext";
|
|
5
|
+
import { updateCacheItem } from "../utils/cacheUtils";
|
|
6
|
+
//import usePost from "./usePost";
|
|
7
|
+
|
|
8
|
+
/// POST to vote on an option
|
|
9
|
+
export default function useMutateVote() {
|
|
10
|
+
const queryClient = useQueryClient();
|
|
11
|
+
const { client } = useContext(WeavyContext);
|
|
12
|
+
|
|
13
|
+
if (!client) {
|
|
14
|
+
throw new Error('useMutateVote must be used within an WeavyProvider');
|
|
15
|
+
}
|
|
16
|
+
//const { refetch } = usePost(parentId, { enabled: false });
|
|
17
|
+
|
|
18
|
+
type MutateProps = {
|
|
19
|
+
id: number,
|
|
20
|
+
appId: number,
|
|
21
|
+
parentId: number
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const mutateVote = async ({ id }: MutateProps) => {
|
|
25
|
+
const response = await client.post(`/api/options/${id}/vote`, "POST", "");
|
|
26
|
+
return response.json();
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return useMutation(mutateVote, {
|
|
30
|
+
onSuccess: async (data: any, variables: any, context: any) => {
|
|
31
|
+
const response = await client.get("/api/posts/" + variables.parentId);
|
|
32
|
+
let json = await response.json();
|
|
33
|
+
// update cache
|
|
34
|
+
updateCacheItem(queryClient, ["posts", variables.appId], variables.parentId, (item: MessageType) => {
|
|
35
|
+
item.options = json.options;
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
onMutate: async (variables: any) => {
|
|
39
|
+
updateCacheItem(queryClient, ["posts", variables.appId], variables.parentId, (item: MessageType) => {
|
|
40
|
+
item.options = item.options?.map((o: PollOptionType) => {
|
|
41
|
+
|
|
42
|
+
if (o.has_voted) {
|
|
43
|
+
o.has_voted = false;
|
|
44
|
+
let count = o.vote_count || 1;
|
|
45
|
+
o.vote_count = count - 1;
|
|
46
|
+
} else if (!o.has_voted && o.id === variables.id) {
|
|
47
|
+
o.has_voted = true;
|
|
48
|
+
let count = o.vote_count || 0;
|
|
49
|
+
o.vote_count = count + 1;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return o;
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { useQuery } from "react-query";
|
|
3
|
+
import { WeavyContext } from "../contexts/WeavyContext";
|
|
4
|
+
|
|
5
|
+
/// GET a specific post
|
|
6
|
+
export default function usePost(id: number, options: any) {
|
|
7
|
+
const { client } = useContext(WeavyContext);
|
|
8
|
+
|
|
9
|
+
if (!client) {
|
|
10
|
+
throw new Error('usePost must be used within an WeavyProvider');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const getPost = async () => {
|
|
14
|
+
const response = await client.get("/api/posts/" + id);
|
|
15
|
+
return response.json();
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
return useQuery<MessageType>(["post", id], getPost, options);
|
|
20
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { useQuery } from "react-query";
|
|
3
|
+
import { WeavyContext } from "../contexts/WeavyContext";
|
|
4
|
+
|
|
5
|
+
/// GET a specific Posts app
|
|
6
|
+
export default function usePosts(id: string, options: any) {
|
|
7
|
+
const { client } = useContext(WeavyContext);
|
|
8
|
+
|
|
9
|
+
if (!client) {
|
|
10
|
+
throw new Error('usePosts must be used within an WeavyProvider');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const getPosts = async () => {
|
|
14
|
+
const response = await client.get("/api/apps/" + id);
|
|
15
|
+
const data = await response.json();
|
|
16
|
+
return data;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
return useQuery<PostsType>(["posts", id], getPosts, options);
|
|
21
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { useInfiniteQuery, useQuery } from "react-query";
|
|
3
|
+
import { WeavyContext } from "../contexts/WeavyContext";
|
|
4
|
+
|
|
5
|
+
/// GET all posts in an app
|
|
6
|
+
export default function usePostsList(id: number | null, options: any) {
|
|
7
|
+
const PAGE_SIZE = 10;
|
|
8
|
+
const { client } = useContext(WeavyContext);
|
|
9
|
+
|
|
10
|
+
if (!client) {
|
|
11
|
+
throw new Error('usePostsList must be used within an WeavyProvider');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const getPosts = async (opt: any) => {
|
|
15
|
+
let skip = opt.pageParam || 0;
|
|
16
|
+
const response = await client.get("/api/apps/" + id + "/posts?orderby=createdat+desc&skip=" + skip + "&top=" + PAGE_SIZE);
|
|
17
|
+
const data = await response.json();
|
|
18
|
+
|
|
19
|
+
return data;
|
|
20
|
+
};
|
|
21
|
+
var opts = {
|
|
22
|
+
...options,
|
|
23
|
+
getNextPageParam: (lastPage:any, pages:any) => {
|
|
24
|
+
if (lastPage?.end < lastPage?.count) {
|
|
25
|
+
return pages.length * PAGE_SIZE;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return useInfiniteQuery<MessagesResult>(['posts', id], getPosts, opts)
|
|
31
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { useQuery } from "react-query";
|
|
3
|
+
import { WeavyContext } from "../contexts/WeavyContext";
|
|
4
|
+
|
|
5
|
+
/// GET who reacted on an entity
|
|
6
|
+
export default function useReactionList(id: number, type: string, options: any) {
|
|
7
|
+
const { client } = useContext(WeavyContext);
|
|
8
|
+
|
|
9
|
+
if (!client) {
|
|
10
|
+
throw new Error('useReactionList must be used within an WeavyProvider');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const getReactions = async () => {
|
|
14
|
+
const response = await client.get(`/api/${type}/${id}/reactions`);
|
|
15
|
+
const data = await response.json();
|
|
16
|
+
return data;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
return useQuery<ReactionsResult>(["reactions", id, type], getReactions, options);
|
|
21
|
+
}
|
|
@@ -4,7 +4,7 @@ import { WeavyContext } from "../contexts/WeavyContext";
|
|
|
4
4
|
|
|
5
5
|
/// GET users by search query
|
|
6
6
|
export default function useSearchUsers(text: string, options: any) {
|
|
7
|
-
const PAGE_SIZE =
|
|
7
|
+
const PAGE_SIZE = 25;
|
|
8
8
|
const { client } = useContext(WeavyContext);
|
|
9
9
|
|
|
10
10
|
if (!client) {
|
|
@@ -12,7 +12,7 @@ export default function useSearchUsers(text: string, options: any) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const getUsers = async () => {
|
|
15
|
-
const response = await client.get(
|
|
15
|
+
const response = await client.get(`/api/users/autocomplete?q=${text}&skip=0&top=${PAGE_SIZE}`);
|
|
16
16
|
const data = await response.json();
|
|
17
17
|
return data;
|
|
18
18
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
const prefix = "wy-";
|
|
4
|
+
|
|
5
|
+
function getSessionStorageOrDefault<T>(key: string, defaultValue: T | (() => T)) {
|
|
6
|
+
const stored = sessionStorage.getItem(prefix + key);
|
|
7
|
+
if (!stored) {
|
|
8
|
+
return defaultValue;
|
|
9
|
+
}
|
|
10
|
+
return JSON.parse(stored) as T;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function useSessionState<S>(key: string, defaultValue: S | (() => S)):[S, React.Dispatch<React.SetStateAction<S>>] {
|
|
14
|
+
const [value, setValue] = useState<S>(
|
|
15
|
+
getSessionStorageOrDefault<S>(key, defaultValue) as S | (() => S)
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
sessionStorage.setItem(prefix + key, JSON.stringify(value));
|
|
20
|
+
}, [key, value]);
|
|
21
|
+
|
|
22
|
+
return [value, setValue];
|
|
23
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useRef, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
const useUnload = (fn: Function) => {
|
|
4
|
+
const cb = useRef(fn); // init with fn, so that type checkers won't assume that current might be undefined
|
|
5
|
+
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
cb.current = fn;
|
|
8
|
+
}, [fn]);
|
|
9
|
+
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const onUnload = (...args: any[]) => cb.current?.(...args);
|
|
12
|
+
|
|
13
|
+
window.addEventListener("beforeunload", onUnload);
|
|
14
|
+
|
|
15
|
+
return () => window.removeEventListener("beforeunload", onUnload);
|
|
16
|
+
}, []);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default useUnload;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DependencyList, EffectCallback, useEffect } from 'react'
|
|
2
|
+
|
|
3
|
+
import useIsFirstRender from './useIsFirstRender';
|
|
4
|
+
|
|
5
|
+
function useUpdateEffect(effect: EffectCallback, deps?: DependencyList) {
|
|
6
|
+
const isFirst = useIsFirstRender()
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (!isFirst) {
|
|
10
|
+
return effect()
|
|
11
|
+
}
|
|
12
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13
|
+
}, deps)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default useUpdateEffect
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { useQuery } from "react-query";
|
|
3
|
+
import { WeavyContext } from "../contexts/WeavyContext";
|
|
4
|
+
|
|
5
|
+
/// GET votes for an option
|
|
6
|
+
export default function useVotes(id: number, options: any) {
|
|
7
|
+
const { client } = useContext(WeavyContext);
|
|
8
|
+
|
|
9
|
+
if (!client) {
|
|
10
|
+
throw new Error('useVotes must be used within an WeavyProvider');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const getVotes = async () => {
|
|
14
|
+
const response = await client.get(`/api/options/${id}/voters`);
|
|
15
|
+
const data = await response.json();
|
|
16
|
+
return data;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
return useQuery<UserType[]>(["votes", id], getVotes, options);
|
|
21
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -8,6 +8,8 @@ import ConversationBadge from './components/ConversationBadge';
|
|
|
8
8
|
import ConversationList from './components/ConversationList';
|
|
9
9
|
import Conversation from './components/Conversation';
|
|
10
10
|
import Chat from './components/Chat';
|
|
11
|
+
import Posts from './components/Posts'
|
|
12
|
+
import Files from './components/Files'
|
|
11
13
|
import Button from './ui/Button';
|
|
12
14
|
import Dropdown from './ui/Dropdown';
|
|
13
15
|
import Icon from './ui/Icon';
|
|
@@ -23,8 +25,10 @@ export {
|
|
|
23
25
|
Messenger,
|
|
24
26
|
ConversationList,
|
|
25
27
|
Conversation,
|
|
26
|
-
Chat,
|
|
28
|
+
Chat,
|
|
27
29
|
ConversationBadge,
|
|
30
|
+
Posts,
|
|
31
|
+
Files,
|
|
28
32
|
Button,
|
|
29
33
|
Dropdown,
|
|
30
34
|
Icon,
|
|
@@ -81,6 +81,10 @@
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
+
.wy-appbar-text-trashed {
|
|
85
|
+
text-decoration: line-through;
|
|
86
|
+
}
|
|
87
|
+
|
|
84
88
|
|
|
85
89
|
// floating toolbars (mainly for pdf preview, but can be also be used for other things)
|
|
86
90
|
.wy-toolbars-bottom {
|
|
@@ -115,10 +119,6 @@
|
|
|
115
119
|
background-color: var(--wy-component-background-color);
|
|
116
120
|
color: var(--wy-component-color);
|
|
117
121
|
box-shadow: #{colors.$outline-variant} 0px -1px 0px 0px inset;
|
|
118
|
-
|
|
119
|
-
span {
|
|
120
|
-
margin-left: .25rem;
|
|
121
|
-
}
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
.wy-toolbar-center {
|
|
@@ -131,6 +131,10 @@
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
.wy-toolbar-text {
|
|
135
|
+
margin-left: .25rem;
|
|
136
|
+
}
|
|
137
|
+
|
|
134
138
|
.wy-footerbars {
|
|
135
139
|
padding-bottom: vars.$footerbar-height;
|
|
136
140
|
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
color: #{colors.$outline};
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
.ͼ2 .cm-content {
|
|
24
|
+
caret-color: #{colors.$on-background};
|
|
25
|
+
}
|
|
26
|
+
|
|
23
27
|
.ͼ1.cm-editor {
|
|
24
28
|
@extend %comment-editor-textfield;
|
|
25
29
|
|
|
@@ -47,7 +51,7 @@
|
|
|
47
51
|
}
|
|
48
52
|
}
|
|
49
53
|
|
|
50
|
-
.wy-is-invalid + .cm-editor {
|
|
54
|
+
.wy-is-invalid + .cm-editor, .wy-is-invalid .cm-editor {
|
|
51
55
|
border-color: colors.$error !important;
|
|
52
56
|
}
|
|
53
57
|
// autocomplete dropdown menu
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
@include text.truncate;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
.wy-comment {
|
|
20
19
|
--wy-component-background-color: #{colors.$surface-3};
|
|
21
20
|
--wy-component-color: #{colors.$on-surface};
|
|
@@ -45,15 +44,18 @@
|
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
|
|
48
|
-
/*.wy-comment-header {
|
|
49
|
-
//padding-right: .25rem;
|
|
50
|
-
}*/
|
|
51
|
-
|
|
52
47
|
.wy-comment-body {
|
|
53
|
-
|
|
54
48
|
flex: 1 0 auto;
|
|
55
49
|
z-index: 1;
|
|
56
|
-
|
|
50
|
+
|
|
51
|
+
.wy-image-grid, .wy-embed, .wy-content, .wy-list, .wy-poll {
|
|
52
|
+
// spacing between content
|
|
53
|
+
margin-bottom: 1rem;
|
|
54
|
+
|
|
55
|
+
&:last-child {
|
|
56
|
+
margin-bottom: 0;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
.wy-comment-content {
|
|
@@ -63,4 +65,3 @@
|
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
|
|
66
|
-
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
.wy-filename {
|
|
7
7
|
font-size: vars.$font-size-sm;
|
|
8
8
|
@include text.truncate;
|
|
9
|
+
text-align: center;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
.wy-files-dragging {
|
|
@@ -24,87 +25,7 @@
|
|
|
24
25
|
bottom: 0;
|
|
25
26
|
right: 0;
|
|
26
27
|
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
.wy-upload-progress-item {
|
|
32
|
-
flex-direction: column;
|
|
33
|
-
padding: 0.75rem .25rem;
|
|
34
|
-
|
|
35
|
-
.wy-upload-progress-item-content {
|
|
36
|
-
flex: 1;
|
|
37
|
-
overflow: hidden;
|
|
38
|
-
text-overflow: ellipsis;
|
|
39
|
-
white-space: nowrap;
|
|
40
|
-
line-height: 1.25rem;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.wy-upload-progress-success {
|
|
44
|
-
display: flex;
|
|
45
|
-
align-items: center;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.wy-upload-progress {
|
|
49
|
-
display: flex;
|
|
50
|
-
width: 100%;
|
|
51
|
-
|
|
52
|
-
progress {
|
|
53
|
-
flex: 1;
|
|
54
|
-
height: 0.5rem;
|
|
55
|
-
accent-color: colors.$primary;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.wy-upload-error {
|
|
61
|
-
align-items: flex-start;
|
|
62
|
-
flex-direction: column;
|
|
63
|
-
white-space: normal;
|
|
64
|
-
|
|
65
|
-
.wy-upload-error-title {
|
|
66
|
-
overflow: hidden;
|
|
67
|
-
text-overflow: ellipsis;
|
|
68
|
-
white-space: nowrap;
|
|
69
|
-
line-height: 1.25rem;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.wy-upload-error-text {
|
|
73
|
-
color: colors.$error;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.wy-upload-error-actions {
|
|
77
|
-
white-space: nowrap;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.wy-file-upload-errors {
|
|
82
|
-
display: flex;
|
|
83
|
-
flex-direction: column;
|
|
84
|
-
|
|
85
|
-
.wy-upload-error-row {
|
|
86
|
-
display: flex;
|
|
87
|
-
margin-bottom: 0.5rem;
|
|
88
|
-
align-items: center;
|
|
89
|
-
column-gap: 1rem;
|
|
90
|
-
|
|
91
|
-
.wy-upload-error-row-title {
|
|
92
|
-
flex: 1;
|
|
93
|
-
overflow: hidden;
|
|
94
|
-
white-space: nowrap;
|
|
95
|
-
text-overflow: ellipsis;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.wy-upload-error-row-conflict {
|
|
99
|
-
background-color: colors.$error-container;
|
|
100
|
-
color: colors.$on-error-container;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.wy-upload-error-row-error {
|
|
104
|
-
color: colors.$error;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
28
|
+
}
|
|
108
29
|
|
|
109
30
|
.wy-table-files {
|
|
110
31
|
thead {
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
// icons normally inherit the text color of its parent
|
|
74
|
-
.wy-icon:not([class*="wy-icon-"]):not([class*="wy-kind-"]) * {
|
|
74
|
+
.wy-icon:not([class*="wy-icon-"]):not([class*="wy-kind-"]):not([data-icon=progress]) * {
|
|
75
75
|
fill: currentColor;
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -92,7 +92,6 @@
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
|
|
96
95
|
// theme icons
|
|
97
96
|
.wy-icon-primary * {
|
|
98
97
|
fill: colors.$primary;
|
|
@@ -147,7 +146,6 @@
|
|
|
147
146
|
fill: #{colors.$gray};
|
|
148
147
|
}
|
|
149
148
|
|
|
150
|
-
|
|
151
149
|
// file type icons
|
|
152
150
|
[class*="wy-kind-"] * {
|
|
153
151
|
fill: colors.$gray;
|
|
@@ -196,3 +194,23 @@
|
|
|
196
194
|
.wy-ext-pdf * {
|
|
197
195
|
fill: colors.$red;
|
|
198
196
|
}
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
// progress icon
|
|
200
|
+
[data-icon=progress] {
|
|
201
|
+
|
|
202
|
+
&.wy-icon-primary {
|
|
203
|
+
color: colors.$primary;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
:first-child {
|
|
207
|
+
fill: none;
|
|
208
|
+
stroke: colors.$surface-variant;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
:last-child {
|
|
212
|
+
fill: none;
|
|
213
|
+
stroke: currentColor;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|