@weavy/uikit-react 12.1.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 (280) hide show
  1. package/changelog.md +60 -0
  2. package/dist/cjs/index.js +28 -6
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/types/client/WeavyClient.d.ts +8 -1
  5. package/dist/cjs/types/components/Attachment.d.ts +2 -1
  6. package/dist/cjs/types/components/Chat.d.ts +1 -1
  7. package/dist/cjs/types/components/Messages.d.ts +3 -1
  8. package/dist/cjs/types/components/PdfViewer.d.ts +3 -1
  9. package/dist/cjs/types/components/Preview.d.ts +8 -10
  10. package/dist/cjs/types/contexts/PreviewContext.d.ts +2 -1
  11. package/dist/cjs/types/contexts/WeavyContext.d.ts +2 -3
  12. package/dist/cjs/types/hooks/useConversations.d.ts +1 -1
  13. package/dist/cjs/types/hooks/useMutateMessage.d.ts +1 -1
  14. package/dist/cjs/types/hooks/useMutateRead.d.ts +1 -0
  15. package/dist/cjs/types/types/Chat.d.ts +2 -1
  16. package/dist/cjs/types/types/Message.d.ts +2 -0
  17. package/dist/cjs/types/types/types.d.ts +63 -9
  18. package/dist/cjs/types/ui/Spinner.d.ts +10 -0
  19. package/dist/cjs/types/utils/fileUtilities.d.ts +1 -4
  20. package/dist/css/weavy-chat.css +1803 -1041
  21. package/dist/css/weavy-messenger.css +2141 -1360
  22. package/dist/css/weavy.css +1943 -1162
  23. package/dist/esm/index.js +28 -6
  24. package/dist/esm/index.js.map +1 -1
  25. package/dist/esm/types/client/WeavyClient.d.ts +8 -1
  26. package/dist/esm/types/components/Attachment.d.ts +2 -1
  27. package/dist/esm/types/components/Chat.d.ts +1 -1
  28. package/dist/esm/types/components/Messages.d.ts +3 -1
  29. package/dist/esm/types/components/PdfViewer.d.ts +3 -1
  30. package/dist/esm/types/components/Preview.d.ts +8 -10
  31. package/dist/esm/types/contexts/PreviewContext.d.ts +2 -1
  32. package/dist/esm/types/contexts/WeavyContext.d.ts +2 -3
  33. package/dist/esm/types/hooks/useConversations.d.ts +1 -1
  34. package/dist/esm/types/hooks/useMutateMessage.d.ts +1 -1
  35. package/dist/esm/types/hooks/useMutateRead.d.ts +1 -0
  36. package/dist/esm/types/types/Chat.d.ts +2 -1
  37. package/dist/esm/types/types/Message.d.ts +2 -0
  38. package/dist/esm/types/types/types.d.ts +63 -9
  39. package/dist/esm/types/ui/Spinner.d.ts +10 -0
  40. package/dist/esm/types/utils/fileUtilities.d.ts +1 -4
  41. package/dist/index.d.ts +15 -7
  42. package/package.json +2 -2
  43. package/rollup.config.js +3 -1
  44. package/src/client/WeavyClient.ts +105 -29
  45. package/src/components/Attachment.tsx +8 -7
  46. package/src/components/Chat.tsx +8 -7
  47. package/src/components/Conversation.tsx +29 -23
  48. package/src/components/ConversationBadge.tsx +7 -5
  49. package/src/components/ConversationForm.tsx +1 -1
  50. package/src/components/ConversationList.tsx +59 -11
  51. package/src/components/ConversationListItem.tsx +71 -54
  52. package/src/components/FileBrowser.tsx +53 -50
  53. package/src/components/MeetingCard.tsx +35 -13
  54. package/src/components/Meetings.tsx +1 -1
  55. package/src/components/Message.tsx +41 -41
  56. package/src/components/Messages.tsx +62 -61
  57. package/src/components/Messenger.tsx +7 -2
  58. package/src/components/NewConversation.tsx +1 -1
  59. package/src/components/PdfViewer.tsx +93 -88
  60. package/src/components/Preview.tsx +115 -54
  61. package/src/components/Reactions.tsx +11 -5
  62. package/src/components/SearchUsers.tsx +21 -11
  63. package/src/components/SeenBy.tsx +13 -7
  64. package/src/components/Typing.tsx +11 -12
  65. package/src/contexts/PreviewContext.tsx +90 -16
  66. package/src/contexts/UserContext.tsx +1 -1
  67. package/src/contexts/WeavyContext.tsx +10 -7
  68. package/src/hooks/useBadge.ts +2 -6
  69. package/src/hooks/useChat.ts +3 -14
  70. package/src/hooks/useConversation.ts +1 -7
  71. package/src/hooks/useConversations.ts +15 -11
  72. package/src/hooks/useFileUploader.ts +6 -8
  73. package/src/hooks/useMembers.ts +1 -7
  74. package/src/hooks/useMessages.ts +1 -7
  75. package/src/hooks/useMutateChat.ts +6 -11
  76. package/src/hooks/useMutateConversation.ts +7 -10
  77. package/src/hooks/useMutateConversationName.ts +10 -12
  78. package/src/hooks/useMutateDeleteReaction.ts +3 -8
  79. package/src/hooks/useMutateExternalBlobs.ts +6 -11
  80. package/src/hooks/useMutateMeeting.ts +6 -11
  81. package/src/hooks/useMutateMembers.ts +8 -13
  82. package/src/hooks/useMutateMessage.ts +9 -18
  83. package/src/hooks/useMutatePinned.ts +3 -8
  84. package/src/hooks/useMutateReaction.ts +6 -12
  85. package/src/hooks/useMutateRead.ts +5 -12
  86. package/src/hooks/useMutateRemoveMembers.ts +7 -12
  87. package/src/hooks/useMutateTyping.ts +6 -11
  88. package/src/hooks/usePresence.ts +2 -3
  89. package/src/hooks/useReactions.ts +11 -12
  90. package/src/hooks/useSearchUsers.ts +1 -6
  91. package/src/hooks/useUser.ts +3 -14
  92. package/src/scss/theme/_alert.scss +61 -63
  93. package/src/scss/theme/_appbar.scss +105 -28
  94. package/src/scss/theme/_avatar.scss +23 -28
  95. package/src/scss/theme/_badge.scss +26 -18
  96. package/src/scss/theme/_buttons.scss +107 -52
  97. package/src/scss/theme/_card.scss +102 -4
  98. package/src/scss/theme/_checkbox.scss +16 -20
  99. package/src/scss/theme/_code-vscode-dark.scss +184 -0
  100. package/src/scss/theme/_code-vscode-light.scss +179 -0
  101. package/src/scss/theme/_code.scss +9 -114
  102. package/src/scss/theme/_comment-editor-cm.scss +97 -0
  103. package/src/scss/theme/_comment-editor.scss +129 -0
  104. package/src/scss/theme/_comments.scss +66 -0
  105. package/src/scss/theme/_content.scss +33 -5
  106. package/src/scss/theme/_conversations.scss +19 -78
  107. package/src/scss/theme/_dropdown.scss +102 -15
  108. package/src/scss/theme/_embed.scss +135 -0
  109. package/src/scss/theme/_facepile.scss +11 -0
  110. package/src/scss/theme/_filebrowser.scss +1 -1
  111. package/src/scss/theme/_files.scss +77 -48
  112. package/src/scss/theme/_grid.scss +8 -0
  113. package/src/scss/theme/_icons.scss +155 -19
  114. package/src/scss/theme/_image-grid.scss +7 -10
  115. package/src/scss/theme/_input.scss +160 -0
  116. package/src/scss/theme/_item.scss +169 -0
  117. package/src/scss/theme/_list.scss +57 -0
  118. package/src/scss/theme/_meeting.scss +11 -0
  119. package/src/scss/theme/_message-editor-cm.scss +95 -0
  120. package/src/scss/theme/_message-editor.scss +66 -20
  121. package/src/scss/theme/_messages.scss +51 -105
  122. package/src/scss/theme/_meta.scss +12 -0
  123. package/src/scss/theme/_overlays.scss +31 -76
  124. package/src/scss/theme/_pager.scss +5 -1
  125. package/src/scss/theme/_pane.scss +13 -2
  126. package/src/scss/theme/_panels.scss +34 -25
  127. package/src/scss/theme/_picker-list.scss +5 -3
  128. package/src/scss/theme/_placeholder.scss +19 -0
  129. package/src/scss/theme/_poll.scss +49 -0
  130. package/src/scss/theme/_post-editor-cm.scss +100 -0
  131. package/src/scss/theme/_post-editor.scss +127 -0
  132. package/src/scss/theme/_post.scss +83 -0
  133. package/src/scss/theme/_preview-code.scss +14 -0
  134. package/src/scss/theme/_preview-embed.scss +11 -5
  135. package/src/scss/theme/_preview-image.scss +8 -26
  136. package/src/scss/theme/_preview-media.scss +1 -0
  137. package/src/scss/theme/_preview-pdf.scss +10 -15
  138. package/src/scss/theme/_preview-text.scss +1 -1
  139. package/src/scss/theme/_preview.scss +59 -76
  140. package/src/scss/theme/_reactions.scss +48 -17
  141. package/src/scss/theme/_sheet.scss +59 -0
  142. package/src/scss/theme/_sidebar.scss +86 -0
  143. package/src/scss/theme/_spinner.scss +11 -7
  144. package/src/scss/theme/_tab.scss +72 -0
  145. package/src/scss/theme/_tables.scss +70 -23
  146. package/src/scss/theme/_toasts.scss +56 -26
  147. package/src/scss/theme/_type.scss +41 -0
  148. package/src/scss/theme/{mixins → base}/_backdrop.scss +0 -0
  149. package/src/scss/theme/{bootstrap/mixins → base}/_breakpoints.scss +9 -0
  150. package/src/scss/theme/base/_colors.scss +315 -0
  151. package/src/scss/theme/base/_md.scss +19 -0
  152. package/src/scss/theme/base/_palette.scss +130 -0
  153. package/src/scss/theme/{mixins → base}/_position.scss +5 -5
  154. package/src/scss/theme/base/_reboot.scss +51 -0
  155. package/src/scss/theme/base/_scroll.scss +180 -0
  156. package/src/scss/theme/base/_svg.scss +49 -0
  157. package/src/scss/theme/base/_text.scss +23 -0
  158. package/src/scss/theme/base/_vars.scss +203 -0
  159. package/src/scss/theme/{fonts → base/fonts}/_fontmapping-roboto.scss +0 -0
  160. package/src/scss/theme/{fonts → base/fonts}/_fontmapping-segoe-ui.scss +0 -0
  161. package/src/scss/theme/base/fonts/_index.scss +2 -0
  162. package/src/scss/weavy-chat.scss +11 -4
  163. package/src/scss/weavy-messenger.scss +38 -21
  164. package/src/types/Chat.ts +2 -1
  165. package/src/types/Message.ts +3 -1
  166. package/src/types/types.ts +72 -10
  167. package/src/ui/Icon.tsx +1 -1
  168. package/src/ui/Spinner.tsx +19 -0
  169. package/src/utils/fileUtilities.ts +11 -125
  170. package/src/utils/infiniteScroll.js +11 -2
  171. package/src/utils/postal-parent.js +398 -0
  172. package/src/utils/promise.js +187 -0
  173. package/src/utils/scrollbarDetection.js +68 -9
  174. package/src/utils/utils.js +547 -0
  175. package/src/scss/theme/_attachments.scss +0 -74
  176. package/src/scss/theme/_cm-editor.scss +0 -42
  177. package/src/scss/theme/_colors.scss +0 -520
  178. package/src/scss/theme/_config.scss +0 -6
  179. package/src/scss/theme/_inputs.scss +0 -28
  180. package/src/scss/theme/_nav.scss +0 -52
  181. package/src/scss/theme/_palette.scss +0 -165
  182. package/src/scss/theme/_preview-icon.scss +0 -41
  183. package/src/scss/theme/_reboot.scss +0 -41
  184. package/src/scss/theme/_root.scss +0 -2
  185. package/src/scss/theme/_scroll.scss +0 -55
  186. package/src/scss/theme/_search.scss +0 -68
  187. package/src/scss/theme/_turbo.scss +0 -17
  188. package/src/scss/theme/_variables.scss +0 -139
  189. package/src/scss/theme/bootstrap/_accordion.scss +0 -146
  190. package/src/scss/theme/bootstrap/_alert.scss +0 -71
  191. package/src/scss/theme/bootstrap/_badge.scss +0 -38
  192. package/src/scss/theme/bootstrap/_breadcrumb.scss +0 -40
  193. package/src/scss/theme/bootstrap/_button-group.scss +0 -142
  194. package/src/scss/theme/bootstrap/_buttons.scss +0 -186
  195. package/src/scss/theme/bootstrap/_card.scss +0 -234
  196. package/src/scss/theme/bootstrap/_carousel.scss +0 -229
  197. package/src/scss/theme/bootstrap/_close.scss +0 -40
  198. package/src/scss/theme/bootstrap/_containers.scss +0 -41
  199. package/src/scss/theme/bootstrap/_dropdown.scss +0 -248
  200. package/src/scss/theme/bootstrap/_forms.scss +0 -9
  201. package/src/scss/theme/bootstrap/_functions.scss +0 -302
  202. package/src/scss/theme/bootstrap/_grid.scss +0 -33
  203. package/src/scss/theme/bootstrap/_helpers.scss +0 -10
  204. package/src/scss/theme/bootstrap/_images.scss +0 -42
  205. package/src/scss/theme/bootstrap/_list-group.scss +0 -191
  206. package/src/scss/theme/bootstrap/_maps.scss +0 -54
  207. package/src/scss/theme/bootstrap/_mixins.scss +0 -43
  208. package/src/scss/theme/bootstrap/_modal.scss +0 -237
  209. package/src/scss/theme/bootstrap/_nav.scss +0 -172
  210. package/src/scss/theme/bootstrap/_navbar.scss +0 -276
  211. package/src/scss/theme/bootstrap/_offcanvas.scss +0 -143
  212. package/src/scss/theme/bootstrap/_pagination.scss +0 -109
  213. package/src/scss/theme/bootstrap/_placeholders.scss +0 -51
  214. package/src/scss/theme/bootstrap/_popover.scss +0 -196
  215. package/src/scss/theme/bootstrap/_progress.scss +0 -59
  216. package/src/scss/theme/bootstrap/_reboot.scss +0 -610
  217. package/src/scss/theme/bootstrap/_root.scss +0 -73
  218. package/src/scss/theme/bootstrap/_spinners.scss +0 -85
  219. package/src/scss/theme/bootstrap/_tables.scss +0 -164
  220. package/src/scss/theme/bootstrap/_toasts.scss +0 -70
  221. package/src/scss/theme/bootstrap/_tooltip.scss +0 -120
  222. package/src/scss/theme/bootstrap/_transitions.scss +0 -27
  223. package/src/scss/theme/bootstrap/_type.scss +0 -106
  224. package/src/scss/theme/bootstrap/_utilities.scss +0 -647
  225. package/src/scss/theme/bootstrap/_variables.scss +0 -1633
  226. package/src/scss/theme/bootstrap/forms/_floating-labels.scss +0 -74
  227. package/src/scss/theme/bootstrap/forms/_form-check.scss +0 -175
  228. package/src/scss/theme/bootstrap/forms/_form-control.scss +0 -194
  229. package/src/scss/theme/bootstrap/forms/_form-range.scss +0 -91
  230. package/src/scss/theme/bootstrap/forms/_form-select.scss +0 -71
  231. package/src/scss/theme/bootstrap/forms/_form-text.scss +0 -11
  232. package/src/scss/theme/bootstrap/forms/_input-group.scss +0 -129
  233. package/src/scss/theme/bootstrap/forms/_labels.scss +0 -36
  234. package/src/scss/theme/bootstrap/forms/_validation.scss +0 -12
  235. package/src/scss/theme/bootstrap/helpers/_clearfix.scss +0 -3
  236. package/src/scss/theme/bootstrap/helpers/_color-bg.scss +0 -10
  237. package/src/scss/theme/bootstrap/helpers/_colored-links.scss +0 -12
  238. package/src/scss/theme/bootstrap/helpers/_position.scss +0 -36
  239. package/src/scss/theme/bootstrap/helpers/_ratio.scss +0 -26
  240. package/src/scss/theme/bootstrap/helpers/_stacks.scss +0 -15
  241. package/src/scss/theme/bootstrap/helpers/_stretched-link.scss +0 -15
  242. package/src/scss/theme/bootstrap/helpers/_text-truncation.scss +0 -7
  243. package/src/scss/theme/bootstrap/helpers/_visually-hidden.scss +0 -8
  244. package/src/scss/theme/bootstrap/helpers/_vr.scss +0 -8
  245. package/src/scss/theme/bootstrap/mixins/_alert.scss +0 -15
  246. package/src/scss/theme/bootstrap/mixins/_backdrop.scss +0 -14
  247. package/src/scss/theme/bootstrap/mixins/_banner.scss +0 -9
  248. package/src/scss/theme/bootstrap/mixins/_border-radius.scss +0 -78
  249. package/src/scss/theme/bootstrap/mixins/_box-shadow.scss +0 -18
  250. package/src/scss/theme/bootstrap/mixins/_buttons.scss +0 -70
  251. package/src/scss/theme/bootstrap/mixins/_caret.scss +0 -64
  252. package/src/scss/theme/bootstrap/mixins/_clearfix.scss +0 -9
  253. package/src/scss/theme/bootstrap/mixins/_color-scheme.scss +0 -7
  254. package/src/scss/theme/bootstrap/mixins/_container.scss +0 -11
  255. package/src/scss/theme/bootstrap/mixins/_deprecate.scss +0 -10
  256. package/src/scss/theme/bootstrap/mixins/_forms.scss +0 -152
  257. package/src/scss/theme/bootstrap/mixins/_gradients.scss +0 -47
  258. package/src/scss/theme/bootstrap/mixins/_grid.scss +0 -151
  259. package/src/scss/theme/bootstrap/mixins/_image.scss +0 -16
  260. package/src/scss/theme/bootstrap/mixins/_list-group.scss +0 -24
  261. package/src/scss/theme/bootstrap/mixins/_lists.scss +0 -7
  262. package/src/scss/theme/bootstrap/mixins/_pagination.scss +0 -10
  263. package/src/scss/theme/bootstrap/mixins/_reset-text.scss +0 -17
  264. package/src/scss/theme/bootstrap/mixins/_resize.scss +0 -6
  265. package/src/scss/theme/bootstrap/mixins/_table-variants.scss +0 -24
  266. package/src/scss/theme/bootstrap/mixins/_text-truncate.scss +0 -8
  267. package/src/scss/theme/bootstrap/mixins/_transition.scss +0 -26
  268. package/src/scss/theme/bootstrap/mixins/_utilities.scss +0 -97
  269. package/src/scss/theme/bootstrap/mixins/_visually-hidden.scss +0 -29
  270. package/src/scss/theme/bootstrap/utilities/_api.scss +0 -47
  271. package/src/scss/theme/bootstrap/vendor/_rfs.scss +0 -354
  272. package/src/scss/theme/bs/_badge.scss +0 -20
  273. package/src/scss/theme/bs/_buttons.scss +0 -185
  274. package/src/scss/theme/bs/_dropdown.scss +0 -86
  275. package/src/scss/theme/bs/_forms.scss +0 -161
  276. package/src/scss/theme/bs/_list-group.scss +0 -73
  277. package/src/scss/theme/bs/_tables.scss +0 -46
  278. package/src/scss/theme/fonts/_index.scss +0 -2
  279. package/src/scss/theme/mixins/_palette.scss +0 -165
  280. package/src/scss/theme/mixins/_scrollbar.scss +0 -110
@@ -0,0 +1,100 @@
1
+ @use "base/vars";
2
+ @use "base/colors";
3
+ @use "base/scroll";
4
+ @use "base/svg";
5
+ @use "post-editor";
6
+
7
+
8
+ .wy-post-editor {
9
+ .ͼ1 .cm-scroller {
10
+ font-family: unset;
11
+ line-height: 1.5;
12
+ }
13
+
14
+ .ͼ1 .cm-widgetBuffer {
15
+ vertical-align: unset;
16
+ }
17
+
18
+ .ͼ1 .cm-placeholder {
19
+ color: #{colors.$outline};
20
+ }
21
+
22
+ .ͼ2 .cm-content {
23
+ caret-color: #{colors.$primary};
24
+ }
25
+
26
+ .ͼ1.cm-editor {
27
+ @extend %post-editor-textfield;
28
+
29
+ &.cm-focused {
30
+ /* default theme in codemirror seems difficult to override */
31
+ --wy-component-color: #{colors.$on-background};
32
+ color: var(--wy-component-color);
33
+ border-color: #{colors.$primary};
34
+ outline: 0;
35
+ }
36
+
37
+ .cm-content {
38
+ @extend %post-editor-textcontent;
39
+ }
40
+
41
+ .cm-scroller {
42
+ overflow: auto;
43
+
44
+ .wy-scrollbars & {
45
+ @include scroll.custom-scrollbar;
46
+ // scrollbar offsets
47
+ @include scroll.scrollbar-top-padding(0.375rem);
48
+ @include scroll.scrollbar-bottom-padding(0.375rem);
49
+ }
50
+ }
51
+ }
52
+
53
+ .wy-is-invalid + [data-editor-target] .cm-editor {
54
+ border-color: colors.$error !important;
55
+ }
56
+ // autocomplete dropdown menu
57
+ .ͼ1 {
58
+ .cm-tooltip.cm-tooltip-autocomplete > ul {
59
+ font-family: unset;
60
+ max-height: 15rem; // room for 5 items
61
+
62
+ > li {
63
+ padding: 0;
64
+ }
65
+ }
66
+ }
67
+
68
+ .ͼ2 {
69
+ .cm-tooltip {
70
+ border: none;
71
+ background-clip: padding-box;
72
+ background-color: #{colors.$surface-2};
73
+ color: #{colors.$on-surface};
74
+ border-radius: vars.$border-radius;
75
+ box-shadow: vars.$shadow-level1;
76
+ overflow: hidden;
77
+ z-index: vars.$zindex-dropdown;
78
+ }
79
+
80
+ .cm-tooltip-autocomplete ul li[aria-selected] {
81
+ background: #{colors.$primary-container};
82
+ color: unset;
83
+ }
84
+ }
85
+
86
+ .cm-tooltip-autocomplete {
87
+ .cm-completionLabel {
88
+ display: none;
89
+ }
90
+
91
+ .wy-item-hover:hover, .wy-item-hover:focus {
92
+ background: #{colors.$surface-variant};
93
+ }
94
+
95
+ .wy-avatar {
96
+ width: 32px;
97
+ height: 32px;
98
+ }
99
+ }
100
+ }
@@ -0,0 +1,127 @@
1
+ @use "base/vars";
2
+ @use "base/colors";
3
+ @use "base/backdrop";
4
+ @use "base/position";
5
+
6
+ .wy-post-editor {
7
+ padding: .75rem;
8
+
9
+ &.wy-uploading {
10
+ .wy-icon-active-stack {
11
+ > :first-child {
12
+ opacity: 0;
13
+ }
14
+
15
+ > :last-child {
16
+ opacity: 1;
17
+ }
18
+ }
19
+ }
20
+
21
+ .wy-picker-list:not(:empty) {
22
+ margin-top: .75rem;
23
+ border-top: 1px solid #{colors.$outline-variant};
24
+ }
25
+ }
26
+
27
+
28
+ .wy-post-editor-dragging {
29
+ &::after {
30
+ content: "Drop files here to upload.";
31
+ background-color: rgba(255, 255, 255, .5);
32
+ display: flex;
33
+ justify-content: center;
34
+ align-items: center;
35
+ border: 2px dashed colors.$primary;
36
+ font-weight: vars.$font-weight-bold;
37
+ z-index: 10000;
38
+ position: absolute;
39
+ top: 0;
40
+ left: 0;
41
+ bottom: 0;
42
+ right: 0;
43
+ }
44
+ }
45
+
46
+
47
+ .wy-post-editor-inputs {
48
+ display: flex;
49
+ flex-direction: row;
50
+ align-items: flex-end;
51
+ //border-top: 1px solid #{colors.$outline-variant};
52
+ //padding: .5rem .25rem;
53
+ min-height: 3.5rem;
54
+ flex-wrap: wrap;
55
+
56
+ > :not(:last-child) {
57
+ margin-right: .25rem;
58
+ }
59
+
60
+ > :last-child {
61
+ margin-left: auto;
62
+ }
63
+ }
64
+
65
+ .wy-post-editor-buttons {
66
+ flex: 1 0 auto;
67
+ }
68
+
69
+ .wy-post-editor-text {
70
+ flex: 1 1 100%;
71
+ display: flex;
72
+ flex-direction: column;
73
+ }
74
+
75
+ .wy-post-editor-mention {
76
+ background: blue;
77
+ color: white;
78
+ }
79
+
80
+ .wy-post-editor-link {
81
+ background: blue;
82
+ color: white;
83
+ }
84
+
85
+ %post-editor-textfield,
86
+ .wy-post-editor-textfield {
87
+ flex: 1 1 100%;
88
+ max-height: 11.25rem;
89
+ min-height: 4rem;
90
+ background-color: colors.$background;
91
+ color: colors.$on-background;
92
+ border-radius: vars.$border-radius;
93
+ border: vars.$input-border-width solid #{colors.$outline-variant};
94
+ caret-color: #{colors.$primary};
95
+
96
+ &:focus {
97
+ border-color: #{colors.$primary};
98
+ }
99
+ }
100
+
101
+ %post-editor-textcontent,
102
+ .wy-post-editor-textcontent {
103
+ font-family: vars.$font-family-base;
104
+ font-size: vars.$font-size-base;
105
+ padding: vars.$input-padding-y vars.$input-padding-x;
106
+ }
107
+
108
+ %post-editor-grow,
109
+ .wy-post-editor-grow {
110
+ display: grid;
111
+
112
+ &::after, > textarea {
113
+ @extend %post-editor-textfield;
114
+ grid-area: 1 / 1 / 2 / 2;
115
+ }
116
+
117
+ &::after {
118
+ content: attr(data-replicated-value) " ";
119
+ white-space: pre-wrap;
120
+ visibility: hidden;
121
+ }
122
+
123
+ > textarea {
124
+ resize: none;
125
+ overflow: hidden;
126
+ }
127
+ }
@@ -0,0 +1,83 @@
1
+ @use "base/colors";
2
+ @use "base/vars";
3
+
4
+ .wy-post {
5
+ --wy-component-background-color: #{colors.$surface-1};
6
+ --wy-component-color: #{colors.$on-surface};
7
+ background-color: var(--wy-component-background-color);
8
+ color: var(--wy-component-color);
9
+ // REVIEW: box-shadow instead of border?
10
+ //box-shadow: vars.$md-shadow-2dp;
11
+
12
+ //border-color: #{colors.$outline-variant};
13
+ //border-style: solid;
14
+ //border-width: 1px 0;
15
+ display: flex;
16
+ flex-direction: column;
17
+ position: relative;
18
+ margin: 1rem .75rem;
19
+
20
+ --wy-component-border-radius: #{vars.$border-radius};
21
+ border-radius: var(--wy-component-border-radius);
22
+
23
+ .wy-image-grid {
24
+ border-radius: 0;
25
+ margin-bottom: 1rem;
26
+ }
27
+
28
+ .wy-embed {
29
+ margin-bottom: 1rem;
30
+ }
31
+
32
+ .wy-comments {
33
+ margin: .5rem .75rem;
34
+ border-top: 1px solid #{colors.$outline-variant};
35
+ padding: .75rem 0 0;
36
+ }
37
+
38
+ }
39
+
40
+ .wy-post-body {
41
+ padding: 0 1rem;
42
+
43
+ &:empty {
44
+ display: none;
45
+ }
46
+
47
+ .wy-content {
48
+ margin-bottom: 1rem;
49
+ }
50
+
51
+ .wy-list {
52
+ margin-bottom: 1rem;
53
+ }
54
+
55
+ .wy-poll {
56
+ margin-bottom: 1rem;
57
+ }
58
+ }
59
+
60
+ .wy-post-footer {
61
+ display: flex;
62
+ align-items: center;
63
+ justify-content: space-between;
64
+ margin: 0 .5rem .5rem;
65
+ }
66
+
67
+ .wy-post-dragging {
68
+ &::after {
69
+ content: "Drop files here to upload.";
70
+ background-color: rgba(255, 255, 255, .5);
71
+ display: flex;
72
+ justify-content: center;
73
+ align-items: center;
74
+ border: 2px dashed colors.$primary;
75
+ font-weight: vars.$font-weight-bold;
76
+ z-index: 10000;
77
+ position: absolute;
78
+ top: 0;
79
+ left: 0;
80
+ bottom: 0;
81
+ right: 0;
82
+ }
83
+ }
@@ -0,0 +1,14 @@
1
+ @use "base/colors";
2
+
3
+ .wy-content-code {
4
+ /*--wy-component-background-color: #{colors.$surface-1};
5
+ --wy-component-color: #{colors.$on-surface};
6
+
7
+ background-color: var(--wy-component-background-color);
8
+ color: var(--wy-component-color);
9
+ */
10
+
11
+ align-self: flex-start;
12
+ width: 100%;
13
+ padding: 2rem 3.5rem;
14
+ }
@@ -1,23 +1,29 @@
1
- @use "variables" as *;
1
+ @use "base/colors";
2
2
 
3
3
  // Embedded iframes
4
4
 
5
- .wy-content-iframe, [data-controller~="embed"] {
5
+ .wy-content-iframe {
6
6
  border: 0;
7
7
  display: block;
8
8
  width: 100%;
9
9
  height: 100%;
10
+ top: 0;
11
+ left: 0;
10
12
  flex: 1 1 100%;
11
13
 
12
- &:not(.wy-loading):not([data-controller~="embed"]), &[data-controller~="embed"].wy-loaded {
13
- background: $white;
14
+ &.wy-loaded {
15
+ --wy-component-background-color: #{colors.$surface-1};
16
+ --wy-component-color: #{colors.$on-surface};
17
+
18
+ background-color: var(--wy-component-background-color);
19
+ color: var(--wy-component-color);
14
20
 
15
21
  ~ .wy-content-iframe-fallback, ~ .wy-spinner {
16
22
  display: none;
17
23
  }
18
24
  }
19
25
 
20
- &.wy-loading:not(.wy-loaded), &[data-controller~="embed"]:not(.wy-loaded) {
26
+ &.wy-loading:not(.wy-loaded) {
21
27
  position: absolute;
22
28
  visibility: hidden;
23
29
  z-index: -1;
@@ -1,4 +1,4 @@
1
- @use "variables" as *;
1
+ @use "base/vars";
2
2
 
3
3
  .wy-content-image {
4
4
  min-width: 0;
@@ -9,38 +9,20 @@
9
9
  margin: auto;
10
10
  max-height: 100%;
11
11
  max-width: 100%;
12
-
13
- &.wy-intrinsic-image {
12
+ /*&.wy-intrinsic-image {
14
13
  object-fit: scale-down;
15
- }
16
-
17
- &:not(.wy-intrinsic-image) {
18
- height: 100%;
19
- width: 100%;
20
- // Similar to object-fit: contain; but works for divs. Must subtract margins.
21
- --max-width: #{'min(calc((100vh - 3rem - 1px) * (var(--width) / var(--height))), calc(var(--width) * 1px), 100%)'};
22
- --max-height: #{'min(calc(100vw * (var(--height) / var(--width))), calc(var(--height) * 1px), 100%)'};
23
- /* // With sidebar
24
- body.controller-content & {
25
- --max-width: #{'min(calc((100vh - 6rem) * (var(--width) / var(--height))), calc(var(--width) * 1px), 100%)'};
26
- --max-height: #{'min(calc(100vw * (var(--height) / var(--width))), calc(var(--height) * 1px), 100%)'};
27
-
28
- @include bs.media-breakpoint-up(lg) {
29
- --max-width: #{'min(calc((100vh - 3rem) * (var(--width) / var(--height))), calc(var(--width) * 1px), 100%)'};
30
- --max-height: #{'min(calc((100vw - 20rem) * (var(--height) / var(--width))), calc(var(--height) * 1px), 100%)'};
31
- }
32
- } */
14
+ }*/
33
15
 
34
- max-width: var(--max-width);
35
- max-height: var(--max-height);
36
- transition: transform $md-animation-duration $md-animation-curve-default, transform-origin $md-animation-duration step-end;
16
+ /*&:not(.wy-intrinsic-image) {
17
+ transition: transform vars.$transition, transform-origin vars.$transition-duration step-end;
37
18
  //cursor: zoom-in;
38
- }
19
+ }*/
20
+ transition: transform vars.$transition, transform-origin vars.$transition-duration step-end;
39
21
 
40
22
 
41
23
  &.wy-zoom {
42
24
  cursor: zoom-out;
43
- transition: transform $md-animation-duration $md-animation-curve-default, transform-origin $md-animation-duration step-start;
25
+ transition: transform vars.$transition, transform-origin vars.$transition-duration step-start;
44
26
  }
45
27
 
46
28
  img {
@@ -4,6 +4,7 @@
4
4
  min-height: 0;
5
5
  max-width: 100%;
6
6
  max-height: 100%;
7
+ flex: 1 1 auto;
7
8
  }
8
9
  }
9
10
 
@@ -1,13 +1,8 @@
1
- @use "config" as *;
2
- @use "inputs";
3
- @use "mixins/backdrop";
4
- @use "mixins/scrollbar";
1
+ @use "base/vars";
2
+ @use "base/colors";
3
+ @use "base/scroll";
5
4
 
6
- $zindex-fixed: $zindex-fixed !default;
7
- $border-radius: $border-radius !default;
8
- $opacity-backdrop: $opacity-backdrop !default;
9
-
10
- :root {
5
+ :root, :host > * {
11
6
  --pdfViewer-padding-bottom: 0;
12
7
  --page-margin: 2rem auto;
13
8
  --page-border: none;
@@ -18,7 +13,7 @@ $opacity-backdrop: $opacity-backdrop !default;
18
13
 
19
14
  // How to test?
20
15
  @media screen and (forced-colors: active) {
21
- :root {
16
+ :root, :host > * {
22
17
  --pdfViewer-padding-bottom: 9px;
23
18
  --page-margin: 9px auto 0;
24
19
  --page-border: none;
@@ -51,11 +46,11 @@ $opacity-backdrop: $opacity-backdrop !default;
51
46
  bottom: 0;
52
47
  left: 0;
53
48
 
54
- @include scrollbar.scroll-y;
55
- @include scrollbar.scroll-x;
49
+ @include scroll.scroll-y;
50
+ @include scroll.scroll-x;
56
51
 
57
52
  .wy-scrollbars & {
58
- @include scrollbar.custom-scrollbar;
53
+ @include scroll.custom-scrollbar;
59
54
 
60
55
  @supports (overflow-y: overlay) {
61
56
  overflow-y: overlay;
@@ -732,8 +727,8 @@ $opacity-backdrop: $opacity-backdrop !default;
732
727
  border: var(--page-border);
733
728
  background-clip: content-box;
734
729
  //border-image: url(/images/pdf/shadow.png) 9 9 repeat;
735
- box-shadow: $box-shadow-sm;
736
- background-color: rgba(255, 255, 255, 1);
730
+ box-shadow: vars.$shadow-level2;
731
+ background-color: colors.$white;
737
732
  }
738
733
 
739
734
  .pdfViewer .dummyPage {
@@ -2,4 +2,4 @@
2
2
  .wy-content-text {
3
3
  word-break: break-word;
4
4
  white-space: pre-wrap;
5
- }
5
+ }
@@ -1,27 +1,58 @@
1
- @use "config" as *;
2
- @use "mixins/backdrop";
3
1
  @use "sass:math";
2
+ @use "base/vars";
3
+ @use "base/colors";
4
+ @use "base/backdrop";
5
+ @use "base/breakpoints";
6
+
7
+ .wy-main {
8
+ display: flex;
9
+ height: calc(100vh - vars.$appbar-height);
10
+
11
+ @include breakpoints.media-breakpoint-down(md) {
12
+ flex-direction: column;
13
+ }
14
+ }
4
15
 
5
16
  .wy-preview {
17
+ --wy-component-background-color: #{colors.$background};
18
+ --wy-component-color: #{colors.$on-background};
19
+ background-color: var(--wy-component-background-color);
20
+ color: var(--wy-component-color);
21
+
6
22
  display: flex;
23
+ flex-direction: column;
24
+
7
25
  align-items: center;
8
- justify-content: center;
9
- height: calc(100% - $appbar-height - $border-width);
26
+ justify-content: space-around;
10
27
  position: relative;
28
+ flex: 1 1 100%;
29
+
30
+ min-width: 16rem;
31
+ min-height: 16rem;
32
+ max-height: 100%;
33
+ max-width: 100%;
34
+ }
35
+
36
+ .wy-preview-area {
37
+ min-width: 0;
38
+ min-height: 0;
39
+ width: 100%;
40
+ height: 100%;
41
+ flex: 1 1 auto;
42
+ display: flex;
43
+ flex-direction: column;
11
44
  }
12
45
 
13
46
  .wy-nav-prev, .wy-nav-next {
14
- position: fixed;
47
+ --wy-component-background-color: #{colors.$surface-variant};
48
+ --wy-component-color: #{colors.$on-surface-variant};
49
+
50
+ background-color: var(--wy-component-background-color);
51
+
52
+ position: absolute;
15
53
  top: 50%;
16
- z-index: $zindex-dropdown;
17
-
18
- .wy-button-icon {
19
- background-color: $light;
20
-
21
- .wy-dark & {
22
- background-color: rgba($dark, $opacity-backdrop);
23
- }
24
- }
54
+ z-index: vars.$zindex-dropdown;
55
+ border-radius: 50%;
25
56
  }
26
57
 
27
58
  .wy-nav-prev {
@@ -30,76 +61,28 @@
30
61
 
31
62
  .wy-nav-next {
32
63
  right: .5rem;
33
- }
64
+ }
34
65
 
35
66
  .wy-document {
67
+ // always black on white
68
+ --wy-component-background-color: var(--wy-white);
69
+ --wy-component-color: var(--wy-on-background);
70
+ background-color: var(--wy-component-background-color);
71
+ color: var(--wy-component-color);
36
72
  align-self: flex-start;
37
- background-color: $body-bg;
38
- color: color-contrast($body-bg);
39
- padding: 2rem 3rem;
73
+ padding: 2rem 3.5rem;
40
74
  width: 100%;
41
75
  min-height: 100%;
76
+ flex: 1 0 auto;
42
77
  // approximate A4 dimensions (h/w = sqrt(2) = 1.4142...)
43
- @include media-breakpoint-up(md) {
78
+ // TODO: REMOVE BREAKPOINTS
79
+ @include breakpoints.media-breakpoint-up(md) {
44
80
  padding: 3rem 4rem;
45
- margin: 2rem 3.5rem;
46
- border-radius: $border-radius-sm;
47
- box-shadow: $box-shadow-sm;
81
+ margin: 2rem auto;
82
+ border-radius: .125rem;
83
+ box-shadow: vars.$shadow-level2;
48
84
  width: 120ch;
49
85
  min-height: 170ch;
50
- max-width: 100%;
51
- }
52
- }
53
-
54
- // floating toolbar (mainly for pdf preview, but can be also be used for other things)
55
- .wy-toolbar {
56
- position: fixed;
57
- z-index: $zindex-fixed;
58
- bottom: math.div($appbar-height, 2);
59
- left: 0;
60
- right: 0;
61
- height: $appbar-height;
62
- display: flex;
63
- justify-content: center;
64
-
65
- span {
66
- margin-left: .25rem;
67
- }
68
-
69
- .wy-input {
70
- text-align: center;
71
- border-color: transparent;
72
- }
73
- }
74
-
75
- .wy-tools {
76
- background-color: rgba($light, $opacity-backdrop);
77
- color: color-contrast($light);
78
- border-radius: $border-radius;
79
- display: flex;
80
- align-items: center;
81
-
82
- @include backdrop.filter;
83
-
84
- // dark theme
85
- .wy-dark &, &.wy-dark {
86
- background-color: rgba($dark, $opacity-backdrop);
87
- color: $navbar-dark-color;
88
-
89
- .wy-icon {
90
- color: $navbar-dark-color;
91
- }
92
-
93
- .wy-input {
94
- background-color: rgba(0, 0, 0, 0.5);
95
- color: $navbar-dark-color;
96
- }
86
+ max-width: calc(100% - 3.5rem);
97
87
  }
98
88
  }
99
-
100
-
101
- .wy-tool {
102
- display: flex;
103
- align-items: center;
104
- margin: 0 .5rem;
105
- }