@weavy/uikit-react 11.0.1 → 12.1.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/.github/workflows/publish.yml +1 -1
- package/README.md +3 -4
- package/changelog.md +30 -0
- package/dist/cjs/index.js +6 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/client/WeavyClient.d.ts +1 -1
- package/dist/cjs/types/components/Image.d.ts +2 -0
- package/dist/cjs/types/components/PdfViewer.d.ts +6 -0
- package/dist/cjs/types/components/Preview.d.ts +58 -0
- package/dist/cjs/types/contexts/MessengerContext.d.ts +1 -2
- package/dist/cjs/types/hooks/useUser.d.ts +2 -1
- package/dist/cjs/types/types/Messenger.d.ts +0 -1
- package/dist/cjs/types/types/types.d.ts +11 -6
- package/dist/cjs/types/utils/fileUtilities.d.ts +16 -1
- package/dist/css/weavy-chat.css +2684 -0
- package/dist/css/weavy-messenger.css +3039 -0
- package/dist/css/weavy.css +3039 -0
- package/dist/esm/index.js +6 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/client/WeavyClient.d.ts +1 -1
- package/dist/esm/types/components/Image.d.ts +2 -0
- package/dist/esm/types/components/PdfViewer.d.ts +6 -0
- package/dist/esm/types/components/Preview.d.ts +58 -0
- package/dist/esm/types/contexts/MessengerContext.d.ts +1 -2
- package/dist/esm/types/hooks/useUser.d.ts +2 -1
- package/dist/esm/types/types/Messenger.d.ts +0 -1
- package/dist/esm/types/types/types.d.ts +11 -6
- package/dist/esm/types/utils/fileUtilities.d.ts +16 -1
- package/dist/index.d.ts +2 -3
- package/package.json +14 -4
- package/rollup.config.js +0 -2
- package/src/client/WeavyClient.ts +3 -3
- package/src/components/Attachment.tsx +5 -6
- package/src/components/Avatar.tsx +2 -3
- package/src/components/Chat.tsx +10 -14
- package/src/components/Conversation.tsx +21 -30
- package/src/components/ConversationBadge.tsx +1 -2
- package/src/components/ConversationForm.tsx +11 -18
- package/src/components/ConversationList.tsx +4 -5
- package/src/components/ConversationListItem.tsx +13 -15
- package/src/components/FileBrowser.tsx +2 -3
- package/src/components/Image.tsx +39 -7
- package/src/components/MeetingCard.tsx +7 -8
- package/src/components/Message.tsx +12 -13
- package/src/components/Messages.tsx +19 -19
- package/src/components/Messenger.tsx +5 -6
- package/src/components/NewConversation.tsx +5 -7
- package/src/components/PdfViewer.tsx +271 -0
- package/src/components/Presence.tsx +2 -2
- package/src/components/Preview.tsx +294 -0
- package/src/components/Reactions.tsx +8 -8
- package/src/components/SearchUsers.tsx +18 -17
- package/src/components/SeenBy.tsx +1 -2
- package/src/components/Typing.tsx +4 -4
- package/src/contexts/MessengerContext.tsx +4 -12
- package/src/contexts/PreviewContext.tsx +4 -6
- package/src/contexts/WeavyContext.tsx +8 -1
- package/src/hooks/useBadge.ts +1 -1
- package/src/hooks/useChat.ts +1 -1
- package/src/hooks/useConversation.ts +1 -2
- package/src/hooks/useConversations.ts +1 -1
- package/src/hooks/useFileUploader.ts +5 -1
- package/src/hooks/useMembers.ts +1 -1
- package/src/hooks/useMessages.ts +1 -1
- package/src/hooks/useMutateChat.ts +1 -1
- package/src/hooks/useMutateConversation.ts +1 -1
- package/src/hooks/useMutateConversationName.ts +1 -1
- package/src/hooks/useMutateDeleteReaction.ts +1 -1
- package/src/hooks/useMutateExternalBlobs.ts +1 -1
- package/src/hooks/useMutateMeeting.ts +1 -1
- package/src/hooks/useMutateMembers.ts +1 -1
- package/src/hooks/useMutateMessage.ts +2 -1
- package/src/hooks/useMutatePinned.ts +1 -1
- package/src/hooks/useMutateReaction.ts +1 -1
- package/src/hooks/useMutateRead.ts +1 -1
- package/src/hooks/useMutateRemoveMembers.ts +1 -1
- package/src/hooks/useMutateTyping.ts +1 -1
- package/src/hooks/usePresence.ts +8 -5
- package/src/hooks/useReactions.ts +0 -1
- package/src/hooks/useSearchUsers.ts +1 -1
- package/src/hooks/useUser.ts +4 -3
- package/src/index.ts +2 -2
- package/src/scss/theme/_alert.scss +73 -0
- package/src/scss/theme/_appbar.scss +112 -0
- package/src/scss/theme/_attachments.scss +74 -0
- package/src/scss/theme/_avatar.scss +54 -0
- package/src/scss/theme/_badge.scss +47 -0
- package/src/scss/theme/_buttons.scss +96 -0
- package/src/scss/theme/_card.scss +7 -0
- package/src/scss/theme/_checkbox.scss +56 -0
- package/src/scss/theme/_cm-editor.scss +42 -0
- package/src/scss/theme/_code.scss +115 -0
- package/src/scss/theme/_colors.scss +520 -0
- package/src/scss/theme/_config.scss +6 -0
- package/src/scss/theme/_content.scss +15 -0
- package/src/scss/theme/_conversations.scss +91 -0
- package/src/scss/theme/_dropdown.scss +86 -0
- package/src/scss/theme/_emoji.scss +5 -0
- package/src/scss/theme/_filebrowser.scss +26 -0
- package/src/scss/theme/_files.scss +140 -0
- package/src/scss/theme/_icons.scss +62 -0
- package/src/scss/theme/_image-grid.scss +63 -0
- package/src/scss/theme/_inputs.scss +28 -0
- package/src/scss/theme/_message-editor.scss +90 -0
- package/src/scss/theme/_messages.scss +238 -0
- package/src/scss/theme/_nav.scss +52 -0
- package/src/scss/theme/_overlays.scss +157 -0
- package/src/scss/theme/_pager.scss +19 -0
- package/src/scss/theme/_palette.scss +165 -0
- package/src/scss/theme/_pane.scss +16 -0
- package/src/scss/theme/_panels.scss +137 -0
- package/src/scss/theme/_picker-list.scss +37 -0
- package/src/scss/theme/_preview-embed.scss +38 -0
- package/src/scss/theme/_preview-html.scss +7 -0
- package/src/scss/theme/_preview-icon.scss +41 -0
- package/src/scss/theme/_preview-image.scss +86 -0
- package/src/scss/theme/_preview-media.scss +28 -0
- package/src/scss/theme/_preview-pdf.scss +838 -0
- package/src/scss/theme/_preview-text.scss +5 -0
- package/src/scss/theme/_preview.scss +105 -0
- package/src/scss/theme/_reactions.scss +58 -0
- package/src/scss/theme/_reboot.scss +41 -0
- package/src/scss/theme/_root.scss +2 -0
- package/src/scss/theme/_scroll.scss +55 -0
- package/src/scss/theme/_search.scss +68 -0
- package/src/scss/theme/_spinner.scss +63 -0
- package/src/scss/theme/_tables.scss +53 -0
- package/src/scss/theme/_toasts.scss +47 -0
- package/src/scss/theme/_turbo.scss +17 -0
- package/src/scss/theme/_typing.scss +26 -0
- package/src/scss/theme/_variables.scss +139 -0
- package/src/scss/theme/bootstrap/_accordion.scss +146 -0
- package/src/scss/theme/bootstrap/_alert.scss +71 -0
- package/src/scss/theme/bootstrap/_badge.scss +38 -0
- package/src/scss/theme/bootstrap/_breadcrumb.scss +40 -0
- package/src/scss/theme/bootstrap/_button-group.scss +142 -0
- package/src/scss/theme/bootstrap/_buttons.scss +186 -0
- package/src/scss/theme/bootstrap/_card.scss +234 -0
- package/src/scss/theme/bootstrap/_carousel.scss +229 -0
- package/src/scss/theme/bootstrap/_close.scss +40 -0
- package/src/scss/theme/bootstrap/_containers.scss +41 -0
- package/src/scss/theme/bootstrap/_dropdown.scss +248 -0
- package/src/scss/theme/bootstrap/_forms.scss +9 -0
- package/src/scss/theme/bootstrap/_functions.scss +302 -0
- package/src/scss/theme/bootstrap/_grid.scss +33 -0
- package/src/scss/theme/bootstrap/_helpers.scss +10 -0
- package/src/scss/theme/bootstrap/_images.scss +42 -0
- package/src/scss/theme/bootstrap/_list-group.scss +191 -0
- package/src/scss/theme/bootstrap/_maps.scss +54 -0
- package/src/scss/theme/bootstrap/_mixins.scss +43 -0
- package/src/scss/theme/bootstrap/_modal.scss +237 -0
- package/src/scss/theme/bootstrap/_nav.scss +172 -0
- package/src/scss/theme/bootstrap/_navbar.scss +276 -0
- package/src/scss/theme/bootstrap/_offcanvas.scss +143 -0
- package/src/scss/theme/bootstrap/_pagination.scss +109 -0
- package/src/scss/theme/bootstrap/_placeholders.scss +51 -0
- package/src/scss/theme/bootstrap/_popover.scss +196 -0
- package/src/scss/theme/bootstrap/_progress.scss +59 -0
- package/src/scss/theme/bootstrap/_reboot.scss +610 -0
- package/src/scss/theme/bootstrap/_root.scss +73 -0
- package/src/scss/theme/bootstrap/_spinners.scss +85 -0
- package/src/scss/theme/bootstrap/_tables.scss +164 -0
- package/src/scss/theme/bootstrap/_toasts.scss +70 -0
- package/src/scss/theme/bootstrap/_tooltip.scss +120 -0
- package/src/scss/theme/bootstrap/_transitions.scss +27 -0
- package/src/scss/theme/bootstrap/_type.scss +106 -0
- package/src/scss/theme/bootstrap/_utilities.scss +647 -0
- package/src/scss/theme/bootstrap/_variables.scss +1633 -0
- package/src/scss/theme/bootstrap/forms/_floating-labels.scss +74 -0
- package/src/scss/theme/bootstrap/forms/_form-check.scss +175 -0
- package/src/scss/theme/bootstrap/forms/_form-control.scss +194 -0
- package/src/scss/theme/bootstrap/forms/_form-range.scss +91 -0
- package/src/scss/theme/bootstrap/forms/_form-select.scss +71 -0
- package/src/scss/theme/bootstrap/forms/_form-text.scss +11 -0
- package/src/scss/theme/bootstrap/forms/_input-group.scss +129 -0
- package/src/scss/theme/bootstrap/forms/_labels.scss +36 -0
- package/src/scss/theme/bootstrap/forms/_validation.scss +12 -0
- package/src/scss/theme/bootstrap/helpers/_clearfix.scss +3 -0
- package/src/scss/theme/bootstrap/helpers/_color-bg.scss +10 -0
- package/src/scss/theme/bootstrap/helpers/_colored-links.scss +12 -0
- package/src/scss/theme/bootstrap/helpers/_position.scss +36 -0
- package/src/scss/theme/bootstrap/helpers/_ratio.scss +26 -0
- package/src/scss/theme/bootstrap/helpers/_stacks.scss +15 -0
- package/src/scss/theme/bootstrap/helpers/_stretched-link.scss +15 -0
- package/src/scss/theme/bootstrap/helpers/_text-truncation.scss +7 -0
- package/src/scss/theme/bootstrap/helpers/_visually-hidden.scss +8 -0
- package/src/scss/theme/bootstrap/helpers/_vr.scss +8 -0
- package/src/scss/theme/bootstrap/mixins/_alert.scss +15 -0
- package/src/scss/theme/bootstrap/mixins/_backdrop.scss +14 -0
- package/src/scss/theme/bootstrap/mixins/_banner.scss +9 -0
- package/src/scss/theme/bootstrap/mixins/_border-radius.scss +78 -0
- package/src/scss/theme/bootstrap/mixins/_box-shadow.scss +18 -0
- package/src/scss/theme/bootstrap/mixins/_breakpoints.scss +127 -0
- package/src/scss/theme/bootstrap/mixins/_buttons.scss +70 -0
- package/src/scss/theme/bootstrap/mixins/_caret.scss +64 -0
- package/src/scss/theme/bootstrap/mixins/_clearfix.scss +9 -0
- package/src/scss/theme/bootstrap/mixins/_color-scheme.scss +7 -0
- package/src/scss/theme/bootstrap/mixins/_container.scss +11 -0
- package/src/scss/theme/bootstrap/mixins/_deprecate.scss +10 -0
- package/src/scss/theme/bootstrap/mixins/_forms.scss +152 -0
- package/src/scss/theme/bootstrap/mixins/_gradients.scss +47 -0
- package/src/scss/theme/bootstrap/mixins/_grid.scss +151 -0
- package/src/scss/theme/bootstrap/mixins/_image.scss +16 -0
- package/src/scss/theme/bootstrap/mixins/_list-group.scss +24 -0
- package/src/scss/theme/bootstrap/mixins/_lists.scss +7 -0
- package/src/scss/theme/bootstrap/mixins/_pagination.scss +10 -0
- package/src/scss/theme/bootstrap/mixins/_reset-text.scss +17 -0
- package/src/scss/theme/bootstrap/mixins/_resize.scss +6 -0
- package/src/scss/theme/bootstrap/mixins/_table-variants.scss +24 -0
- package/src/scss/theme/bootstrap/mixins/_text-truncate.scss +8 -0
- package/src/scss/theme/bootstrap/mixins/_transition.scss +26 -0
- package/src/scss/theme/bootstrap/mixins/_utilities.scss +97 -0
- package/src/scss/theme/bootstrap/mixins/_visually-hidden.scss +29 -0
- package/src/scss/theme/bootstrap/utilities/_api.scss +47 -0
- package/src/scss/theme/bootstrap/vendor/_rfs.scss +354 -0
- package/src/scss/theme/bs/_badge.scss +20 -0
- package/src/scss/theme/bs/_buttons.scss +185 -0
- package/src/scss/theme/bs/_dropdown.scss +86 -0
- package/src/scss/theme/bs/_forms.scss +161 -0
- package/src/scss/theme/bs/_list-group.scss +73 -0
- package/src/scss/theme/bs/_tables.scss +46 -0
- package/src/scss/theme/fonts/_fontmapping-roboto.scss +129 -0
- package/src/scss/theme/fonts/_fontmapping-segoe-ui.scss +127 -0
- package/src/scss/theme/fonts/_index.scss +2 -0
- package/src/scss/theme/mixins/_backdrop.scss +13 -0
- package/src/scss/theme/mixins/_palette.scss +165 -0
- package/src/scss/theme/mixins/_position.scss +33 -0
- package/src/scss/theme/mixins/_scrollbar.scss +110 -0
- package/src/scss/weavy-chat.scss +31 -0
- package/src/scss/weavy-messenger.scss +60 -0
- package/src/scss/weavy.scss +2 -0
- package/src/types/Messenger.ts +1 -1
- package/src/types/types.ts +14 -9
- package/src/ui/Button.tsx +3 -4
- package/src/ui/Dropdown.tsx +4 -5
- package/src/ui/Icon.tsx +75 -39
- package/src/ui/Overlay.tsx +2 -3
- package/src/utils/fileUtilities.ts +280 -72
- package/src/utils/scrollbarDetection.js +48 -0
- package/dist/cjs/types/utils/styles.d.ts +0 -17
- package/dist/esm/types/utils/styles.d.ts +0 -17
- package/src/utils/styles.ts +0 -42
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// Normal
|
|
2
|
+
@font-face {
|
|
3
|
+
font-family: 'Segoe UI';
|
|
4
|
+
font-style: normal;
|
|
5
|
+
font-weight: 100;
|
|
6
|
+
src: local('Segoe UI Thin'), local('Segoe UI Light');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@font-face {
|
|
10
|
+
font-family: 'Segoe UI';
|
|
11
|
+
font-style: normal;
|
|
12
|
+
font-weight: 200;
|
|
13
|
+
src: local('Segoe UI Light');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@font-face {
|
|
17
|
+
font-family: 'Segoe UI';
|
|
18
|
+
font-style: normal;
|
|
19
|
+
font-weight: 300;
|
|
20
|
+
src: local('Segoe UI Semilight');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@font-face {
|
|
24
|
+
font-family: 'Segoe UI';
|
|
25
|
+
font-style: normal;
|
|
26
|
+
font-weight: 400;
|
|
27
|
+
src: local('Segoe UI');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@font-face {
|
|
31
|
+
font-family: 'Segoe UI';
|
|
32
|
+
font-style: normal;
|
|
33
|
+
font-weight: 500;
|
|
34
|
+
src: local('Segoe UI Medium'), local('Segoe UI Semibold');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@font-face {
|
|
38
|
+
font-family: 'Segoe UI';
|
|
39
|
+
font-style: normal;
|
|
40
|
+
font-weight: 600;
|
|
41
|
+
src: local('Segoe UI Semibold');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@font-face {
|
|
45
|
+
font-family: 'Segoe UI';
|
|
46
|
+
font-style: normal;
|
|
47
|
+
font-weight: 700;
|
|
48
|
+
src: local('Segoe UI Bold');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@font-face {
|
|
52
|
+
font-family: 'Segoe UI';
|
|
53
|
+
font-style: normal;
|
|
54
|
+
font-weight: 800;
|
|
55
|
+
src: local('Segoe UI Semiblack'), local('Segoe UI Black');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@font-face {
|
|
59
|
+
font-family: 'Segoe UI';
|
|
60
|
+
font-style: normal;
|
|
61
|
+
font-weight: 900;
|
|
62
|
+
src: local('Segoe UI Black');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Italic
|
|
66
|
+
@font-face {
|
|
67
|
+
font-family: 'Segoe UI';
|
|
68
|
+
font-style: italic;
|
|
69
|
+
font-weight: 100;
|
|
70
|
+
src: local('Segoe UI Thin Italic'), local('Segoe UI Light Italic');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@font-face {
|
|
74
|
+
font-family: 'Segoe UI';
|
|
75
|
+
font-style: italic;
|
|
76
|
+
font-weight: 200;
|
|
77
|
+
src: local('Segoe UI Light Italic');
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@font-face {
|
|
81
|
+
font-family: 'Segoe UI';
|
|
82
|
+
font-style: italic;
|
|
83
|
+
font-weight: 300;
|
|
84
|
+
src: local('Segoe UI Semilight Italic');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@font-face {
|
|
88
|
+
font-family: 'Segoe UI';
|
|
89
|
+
font-style: italic;
|
|
90
|
+
font-weight: 400;
|
|
91
|
+
src: local('Segoe UI Italic');
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@font-face {
|
|
95
|
+
font-family: 'Segoe UI';
|
|
96
|
+
font-style: italic;
|
|
97
|
+
font-weight: 500;
|
|
98
|
+
src: local('Segoe UI Medium Italic'), local('Segoe UI Semibold Italic');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@font-face {
|
|
102
|
+
font-family: 'Segoe UI';
|
|
103
|
+
font-style: italic;
|
|
104
|
+
font-weight: 600;
|
|
105
|
+
src: local('Segoe UI Semibold Italic');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@font-face {
|
|
109
|
+
font-family: 'Segoe UI';
|
|
110
|
+
font-style: italic;
|
|
111
|
+
font-weight: 700;
|
|
112
|
+
src: local('Segoe UI Bold Italic');
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@font-face {
|
|
116
|
+
font-family: 'Segoe UI';
|
|
117
|
+
font-style: italic;
|
|
118
|
+
font-weight: 800;
|
|
119
|
+
src: local('Segoe UI Semiblack Italic'), local('Segoe UI Black Italic');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@font-face {
|
|
123
|
+
font-family: 'Segoe UI';
|
|
124
|
+
font-style: italic;
|
|
125
|
+
font-weight: 900;
|
|
126
|
+
src: local('Segoe UI Black Italic');
|
|
127
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
$enable-backdrop-filter: true !default;
|
|
2
|
+
$backdrop-filter: blur(.5rem) !default;
|
|
3
|
+
|
|
4
|
+
@mixin filter($backdrop-filter: $backdrop-filter) {
|
|
5
|
+
backface-visibility: hidden;
|
|
6
|
+
|
|
7
|
+
@if($enable-backdrop-filter) {
|
|
8
|
+
@supports(backdrop-filter: $backdrop-filter) {
|
|
9
|
+
backdrop-filter: $backdrop-filter;
|
|
10
|
+
@content;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "sass:list";
|
|
3
|
+
@use "sass:string";
|
|
4
|
+
@use "sass:math";
|
|
5
|
+
@use "sass:color";
|
|
6
|
+
|
|
7
|
+
// RYB COLOR WHEEL
|
|
8
|
+
// HSL mapping based on http://computergraphics.stackexchange.com/questions/1748/function-to-convert-hsv-angle-to-ryb-angle
|
|
9
|
+
// Matching bootstrap and MD colors
|
|
10
|
+
$color-names: (
|
|
11
|
+
"red": null,
|
|
12
|
+
"deep-orange": null,
|
|
13
|
+
"orange": null,
|
|
14
|
+
"amber": null,
|
|
15
|
+
"yellow": null,
|
|
16
|
+
"lime": null,
|
|
17
|
+
"light-green": null,
|
|
18
|
+
"green": null,
|
|
19
|
+
"teal": null,
|
|
20
|
+
"cyan": null,
|
|
21
|
+
"light-blue": null,
|
|
22
|
+
"blue": null,
|
|
23
|
+
"indigo": null,
|
|
24
|
+
"deep-purple": null,
|
|
25
|
+
"purple": null,
|
|
26
|
+
"pink": null
|
|
27
|
+
) !default;
|
|
28
|
+
|
|
29
|
+
// Matching MD shades
|
|
30
|
+
// Added 950 for dark theme compatibility
|
|
31
|
+
$color-shades: (
|
|
32
|
+
"50": 95,
|
|
33
|
+
"100": 90,
|
|
34
|
+
"200": 80,
|
|
35
|
+
"300": 70,
|
|
36
|
+
"400": 60,
|
|
37
|
+
"500": 50,
|
|
38
|
+
"600": 42,
|
|
39
|
+
"700": 36,
|
|
40
|
+
"800": 28,
|
|
41
|
+
"900": 22,
|
|
42
|
+
"950": 16
|
|
43
|
+
) !default;
|
|
44
|
+
|
|
45
|
+
// color mapping
|
|
46
|
+
$ryb-rgb-mapping: (
|
|
47
|
+
(0, 0) // Red
|
|
48
|
+
(50, 35) // Orange
|
|
49
|
+
(110, 60) // Yellow
|
|
50
|
+
(165, 120) // Green
|
|
51
|
+
(210, 180) // Cyan
|
|
52
|
+
(285, 240) // Blue
|
|
53
|
+
(330, 300) // Purple
|
|
54
|
+
(360, 360) // Red (same as 0)
|
|
55
|
+
) !default;
|
|
56
|
+
|
|
57
|
+
// saturation mapping
|
|
58
|
+
$hue-sat-mapping: (
|
|
59
|
+
(0, 85) // Red
|
|
60
|
+
(110, 100) // Yellow
|
|
61
|
+
(165, 60) // Green
|
|
62
|
+
(210, 88) // Cyan
|
|
63
|
+
(285, 97) // Blue
|
|
64
|
+
(330, 65) // Purple
|
|
65
|
+
(360, 85) // Red (same as 0)
|
|
66
|
+
) !default;
|
|
67
|
+
|
|
68
|
+
@function ryb-hue($h, $reverse: false) {
|
|
69
|
+
$deg: $h % 360;
|
|
70
|
+
|
|
71
|
+
$from: 1;
|
|
72
|
+
$to: 2;
|
|
73
|
+
|
|
74
|
+
@if $reverse {
|
|
75
|
+
$from: 2;
|
|
76
|
+
$to: 1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
$lower: 1;
|
|
80
|
+
$upper: 2;
|
|
81
|
+
|
|
82
|
+
@while $deg > list.nth(list.nth($ryb-rgb-mapping, $upper), $from) {
|
|
83
|
+
$lower: $upper;
|
|
84
|
+
$upper: $upper + 1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
$lower-from: list.nth(list.nth($ryb-rgb-mapping, $lower), $from);
|
|
88
|
+
$lower-to: list.nth(list.nth($ryb-rgb-mapping, $lower), $to);
|
|
89
|
+
$upper-from: list.nth(list.nth($ryb-rgb-mapping, $upper), $from);
|
|
90
|
+
$upper-to: list.nth(list.nth($ryb-rgb-mapping, $upper), $to);
|
|
91
|
+
|
|
92
|
+
$percent: math.div(($deg - $lower-from), ($upper-from - $lower-from));
|
|
93
|
+
$hue: $lower-to + ($upper-to - $lower-to) * $percent;
|
|
94
|
+
|
|
95
|
+
@return $hue;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@function ryb-saturation($rybHue, $saturation, $reverse: false) {
|
|
99
|
+
$deg: $rybHue % 360;
|
|
100
|
+
$sat: math.clamp(0, $saturation, 100);
|
|
101
|
+
|
|
102
|
+
$index: 1;
|
|
103
|
+
$value: 2;
|
|
104
|
+
|
|
105
|
+
$lower: 1;
|
|
106
|
+
$upper: 2;
|
|
107
|
+
|
|
108
|
+
@while $deg > list.nth(list.nth($hue-sat-mapping, $upper), $index) {
|
|
109
|
+
$lower: $upper;
|
|
110
|
+
$upper: $upper + 1;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
$lower-index: list.nth(list.nth($hue-sat-mapping, $lower), $index);
|
|
114
|
+
$upper-index: list.nth(list.nth($hue-sat-mapping, $upper), $index);
|
|
115
|
+
$lower-value: list.nth(list.nth($hue-sat-mapping, $lower), $value);
|
|
116
|
+
$upper-value: list.nth(list.nth($hue-sat-mapping, $upper), $value);
|
|
117
|
+
|
|
118
|
+
$percent: math.div(($deg - $lower-index), ($upper-index - $lower-index));
|
|
119
|
+
$interpolation: math.div(($lower-value + ($upper-value - $lower-value) * $percent), 100);
|
|
120
|
+
|
|
121
|
+
@if $reverse {
|
|
122
|
+
@return math.div($sat, $interpolation);
|
|
123
|
+
} @else {
|
|
124
|
+
@return $sat * $interpolation;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@function hsl-to-ryb-as-hsl($h, $s, $l) {
|
|
130
|
+
$hue: math.floor(ryb-hue($h));
|
|
131
|
+
$saturation: ryb-saturation($h, $s) * 1%;
|
|
132
|
+
$lightness: $l * 1%;
|
|
133
|
+
@return hsl($hue, $saturation, $lightness);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@function generate-colors($base-color) {
|
|
137
|
+
$h: ryb-hue(math.div(hue($base-color), 1deg), true);
|
|
138
|
+
$divisions: list.length($color-names);
|
|
139
|
+
|
|
140
|
+
// 33% is minimum threshold to not get all colors gray
|
|
141
|
+
$normalizedS: math.clamp(ryb-saturation($h, 33), math.div(saturation($base-color), 1%), ryb-saturation($h, 100));
|
|
142
|
+
$s: ryb-saturation($h, $normalizedS, true);
|
|
143
|
+
|
|
144
|
+
$distance: math.div(360, $divisions);
|
|
145
|
+
|
|
146
|
+
$start-offset: $h % $distance;
|
|
147
|
+
|
|
148
|
+
// Clone
|
|
149
|
+
$generated-colors: map.merge($color-names, ());
|
|
150
|
+
|
|
151
|
+
@for $i from 1 through $divisions {
|
|
152
|
+
$ih: $start-offset + ($i - 1) * $distance;
|
|
153
|
+
$il: map.get($color-shades, "500");
|
|
154
|
+
$iname: list.nth(map.keys($color-names), $i);
|
|
155
|
+
$icolor: hsl-to-ryb-as-hsl($ih, $s, $il);
|
|
156
|
+
//@debug $iname $icolor;
|
|
157
|
+
$generated-colors: map.set($generated-colors, $iname, $icolor);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@return $generated-colors;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@function color-shade($color, $shade, $shades: $color-shades) {
|
|
164
|
+
@return color.change($color, $lightness: map.get($shades, $shade) * 1%)
|
|
165
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@use "../variables";
|
|
2
|
+
|
|
3
|
+
@mixin fixed-top {
|
|
4
|
+
position: fixed;
|
|
5
|
+
top: 0;
|
|
6
|
+
right: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
z-index: variables.$zindex-fixed;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@mixin fixed-bottom {
|
|
12
|
+
position: fixed;
|
|
13
|
+
right: 0;
|
|
14
|
+
bottom: 0;
|
|
15
|
+
left: 0;
|
|
16
|
+
z-index: variables.$zindex-fixed;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@mixin sticky-top {
|
|
20
|
+
@supports (position: sticky) {
|
|
21
|
+
position: sticky;
|
|
22
|
+
top: 0;
|
|
23
|
+
z-index: variables.$zindex-sticky;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@mixin sticky-bottom {
|
|
28
|
+
@supports (position: sticky) {
|
|
29
|
+
position: sticky;
|
|
30
|
+
bottom: 0;
|
|
31
|
+
z-index: variables.$zindex-sticky;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
@use "../colors";
|
|
2
|
+
|
|
3
|
+
@mixin scroll-y {
|
|
4
|
+
overflow-y: auto;
|
|
5
|
+
touch-action: pan-y, pan-x;
|
|
6
|
+
|
|
7
|
+
// to enable HW acceleration and not cause repaint on scroll
|
|
8
|
+
// opacity needed for custom scrollbar to paint
|
|
9
|
+
will-change: scroll-position, opacity;
|
|
10
|
+
backface-visibility: hidden;
|
|
11
|
+
|
|
12
|
+
// ios momentum scrolling on iOS <= 12, cannot be used on the <body> element!
|
|
13
|
+
&:not(body) {
|
|
14
|
+
-webkit-overflow-scrolling: touch;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
max-height: 100%;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@mixin scroll-x {
|
|
21
|
+
overflow-x: auto;
|
|
22
|
+
touch-action: pan-y, pan-x;
|
|
23
|
+
|
|
24
|
+
// to enable HW acceleration and not cause repaint on scroll
|
|
25
|
+
will-change: scroll-position, opacity;
|
|
26
|
+
backface-visibility: hidden;
|
|
27
|
+
max-width: 100%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// custom scrollbar styling
|
|
31
|
+
@mixin custom-scrollbar {
|
|
32
|
+
// custom scrollbar for webkit browsers
|
|
33
|
+
// reference https://webkit.org/blog/363/styling-scrollbars/
|
|
34
|
+
|
|
35
|
+
&::-webkit-scrollbar {
|
|
36
|
+
height: .625rem;
|
|
37
|
+
width: .625rem;
|
|
38
|
+
background: transparent;
|
|
39
|
+
z-index: 999;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&::-webkit-scrollbar-track {
|
|
43
|
+
background: transparent;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&::-webkit-scrollbar-thumb {
|
|
47
|
+
background-color: rgba(colors.$gray-500, 0.75);
|
|
48
|
+
border: .125rem solid transparent;
|
|
49
|
+
border-radius: .5rem;
|
|
50
|
+
background-clip: padding-box;
|
|
51
|
+
|
|
52
|
+
&:hover {
|
|
53
|
+
background-color: rgba(colors.$gray-700, 0.75);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&:window-inactive {
|
|
57
|
+
background-color: rgba(colors.$gray-500, 0.5);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// custom scrollbar for firefox
|
|
62
|
+
scrollbar-width: thin;
|
|
63
|
+
scrollbar-color: rgba(colors.$gray-500, 0.75) transparent;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// custom scrollbar styling
|
|
67
|
+
@mixin thin-scrollbar {
|
|
68
|
+
// custom scrollbar for webkit browsers
|
|
69
|
+
&::-webkit-scrollbar {
|
|
70
|
+
height: .375rem;
|
|
71
|
+
width: .375rem;
|
|
72
|
+
background: transparent;
|
|
73
|
+
z-index: 999;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&::-webkit-scrollbar-track {
|
|
77
|
+
background: transparent;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&::-webkit-scrollbar-thumb {
|
|
81
|
+
background-color: rgba(colors.$gray-700, 0.75);
|
|
82
|
+
border: 0 solid transparent;
|
|
83
|
+
border-radius: 0;
|
|
84
|
+
background-clip: padding-box;
|
|
85
|
+
|
|
86
|
+
&:hover {
|
|
87
|
+
background-color: rgba(colors.$gray-500, 0.75);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&:window-inactive {
|
|
91
|
+
background-color: rgba(colors.$gray-500, 0.5);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// custom scrollbar for firefox
|
|
96
|
+
scrollbar-width: thin;
|
|
97
|
+
scrollbar-color: rgba(colors.$gray-700, 0.75) transparent;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@mixin scrollbar-top-padding($scrollbar-padding) {
|
|
101
|
+
&::-webkit-scrollbar-button:vertical:start {
|
|
102
|
+
height: $scrollbar-padding;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@mixin scrollbar-bottom-padding($scrollbar-padding) {
|
|
107
|
+
&::-webkit-scrollbar-button:vertical:end {
|
|
108
|
+
height: $scrollbar-padding;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// weavy reboot
|
|
2
|
+
@use "theme/reboot";
|
|
3
|
+
// weavy ui components
|
|
4
|
+
@use "theme/attachments";
|
|
5
|
+
@use "theme/avatar";
|
|
6
|
+
@use "theme/buttons";
|
|
7
|
+
@use "theme/code";
|
|
8
|
+
@use "theme/content";
|
|
9
|
+
@use "theme/dropdown";
|
|
10
|
+
@use "theme/emoji";
|
|
11
|
+
@use "theme/icons";
|
|
12
|
+
@use "theme/image-grid";
|
|
13
|
+
@use "theme/messages";
|
|
14
|
+
@use "theme/message-editor";
|
|
15
|
+
@use "theme/overlays";
|
|
16
|
+
@use "theme/pager";
|
|
17
|
+
@use "theme/pane";
|
|
18
|
+
@use "theme/panels";
|
|
19
|
+
@use "theme/picker-list";
|
|
20
|
+
@use "theme/preview";
|
|
21
|
+
@use "theme/preview-embed";
|
|
22
|
+
@use "theme/preview-html";
|
|
23
|
+
@use "theme/preview-icon";
|
|
24
|
+
@use "theme/preview-image";
|
|
25
|
+
@use "theme/preview-media";
|
|
26
|
+
@use "theme/preview-pdf";
|
|
27
|
+
@use "theme/preview-text";
|
|
28
|
+
@use "theme/reactions";
|
|
29
|
+
@use "theme/scroll";
|
|
30
|
+
@use "theme/spinner";
|
|
31
|
+
@use "theme/typing";
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// weavy reboot
|
|
2
|
+
@use "theme/reboot";
|
|
3
|
+
|
|
4
|
+
// weavy ui components
|
|
5
|
+
@use "theme/appbar";
|
|
6
|
+
@use "theme/attachments";
|
|
7
|
+
@use "theme/avatar";
|
|
8
|
+
@use "theme/badge";
|
|
9
|
+
@use "theme/buttons";
|
|
10
|
+
@use "theme/checkbox";
|
|
11
|
+
@use "theme/code";
|
|
12
|
+
@use "theme/content";
|
|
13
|
+
@use "theme/conversations";
|
|
14
|
+
@use "theme/dropdown";
|
|
15
|
+
@use "theme/emoji";
|
|
16
|
+
@use "theme/icons";
|
|
17
|
+
@use "theme/image-grid";
|
|
18
|
+
@use "theme/inputs";
|
|
19
|
+
@use "theme/messages";
|
|
20
|
+
@use "theme/message-editor";
|
|
21
|
+
@use "theme/overlays";
|
|
22
|
+
@use "theme/pager";
|
|
23
|
+
@use "theme/pane";
|
|
24
|
+
@use "theme/panels";
|
|
25
|
+
@use "theme/picker-list";
|
|
26
|
+
@use "theme/preview";
|
|
27
|
+
@use "theme/preview-embed";
|
|
28
|
+
@use "theme/preview-html";
|
|
29
|
+
@use "theme/preview-icon";
|
|
30
|
+
@use "theme/preview-image";
|
|
31
|
+
@use "theme/preview-media";
|
|
32
|
+
@use "theme/preview-pdf";
|
|
33
|
+
@use "theme/preview-text";
|
|
34
|
+
@use "theme/reactions";
|
|
35
|
+
@use "theme/search";
|
|
36
|
+
@use "theme/scroll";
|
|
37
|
+
@use "theme/spinner";
|
|
38
|
+
@use "theme/typing";
|
|
39
|
+
|
|
40
|
+
// layout
|
|
41
|
+
.wy-messenger-provider {
|
|
42
|
+
display: flex;
|
|
43
|
+
min-height: 0;
|
|
44
|
+
min-width: 0;
|
|
45
|
+
flex: 1 1 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.wy-messenger-sidebar {
|
|
49
|
+
width: 300px;
|
|
50
|
+
border-right: 1px solid #ccc;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.wy-messenger-conversation{
|
|
54
|
+
overflow-anchor: none;
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
flex: 1 1 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
package/src/types/Messenger.ts
CHANGED
package/src/types/types.ts
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
interface WeavyClient {
|
|
2
|
+
url: string,
|
|
3
|
+
tokenFactory: (() => string | Promise<string>),
|
|
4
|
+
subscribe: Function,
|
|
5
|
+
unsubscribe: Function,
|
|
6
|
+
}
|
|
7
|
+
|
|
1
8
|
type WeavyClientOptions = {
|
|
2
|
-
|
|
9
|
+
url: string,
|
|
3
10
|
tokenFactory: (() => string | Promise<string>)
|
|
4
11
|
}
|
|
5
12
|
|
|
6
13
|
type WeavyContextProps = {
|
|
7
|
-
client:
|
|
14
|
+
client: WeavyClient | null,
|
|
8
15
|
options?: WeavyContextOptions
|
|
9
16
|
};
|
|
10
17
|
|
|
@@ -12,11 +19,12 @@ type WeavyContextOptions = {
|
|
|
12
19
|
zoomAuthenticationUrl?: string,
|
|
13
20
|
teamsAuthenticationUrl?: string,
|
|
14
21
|
enableCloudFiles?: boolean,
|
|
15
|
-
|
|
22
|
+
enableScrollbarDetection?: boolean,
|
|
23
|
+
filebrowserUrl?: string,
|
|
24
|
+
reactions?: string[]
|
|
16
25
|
}
|
|
17
26
|
|
|
18
27
|
type MessengerContextProps = {
|
|
19
|
-
options?: MessengerContextOptions,
|
|
20
28
|
selectedConversationId: null | number,
|
|
21
29
|
setSelectedConversationId: Function
|
|
22
30
|
};
|
|
@@ -25,11 +33,6 @@ type UserContextProps = {
|
|
|
25
33
|
user: UserType
|
|
26
34
|
};
|
|
27
35
|
|
|
28
|
-
|
|
29
|
-
type MessengerContextOptions = {
|
|
30
|
-
reactions?: string[]
|
|
31
|
-
}
|
|
32
|
-
|
|
33
36
|
type PreviewContextProps = {
|
|
34
37
|
openPreview: Function,
|
|
35
38
|
closePreview: Function
|
|
@@ -134,6 +137,8 @@ type AttachmentType = {
|
|
|
134
137
|
external_url: string
|
|
135
138
|
}
|
|
136
139
|
|
|
140
|
+
type PreviewFormatType = "text"|"code"|"markup"|"image"|"video"|"audio"|"document"|"embed"|"link"|"download"|"none";
|
|
141
|
+
|
|
137
142
|
type ReactionType = {
|
|
138
143
|
id: number,
|
|
139
144
|
parent: MessageType,
|
package/src/ui/Button.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { Children } from "react";
|
|
2
2
|
import Icon from "./Icon";
|
|
3
3
|
import classNames from "classnames";
|
|
4
|
-
import { prefix as wy } from "../utils/styles";
|
|
5
4
|
|
|
6
5
|
type Props = {
|
|
7
6
|
active?: boolean,
|
|
@@ -16,11 +15,11 @@ const Button: any = ({ active = false, type = "button", onClick, className = "",
|
|
|
16
15
|
let singleChild: any = Children.count(children) === 1 && Children.toArray(children).pop();
|
|
17
16
|
|
|
18
17
|
let buttonClassNames = classNames(
|
|
19
|
-
wy
|
|
18
|
+
"wy-button",
|
|
20
19
|
className,
|
|
21
20
|
{
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
"wy-active": active,
|
|
22
|
+
"wy-button-icon": singleChild?.type === Icon.UI
|
|
24
23
|
}
|
|
25
24
|
);
|
|
26
25
|
|
package/src/ui/Dropdown.tsx
CHANGED
|
@@ -2,7 +2,6 @@ import React, { useEffect, useState } from "react";
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import Icon from "./Icon";
|
|
4
4
|
import Button from "./Button";
|
|
5
|
-
import { prefix as wy } from "../utils/styles";
|
|
6
5
|
|
|
7
6
|
type DropdownProps = {
|
|
8
7
|
directionX?: "left" | "right";
|
|
@@ -30,12 +29,12 @@ const Dropdown = ({ directionX = "right", directionY = "down", children, classNa
|
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
return (
|
|
33
|
-
<span className={classNames(wy
|
|
34
|
-
<Button.UI onClick={(e: any) => handleMenuClick(e)} className={
|
|
32
|
+
<span className={classNames("wy-dropdown", { "wy-dropup": directionY === "up" }, className)} {...props}>
|
|
33
|
+
<Button.UI onClick={(e: any) => handleMenuClick(e)} className={classNames({ "wy-active": visible })}>
|
|
35
34
|
<Icon.UI name="dots-vertical" />
|
|
36
35
|
</Button.UI>
|
|
37
36
|
|
|
38
|
-
<div className={
|
|
37
|
+
<div className={classNames("wy-dropdown-menu", { "wy-dropdown-menu-end": directionX === "left" })} hidden={!visible}>
|
|
39
38
|
{children}
|
|
40
39
|
</div>
|
|
41
40
|
</span>
|
|
@@ -50,7 +49,7 @@ type ItemProps = {
|
|
|
50
49
|
props?: React.HTMLAttributes<HTMLDivElement>
|
|
51
50
|
}
|
|
52
51
|
const DropdownItem = ({ children, className = "", onClick, ...props }: ItemProps) => {
|
|
53
|
-
return <div className={classNames(wy
|
|
52
|
+
return <div className={classNames("wy-dropdown-item", className)} onClick={onClick} {...props}>{children}</div>
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
// Export as replacable UI component
|