@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
@@ -1,7 +1,9 @@
1
1
  // weavy reboot
2
- @use "theme/reboot";
2
+ @use "theme/base/reboot";
3
+ @use "theme/base/scroll";
4
+ @use "theme/base/vars";
5
+
3
6
  // weavy ui components
4
- @use "theme/attachments";
5
7
  @use "theme/avatar";
6
8
  @use "theme/buttons";
7
9
  @use "theme/code";
@@ -10,8 +12,12 @@
10
12
  @use "theme/emoji";
11
13
  @use "theme/icons";
12
14
  @use "theme/image-grid";
15
+ @use "theme/input";
16
+ @use "theme/item";
17
+ @use "theme/list";
13
18
  @use "theme/messages";
14
19
  @use "theme/message-editor";
20
+ @use "theme/meta";
15
21
  @use "theme/overlays";
16
22
  @use "theme/pager";
17
23
  @use "theme/pane";
@@ -21,12 +27,12 @@
21
27
  @use "theme/preview-code";
22
28
  @use "theme/preview-embed";
23
29
  @use "theme/preview-html";
24
- @use "theme/preview-icon";
25
30
  @use "theme/preview-image";
26
31
  @use "theme/preview-media";
27
32
  @use "theme/preview-pdf";
28
33
  @use "theme/preview-text";
29
34
  @use "theme/reactions";
30
- @use "theme/scroll";
31
35
  @use "theme/spinner";
36
+ @use "theme/type";
32
37
  @use "theme/typing";
38
+ @use "theme/meeting";
@@ -1,9 +1,10 @@
1
1
  // weavy reboot
2
- @use "theme/reboot";
2
+ @use "theme/base/reboot";
3
+ @use "theme/base/scroll";
4
+ @use "theme/base/colors";
3
5
 
4
6
  // weavy ui components
5
7
  @use "theme/appbar";
6
- @use "theme/attachments";
7
8
  @use "theme/avatar";
8
9
  @use "theme/badge";
9
10
  @use "theme/buttons";
@@ -15,9 +16,12 @@
15
16
  @use "theme/emoji";
16
17
  @use "theme/icons";
17
18
  @use "theme/image-grid";
18
- @use "theme/inputs";
19
+ @use "theme/input";
20
+ @use "theme/item";
21
+ @use "theme/list";
19
22
  @use "theme/messages";
20
23
  @use "theme/message-editor";
24
+ @use "theme/meta";
21
25
  @use "theme/overlays";
22
26
  @use "theme/pager";
23
27
  @use "theme/pane";
@@ -27,35 +31,47 @@
27
31
  @use "theme/preview-code";
28
32
  @use "theme/preview-embed";
29
33
  @use "theme/preview-html";
30
- @use "theme/preview-icon";
31
34
  @use "theme/preview-image";
32
35
  @use "theme/preview-media";
33
36
  @use "theme/preview-pdf";
34
37
  @use "theme/preview-text";
35
38
  @use "theme/reactions";
36
- @use "theme/search";
37
- @use "theme/scroll";
38
39
  @use "theme/spinner";
40
+ @use "theme/tables";
41
+ @use "theme/type";
39
42
  @use "theme/typing";
43
+ @use "theme/meeting";
40
44
 
41
45
  // layout
42
46
  .wy-messenger-provider {
43
- display: flex;
44
- min-height: 0;
45
- min-width: 0;
46
- flex: 1 1 0;
47
- }
47
+ display: flex;
48
+ min-height: 0;
49
+ min-width: 0;
50
+ flex: 1 1 0;
51
+ }
48
52
 
49
- .wy-messenger-sidebar {
50
- width: 300px;
51
- border-right: 1px solid #ccc;
52
- }
53
+ .wy-messenger-sidebar {
54
+ ---background-color: #{colors.$background};
55
+ ---color: #{colors.$on-background};
56
+
57
+ background-color: var(---background-color);
58
+ color: var(---color);
59
+
60
+ width: 300px;
61
+ border-right: 1px solid #{colors.$outline-variant};
62
+ }
53
63
 
54
- .wy-messenger-conversation{
55
- overflow-anchor: none;
56
- display: flex;
57
- flex-direction: column;
58
- flex: 1 1 0;
59
- }
64
+ .wy-messenger-conversation {
65
+ ---background-color: #{colors.$background};
66
+ ---color: #{colors.$on-background};
67
+
68
+ background-color: var(---background-color);
69
+ color: var(---color);
70
+
71
+ overflow-anchor: none;
72
+ display: flex;
73
+ flex-direction: column;
74
+ flex: 1 1 0;
75
+ }
60
76
 
61
77
 
package/src/types/Chat.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export interface ChatProps {
2
- uid: string
2
+ uid: string,
3
+ className?: string
3
4
  }
@@ -6,11 +6,13 @@ export interface MessageProps {
6
6
  avatar?: string,
7
7
  name: string,
8
8
  created_at: string,
9
+ created_by: string,
9
10
  attachments: AttachmentType[],
10
11
  meeting: MeetingCardType,
11
12
  parentId: number | null,
12
13
  reactions: ReactableType[],
13
14
  reactions_count?: number,
14
- seenBy: MemberType[]
15
+ seenBy: MemberType[],
16
+ chatRoom: boolean
15
17
  }
16
18
 
@@ -92,9 +92,16 @@ type MemberType = {
92
92
  name: string,
93
93
  display_name: string,
94
94
  avatar_url: string,
95
- delivered_at: string,
96
- read_at: string,
97
- presence: string
95
+ delivered_at?: string,
96
+ read_at?: string,
97
+ presence: string,
98
+ marked_id?: number,
99
+ marked_at?: string
100
+
101
+ }
102
+
103
+ type MemberTypingType = MemberType & {
104
+ time: number
98
105
  }
99
106
 
100
107
  type MessageType = {
@@ -105,6 +112,7 @@ type MessageType = {
105
112
  temp?: boolean,
106
113
  created_at: string,
107
114
  created_by: MemberType,
115
+ created_by_id: number,
108
116
  attachments: AttachmentType[],
109
117
  attachment_ids: number[],
110
118
  meeting: MeetingCardType,
@@ -114,10 +122,11 @@ type MessageType = {
114
122
 
115
123
  type UserType = {
116
124
  id: number,
125
+ uid: string,
126
+ name: string,
117
127
  username: string,
118
128
  email: string,
119
- name: string,
120
- title: string,
129
+ display_name: string,
121
130
  avatar_url: string,
122
131
  presence: string
123
132
  }
@@ -189,3 +198,45 @@ type BadgeType = {
189
198
  rooms: number,
190
199
  chat: number
191
200
  }
201
+
202
+ type EntityType = {
203
+ id: number,
204
+ type: string
205
+ }
206
+
207
+ type RealtimeMessage = {
208
+ action: string,
209
+ id: number,
210
+ actor: UserType,
211
+ message: MessageType
212
+ }
213
+
214
+ type RealtimeReaction = {
215
+ action: string,
216
+ id: number,
217
+ actor: UserType,
218
+ entity: EntityType,
219
+ reaction: string
220
+ }
221
+
222
+ type RealtimeApp = {
223
+ action: string,
224
+ id: number,
225
+ actor: UserType,
226
+ app: ConversationType
227
+ }
228
+
229
+ type RealtimeMember = {
230
+ action: string,
231
+ id: number,
232
+ actor: UserType,
233
+ app: ConversationType,
234
+ member: MemberType
235
+ }
236
+
237
+ type RealtimeTyping = {
238
+ action: string,
239
+ id: number,
240
+ actor: MemberTypingType,
241
+ conversation: ConversationType
242
+ }
package/src/ui/Icon.tsx CHANGED
@@ -103,7 +103,7 @@ const Icon = ({ name, color = "", size, ...props }: Props) => {
103
103
  let overlayPath = getIconOverlay(name);
104
104
 
105
105
  return (
106
- <span className={'wy-icon ' + color} style={{width: size && (size * 1.5 + "rem"), height: size && (size * 1.5 + "rem")}} { ...props }>
106
+ <span className={'wy-icon' + (color ? ' wy-icon-' + color : '')} style={{width: size && (size * 1.5 + "rem"), height: size && (size * 1.5 + "rem")}} { ...props }>
107
107
  {iconPath ? <MdiIcon.Icon color={color} path={iconPath} size={size} /> : name }
108
108
  {overlayPath && <MdiIcon.Icon color={color} path={overlayPath} className="wy-icon-overlay" size={(size || 1) / 2} /> }
109
109
  </span>
@@ -4,12 +4,13 @@ import classNames from 'classnames';
4
4
  type SpinnerProps = {
5
5
  size?: number,
6
6
  spin?: boolean,
7
+ overlay?: boolean
7
8
  }
8
9
 
9
- const SpinnerImpl = ({ spin = true, size = 24 }: SpinnerProps) => {
10
+ const SpinnerImpl = ({ spin = true, size = 24, overlay= false }: SpinnerProps) => {
10
11
 
11
12
  return (
12
- <svg className={classNames("wy-spinner", {"wy-spin" : spin })} width={size} height={size} viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle fill="none" cx="12" cy="12" r="11" stroke-linecap="butt" stroke-width="2" /></svg>
13
+ <svg className={classNames("wy-spinner", {"wy-spin" : spin, "wy-spinner-overlay" : overlay })} width={size} height={size} viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle fill="none" cx="12" cy="12" r="11" strokeLinecap="butt" strokeWidth="2" /></svg>
13
14
  )
14
15
  }
15
16
 
@@ -9,6 +9,12 @@
9
9
  console.log("creating regular scroller");
10
10
  var parent = getScrollParent(observeElement);
11
11
 
12
+ // Disable scroll anchoring https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-anchor/Guide_to_scroll_anchoring
13
+ parent.style.overflowAnchor = "none";
14
+
15
+ // Bug using scrollingElement in frames. See https://github.com/w3c/IntersectionObserver/issues/372
16
+ var intersectionParent = (parent === document.documentElement ? document : parent);
17
+
12
18
  whenNext ??= () => Promise.reject(new Error("No scroller handler function defined")); // default
13
19
 
14
20
  const nextObserver = new IntersectionObserver((entries, observer) => {
@@ -17,7 +23,7 @@
17
23
  whenNext();
18
24
  }
19
25
  });
20
- }, { root: parent, threshold: 0 });
26
+ }, { root: intersectionParent, threshold: 0, rootMargin: "500px" });
21
27
 
22
28
  nextObserver.observe(observeElement);
23
29
 
@@ -41,6 +47,9 @@ export function createReverseScroller(observeElement, whenNext) {
41
47
  // Disable scroll anchoring https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-anchor/Guide_to_scroll_anchoring
42
48
  parent.style.overflowAnchor = "none";
43
49
 
50
+ // Bug using scrollingElement in frames. See https://github.com/w3c/IntersectionObserver/issues/372
51
+ var intersectionParent = (parent === document.documentElement ? document : parent);
52
+
44
53
  whenNext ??= () => Promise.reject(new Error("No reverse scroller handler function defined")); // default
45
54
 
46
55
  const prevObserver = new IntersectionObserver((entries, observer) => {
@@ -97,7 +106,7 @@ export function createReverseScroller(observeElement, whenNext) {
97
106
  }
98
107
  }
99
108
  })
100
- }, { root: parent, threshold: 0, rootMargin: "500px 0px 0px 0px" });
109
+ }, { root: intersectionParent, threshold: 0, rootMargin: "500px" });
101
110
 
102
111
  prevObserver.observe(observeElement);
103
112