@penwin/discord-components-core 4.3.8 → 4.3.9-dev-32918495512.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 (207) hide show
  1. package/CHANGELOG.md +826 -826
  2. package/LICENSE.md +20 -0
  3. package/README.md +673 -673
  4. package/custom-elements.json +1803 -1708
  5. package/dist/bundle/index.mjs +1976 -1976
  6. package/dist/bundle/index.mjs.map +1 -1
  7. package/dist/bundle/styles/base.css +1 -2
  8. package/dist/components/_private/BaseDiscordSelectMenuOption.js +72 -72
  9. package/dist/components/_private/DiscordMediaAttachmentStyles.js +114 -114
  10. package/dist/components/_private/DiscordPlaybackControlStyles.js +153 -153
  11. package/dist/components/_private/DiscordVolumeControlStyles.js +158 -158
  12. package/dist/components/_private/DiscordWhiteSpace.js +4 -4
  13. package/dist/components/discord-action-row/DiscordActionRow.js +6 -6
  14. package/dist/components/discord-attachments/DiscordAttachments.js +18 -18
  15. package/dist/components/discord-audio-attachment/DiscordAudioAttachment.js +202 -202
  16. package/dist/components/discord-author-info/DiscordAuthorInfo.d.ts.map +1 -1
  17. package/dist/components/discord-author-info/DiscordAuthorInfo.js +156 -156
  18. package/dist/components/discord-author-info/DiscordAuthorInfo.js.map +1 -1
  19. package/dist/components/discord-bold/DiscordBold.js +4 -4
  20. package/dist/components/discord-button/DiscordButton.d.ts.map +1 -1
  21. package/dist/components/discord-button/DiscordButton.js +131 -128
  22. package/dist/components/discord-button/DiscordButton.js.map +1 -1
  23. package/dist/components/discord-channel-select-menu-option/DiscordChannelSelectMenuOption.js +131 -131
  24. package/dist/components/discord-code/DiscordCode.js +64 -64
  25. package/dist/components/discord-code-block/DiscordCodeBlock.js +2 -2
  26. package/dist/components/discord-command/DiscordCommand.js +109 -109
  27. package/dist/components/discord-components-column/DiscordComponentsColumn.js +18 -18
  28. package/dist/components/discord-container/DiscordContainer.js +47 -47
  29. package/dist/components/discord-custom-emoji/DiscordCustomEmoji.js +36 -36
  30. package/dist/components/discord-embed/DiscordEmbed.d.ts.map +1 -1
  31. package/dist/components/discord-embed/DiscordEmbed.js +285 -285
  32. package/dist/components/discord-embed/DiscordEmbed.js.map +1 -1
  33. package/dist/components/discord-embed-description/DiscordEmbedDescription.js +25 -25
  34. package/dist/components/discord-embed-field/DiscordEmbedField.js +40 -40
  35. package/dist/components/discord-embed-fields/DiscordEmbedFields.js +19 -19
  36. package/dist/components/discord-embed-footer/DiscordEmbedFooter.js +36 -36
  37. package/dist/components/discord-file-attachment/DiscordFileAttachment.js +191 -191
  38. package/dist/components/discord-forwarded-message/DiscordForwardedMessage.js +126 -126
  39. package/dist/components/discord-header/DiscordHeader.js +27 -27
  40. package/dist/components/discord-image-attachment/DiscordImageAttachment.js +38 -38
  41. package/dist/components/discord-input-text/DiscordInputText.js +284 -284
  42. package/dist/components/discord-invite/DiscordInvite.js +225 -225
  43. package/dist/components/discord-italic/DiscordItalic.js +4 -4
  44. package/dist/components/discord-link/DiscordLink.js +19 -19
  45. package/dist/components/discord-list-item/DiscordListItem.d.ts.map +1 -1
  46. package/dist/components/discord-list-item/DiscordListItem.js +8 -5
  47. package/dist/components/discord-list-item/DiscordListItem.js.map +1 -1
  48. package/dist/components/discord-media-fullscreen-previewer/DiscordMediaFullscreenPreviewer.js +463 -463
  49. package/dist/components/discord-media-gallery/DiscordMediaGallery.js +219 -219
  50. package/dist/components/discord-media-gallery-item/DiscordMediaGalleryItem.d.ts.map +1 -1
  51. package/dist/components/discord-media-gallery-item/DiscordMediaGalleryItem.js +102 -99
  52. package/dist/components/discord-media-gallery-item/DiscordMediaGalleryItem.js.map +1 -1
  53. package/dist/components/discord-media-spoileable-cover/DiscordMediaSpoileableCover.js +65 -65
  54. package/dist/components/discord-mention/DiscordMention.js +66 -66
  55. package/dist/components/discord-message/DiscordMessage.d.ts.map +1 -1
  56. package/dist/components/discord-message/DiscordMessage.js +338 -335
  57. package/dist/components/discord-message/DiscordMessage.js.map +1 -1
  58. package/dist/components/discord-messages/DiscordMessages.js +77 -77
  59. package/dist/components/discord-modal/DiscordModal.js +465 -465
  60. package/dist/components/discord-ordered-list/DiscordOrderedList.d.ts.map +1 -1
  61. package/dist/components/discord-ordered-list/DiscordOrderedList.js +20 -14
  62. package/dist/components/discord-ordered-list/DiscordOrderedList.js.map +1 -1
  63. package/dist/components/discord-poll/DiscordPoll.js +157 -157
  64. package/dist/components/discord-poll-answer/DiscordPollAnswer.js +227 -227
  65. package/dist/components/discord-pre/DiscordPre.js +18 -18
  66. package/dist/components/discord-quote/DiscordQuote.js +31 -31
  67. package/dist/components/discord-reaction/DiscordReaction.js +73 -73
  68. package/dist/components/discord-reactions/DiscordReactions.js +9 -9
  69. package/dist/components/discord-reply/DiscordReply.d.ts.map +1 -1
  70. package/dist/components/discord-reply/DiscordReply.js +246 -246
  71. package/dist/components/discord-reply/DiscordReply.js.map +1 -1
  72. package/dist/components/discord-role-select-menu-option/DiscordRoleSelectMenuOption.js +75 -75
  73. package/dist/components/discord-section/DiscordSection.js +6 -6
  74. package/dist/components/discord-section-components/DiscordSectionComponents.js +14 -14
  75. package/dist/components/discord-select-menu-portal/DiscordSelectMenuPortal.js +30 -30
  76. package/dist/components/discord-separator/DiscordSeparator.js +9 -9
  77. package/dist/components/discord-spoiler/DiscordSpoiler.js +31 -31
  78. package/dist/components/discord-string-select-menu/DiscordStringSelectMenu.js +192 -192
  79. package/dist/components/discord-string-select-menu-option/DiscordStringSelectMenuOption.js +45 -45
  80. package/dist/components/discord-subscript/DiscordSubscript.js +15 -15
  81. package/dist/components/discord-system-message/DiscordSystemMessage.d.ts.map +1 -1
  82. package/dist/components/discord-system-message/DiscordSystemMessage.js +134 -131
  83. package/dist/components/discord-system-message/DiscordSystemMessage.js.map +1 -1
  84. package/dist/components/discord-tenor-video/DiscordTenorVideo.js +76 -76
  85. package/dist/components/discord-text-display/DiscordTextDisplay.js +10 -10
  86. package/dist/components/discord-text-file-attachment-previewer/DiscordTextFileAttachmentPreviewer.js +55 -55
  87. package/dist/components/discord-thread/DiscordThread.js +81 -81
  88. package/dist/components/discord-thread-message/DiscordThreadMessage.js +90 -90
  89. package/dist/components/discord-thumbnail/DiscordThumbnail.js +20 -20
  90. package/dist/components/discord-time/DiscordTime.js +7 -7
  91. package/dist/components/discord-transcript-header/DiscordTranscriptHeader.js +51 -51
  92. package/dist/components/discord-unordered-list/DiscordUnorderedList.d.ts.map +1 -1
  93. package/dist/components/discord-unordered-list/DiscordUnorderedList.js +18 -15
  94. package/dist/components/discord-unordered-list/DiscordUnorderedList.js.map +1 -1
  95. package/dist/components/discord-user-select-menu-option/DiscordUserSelectMenuOption.js +58 -58
  96. package/dist/components/discord-verified-author-tag/DiscordVerifiedAuthorTag.js +36 -36
  97. package/dist/components/discord-video-attachment/DiscordVideoAttachment.js +494 -494
  98. package/dist/components/discord-voice-message/DiscordVoiceMessage.js +255 -255
  99. package/dist/components/svgs/AttachmentDownloadButton.js +67 -67
  100. package/dist/components/svgs/AttachmentReply.js +5 -5
  101. package/dist/components/svgs/Boost.js +3 -3
  102. package/dist/components/svgs/ChannelForum.js +19 -19
  103. package/dist/components/svgs/ChannelIcon.js +17 -17
  104. package/dist/components/svgs/ChannelThread.js +15 -15
  105. package/dist/components/svgs/ChannelsAndRoles.js +23 -23
  106. package/dist/components/svgs/CommandIcon.js +4 -4
  107. package/dist/components/svgs/CommandIconName.js +5 -5
  108. package/dist/components/svgs/CommandReply.js +9 -9
  109. package/dist/components/svgs/CustomizeCommunity.js +17 -17
  110. package/dist/components/svgs/DMCall.js +6 -6
  111. package/dist/components/svgs/DMEdit.js +8 -8
  112. package/dist/components/svgs/DMMissedCall.js +8 -8
  113. package/dist/components/svgs/Ephemeral.js +21 -21
  114. package/dist/components/svgs/ExpandMore.js +4 -4
  115. package/dist/components/svgs/FileAttachment.js +10 -10
  116. package/dist/components/svgs/GuildBadge.js +8 -8
  117. package/dist/components/svgs/LaunchIcon.js +9 -9
  118. package/dist/components/svgs/LockedVoiceChannel.js +17 -17
  119. package/dist/components/svgs/MediaPauseIcon.js +2 -2
  120. package/dist/components/svgs/MediaPlayIcon.js +2 -2
  121. package/dist/components/svgs/MediaRestartIcon.js +2 -2
  122. package/dist/components/svgs/MediaVolumeAbove50PercentIcon.js +3 -3
  123. package/dist/components/svgs/MediaVolumeBelow50PercentIcon.js +2 -2
  124. package/dist/components/svgs/MediaVolumeMutedIcon.js +2 -2
  125. package/dist/components/svgs/MessageIcon.js +3 -3
  126. package/dist/components/svgs/ModalClose.js +4 -4
  127. package/dist/components/svgs/ModalWarning.js +5 -5
  128. package/dist/components/svgs/PartnerBadgeOverlay.js +11 -11
  129. package/dist/components/svgs/Pin.js +5 -5
  130. package/dist/components/svgs/PremiumIcon.js +6 -6
  131. package/dist/components/svgs/ReplyIcon.js +5 -5
  132. package/dist/components/svgs/ServerGuide.js +17 -17
  133. package/dist/components/svgs/ServerUpgrade.js +7 -7
  134. package/dist/components/svgs/SystemAlert.js +7 -7
  135. package/dist/components/svgs/SystemError.js +6 -6
  136. package/dist/components/svgs/Thread.js +9 -9
  137. package/dist/components/svgs/UserJoin.js +5 -5
  138. package/dist/components/svgs/UserLeave.js +5 -5
  139. package/dist/components/svgs/VerifiedBadgeOverlay.js +4 -4
  140. package/dist/components/svgs/VerifiedTick.js +13 -13
  141. package/dist/components/svgs/VideoFullScreenIcon.js +8 -8
  142. package/dist/components/svgs/VideoPausePopIcon.js +2 -2
  143. package/dist/components/svgs/VideoPlayPopIcon.js +2 -2
  144. package/dist/components/svgs/VoiceChannel.js +19 -19
  145. package/dist/components/svgs/clan-icons/Crystal.js +27 -27
  146. package/dist/components/svgs/clan-icons/Diamond.js +35 -35
  147. package/dist/components/svgs/clan-icons/Explosion.js +30 -30
  148. package/dist/components/svgs/clan-icons/Flame.js +23 -23
  149. package/dist/components/svgs/clan-icons/Flower.js +18 -18
  150. package/dist/components/svgs/clan-icons/Heart.js +19 -19
  151. package/dist/components/svgs/clan-icons/Key.js +32 -32
  152. package/dist/components/svgs/clan-icons/Leaf.js +23 -23
  153. package/dist/components/svgs/clan-icons/Lightning.js +25 -25
  154. package/dist/components/svgs/clan-icons/Magic.js +34 -34
  155. package/dist/components/svgs/clan-icons/Moon.js +21 -21
  156. package/dist/components/svgs/clan-icons/Mushroom.js +33 -33
  157. package/dist/components/svgs/clan-icons/Mythical.js +32 -32
  158. package/dist/components/svgs/clan-icons/Ornament.js +48 -48
  159. package/dist/components/svgs/clan-icons/Plasma.js +23 -23
  160. package/dist/components/svgs/clan-icons/Rock.js +20 -20
  161. package/dist/components/svgs/clan-icons/Shell.js +29 -29
  162. package/dist/components/svgs/clan-icons/Skull.js +28 -28
  163. package/dist/components/svgs/clan-icons/Sun.js +36 -36
  164. package/dist/components/svgs/clan-icons/Sword.js +27 -27
  165. package/dist/components/svgs/clan-icons/Water.js +20 -20
  166. package/dist/config.d.ts +1 -1
  167. package/dist/config.d.ts.map +1 -1
  168. package/dist/config.js +9 -3
  169. package/dist/config.js.map +1 -1
  170. package/dist/hydrate/index.d.ts +40 -0
  171. package/dist/hydrate/index.d.ts.map +1 -0
  172. package/dist/hydrate/index.js +48 -0
  173. package/dist/hydrate/index.js.map +1 -0
  174. package/package.json +222 -219
  175. package/dist/bundle/styles/base.css.map +0 -1
  176. package/dist/components/discord-container copy/DiscordContainer.d.ts +0 -22
  177. package/dist/components/discord-container copy/DiscordContainer.d.ts.map +0 -1
  178. package/dist/components/discord-container copy/DiscordContainer.js +0 -159
  179. package/dist/components/discord-container copy/DiscordContainer.js.map +0 -1
  180. package/dist/components/discord-media-fullscreen-previewer/context.d.ts +0 -10
  181. package/dist/components/discord-media-fullscreen-previewer/context.d.ts.map +0 -1
  182. package/dist/components/discord-media-fullscreen-previewer/context.js +0 -3
  183. package/dist/components/discord-media-fullscreen-previewer/context.js.map +0 -1
  184. package/dist/components/discord-media-gallery-tem/DiscordMediaGalleryItem.d.ts +0 -26
  185. package/dist/components/discord-media-gallery-tem/DiscordMediaGalleryItem.d.ts.map +0 -1
  186. package/dist/components/discord-media-gallery-tem/DiscordMediaGalleryItem.js +0 -183
  187. package/dist/components/discord-media-gallery-tem/DiscordMediaGalleryItem.js.map +0 -1
  188. package/dist/components/discord-section/DiscordContainer.d.ts +0 -22
  189. package/dist/components/discord-section/DiscordContainer.d.ts.map +0 -1
  190. package/dist/components/discord-section/DiscordContainer.js +0 -159
  191. package/dist/components/discord-section/DiscordContainer.js.map +0 -1
  192. package/dist/components/discord-section copy/DiscordSection.d.ts +0 -15
  193. package/dist/components/discord-section copy/DiscordSection.d.ts.map +0 -1
  194. package/dist/components/discord-section copy/DiscordSection.js +0 -77
  195. package/dist/components/discord-section copy/DiscordSection.js.map +0 -1
  196. package/dist/components/discord-section-components/DiscordSection.d.ts +0 -15
  197. package/dist/components/discord-section-components/DiscordSection.d.ts.map +0 -1
  198. package/dist/components/discord-section-components/DiscordSection.js +0 -77
  199. package/dist/components/discord-section-components/DiscordSection.js.map +0 -1
  200. package/dist/components/discord-text-display/DiscordSection.d.ts +0 -15
  201. package/dist/components/discord-text-display/DiscordSection.d.ts.map +0 -1
  202. package/dist/components/discord-text-display/DiscordSection.js +0 -79
  203. package/dist/components/discord-text-display/DiscordSection.js.map +0 -1
  204. package/dist/components/discord-text-file-attachment-preview/DiscordTextFileAttachmentPreviewer.d.ts +0 -71
  205. package/dist/components/discord-text-file-attachment-preview/DiscordTextFileAttachmentPreviewer.d.ts.map +0 -1
  206. package/dist/components/discord-text-file-attachment-preview/DiscordTextFileAttachmentPreviewer.js +0 -238
  207. package/dist/components/discord-text-file-attachment-preview/DiscordTextFileAttachmentPreviewer.js.map +0 -1
@@ -8,7 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
10
  import { consume, createContext, provide } from '@lit/context';
11
- import { css, html, LitElement } from 'lit';
11
+ import { css, html, isServer, LitElement } from 'lit';
12
12
  import { customElement, property } from 'lit/decorators.js';
13
13
  import { classMap } from 'lit/directives/class-map.js';
14
14
  import { ifDefined } from 'lit/directives/if-defined.js';
@@ -116,270 +116,273 @@ let DiscordMessage = class DiscordMessage extends LitElement {
116
116
  /**
117
117
  * @internal
118
118
  */
119
- static { this.styles = css `
120
- :host {
121
- color: #dcddde;
122
- display: flex;
123
- flex-direction: column;
124
- font-size: 0.9em;
125
- font-family: 'gg sans', 'Noto Sans', Whitney, 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;
126
-
127
- position: relative;
128
- word-wrap: break-word;
129
- -webkit-user-select: text;
130
- -moz-user-select: text;
131
- -ms-user-select: text;
132
- user-select: text;
133
- -webkit-box-flex: 0;
134
- -ms-flex: 0 0 auto;
135
- flex: 0 0 auto;
136
- min-height: 1.375rem;
137
- padding-left: 1em;
138
- padding-right: 48px;
139
- margin-top: inherit;
140
- margin-bottom: inherit;
141
- line-height: 16px;
142
- }
143
-
144
- :host([is-in-forwarded-message]) {
145
- padding-left: 0;
146
- padding-right: 0;
147
- }
148
-
149
- .discord-message-inner {
150
- display: flex;
151
- position: relative;
152
- -webkit-box-flex: 0;
153
- -ms-flex: 0 0 auto;
154
- flex: 0 0 auto;
155
- }
156
-
157
- .discord-message-inner-center {
158
- align-items: center;
159
- }
160
-
161
- :host([message-body-only]) {
162
- margin-top: 0px !important;
163
- padding-top: 0.125rem !important;
164
- padding-bottom: 0.0625rem !important;
165
- }
166
-
167
- :host([highlight]),
168
- :host([ephemeral]) {
169
- padding-right: 5px;
170
- position: relative;
171
- }
172
-
173
- :host([highlight])::before,
174
- :host([ephemeral])::before {
175
- content: '';
176
- position: absolute;
177
- display: block;
178
- top: 0;
179
- left: 0;
180
- bottom: 0;
181
- pointer-events: none;
182
- width: 2px;
183
- }
184
-
185
- :host([highlight]) {
186
- background-color: rgba(250, 166, 26, 0.1);
187
- }
188
-
189
- :host([highlight][light-theme]) {
190
- background-color: rgba(250, 166, 26, 0.1);
191
- }
192
-
193
- :host([highlight])::before {
194
- background-color: #faa61a;
195
- }
196
-
197
- :host([light-theme][highlight])::before {
198
- background-color: #af7615;
199
- }
200
-
201
- :host([ephemeral]) {
202
- background-color: rgba(88, 101, 242, 0.05);
203
- }
204
-
205
- :host([ephemeral]:hover) {
206
- background-color: rgba(88, 101, 242, 0.1);
207
- }
208
-
209
- :host([ephemeral])::before {
210
- background-color: #5865f2;
211
- }
212
-
213
- :host([light-theme]) {
214
- color: #2e3338;
215
- border-color: #eceeef;
216
- --message-hover-background-color: color-mix(
217
- in oklab,
218
- hsl(240 calc(1 * 4%) 60.784% /0.12156862745098039) 100%,
219
- hsl(0 0% 0% /0.12156862745098039) 0%
220
- );
221
- }
222
-
223
- .discord-author-avatar {
224
- margin-right: 16px;
225
- margin-top: 5px;
226
- min-width: 40px;
227
- z-index: 1;
228
- display: flex;
229
- }
230
-
231
- .discord-author-avatar img {
232
- width: 40px;
233
- height: 40px;
234
- border-radius: 50%;
235
- cursor: pointer;
236
- }
237
-
238
- .discord-message-timestamp {
239
- color: #72767d;
240
- font-size: 12px;
241
- margin-left: 3px;
242
- }
243
-
244
- .discord-message-body-only-indent {
245
- width: 56px;
246
- }
247
-
248
- :host(:hover) .discord-message-timestamp-hover::before {
249
- content: attr(datetime);
250
- }
251
-
252
- :host([light-theme]) .discord-message-timestamp {
253
- color: #747f8d;
254
- }
255
-
256
- .discord-message-edited {
257
- color: #72767d;
258
- font-size: 10px;
259
- }
260
-
261
- :host([light-theme]) .discord-message-edited {
262
- color: #99aab5;
263
- }
264
-
265
- .discord-message-content {
266
- width: 100%;
267
- line-height: 160%;
268
- font-weight: normal;
269
- padding-top: 2px;
270
- }
271
-
272
- .discord-message-body {
273
- font-size: 1rem;
274
- font-weight: 400;
275
- word-break: break-word;
276
- position: relative;
277
- }
278
-
279
- :host([light-theme]) .discord-message-timestamp,
280
- :host([compact-mode]) .discord-message:hover .discord-message-timestamp {
281
- color: #99aab5;
282
- }
283
-
284
- :host([light-theme][compact-mode]).discord-message-timestamp {
285
- color: #d1d9de;
286
- }
287
-
288
- :host([compact-mode]) .discord-message-timestamp {
289
- display: inline-block;
290
- width: 3.1rem;
291
- text-align: right;
292
- font-size: 0.6875rem;
293
- line-height: 1.375rem;
294
- margin-right: 0.375rem;
295
- margin-left: 0;
296
- text-indent: 0;
297
- }
298
-
299
- :host([compact-mode]) .discord-message-body {
300
- line-height: 1.375rem;
301
- padding-left: 10px;
302
- margin-left: -6px;
303
- }
304
-
305
- :host([compact-mode]) .discord-message-compact-indent {
306
- padding-left: 10px;
307
- }
308
-
309
- .discord-message-compact-indent {
310
- display: grid;
311
- grid-template-columns: 1fr;
312
- }
313
-
314
- :host .discord-message-markup {
315
- font-size: 1rem;
316
- line-height: 1.375rem;
317
- word-wrap: break-word;
318
- user-select: text;
319
- font-weight: 400;
320
- display: inline;
321
- /* white-space: pre-wrap; */
322
- }
323
-
324
- :host(:hover) {
325
- background-color: var(--message-hover-background-color, #3a3b41);
326
- }
327
-
328
- :host([highlight]:hover) {
329
- background-color: hsl(40 calc(1 * 86.4%) 56.9%/0.08);
330
- }
331
-
332
- :host([has-thread]):after {
333
- width: 2rem;
334
- left: 2.2rem;
335
- top: 3.2rem;
336
- border-left: 2px solid #4f545c !important;
337
- border-bottom: 2px solid #4f545c !important;
338
- border-bottom-left-radius: 8px !important;
339
- bottom: 29px;
340
- content: '';
341
- position: absolute;
342
- }
343
-
344
- :host([light-theme][has-Thread]):after {
345
- border-color: #747f8d !important;
346
- }
347
-
348
- .discord-message-ephemeral {
349
- margin-top: 4px;
350
- font-size: 12px;
351
- font-weight: 400;
352
- color: #72767d;
353
- }
354
-
355
- :host([light-theme]) .discord-message-ephemeral {
356
- color: #747f8d;
357
- }
358
-
359
- .discord-message-ephemeral .discord-message-ephemeral-link {
360
- color: #00aff4;
361
- font-weight: 500;
362
- cursor: pointer;
363
- }
364
-
365
- .discord-message-ephemeral .discord-message-ephemeral-link:hover {
366
- text-decoration: underline;
367
- }
368
-
369
- .discord-message-ephemeral .discord-message-ephemeral-icon {
370
- margin-right: 4px;
371
- vertical-align: text-bottom;
372
- }
373
-
374
- .bold-timestamp {
375
- font-weight: 600;
376
- }
377
-
378
- slot[name='embeds']::slotted(discord-media-gallery:not(:last-child)) {
379
- margin-bottom: 4px;
380
- }
119
+ static { this.styles = css `
120
+ :host {
121
+ color: #dcddde;
122
+ display: flex;
123
+ flex-direction: column;
124
+ font-size: 0.9em;
125
+ font-family: 'gg sans', 'Noto Sans', Whitney, 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;
126
+
127
+ position: relative;
128
+ word-wrap: break-word;
129
+ -webkit-user-select: text;
130
+ -moz-user-select: text;
131
+ -ms-user-select: text;
132
+ user-select: text;
133
+ -webkit-box-flex: 0;
134
+ -ms-flex: 0 0 auto;
135
+ flex: 0 0 auto;
136
+ min-height: 1.375rem;
137
+ padding-left: 1em;
138
+ padding-right: 48px;
139
+ margin-top: inherit;
140
+ margin-bottom: inherit;
141
+ line-height: 16px;
142
+ }
143
+
144
+ :host([is-in-forwarded-message]) {
145
+ padding-left: 0;
146
+ padding-right: 0;
147
+ }
148
+
149
+ .discord-message-inner {
150
+ display: flex;
151
+ position: relative;
152
+ -webkit-box-flex: 0;
153
+ -ms-flex: 0 0 auto;
154
+ flex: 0 0 auto;
155
+ }
156
+
157
+ .discord-message-inner-center {
158
+ align-items: center;
159
+ }
160
+
161
+ :host([message-body-only]) {
162
+ margin-top: 0px !important;
163
+ padding-top: 0.125rem !important;
164
+ padding-bottom: 0.0625rem !important;
165
+ }
166
+
167
+ :host([highlight]),
168
+ :host([ephemeral]) {
169
+ padding-right: 5px;
170
+ position: relative;
171
+ }
172
+
173
+ :host([highlight])::before,
174
+ :host([ephemeral])::before {
175
+ content: '';
176
+ position: absolute;
177
+ display: block;
178
+ top: 0;
179
+ left: 0;
180
+ bottom: 0;
181
+ pointer-events: none;
182
+ width: 2px;
183
+ }
184
+
185
+ :host([highlight]) {
186
+ background-color: rgba(250, 166, 26, 0.1);
187
+ }
188
+
189
+ :host([highlight][light-theme]) {
190
+ background-color: rgba(250, 166, 26, 0.1);
191
+ }
192
+
193
+ :host([highlight])::before {
194
+ background-color: #faa61a;
195
+ }
196
+
197
+ :host([light-theme][highlight])::before {
198
+ background-color: #af7615;
199
+ }
200
+
201
+ :host([ephemeral]) {
202
+ background-color: rgba(88, 101, 242, 0.05);
203
+ }
204
+
205
+ :host([ephemeral]:hover) {
206
+ background-color: rgba(88, 101, 242, 0.1);
207
+ }
208
+
209
+ :host([ephemeral])::before {
210
+ background-color: #5865f2;
211
+ }
212
+
213
+ :host([light-theme]) {
214
+ color: #2e3338;
215
+ border-color: #eceeef;
216
+ --message-hover-background-color: color-mix(
217
+ in oklab,
218
+ hsl(240 calc(1 * 4%) 60.784% /0.12156862745098039) 100%,
219
+ hsl(0 0% 0% /0.12156862745098039) 0%
220
+ );
221
+ }
222
+
223
+ .discord-author-avatar {
224
+ margin-right: 16px;
225
+ margin-top: 5px;
226
+ min-width: 40px;
227
+ z-index: 1;
228
+ display: flex;
229
+ }
230
+
231
+ .discord-author-avatar img {
232
+ width: 40px;
233
+ height: 40px;
234
+ border-radius: 50%;
235
+ cursor: pointer;
236
+ }
237
+
238
+ .discord-message-timestamp {
239
+ color: #72767d;
240
+ font-size: 12px;
241
+ margin-left: 3px;
242
+ }
243
+
244
+ .discord-message-body-only-indent {
245
+ width: 56px;
246
+ }
247
+
248
+ :host(:hover) .discord-message-timestamp-hover::before {
249
+ content: attr(datetime);
250
+ }
251
+
252
+ :host([light-theme]) .discord-message-timestamp {
253
+ color: #747f8d;
254
+ }
255
+
256
+ .discord-message-edited {
257
+ color: #72767d;
258
+ font-size: 10px;
259
+ }
260
+
261
+ :host([light-theme]) .discord-message-edited {
262
+ color: #99aab5;
263
+ }
264
+
265
+ .discord-message-content {
266
+ width: 100%;
267
+ line-height: 160%;
268
+ font-weight: normal;
269
+ padding-top: 2px;
270
+ }
271
+
272
+ .discord-message-body {
273
+ font-size: 1rem;
274
+ font-weight: 400;
275
+ word-break: break-word;
276
+ position: relative;
277
+ }
278
+
279
+ :host([light-theme]) .discord-message-timestamp,
280
+ :host([compact-mode]) .discord-message:hover .discord-message-timestamp {
281
+ color: #99aab5;
282
+ }
283
+
284
+ :host([light-theme][compact-mode]).discord-message-timestamp {
285
+ color: #d1d9de;
286
+ }
287
+
288
+ :host([compact-mode]) .discord-message-timestamp {
289
+ display: inline-block;
290
+ width: 3.1rem;
291
+ text-align: right;
292
+ font-size: 0.6875rem;
293
+ line-height: 1.375rem;
294
+ margin-right: 0.375rem;
295
+ margin-left: 0;
296
+ text-indent: 0;
297
+ }
298
+
299
+ :host([compact-mode]) .discord-message-body {
300
+ line-height: 1.375rem;
301
+ padding-left: 10px;
302
+ margin-left: -6px;
303
+ }
304
+
305
+ :host([compact-mode]) .discord-message-compact-indent {
306
+ padding-left: 10px;
307
+ }
308
+
309
+ .discord-message-compact-indent {
310
+ display: grid;
311
+ grid-template-columns: 1fr;
312
+ }
313
+
314
+ :host .discord-message-markup {
315
+ font-size: 1rem;
316
+ line-height: 1.375rem;
317
+ word-wrap: break-word;
318
+ user-select: text;
319
+ font-weight: 400;
320
+ display: inline;
321
+ /* white-space: pre-wrap; */
322
+ }
323
+
324
+ :host(:hover) {
325
+ background-color: var(--message-hover-background-color, #3a3b41);
326
+ }
327
+
328
+ :host([highlight]:hover) {
329
+ background-color: hsl(40 calc(1 * 86.4%) 56.9%/0.08);
330
+ }
331
+
332
+ :host([has-thread]):after {
333
+ width: 2rem;
334
+ left: 2.2rem;
335
+ top: 3.2rem;
336
+ border-left: 2px solid #4f545c !important;
337
+ border-bottom: 2px solid #4f545c !important;
338
+ border-bottom-left-radius: 8px !important;
339
+ bottom: 29px;
340
+ content: '';
341
+ position: absolute;
342
+ }
343
+
344
+ :host([light-theme][has-Thread]):after {
345
+ border-color: #747f8d !important;
346
+ }
347
+
348
+ .discord-message-ephemeral {
349
+ margin-top: 4px;
350
+ font-size: 12px;
351
+ font-weight: 400;
352
+ color: #72767d;
353
+ }
354
+
355
+ :host([light-theme]) .discord-message-ephemeral {
356
+ color: #747f8d;
357
+ }
358
+
359
+ .discord-message-ephemeral .discord-message-ephemeral-link {
360
+ color: #00aff4;
361
+ font-weight: 500;
362
+ cursor: pointer;
363
+ }
364
+
365
+ .discord-message-ephemeral .discord-message-ephemeral-link:hover {
366
+ text-decoration: underline;
367
+ }
368
+
369
+ .discord-message-ephemeral .discord-message-ephemeral-icon {
370
+ margin-right: 4px;
371
+ vertical-align: text-bottom;
372
+ }
373
+
374
+ .bold-timestamp {
375
+ font-weight: 600;
376
+ }
377
+
378
+ slot[name='embeds']::slotted(discord-media-gallery:not(:last-child)) {
379
+ margin-bottom: 4px;
380
+ }
381
381
  `; }
382
382
  willUpdate() {
383
+ // children are only inspectable on the client; during SSR the light DOM is streamed as-is.
384
+ if (isServer)
385
+ return;
383
386
  this.hasThread = Array.from(this.children).some((child) => child.tagName.toLowerCase() === 'discord-thread');
384
387
  this.highlight =
385
388
  this.highlight ||
@@ -412,85 +415,85 @@ let DiscordMessage = class DiscordMessage extends LitElement {
412
415
  const profile = { ...defaultData, ...profileData, avatar: this.resolveAvatar(profileData.avatar ?? this.avatar) };
413
416
  this.resolvedProfile = profile;
414
417
  const computedTimestamp = handleTimestamp(this.timestamp, this.compactMode, this.twentyFour) ?? undefined;
415
- return html `
416
- <slot name="reply"></slot>
417
- <div
418
+ return html `
419
+ <slot name="reply"></slot>
420
+ <div
418
421
  class=${classMap({
419
422
  'discord-message-inner': true,
420
423
  'discord-message-inner-center': this.messageBodyOnly
421
- })}
422
- >
423
- ${when(this.compactMode && !this.messageBodyOnly, () => html `<time datetime="${ifDefined(computedTimestamp)}" class="discord-message-timestamp">${computedTimestamp}</time>`, () => null)}
424
- ${when(this.messageBodyOnly && !this.isInForwardedMessage, () => html `<time
425
- datetime="${ifDefined(computedTimestamp)}"
424
+ })}
425
+ >
426
+ ${when(this.compactMode && !this.messageBodyOnly, () => html `<time datetime="${ifDefined(computedTimestamp)}" class="discord-message-timestamp">${computedTimestamp}</time>`, () => null)}
427
+ ${when(this.messageBodyOnly && !this.isInForwardedMessage, () => html `<time
428
+ datetime="${ifDefined(computedTimestamp)}"
426
429
  class=${classMap({
427
430
  'discord-message-timestamp': true,
428
431
  'discord-message-timestamp-hover': true,
429
432
  'discord-message-body-only-indent': !this.compactMode
430
- })}
431
- ></time>`, () => null)}
432
- ${when(this.compactMode || this.messageBodyOnly || this.isInForwardedMessage, () => null, () => html `<div class="discord-author-avatar">
433
- <img src="${ifDefined(profile.avatar)}" alt="${ifDefined(profile.author)}" />
434
- </div>`)}
435
-
436
- <div class="discord-message-content">
437
- ${when(this.compactMode || this.messageBodyOnly || this.isInForwardedMessage, () => null, () => html `
438
- <discord-author-info
439
- author=${profile.author ?? ''}
440
- ?bot=${profile.bot ?? false}
441
- ?server=${profile.server ?? false}
442
- ?official-app=${profile.officialApp ?? false}
443
- ?verified=${profile.verified ?? false}
444
- ?op=${profile.op ?? false}
445
- role-color=${profile.roleColor ?? ''}
446
- role-icon=${profile.roleIcon ?? ''}
447
- role-name=${profile.roleName ?? ''}
448
- clan-icon=${profile.clanIcon ?? ''}
449
- clan-tag=${profile.clanTag ?? ''}
450
- ></discord-author-info
451
- ><time datetime="${ifDefined(computedTimestamp)}" class="discord-message-timestamp bold-timestamp"
452
- >${dateFormatter(this.rawTimestamp)}
453
- </time>
454
- `)}
455
- <div class="discord-message-body">
456
- ${when(this.compactMode, () => html `<discord-author-info
457
- author=${profile.author ?? ''}
458
- ?bot=${profile.bot ?? false}
459
- ?server=${profile.server ?? false}
460
- ?official-app=${profile.officialApp ?? false}
461
- ?verified=${profile.verified ?? false}
462
- ?op=${profile.op ?? false}
463
- role-color=${profile.roleColor ?? ''}
464
- role-icon=${profile.roleIcon ?? ''}
465
- role-name=${profile.roleName ?? ''}
466
- clan-icon=${profile.clanIcon ?? ''}
467
- clan-tag=${profile.clanTag ?? ''}
468
- ></discord-author-info>`, () => null)}<span class="discord-message-markup">
469
- <discord-white-space><slot></slot></discord-white-space>
470
- </span>
471
- ${when(this.edited, () => html `<span class="discord-message-edited">(edited)</span>`, () => null)}
472
- </div>
473
- <div class="discord-message-compact-indent">
474
- <slot name="attachments"></slot>
475
- <slot name="embeds"></slot>
476
- <slot name="components"></slot>
477
- <slot name="reactions"></slot>
478
- <slot name="thread"></slot>
479
- ${when(this.ephemeral, () => html `
480
- <div class="discord-message-ephemeral">
481
- ${Ephemeral()} Only you can see this •
482
- <span
483
- role="button"
484
- class="discord-message-ephemeral-link"
485
- @click=${this.dismissMessageClicked}
486
- @keydown=${this.handleSpaceToDismissMessage}
487
- >Dismiss message</span
488
- >
489
- </div>
490
- `, () => null)}
491
- </div>
492
- </div>
493
- </div>
433
+ })}
434
+ ></time>`, () => null)}
435
+ ${when(this.compactMode || this.messageBodyOnly || this.isInForwardedMessage, () => null, () => html `<div class="discord-author-avatar">
436
+ <img src="${ifDefined(profile.avatar)}" alt="${ifDefined(profile.author)}" />
437
+ </div>`)}
438
+
439
+ <div class="discord-message-content">
440
+ ${when(this.compactMode || this.messageBodyOnly || this.isInForwardedMessage, () => null, () => html `
441
+ <discord-author-info
442
+ author=${profile.author ?? ''}
443
+ ?bot=${profile.bot ?? false}
444
+ ?server=${profile.server ?? false}
445
+ ?official-app=${profile.officialApp ?? false}
446
+ ?verified=${profile.verified ?? false}
447
+ ?op=${profile.op ?? false}
448
+ role-color=${profile.roleColor ?? ''}
449
+ role-icon=${profile.roleIcon ?? ''}
450
+ role-name=${profile.roleName ?? ''}
451
+ clan-icon=${profile.clanIcon ?? ''}
452
+ clan-tag=${profile.clanTag ?? ''}
453
+ ></discord-author-info
454
+ ><time datetime="${ifDefined(computedTimestamp)}" class="discord-message-timestamp bold-timestamp"
455
+ >${dateFormatter(this.rawTimestamp)}
456
+ </time>
457
+ `)}
458
+ <div class="discord-message-body">
459
+ ${when(this.compactMode, () => html `<discord-author-info
460
+ author=${profile.author ?? ''}
461
+ ?bot=${profile.bot ?? false}
462
+ ?server=${profile.server ?? false}
463
+ ?official-app=${profile.officialApp ?? false}
464
+ ?verified=${profile.verified ?? false}
465
+ ?op=${profile.op ?? false}
466
+ role-color=${profile.roleColor ?? ''}
467
+ role-icon=${profile.roleIcon ?? ''}
468
+ role-name=${profile.roleName ?? ''}
469
+ clan-icon=${profile.clanIcon ?? ''}
470
+ clan-tag=${profile.clanTag ?? ''}
471
+ ></discord-author-info>`, () => null)}<span class="discord-message-markup">
472
+ <discord-white-space><slot></slot></discord-white-space>
473
+ </span>
474
+ ${when(this.edited, () => html `<span class="discord-message-edited">(edited)</span>`, () => null)}
475
+ </div>
476
+ <div class="discord-message-compact-indent">
477
+ <slot name="attachments"></slot>
478
+ <slot name="embeds"></slot>
479
+ <slot name="components"></slot>
480
+ <slot name="reactions"></slot>
481
+ <slot name="thread"></slot>
482
+ ${when(this.ephemeral, () => html `
483
+ <div class="discord-message-ephemeral">
484
+ ${Ephemeral()} Only you can see this •
485
+ <span
486
+ role="button"
487
+ class="discord-message-ephemeral-link"
488
+ @click=${this.dismissMessageClicked}
489
+ @keydown=${this.handleSpaceToDismissMessage}
490
+ >Dismiss message</span
491
+ >
492
+ </div>
493
+ `, () => null)}
494
+ </div>
495
+ </div>
496
+ </div>
494
497
  `;
495
498
  }
496
499
  resolveAvatar(avatar) {