@penwin/discord-components-core 4.3.8 → 4.3.9-dev-32917005672.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 +1898 -1981
  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
@@ -14,25 +14,25 @@ import { ifDefined } from 'lit/directives/if-defined.js';
14
14
  import { styleMap } from 'lit/directives/style-map.js';
15
15
  import { when } from 'lit/directives/when.js';
16
16
  import { BaseDiscordSelectMenuOption } from '../_private/BaseDiscordSelectMenuOption.js';
17
- const roleCountIcon = html `
18
- <svg aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" viewBox="0 0 24 24">
19
- <path
20
- fill="currentColor"
21
- d="M12 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM11.53 11A9.53 9.53 0 0 0 2 20.53c0 .81.66 1.47 1.47 1.47h.22c.24 0 .44-.17.5-.4.29-1.12.84-2.17 1.32-2.91.14-.21.43-.1.4.15l-.26 2.61c-.02.3.2.55.5.55h11.7a.5.5 0 0 0 .5-.55l-.27-2.6c-.02-.26.27-.37.41-.16.48.74 1.03 1.8 1.32 2.9.06.24.26.41.5.41h.22c.81 0 1.47-.66 1.47-1.47A9.53 9.53 0 0 0 12.47 11h-.94Z"
22
- class=""
23
- ></path>
24
- </svg>
17
+ const roleCountIcon = html `
18
+ <svg aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" viewBox="0 0 24 24">
19
+ <path
20
+ fill="currentColor"
21
+ d="M12 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM11.53 11A9.53 9.53 0 0 0 2 20.53c0 .81.66 1.47 1.47 1.47h.22c.24 0 .44-.17.5-.4.29-1.12.84-2.17 1.32-2.91.14-.21.43-.1.4.15l-.26 2.61c-.02.3.2.55.5.55h11.7a.5.5 0 0 0 .5-.55l-.27-2.6c-.02-.26.27-.37.41-.16.48.74 1.03 1.8 1.32 2.9.06.24.26.41.5.41h.22c.81 0 1.47-.66 1.47-1.47A9.53 9.53 0 0 0 12.47 11h-.94Z"
22
+ class=""
23
+ ></path>
24
+ </svg>
25
25
  `;
26
- const roleIcon = html `
27
- <svg aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24" class="role-icon">
28
- <path
29
- fill="currentColor"
30
- fill-rule="evenodd"
31
- d="M3.47 5.18c.27-.4.64-.74 1.1-.96l6.09-3.05a3 3 0 0 1 2.68 0l6.1 3.05A2.83 2.83 0 0 1 21 6.75v3.5a14.17 14.17 0 0 1-8.42 12.5c-.37.16-.79.16-1.16 0A14.18 14.18 0 0 1 3 9.77V6.75c0-.57.17-1.11.47-1.57Zm2.95 10.3A12.18 12.18 0 0 0 12 20.82a12.18 12.18 0 0 0 5.58-5.32A9.49 9.49 0 0 0 12.47 14h-.94c-1.88 0-3.63.55-5.11 1.49ZM12 13a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z"
32
- clip-rule="evenodd"
33
- class=""
34
- ></path>
35
- </svg>
26
+ const roleIcon = html `
27
+ <svg aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24" class="role-icon">
28
+ <path
29
+ fill="currentColor"
30
+ fill-rule="evenodd"
31
+ d="M3.47 5.18c.27-.4.64-.74 1.1-.96l6.09-3.05a3 3 0 0 1 2.68 0l6.1 3.05A2.83 2.83 0 0 1 21 6.75v3.5a14.17 14.17 0 0 1-8.42 12.5c-.37.16-.79.16-1.16 0A14.18 14.18 0 0 1 3 9.77V6.75c0-.57.17-1.11.47-1.57Zm2.95 10.3A12.18 12.18 0 0 0 12 20.82a12.18 12.18 0 0 0 5.58-5.32A9.49 9.49 0 0 0 12.47 14h-.94c-1.88 0-3.63.55-5.11 1.49ZM12 13a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z"
32
+ clip-rule="evenodd"
33
+ class=""
34
+ ></path>
35
+ </svg>
36
36
  `;
37
37
  let DiscordRoleSelectMenuOption = class DiscordRoleSelectMenuOption extends BaseDiscordSelectMenuOption {
38
38
  constructor() {
@@ -43,42 +43,42 @@ let DiscordRoleSelectMenuOption = class DiscordRoleSelectMenuOption extends Base
43
43
  * @internal
44
44
  */
45
45
  static { this.styles = [
46
- css `
47
- img {
48
- margin-right: 4px;
49
- vertical-align: bottom;
50
- object-fit: contain;
51
- }
52
-
53
- .discord-string-select-menu-option-ellipsis-text {
54
- overflow: hidden;
55
- text-overflow: ellipsis;
56
- white-space: nowrap;
57
- display: flex;
58
- align-items: center;
59
- gap: 4px;
60
- font-size: 16px;
61
- }
62
-
63
- strong {
64
- font-weight: 600;
65
- }
66
-
67
- .discord-string-select-menu-option-hidden {
68
- display: none;
69
- }
70
-
71
- discord-verified-author-tag {
72
- font-size: 12px;
73
- font-weight: 600;
74
- }
75
-
76
- .role-icon {
77
- fill: var(--role-color);
78
- & > path {
79
- fill: var(--role-color);
80
- }
81
- }
46
+ css `
47
+ img {
48
+ margin-right: 4px;
49
+ vertical-align: bottom;
50
+ object-fit: contain;
51
+ }
52
+
53
+ .discord-string-select-menu-option-ellipsis-text {
54
+ overflow: hidden;
55
+ text-overflow: ellipsis;
56
+ white-space: nowrap;
57
+ display: flex;
58
+ align-items: center;
59
+ gap: 4px;
60
+ font-size: 16px;
61
+ }
62
+
63
+ strong {
64
+ font-weight: 600;
65
+ }
66
+
67
+ .discord-string-select-menu-option-hidden {
68
+ display: none;
69
+ }
70
+
71
+ discord-verified-author-tag {
72
+ font-size: 12px;
73
+ font-weight: 600;
74
+ }
75
+
76
+ .role-icon {
77
+ fill: var(--role-color);
78
+ & > path {
79
+ fill: var(--role-color);
80
+ }
81
+ }
82
82
  `,
83
83
  BaseDiscordSelectMenuOption.baseStyles
84
84
  ]; }
@@ -86,27 +86,27 @@ let DiscordRoleSelectMenuOption = class DiscordRoleSelectMenuOption extends Base
86
86
  return this.name.toLowerCase().includes(searchValue);
87
87
  }
88
88
  render() {
89
- return html `
90
- <label style=${styleMap({ '--role-color': this.color })}>
91
- ${when(this.iconUrl, () => html `
92
- <img
93
- src=${ifDefined(this.iconUrl)}
94
- alt=${ifDefined(this.name)}
95
- draggable="false"
96
- class="discord-string-select-menu-option-emoji"
97
- width="24"
98
- height="24"
99
- />
100
- `, () => html `${roleIcon}`)}
101
- ${this.renderSelectedContainer(html `<div class="discord-string-select-menu-option-ellipsis-text">
102
- <div class="discord-string-select-menu-option-ellipsis-text">
103
- <span>${this.name}</span>
104
- ${when(this.showMemberCount, () => html `${roleCountIcon} <span>${this.memberCount}</span>`)}
105
- </div>
106
- </div>`)}
107
-
108
- <span class="discord-string-select-menu-option-hidden"><input type="checkbox" @click=${this.selectOption} /></span>
109
- </label>
89
+ return html `
90
+ <label style=${styleMap({ '--role-color': this.color })}>
91
+ ${when(this.iconUrl, () => html `
92
+ <img
93
+ src=${ifDefined(this.iconUrl)}
94
+ alt=${ifDefined(this.name)}
95
+ draggable="false"
96
+ class="discord-string-select-menu-option-emoji"
97
+ width="24"
98
+ height="24"
99
+ />
100
+ `, () => html `${roleIcon}`)}
101
+ ${this.renderSelectedContainer(html `<div class="discord-string-select-menu-option-ellipsis-text">
102
+ <div class="discord-string-select-menu-option-ellipsis-text">
103
+ <span>${this.name}</span>
104
+ ${when(this.showMemberCount, () => html `${roleCountIcon} <span>${this.memberCount}</span>`)}
105
+ </div>
106
+ </div>`)}
107
+
108
+ <span class="discord-string-select-menu-option-hidden"><input type="checkbox" @click=${this.selectOption} /></span>
109
+ </label>
110
110
  `;
111
111
  }
112
112
  };
@@ -20,12 +20,12 @@ let DiscordSection = class DiscordSection extends LitElement {
20
20
  /**
21
21
  * @internal
22
22
  */
23
- static { this.styles = css `
24
- :host {
25
- display: flex;
26
- gap: 12px;
27
- justify-content: space-between;
28
- }
23
+ static { this.styles = css `
24
+ :host {
25
+ display: flex;
26
+ gap: 12px;
27
+ justify-content: space-between;
28
+ }
29
29
  `; }
30
30
  updated() {
31
31
  const hasButton = Boolean(this?.querySelector('discord-button'));
@@ -22,17 +22,17 @@ let DiscordSectionComponents = class DiscordSectionComponents extends LitElement
22
22
  /**
23
23
  * @internal
24
24
  */
25
- static { this.styles = css `
26
- :host {
27
- display: flex;
28
- flex-direction: column;
29
- flex: 1;
30
- row-gap: 8px;
31
- }
32
-
33
- slot.has-only-one-text-display-child::slotted(discord-text-display) {
34
- --justify-content: center;
35
- }
25
+ static { this.styles = css `
26
+ :host {
27
+ display: flex;
28
+ flex-direction: column;
29
+ flex: 1;
30
+ row-gap: 8px;
31
+ }
32
+
33
+ slot.has-only-one-text-display-child::slotted(discord-text-display) {
34
+ --justify-content: center;
35
+ }
36
36
  `; }
37
37
  calcHasOnlyOneTextDisplayChild() {
38
38
  if (!this.withButton)
@@ -45,11 +45,11 @@ let DiscordSectionComponents = class DiscordSectionComponents extends LitElement
45
45
  return undefined;
46
46
  }
47
47
  render() {
48
- return html `<slot
49
- @slotchange=${this.calcHasOnlyOneTextDisplayChild}
48
+ return html `<slot
49
+ @slotchange=${this.calcHasOnlyOneTextDisplayChild}
50
50
  class=${classMap({
51
51
  'has-only-one-text-display-child': this.hasOnlyOneTextDisplayChild
52
- })}
52
+ })}
53
53
  ></slot>`;
54
54
  }
55
55
  };
@@ -19,10 +19,10 @@ let DiscordSelectMenuPortal = class DiscordSelectMenuPortal extends LitElement {
19
19
  this.placeholder = 'Make a selection';
20
20
  this.lightTheme = false;
21
21
  }
22
- static { this.styles = css `
23
- :host {
24
- display: contents;
25
- }
22
+ static { this.styles = css `
23
+ :host {
24
+ display: contents;
25
+ }
26
26
  `; }
27
27
  render() {
28
28
  const options = [];
@@ -34,47 +34,47 @@ let DiscordSelectMenuPortal = class DiscordSelectMenuPortal extends LitElement {
34
34
  if (hasUsers && data?.users) {
35
35
  const isDefaultInUsers = !this.defaultType || this.defaultType === 'user';
36
36
  for (const user of data.users) {
37
- options.push(html `<discord-user-select-menu-option
38
- identifier=${user.identifier}
39
- avatar-url=${user.avatarUrl}
40
- username=${user.username}
41
- discriminator=${user.discriminator}
42
- global-name=${ifDefined(user.globalName)}
43
- ?bot=${user.bot}
44
- ?verified=${user.verified}
45
- ?selected=${user.identifier === this.defaultIdentifier && isDefaultInUsers}
37
+ options.push(html `<discord-user-select-menu-option
38
+ identifier=${user.identifier}
39
+ avatar-url=${user.avatarUrl}
40
+ username=${user.username}
41
+ discriminator=${user.discriminator}
42
+ global-name=${ifDefined(user.globalName)}
43
+ ?bot=${user.bot}
44
+ ?verified=${user.verified}
45
+ ?selected=${user.identifier === this.defaultIdentifier && isDefaultInUsers}
46
46
  ></discord-user-select-menu-option>`);
47
47
  }
48
48
  }
49
49
  if (hasRoles && data?.roles) {
50
50
  const isDefaultInRoles = !this.defaultType || this.defaultType === 'role';
51
51
  for (const role of data.roles) {
52
- options.push(html `<discord-role-select-menu-option
53
- identifier=${role.identifier}
54
- name=${role.name}
55
- color=${role.color}
56
- member-count=${role.memberCount}
57
- icon-url=${ifDefined(role.iconUrl)}
58
- ?selected=${role.identifier === this.defaultIdentifier && isDefaultInRoles}
59
- .showMemberCount=${role.showMemberCount ?? true}
52
+ options.push(html `<discord-role-select-menu-option
53
+ identifier=${role.identifier}
54
+ name=${role.name}
55
+ color=${role.color}
56
+ member-count=${role.memberCount}
57
+ icon-url=${ifDefined(role.iconUrl)}
58
+ ?selected=${role.identifier === this.defaultIdentifier && isDefaultInRoles}
59
+ .showMemberCount=${role.showMemberCount ?? true}
60
60
  ></discord-role-select-menu-option>`);
61
61
  }
62
62
  }
63
63
  if (hasChannels && data?.channels) {
64
64
  const isDefaultInChannels = !this.defaultType || this.defaultType === 'channel';
65
65
  for (const channel of data.channels) {
66
- options.push(html `<discord-channel-select-menu-option
67
- identifier=${channel.identifier}
68
- name=${channel.name}
69
- type=${channel.type}
70
- ?selected=${channel.identifier === this.defaultIdentifier && isDefaultInChannels}
66
+ options.push(html `<discord-channel-select-menu-option
67
+ identifier=${channel.identifier}
68
+ name=${channel.name}
69
+ type=${channel.type}
70
+ ?selected=${channel.identifier === this.defaultIdentifier && isDefaultInChannels}
71
71
  ></discord-channel-select-menu-option>`);
72
72
  }
73
73
  }
74
- return html `
75
- <discord-mentionable-select-menu light-theme=${this.lightTheme} placeholder=${this.placeholder} ?disabled=${this.disabled}
76
- >${options}</discord-mentionable-select-menu
77
- >
74
+ return html `
75
+ <discord-mentionable-select-menu light-theme=${this.lightTheme} placeholder=${this.placeholder} ?disabled=${this.disabled}
76
+ >${options}</discord-mentionable-select-menu
77
+ >
78
78
  `;
79
79
  }
80
80
  };
@@ -20,15 +20,15 @@ let DiscordSeparator = class DiscordSeparator extends LitElement {
20
20
  /**
21
21
  * @internal
22
22
  */
23
- static { this.styles = css `
24
- .discord-divider-hr {
25
- display: block;
26
- border-bottom: 1px solid #4c4c54;
27
- }
28
-
29
- :host([spacing='2']) {
30
- margin: 8px 0px;
31
- }
23
+ static { this.styles = css `
24
+ .discord-divider-hr {
25
+ display: block;
26
+ border-bottom: 1px solid #4c4c54;
27
+ }
28
+
29
+ :host([spacing='2']) {
30
+ margin: 8px 0px;
31
+ }
32
32
  `; }
33
33
  render() {
34
34
  return html ` ${when(this.divider, () => html `<div class="discord-divider-hr"></div>`)} `;
@@ -23,43 +23,43 @@ let DiscordSpoiler = class DiscordSpoiler extends LitElement {
23
23
  /**
24
24
  * @internal
25
25
  */
26
- static { this.styles = css `
27
- :host {
28
- background-color: #202225;
29
- border-radius: 3px;
30
- color: transparent;
31
- cursor: pointer;
32
- }
33
-
34
- :host([light-theme]) {
35
- background-color: #c4c9ce;
36
- }
37
-
38
- :host(:hover) {
39
- background-color: rgba(32, 34, 37, 0.8);
40
- }
41
-
42
- :host([light-theme]:hover) {
43
- background-color: #cfd3d7;
44
- }
45
-
46
- :host([activated]) {
47
- color: inherit;
48
- background-color: hsla(0, 0%, 100%, 0.1);
49
- }
50
-
51
- :host([light-theme][activated]) {
52
- background-color: #e5e5e5;
53
- }
26
+ static { this.styles = css `
27
+ :host {
28
+ background-color: #202225;
29
+ border-radius: 3px;
30
+ color: transparent;
31
+ cursor: pointer;
32
+ }
33
+
34
+ :host([light-theme]) {
35
+ background-color: #c4c9ce;
36
+ }
37
+
38
+ :host(:hover) {
39
+ background-color: rgba(32, 34, 37, 0.8);
40
+ }
41
+
42
+ :host([light-theme]:hover) {
43
+ background-color: #cfd3d7;
44
+ }
45
+
46
+ :host([activated]) {
47
+ color: inherit;
48
+ background-color: hsla(0, 0%, 100%, 0.1);
49
+ }
50
+
51
+ :host([light-theme][activated]) {
52
+ background-color: #e5e5e5;
53
+ }
54
54
  `; }
55
55
  render() {
56
- return html `<slot
56
+ return html `<slot
57
57
  @click=${() => {
58
58
  this.activated = true;
59
- }}
59
+ }}
60
60
  @keydown=${() => {
61
61
  this.activated = true;
62
- }}
62
+ }}
63
63
  ></slot>`;
64
64
  }
65
65
  };