@weavy/uikit-react 13.0.0 → 14.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.
Files changed (243) hide show
  1. package/changelog.md +24 -0
  2. package/dist/cjs/index.js +3 -3
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/types/components/Chat.d.ts +1 -1
  5. package/dist/cjs/types/components/Messages.d.ts +3 -1
  6. package/dist/cjs/types/hooks/useConversations.d.ts +1 -1
  7. package/dist/cjs/types/hooks/useMutateMessage.d.ts +1 -1
  8. package/dist/cjs/types/hooks/useMutateRead.d.ts +1 -0
  9. package/dist/cjs/types/types/Chat.d.ts +1 -0
  10. package/dist/cjs/types/types/Message.d.ts +2 -0
  11. package/dist/cjs/types/types/types.d.ts +47 -4
  12. package/dist/cjs/types/ui/Spinner.d.ts +2 -1
  13. package/dist/css/weavy-chat.css +1540 -954
  14. package/dist/css/weavy-messenger.css +1901 -1298
  15. package/dist/css/weavy.css +1696 -1093
  16. package/dist/esm/index.js +3 -3
  17. package/dist/esm/index.js.map +1 -1
  18. package/dist/esm/types/components/Chat.d.ts +1 -1
  19. package/dist/esm/types/components/Messages.d.ts +3 -1
  20. package/dist/esm/types/hooks/useConversations.d.ts +1 -1
  21. package/dist/esm/types/hooks/useMutateMessage.d.ts +1 -1
  22. package/dist/esm/types/hooks/useMutateRead.d.ts +1 -0
  23. package/dist/esm/types/types/Chat.d.ts +1 -0
  24. package/dist/esm/types/types/Message.d.ts +2 -0
  25. package/dist/esm/types/types/types.d.ts +47 -4
  26. package/dist/esm/types/ui/Spinner.d.ts +2 -1
  27. package/dist/index.d.ts +2 -1
  28. package/package.json +2 -2
  29. package/src/client/WeavyClient.ts +12 -17
  30. package/src/components/Attachment.tsx +5 -5
  31. package/src/components/Chat.tsx +6 -5
  32. package/src/components/Conversation.tsx +26 -20
  33. package/src/components/ConversationBadge.tsx +7 -5
  34. package/src/components/ConversationForm.tsx +1 -1
  35. package/src/components/ConversationList.tsx +59 -11
  36. package/src/components/ConversationListItem.tsx +71 -54
  37. package/src/components/FileBrowser.tsx +53 -50
  38. package/src/components/MeetingCard.tsx +35 -13
  39. package/src/components/Meetings.tsx +1 -1
  40. package/src/components/Message.tsx +41 -41
  41. package/src/components/Messages.tsx +61 -60
  42. package/src/components/Messenger.tsx +7 -2
  43. package/src/components/NewConversation.tsx +1 -1
  44. package/src/components/PdfViewer.tsx +5 -5
  45. package/src/components/Preview.tsx +2 -2
  46. package/src/components/Reactions.tsx +11 -5
  47. package/src/components/SearchUsers.tsx +19 -9
  48. package/src/components/SeenBy.tsx +13 -7
  49. package/src/components/Typing.tsx +11 -12
  50. package/src/contexts/UserContext.tsx +1 -1
  51. package/src/contexts/WeavyContext.tsx +3 -3
  52. package/src/hooks/useConversations.ts +15 -5
  53. package/src/hooks/useMutateMessage.ts +1 -5
  54. package/src/hooks/useMutateRead.ts +5 -3
  55. package/src/hooks/usePresence.ts +2 -3
  56. package/src/hooks/useReactions.ts +11 -12
  57. package/src/scss/theme/_alert.scss +61 -63
  58. package/src/scss/theme/_appbar.scss +105 -30
  59. package/src/scss/theme/_avatar.scss +23 -28
  60. package/src/scss/theme/_badge.scss +26 -18
  61. package/src/scss/theme/_buttons.scss +107 -52
  62. package/src/scss/theme/_card.scss +102 -4
  63. package/src/scss/theme/_checkbox.scss +16 -20
  64. package/src/scss/theme/_code-vscode-dark.scss +3 -3
  65. package/src/scss/theme/_code-vscode-light.scss +3 -3
  66. package/src/scss/theme/_code.scss +0 -2
  67. package/src/scss/theme/_comment-editor-cm.scss +97 -0
  68. package/src/scss/theme/_comment-editor.scss +129 -0
  69. package/src/scss/theme/_comments.scss +66 -0
  70. package/src/scss/theme/_content.scss +33 -5
  71. package/src/scss/theme/_conversations.scss +19 -78
  72. package/src/scss/theme/_dropdown.scss +102 -15
  73. package/src/scss/theme/_embed.scss +135 -0
  74. package/src/scss/theme/_facepile.scss +11 -0
  75. package/src/scss/theme/_filebrowser.scss +1 -1
  76. package/src/scss/theme/_files.scss +76 -47
  77. package/src/scss/theme/_grid.scss +8 -0
  78. package/src/scss/theme/_icons.scss +155 -19
  79. package/src/scss/theme/_image-grid.scss +7 -10
  80. package/src/scss/theme/_input.scss +160 -0
  81. package/src/scss/theme/_item.scss +169 -0
  82. package/src/scss/theme/_list.scss +57 -0
  83. package/src/scss/theme/_meeting.scss +11 -0
  84. package/src/scss/theme/_message-editor-cm.scss +95 -0
  85. package/src/scss/theme/_message-editor.scss +65 -19
  86. package/src/scss/theme/_messages.scss +51 -105
  87. package/src/scss/theme/_meta.scss +12 -0
  88. package/src/scss/theme/_overlays.scss +31 -76
  89. package/src/scss/theme/_pager.scss +5 -1
  90. package/src/scss/theme/_pane.scss +13 -2
  91. package/src/scss/theme/_panels.scss +33 -28
  92. package/src/scss/theme/_picker-list.scss +5 -3
  93. package/src/scss/theme/_placeholder.scss +19 -0
  94. package/src/scss/theme/_poll.scss +49 -0
  95. package/src/scss/theme/_post-editor-cm.scss +100 -0
  96. package/src/scss/theme/_post-editor.scss +127 -0
  97. package/src/scss/theme/_post.scss +83 -0
  98. package/src/scss/theme/_preview-code.scss +11 -2
  99. package/src/scss/theme/_preview-embed.scss +8 -2
  100. package/src/scss/theme/_preview-image.scss +8 -26
  101. package/src/scss/theme/_preview-media.scss +1 -0
  102. package/src/scss/theme/_preview-pdf.scss +10 -15
  103. package/src/scss/theme/_preview.scss +57 -79
  104. package/src/scss/theme/_reactions.scss +48 -17
  105. package/src/scss/theme/_sheet.scss +59 -0
  106. package/src/scss/theme/_sidebar.scss +86 -0
  107. package/src/scss/theme/_spinner.scss +11 -7
  108. package/src/scss/theme/_tab.scss +72 -0
  109. package/src/scss/theme/_tables.scss +70 -23
  110. package/src/scss/theme/_toasts.scss +56 -26
  111. package/src/scss/theme/_type.scss +41 -0
  112. package/src/scss/theme/{mixins → base}/_backdrop.scss +0 -0
  113. package/src/scss/theme/{bootstrap/mixins → base}/_breakpoints.scss +9 -0
  114. package/src/scss/theme/base/_colors.scss +315 -0
  115. package/src/scss/theme/base/_md.scss +19 -0
  116. package/src/scss/theme/base/_palette.scss +130 -0
  117. package/src/scss/theme/{mixins → base}/_position.scss +5 -5
  118. package/src/scss/theme/base/_reboot.scss +51 -0
  119. package/src/scss/theme/base/_scroll.scss +180 -0
  120. package/src/scss/theme/base/_svg.scss +49 -0
  121. package/src/scss/theme/base/_text.scss +23 -0
  122. package/src/scss/theme/base/_vars.scss +203 -0
  123. package/src/scss/theme/{fonts → base/fonts}/_fontmapping-roboto.scss +0 -0
  124. package/src/scss/theme/{fonts → base/fonts}/_fontmapping-segoe-ui.scss +0 -0
  125. package/src/scss/theme/base/fonts/_index.scss +2 -0
  126. package/src/scss/weavy-chat.scss +10 -4
  127. package/src/scss/weavy-messenger.scss +37 -21
  128. package/src/types/Chat.ts +2 -1
  129. package/src/types/Message.ts +3 -1
  130. package/src/types/types.ts +56 -5
  131. package/src/ui/Icon.tsx +1 -1
  132. package/src/ui/Spinner.tsx +3 -2
  133. package/src/utils/infiniteScroll.js +11 -2
  134. package/src/utils/postal-parent.js +398 -0
  135. package/src/utils/promise.js +187 -0
  136. package/src/utils/scrollbarDetection.js +68 -9
  137. package/src/utils/utils.js +547 -0
  138. package/src/scss/theme/_attachments.scss +0 -74
  139. package/src/scss/theme/_cm-editor.scss +0 -42
  140. package/src/scss/theme/_colors.scss +0 -520
  141. package/src/scss/theme/_config.scss +0 -6
  142. package/src/scss/theme/_inputs.scss +0 -28
  143. package/src/scss/theme/_nav.scss +0 -52
  144. package/src/scss/theme/_palette.scss +0 -165
  145. package/src/scss/theme/_preview-icon.scss +0 -41
  146. package/src/scss/theme/_reboot.scss +0 -41
  147. package/src/scss/theme/_root.scss +0 -2
  148. package/src/scss/theme/_scroll.scss +0 -55
  149. package/src/scss/theme/_search.scss +0 -68
  150. package/src/scss/theme/_turbo.scss +0 -17
  151. package/src/scss/theme/_variables.scss +0 -139
  152. package/src/scss/theme/bootstrap/_accordion.scss +0 -146
  153. package/src/scss/theme/bootstrap/_alert.scss +0 -71
  154. package/src/scss/theme/bootstrap/_badge.scss +0 -38
  155. package/src/scss/theme/bootstrap/_breadcrumb.scss +0 -40
  156. package/src/scss/theme/bootstrap/_button-group.scss +0 -142
  157. package/src/scss/theme/bootstrap/_buttons.scss +0 -186
  158. package/src/scss/theme/bootstrap/_card.scss +0 -234
  159. package/src/scss/theme/bootstrap/_carousel.scss +0 -229
  160. package/src/scss/theme/bootstrap/_close.scss +0 -40
  161. package/src/scss/theme/bootstrap/_containers.scss +0 -41
  162. package/src/scss/theme/bootstrap/_dropdown.scss +0 -248
  163. package/src/scss/theme/bootstrap/_forms.scss +0 -9
  164. package/src/scss/theme/bootstrap/_functions.scss +0 -302
  165. package/src/scss/theme/bootstrap/_grid.scss +0 -33
  166. package/src/scss/theme/bootstrap/_helpers.scss +0 -10
  167. package/src/scss/theme/bootstrap/_images.scss +0 -42
  168. package/src/scss/theme/bootstrap/_list-group.scss +0 -191
  169. package/src/scss/theme/bootstrap/_maps.scss +0 -54
  170. package/src/scss/theme/bootstrap/_mixins.scss +0 -43
  171. package/src/scss/theme/bootstrap/_modal.scss +0 -237
  172. package/src/scss/theme/bootstrap/_nav.scss +0 -172
  173. package/src/scss/theme/bootstrap/_navbar.scss +0 -276
  174. package/src/scss/theme/bootstrap/_offcanvas.scss +0 -143
  175. package/src/scss/theme/bootstrap/_pagination.scss +0 -109
  176. package/src/scss/theme/bootstrap/_placeholders.scss +0 -51
  177. package/src/scss/theme/bootstrap/_popover.scss +0 -196
  178. package/src/scss/theme/bootstrap/_progress.scss +0 -59
  179. package/src/scss/theme/bootstrap/_reboot.scss +0 -610
  180. package/src/scss/theme/bootstrap/_root.scss +0 -73
  181. package/src/scss/theme/bootstrap/_spinners.scss +0 -85
  182. package/src/scss/theme/bootstrap/_tables.scss +0 -164
  183. package/src/scss/theme/bootstrap/_toasts.scss +0 -70
  184. package/src/scss/theme/bootstrap/_tooltip.scss +0 -120
  185. package/src/scss/theme/bootstrap/_transitions.scss +0 -27
  186. package/src/scss/theme/bootstrap/_type.scss +0 -106
  187. package/src/scss/theme/bootstrap/_utilities.scss +0 -647
  188. package/src/scss/theme/bootstrap/_variables.scss +0 -1633
  189. package/src/scss/theme/bootstrap/forms/_floating-labels.scss +0 -74
  190. package/src/scss/theme/bootstrap/forms/_form-check.scss +0 -175
  191. package/src/scss/theme/bootstrap/forms/_form-control.scss +0 -194
  192. package/src/scss/theme/bootstrap/forms/_form-range.scss +0 -91
  193. package/src/scss/theme/bootstrap/forms/_form-select.scss +0 -71
  194. package/src/scss/theme/bootstrap/forms/_form-text.scss +0 -11
  195. package/src/scss/theme/bootstrap/forms/_input-group.scss +0 -129
  196. package/src/scss/theme/bootstrap/forms/_labels.scss +0 -36
  197. package/src/scss/theme/bootstrap/forms/_validation.scss +0 -12
  198. package/src/scss/theme/bootstrap/helpers/_clearfix.scss +0 -3
  199. package/src/scss/theme/bootstrap/helpers/_color-bg.scss +0 -10
  200. package/src/scss/theme/bootstrap/helpers/_colored-links.scss +0 -12
  201. package/src/scss/theme/bootstrap/helpers/_position.scss +0 -36
  202. package/src/scss/theme/bootstrap/helpers/_ratio.scss +0 -26
  203. package/src/scss/theme/bootstrap/helpers/_stacks.scss +0 -15
  204. package/src/scss/theme/bootstrap/helpers/_stretched-link.scss +0 -15
  205. package/src/scss/theme/bootstrap/helpers/_text-truncation.scss +0 -7
  206. package/src/scss/theme/bootstrap/helpers/_visually-hidden.scss +0 -8
  207. package/src/scss/theme/bootstrap/helpers/_vr.scss +0 -8
  208. package/src/scss/theme/bootstrap/mixins/_alert.scss +0 -15
  209. package/src/scss/theme/bootstrap/mixins/_backdrop.scss +0 -14
  210. package/src/scss/theme/bootstrap/mixins/_banner.scss +0 -9
  211. package/src/scss/theme/bootstrap/mixins/_border-radius.scss +0 -78
  212. package/src/scss/theme/bootstrap/mixins/_box-shadow.scss +0 -18
  213. package/src/scss/theme/bootstrap/mixins/_buttons.scss +0 -70
  214. package/src/scss/theme/bootstrap/mixins/_caret.scss +0 -64
  215. package/src/scss/theme/bootstrap/mixins/_clearfix.scss +0 -9
  216. package/src/scss/theme/bootstrap/mixins/_color-scheme.scss +0 -7
  217. package/src/scss/theme/bootstrap/mixins/_container.scss +0 -11
  218. package/src/scss/theme/bootstrap/mixins/_deprecate.scss +0 -10
  219. package/src/scss/theme/bootstrap/mixins/_forms.scss +0 -152
  220. package/src/scss/theme/bootstrap/mixins/_gradients.scss +0 -47
  221. package/src/scss/theme/bootstrap/mixins/_grid.scss +0 -151
  222. package/src/scss/theme/bootstrap/mixins/_image.scss +0 -16
  223. package/src/scss/theme/bootstrap/mixins/_list-group.scss +0 -24
  224. package/src/scss/theme/bootstrap/mixins/_lists.scss +0 -7
  225. package/src/scss/theme/bootstrap/mixins/_pagination.scss +0 -10
  226. package/src/scss/theme/bootstrap/mixins/_reset-text.scss +0 -17
  227. package/src/scss/theme/bootstrap/mixins/_resize.scss +0 -6
  228. package/src/scss/theme/bootstrap/mixins/_table-variants.scss +0 -24
  229. package/src/scss/theme/bootstrap/mixins/_text-truncate.scss +0 -8
  230. package/src/scss/theme/bootstrap/mixins/_transition.scss +0 -26
  231. package/src/scss/theme/bootstrap/mixins/_utilities.scss +0 -97
  232. package/src/scss/theme/bootstrap/mixins/_visually-hidden.scss +0 -29
  233. package/src/scss/theme/bootstrap/utilities/_api.scss +0 -47
  234. package/src/scss/theme/bootstrap/vendor/_rfs.scss +0 -354
  235. package/src/scss/theme/bs/_badge.scss +0 -20
  236. package/src/scss/theme/bs/_buttons.scss +0 -185
  237. package/src/scss/theme/bs/_dropdown.scss +0 -86
  238. package/src/scss/theme/bs/_forms.scss +0 -161
  239. package/src/scss/theme/bs/_list-group.scss +0 -73
  240. package/src/scss/theme/bs/_tables.scss +0 -46
  241. package/src/scss/theme/fonts/_index.scss +0 -2
  242. package/src/scss/theme/mixins/_palette.scss +0 -165
  243. package/src/scss/theme/mixins/_scrollbar.scss +0 -110
@@ -0,0 +1,169 @@
1
+ @use "base/vars";
2
+ @use "base/colors";
3
+ @use "base/text";
4
+
5
+ // An individual (list) item with support for icon/img, content and actions.
6
+ .wy-item {
7
+ position: relative;
8
+ display: flex;
9
+ align-items: center;
10
+ gap: .5rem;
11
+ padding: .25rem .75rem;
12
+ text-decoration: none;
13
+ min-height: 3rem;
14
+ // Adjust position of icon/avatar (makes padding/margin look ok for all combinations of item content)
15
+ > .wy-avatar, > .wy-icon, > .wy-icon-stack {
16
+ margin-left: -.25rem;
17
+ }
18
+ }
19
+
20
+ .wy-item-body {
21
+ width: 100%;
22
+ @include text.truncate;
23
+
24
+ > * {
25
+ @include text.truncate;
26
+ }
27
+ // adjust position of buttons/emoji
28
+ + .wy-dropdown, + .wy-button-icon, + .wy-item-actions {
29
+ margin-right: -.5rem;
30
+ }
31
+
32
+ + .wy-emoji {
33
+ margin-right: .125rem;
34
+ }
35
+
36
+ }
37
+
38
+ .wy-item-title {
39
+ color: colors.$on-background;
40
+ font-weight: vars.$headings-font-weight;
41
+ @include text.truncate;
42
+ }
43
+
44
+ .wy-item-text {
45
+ color: colors.$outline;
46
+ @include text.truncate;
47
+ font-size: vars.$font-size-sm;
48
+
49
+ .wy-emoji, .wy-icon {
50
+ width: 1.25rem;
51
+ height: 1.25rem;
52
+ vertical-align: -.3125rem;
53
+ }
54
+ }
55
+
56
+ // For items with more than one action, and items with top/bottom positioned actions
57
+ .wy-item-actions {
58
+ --wy-component-background-color: transparent;
59
+ display: flex;
60
+ align-items: center;
61
+ flex: 0 0 auto;
62
+ }
63
+
64
+ .wy-item-actions-top {
65
+ position: absolute;
66
+ top: .25rem;
67
+ right: .25rem;
68
+ margin:0 !important;
69
+ }
70
+
71
+ .wy-item-actions-bottom {
72
+ position: absolute;
73
+ bottom: .25rem;
74
+ right: .25rem;
75
+ margin: 0 !important;
76
+ }
77
+
78
+ .wy-item-body:has(+ .wy-item-actions-bottom) {
79
+ .wy-item-row:last-child {
80
+ // room for 2 icons
81
+ margin-right: 4.5rem;
82
+ }
83
+ }
84
+
85
+ .wy-item-body:has(+ .wy-item-actions-top) {
86
+ .wy-item-row:first-child {
87
+ // room for 1 icon
88
+ margin-right: 2rem;
89
+ }
90
+ }
91
+
92
+ .wy-item-row {
93
+ display: flex;
94
+ align-items: center;
95
+
96
+ &:first-child {
97
+ margin-bottom: .125rem;
98
+ }
99
+
100
+ .wy-item-title {
101
+ margin-right: auto;
102
+ }
103
+
104
+ .wy-item-text {
105
+ margin-right: auto;
106
+ }
107
+
108
+
109
+ .wy-meta {
110
+ margin: 0 .25rem;
111
+ white-space: nowrap;
112
+ }
113
+ }
114
+
115
+ // An actionable item with hover, disabled, and active states.
116
+ .wy-item-hover {
117
+ //--wy-component-background-color: #{colors.$surface-1};
118
+ //--wy-component-color: #{colors.$on-surface};
119
+ //background-color: var(--wy-component-background-color);
120
+ //color: var(--wy-component-color);
121
+
122
+ user-select: none;
123
+ cursor: pointer;
124
+
125
+ // Hover state
126
+ &:hover,
127
+ &:focus {
128
+ --wy-component-background-color: #{colors.$surface-2};
129
+ --wy-component-color: #{colors.$on-surface};
130
+ background-color: var(--wy-component-background-color);
131
+ color: var(--wy-component-color);
132
+ text-decoration: none;
133
+ }
134
+
135
+ &:active {
136
+ --wy-component-background-color: #{colors.$surface-variant};
137
+ --wy-component-color: #{colors.$on-surface-variant};
138
+ background-color: var(--wy-component-background-color);
139
+ color: var(--wy-component-color);
140
+ }
141
+
142
+ &.wy-disabled,
143
+ &:disabled {
144
+ //--wy-component-background-color: #{colors.$surface-1};
145
+ //background-color: var(--wy-component-background-color);
146
+ opacity: vars.$opacity-disabled;
147
+ pointer-events: none;
148
+ }
149
+ // Include both here for `<a>`s and `<button>`s
150
+ &.wy-active {
151
+ --wy-component-background-color: #{colors.$primary-container};
152
+ --wy-component-color: #{colors.$on-primary-container};
153
+ background-color: var(--wy-component-background-color);
154
+ color: var(--wy-component-color);
155
+ border-color: var(--wy-component-background-color);
156
+ }
157
+ }
158
+
159
+ // Item with room for larger icon and two rows of content
160
+ .wy-item-lg {
161
+ padding: .75rem;
162
+ min-height: 4.5rem;
163
+ gap: .75rem;
164
+
165
+ // adjust position of icon/avatar
166
+ > .wy-avatar, > .wy-icon, > .wy-icon-stack {
167
+ margin-left: 0;
168
+ }
169
+ }
@@ -0,0 +1,57 @@
1
+ @use "base/vars";
2
+ @use "base/colors";
3
+ @use "base/text";
4
+
5
+ // A list of items with rounded corners and spacing to visually group them together
6
+ .wy-list {
7
+ border-radius: vars.$border-radius-sm;
8
+ display: flex;
9
+ flex-direction: column;
10
+ gap: 1px;
11
+ min-width: 0;
12
+
13
+ .wy-item {
14
+
15
+ &:not(.wy-item-hover) {
16
+ --wy-component-background-color: #{colors.$background};
17
+ --wy-component-color: #{colors.$on-background};
18
+ background-color: var(--wy-component-background-color);
19
+ color: var(--wy-component-color);
20
+ }
21
+
22
+ &:first-child {
23
+ border-top-left-radius: inherit;
24
+ border-top-right-radius: inherit;
25
+ }
26
+
27
+ &:last-child {
28
+ border-bottom-left-radius: inherit;
29
+ border-bottom-right-radius: inherit;
30
+ }
31
+ }
32
+ }
33
+
34
+ // A list of items with rounded corners and borders to visually group them together
35
+ .wy-list-bordered {
36
+ border: 1px solid #{colors.$outline-variant};
37
+ gap:0;
38
+
39
+ .wy-item {
40
+ border-top: 1px solid #{colors.$outline-variant};
41
+ border-left: none;
42
+ border-right: none;
43
+
44
+ &:first-child {
45
+ border-top: none;
46
+ }
47
+
48
+ &:last-child {
49
+ border-bottom: none;
50
+ }
51
+
52
+ & + & {
53
+ // No top-border on following items
54
+ border-top-width: 0;
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,11 @@
1
+ @use "base/colors";
2
+ @use "base/vars";
3
+
4
+ .wy-meeting {
5
+ flex: 1 1 100%;
6
+ align-items: flex-start;
7
+ }
8
+
9
+ .wy-meeting-actions {
10
+ margin-top: .5rem;
11
+ }
@@ -0,0 +1,95 @@
1
+ @use "base/vars";
2
+ @use "base/colors";
3
+ @use "base/scroll";
4
+ @use "base/svg";
5
+ @use "message-editor";
6
+
7
+ .wy-message-editor {
8
+ .ͼ1 .cm-scroller {
9
+ font-family: unset;
10
+ line-height: 1.5;
11
+ }
12
+
13
+ .ͼ1 .cm-widgetBuffer {
14
+ vertical-align: unset;
15
+ }
16
+
17
+ .ͼ1 .cm-placeholder {
18
+ color: #{colors.$outline};
19
+ }
20
+
21
+ .ͼ1.cm-editor {
22
+ @extend %message-editor-textfield;
23
+
24
+ &.cm-focused {
25
+ /* default theme in codemirror seems difficult to override */
26
+ --wy-component-color: #{colors.$on-background};
27
+ color: var(--wy-component-color);
28
+ border-color: #{colors.$outline-variant};
29
+ outline: 0;
30
+ }
31
+
32
+ .cm-content {
33
+ @extend %message-editor-textcontent;
34
+ }
35
+
36
+ .cm-scroller {
37
+ overflow: auto;
38
+
39
+ .wy-scrollbars & {
40
+ @include scroll.custom-scrollbar;
41
+ // scrollbar offsets
42
+ @include scroll.scrollbar-top-padding(0.375rem);
43
+ @include scroll.scrollbar-bottom-padding(0.375rem);
44
+ }
45
+ }
46
+ }
47
+
48
+ .wy-is-invalid + [data-editor-target] .cm-editor {
49
+ border-color: colors.$error !important;
50
+ }
51
+ // autocomplete dropdown menu
52
+ .ͼ1 {
53
+ .cm-tooltip.cm-tooltip-autocomplete > ul {
54
+ font-family: unset;
55
+ max-height: 15rem; // room for 5 items
56
+
57
+ > li {
58
+ padding: 0;
59
+ }
60
+ }
61
+ }
62
+
63
+ .ͼ2 {
64
+ .cm-tooltip {
65
+ border: none;
66
+ background-clip: padding-box;
67
+ background-color: #{colors.$surface-2};
68
+ color: #{colors.$on-surface};
69
+ border-radius: vars.$border-radius;
70
+ box-shadow: vars.$shadow-level1;
71
+ overflow: hidden;
72
+ z-index: vars.$zindex-dropdown;
73
+ }
74
+
75
+ .cm-tooltip-autocomplete ul li[aria-selected] {
76
+ background: #{colors.$primary-container};
77
+ color: unset;
78
+ }
79
+ }
80
+
81
+ .cm-tooltip-autocomplete {
82
+ .cm-completionLabel {
83
+ display: none;
84
+ }
85
+
86
+ .wy-item-hover:hover, .wy-item-hover:focus {
87
+ background: #{colors.$surface-variant};
88
+ }
89
+
90
+ .wy-avatar {
91
+ width: 32px;
92
+ height: 32px;
93
+ }
94
+ }
95
+ }
@@ -1,12 +1,43 @@
1
- @use "config" as *;
2
- @use "mixins/backdrop";
3
- @use "mixins/position";
1
+ @use "base/vars";
2
+ @use "base/colors";
3
+ @use "base/backdrop";
4
+ @use "base/position";
5
+
4
6
 
5
7
  .wy-message-editor {
8
+ //background-color: colors.$surface-1;
9
+ }
10
+
11
+ .wy-message-editor-top {
12
+ @include position.sticky-top;
13
+
14
+ background-color: var(--wy-component-background-color);
15
+ color: var(--wy-component-color);
16
+ }
17
+
18
+ .wy-message-editor-bottom {
6
19
  @include position.sticky-bottom;
7
- @include backdrop.filter;
8
20
 
9
- background-color: rgba($light, $opacity-backdrop);
21
+ background-color: var(--wy-component-background-color);
22
+ color: var(--wy-component-color);
23
+ }
24
+
25
+ .wy-message-editor-dragging {
26
+ &::after {
27
+ content: "Drop files here to upload.";
28
+ background-color: rgba(255, 255, 255, .5);
29
+ display: flex;
30
+ justify-content: center;
31
+ align-items: center;
32
+ border: 2px dashed colors.$primary;
33
+ font-weight: vars.$font-weight-bold;
34
+ z-index: 10000;
35
+ position: absolute;
36
+ top: 0;
37
+ left: 0;
38
+ bottom: 0;
39
+ right: 0;
40
+ }
10
41
  }
11
42
 
12
43
  .wy-message-form {
@@ -25,7 +56,7 @@
25
56
  }
26
57
 
27
58
  .wy-picker-list:not(:empty) {
28
- border-top: $border-width solid $border-color;
59
+ border-top: 1px solid #{colors.$outline-variant};
29
60
  }
30
61
  }
31
62
 
@@ -33,12 +64,12 @@
33
64
  display: flex;
34
65
  flex-direction: row;
35
66
  align-items: flex-end;
36
- border-top: $border-width solid rgba($gray-200, $opacity-backdrop);
37
- padding: .5rem;
38
- min-height: 3rem;
67
+ //border-top: 1px solid #{colors.$outline-variant};
68
+ padding: .5rem .25rem;
69
+ min-height: 3.5rem;
39
70
 
40
71
  > :not(:last-child) {
41
- margin-right: .5rem;
72
+ margin-right: .25rem;
42
73
  }
43
74
  }
44
75
 
@@ -51,25 +82,40 @@
51
82
  display: flex;
52
83
  flex-direction: column;
53
84
  }
85
+
86
+ .wy-message-editor-mention {
87
+ background: blue;
88
+ color: white;
89
+ }
90
+
91
+ .wy-message-editor-link {
92
+ background: blue;
93
+ color: white;
94
+ }
95
+
54
96
  %message-editor-textfield,
55
97
  .wy-message-editor-textfield {
56
98
  flex: 1 1 100%;
57
- outline: $light solid 1px;
58
- max-height: 10.2rem;
59
- background-color: $input-bg;
60
- border-radius: $border-radius-xl;
61
- border: none;
99
+ max-height: 11.25rem;
100
+ background-color: colors.$background;
101
+ color: colors.$on-background;
102
+ border-radius: 1.25rem;
103
+ border: vars.$input-border-width solid #{colors.$background};
104
+
105
+ &:focus {
106
+ border-color: #{colors.$outline-variant};
107
+ }
62
108
  }
63
109
 
64
110
  %message-editor-textcontent,
65
111
  .wy-message-editor-textcontent {
66
- font-family: $font-family-base;
67
- font-size: $font-size-base;
68
- padding: $input-padding-y $input-padding-x;
112
+ font-family: vars.$font-family-base;
113
+ font-size: vars.$font-size-base;
114
+ padding: vars.$input-padding-y vars.$input-padding-x;
69
115
  }
70
116
 
71
117
  %message-editor-grow,
72
- .#{wy}-message-editor-grow {
118
+ .wy-message-editor-grow {
73
119
  display: grid;
74
120
 
75
121
  &::after, > textarea {
@@ -1,11 +1,10 @@
1
1
  @use "sass:color";
2
- @use "config" as *;
3
- @use "reactions";
2
+ @use "base/vars";
3
+ @use "base/colors";
4
4
 
5
5
  .wy-messages {
6
6
  padding: 1rem 1rem 0 .75rem;
7
7
  flex: 1 1 100%;
8
-
9
8
  }
10
9
 
11
10
  .wy-message-placeholder {
@@ -13,24 +12,25 @@
13
12
  }
14
13
 
15
14
  .wy-date-separator {
16
- font-size: $font-size-xs;
15
+ font-size: vars.$font-size-xs;
17
16
  pointer-events: none;
18
17
  margin: .5rem;
19
18
  text-align: center;
20
19
  position: sticky;
21
20
  top: 1.5rem;
22
- z-index: 2;
21
+ z-index: 10;
23
22
 
24
23
  time {
25
- background: $light;
24
+ background: colors.$surface-3;
25
+ color: colors.$on-surface;
26
26
  padding: .25rem .5rem;
27
- border-radius: $border-radius;
27
+ border-radius: vars.$border-radius-sm;
28
28
  display: inline-block;
29
29
  }
30
30
  }
31
31
 
32
32
  .wy-appbars + .wy-pane-body .wy-date-separator {
33
- top: $appbar-height + 1.5rem;
33
+ top: vars.$appbar-height + 1.5rem;
34
34
  }
35
35
 
36
36
 
@@ -42,70 +42,51 @@
42
42
 
43
43
  .wy-image-grid,
44
44
  .wy-attachments {
45
- border-radius: $border-radius-lg;
46
- }
47
-
48
- &:hover {
49
- .wy-message-buttons {
50
- opacity: 1;
51
- }
52
- }
53
-
54
- .wy-reaction-menu {
55
- right: 0;
45
+ border-radius: vars.$border-radius;
56
46
  }
57
47
  }
58
48
 
59
49
  .wy-message-meta {
60
- font-size: $font-size-xs;
50
+ font-size: vars.$font-size-xs;
61
51
  margin: 0 0 .25rem .25rem;
62
- color: $text-muted;
52
+ color: colors.$on-surface-variant;
63
53
  }
64
54
 
65
55
  .wy-message-bubble {
66
- background-color: $gray-50;
67
- border-radius: $border-radius-xl;
56
+ --wy-component-background-color: #{colors.$surface-variant};
57
+ --wy-component-color: #{colors.$on-surface-variant};
58
+ //--wy-component-border-radius: #{vars.$border-radius};
59
+
60
+ background-color: var(--wy-component-background-color);
61
+ color: var(--wy-component-color);
62
+ //border-radius: var(--wy-component-border-radius);
63
+
64
+ border-radius: calc(vars.$border-radius + .5rem);
68
65
  display: flex; //inline-block;
69
- flex-direction: row;
70
- flex-wrap: wrap;
66
+ flex-direction: column;
71
67
  padding: .75rem;
68
+ gap: .75rem;
72
69
  max-width: min(32rem, calc(100% - 2rem));
73
- min-width: 10rem;
74
70
 
75
71
  > div {
76
72
  // message section (images, attachments, embeds etc.)
77
- margin-bottom: .5rem;
78
73
  flex: 1 1 100%;
79
-
80
- &:last-of-type {
81
- margin-bottom: 0;
82
- }
83
- }
84
- }
85
-
86
- .wy-message-text {
87
- overflow-wrap: break-word;
88
- min-width: 0;
89
-
90
- // inline code
91
- :not(pre) > code {
92
- overflow-wrap: inherit;
93
74
  }
94
75
 
95
- // code block
96
- pre, pre > code {
97
- white-space: pre-wrap;
98
- }
99
-
100
- :last-child {
101
- margin-bottom: 0;
102
- }
76
+ .wy-reactions-line {
77
+ position: relative;
78
+ height: 0;
79
+ min-height: 0;
80
+ max-height: 0;
103
81
 
104
- &:empty {
105
- display: none;
82
+ margin: 0 -.75rem -.75rem;
83
+ flex: 0 0 0;
84
+ flex-direction: row-reverse;
85
+ justify-content: flex-end;
106
86
  }
107
87
  }
108
88
 
89
+
109
90
  .wy-message-author {
110
91
  margin: 1.375rem .5rem 0 0;
111
92
  }
@@ -118,16 +99,6 @@
118
99
  flex-wrap: wrap;
119
100
  min-width: 0;
120
101
  position: relative; // so that we can position reactions
121
-
122
- .wy-reactions {
123
- position: absolute;
124
- bottom: -.75rem;
125
- left: .75rem;
126
- background: $gray-50;
127
- border-radius: 1.5rem;
128
- border: $border-width solid $gray-50;
129
- padding: .125rem;
130
- }
131
102
  }
132
103
 
133
104
  .wy-message-content-row {
@@ -137,14 +108,6 @@
137
108
  max-width: 100%;
138
109
  }
139
110
 
140
- .wy-message-buttons {
141
- display: flex;
142
- flex-direction: row;
143
- column-gap: .25rem;
144
- margin: .25rem;
145
- opacity: 0;
146
- }
147
-
148
111
  // override some styles for message by current user
149
112
  .wy-message-me {
150
113
  margin-right: 0;
@@ -163,24 +126,21 @@
163
126
  flex-direction: row-reverse;
164
127
  }
165
128
 
166
- .wy-message-buttons {
167
- flex-direction: row-reverse;
168
- }
169
-
170
129
  .wy-message-bubble {
171
- background-color: $primary-50;
172
- }
130
+ --wy-component-background-color: #{colors.$primary-container};
131
+ --wy-component-color: #{colors.$on-primary-container};
132
+ //--wy-component-border-radius: #{vars.$border-radius};
173
133
 
174
- .wy-reaction-menu {
175
- justify-content: flex-start;
176
- right: auto;
134
+ background-color: var(--wy-component-background-color);
135
+ color: var(--wy-component-color);
136
+ //border-radius: var(--wy-component-border-radius);
177
137
  }
178
138
 
179
- .wy-reactions {
180
- background: $primary-50;
181
- border-color: $primary-50;
182
- left: auto;
183
- right: .75rem;
139
+ .wy-reactions-line {
140
+ flex-direction: row;
141
+ .wy-dropdown-menu {
142
+ right: 0;
143
+ }
184
144
  }
185
145
  }
186
146
 
@@ -188,16 +148,22 @@
188
148
  .wy-message-emoji {
189
149
  .wy-message-bubble {
190
150
  background: none;
191
- padding: 0;
151
+ padding: 0 0 .75rem;
192
152
  }
193
153
 
194
- .wy-message-text {
154
+ .wy-content {
195
155
  .wy-emoji {
196
156
  width: 3rem;
197
157
  height: 3rem;
198
158
  margin: 0;
199
159
  }
200
160
  }
161
+
162
+ &.wy-message-me {
163
+ .wy-content {
164
+ text-align: end;
165
+ }
166
+ }
201
167
  }
202
168
 
203
169
  // message status indicator (sending, sent, delivered, read)
@@ -212,26 +178,6 @@
212
178
  }
213
179
  }
214
180
 
215
- .wy-message-toaster {
216
- position: sticky;
217
- top: 3.5rem;
218
- bottom: 3.5rem;
219
- cursor: pointer;
220
- z-index: 3;
221
- border-radius: 50rem;
222
- background-color: $primary;
223
- color: $white;
224
- padding: .5rem 1rem;
225
- margin-left: auto;
226
- margin-right: auto;
227
- margin-bottom: .5rem;
228
- font-size: $font-size-sm;
229
- width: max-content;
230
- align-self: center;
231
- text-align: center;
232
- color: $white;
233
- }
234
-
235
181
  .wy-message-readmore {
236
182
  justify-self: center;
237
183
  text-align: center;