@arcscord/discord-ui-core 0.2.0 → 0.3.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.
@@ -0,0 +1,80 @@
1
+ import { L as MessageEntities } from "./components-D6NgWu9m.mjs";
2
+ import { i as ThemeOverrides, n as ThemeInput } from "./themes-DjBcMvDf.mjs";
3
+ declare const defaultMediaLabels: {
4
+ mediaPlay: string;
5
+ mediaReplay: string;
6
+ mediaPause: string;
7
+ mediaSeek: string;
8
+ mediaVolume: string;
9
+ mediaMute: string;
10
+ mediaUnmute: string;
11
+ mediaFullscreen: string;
12
+ mediaExitFullscreen: string;
13
+ mediaPlaybackSpeed: string;
14
+ mediaLoading: string;
15
+ mediaUnsupportedSticker: string;
16
+ };
17
+ type UILabels = Partial<typeof defaultMediaLabels> & {
18
+ selectPlaceholder?: string;
19
+ channelSelectPlaceholder?: string;
20
+ removeSelection?: string;
21
+ selectNoResults?: string;
22
+ selectNoOptions?: string;
23
+ userOnline?: string;
24
+ userIdle?: string;
25
+ userDnd?: string;
26
+ userOffline?: string;
27
+ commandOptions: string;
28
+ commandReady: string;
29
+ removeArgument: string;
30
+ slashCommands: string;
31
+ cancelCommand: string;
32
+ chooseValue: string;
33
+ edited: string;
34
+ reply: string;
35
+ replyUnavailable: string;
36
+ interactionReply: string;
37
+ interactionUsed: string;
38
+ mentionedMessage?: string;
39
+ ephemeralNotice: string;
40
+ dismissMessage: string;
41
+ downloadFile: string;
42
+ reactions: string;
43
+ thread: string;
44
+ openThread: string;
45
+ closeThread: string;
46
+ threadMessageSingular: string;
47
+ threadMessagePlural: string;
48
+ threadNoRecentMessages: string;
49
+ messages: string;
50
+ emptyChannel: string;
51
+ messagePlaceholder: string;
52
+ sendMessage: string;
53
+ spoiler: string;
54
+ showSpoiler: string;
55
+ hideSpoiler: string;
56
+ mediaUnavailable: string;
57
+ invalidTimestamp: string;
58
+ };
59
+ /** Twemoji files are served as `${baseUrl}/${codepoints}.svg`; no CDN is implicit. */
60
+ type UnicodeEmojiOptions = {
61
+ mode: "native";
62
+ } | {
63
+ mode: "twemoji";
64
+ baseUrl: string;
65
+ };
66
+ type BaseDisplayOptions = {
67
+ theme: ThemeInput;
68
+ tokens?: ThemeOverrides;
69
+ locale: string;
70
+ timeZone: string;
71
+ referenceTime?: string;
72
+ entities: MessageEntities;
73
+ allowRemoteMedia: boolean;
74
+ /** HTTP(S) origins, directories or exact paths allowed when remote media is disabled. */
75
+ remoteMediaAllowlist?: readonly string[];
76
+ unicodeEmoji?: UnicodeEmojiOptions;
77
+ labels: UILabels;
78
+ };
79
+ declare const defaultDisplayOptions: BaseDisplayOptions;
80
+ export { defaultMediaLabels as a, defaultDisplayOptions as i, UILabels as n, UnicodeEmojiOptions as r, BaseDisplayOptions as t };
package/dist/emoji.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as BaseDisplayOptions } from "./display-options-CDOCAill.mjs";
1
+ import { t as BaseDisplayOptions } from "./display-options-B5ta4WHV.mjs";
2
2
  export type UnicodeEmojiSegment = {
3
3
  kind: "text";
4
4
  text: string;
@@ -12,5 +12,4 @@ export type UnicodeEmojiSegment = {
12
12
  /** Check whether the entire string is a single Unicode emoji. */
13
13
  export declare function isUnicodeEmoji(content: string): boolean;
14
14
  /** Resolve data only: image loading and failure fallback belong to the renderer. */
15
- export declare function segmentUnicodeEmoji(content: string, { unicodeEmoji, allowRemoteMedia, remoteMediaAllowlist }?: Partial<Pick<BaseDisplayOptions, "unicodeEmoji" | "allowRemoteMedia" | "remoteMediaAllowlist">>): UnicodeEmojiSegment[];
16
- //# sourceMappingURL=emoji.d.mts.map
15
+ export declare function segmentUnicodeEmoji(content: string, { unicodeEmoji, allowRemoteMedia, remoteMediaAllowlist }?: Partial<Pick<BaseDisplayOptions, "unicodeEmoji" | "allowRemoteMedia" | "remoteMediaAllowlist">>): UnicodeEmojiSegment[];
package/dist/emoji.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { n as mediaUrl } from "./urls-C7KTt8t0.mjs";
2
1
  import { parse } from "@twemoji/parser";
2
+ import { n as mediaUrl } from "./urls-BdQaTx9e.mjs";
3
3
  // src/emoji.ts
4
4
  /** Check whether the entire string is a single Unicode emoji. */
5
5
  function isUnicodeEmoji(content) {
@@ -10,5 +10,4 @@ export type HighlightResult = {
10
10
  language: string | undefined;
11
11
  tokens: HighlightToken[];
12
12
  };
13
- export declare function highlightCode(content: string, language: string): HighlightResult;
14
- //# sourceMappingURL=highlight.d.mts.map
13
+ export declare function highlightCode(content: string, language: string): HighlightResult;
package/dist/index.d.mts CHANGED
@@ -1,5 +1,27 @@
1
- import { $ as SelectValuesByMessage, A as ButtonView, B as LinkButtonView, C as TextMessageBody, D as ReactionToggleHandler, E as ThreadView, F as ComponentsV2Body, G as RoleSelectMenuView, H as MessageButtonView, I as ContainerChild, J as SelectChannelType, K as RoleSelectOptionView, L as ContainerView, M as ChannelSelectOptionView, N as ComponentHandlers, O as ReactionView, P as ComponentInteractionContext, Q as SelectValues, R as FileView, S as ReplyView, T as ThreadSummaryView, U as MessageComponent, V as MentionableSelectMenuView, W as PremiumButtonView, X as SelectMenuView, Y as SelectDefaultValue, Z as SelectOptionView, _ as MessageAuthor, a as EmbedView, at as UserSelectMenuView, b as MessageReplyView, c as MessageEntities, d as EntityView, et as SeparatorView, f as RoleView, g as InteractionReplyView, h as AvatarFallback, i as defaultDisplayOptions, it as ThumbnailView, j as ChannelSelectMenuView, k as ActionRowView, l as ChannelEntityView, m as ChannelViewModel, n as UILabels, nt as StringSelectOptionView, o as MarkdownMessageBody, ot as UserSelectOptionView, p as UserView, q as SectionView, r as UnicodeEmojiOptions, rt as TextDisplayView, s as MediaView, t as BaseDisplayOptions, tt as StringSelectMenuView, u as ChannelType, v as MessageContentView, w as ThreadMessageView, x as MessageView, y as MessageMetadata, z as GalleryView } from "./display-options-CDOCAill.mjs";
2
- import { a as ThemeStyle, c as resolveTheme, d as themes, i as ThemeOverrides, l as themeStyle, n as ThemeInput, o as ThemeTokens, r as ThemeName, s as defineTheme, t as DiscordTheme, u as themeTokenProperties } from "./themes-yWxS4t7J.mjs";
1
+ import { a as defaultMediaLabels, i as defaultDisplayOptions, n as UILabels, r as UnicodeEmojiOptions, t as BaseDisplayOptions } from "./display-options-B5ta4WHV.mjs";
2
+ import { $ as MessageReplyView, A as ThumbnailView, B as VideoView, C as SelectOptionView, D as StringSelectMenuView, E as SeparatorView, F as MarkdownMessageBody, G as UserView, H as ChannelType, I as MediaView, J as AvatarFallback, K as ChannelViewModel, L as MessageEntities, M as UserSelectOptionView, N as AudioView, O as StringSelectOptionView, P as EmbedView, Q as MessageMetadata, R as MessageMediaView, S as SelectMenuView, T as SelectValuesByMessage, U as EntityView, V as ChannelEntityView, W as RoleView, X as MessageAuthor, Y as InteractionReplyView, Z as MessageContentView, _ as RoleSelectMenuView, a as ComponentHandlers, at as ThreadView, b as SelectChannelType, c as ContainerChild, d as GalleryView, et as MessageView, f as LinkButtonView, g as PremiumButtonView, h as MessageComponent, i as ChannelSelectOptionView, it as ThreadSummaryView, j as UserSelectMenuView, k as TextDisplayView, l as ContainerView, m as MessageButtonView, n as ButtonView, nt as TextMessageBody, o as ComponentInteractionContext, ot as ReactionToggleHandler, p as MentionableSelectMenuView, q as AuthorTag, r as ChannelSelectMenuView, rt as ThreadMessageView, s as ComponentsV2Body, st as ReactionView, t as ActionRowView, tt as ReplyView, u as FileView, v as RoleSelectOptionView, w as SelectValues, x as SelectDefaultValue, y as SectionView, z as StickerView } from "./components-D6NgWu9m.mjs";
3
+ import { a as ThemeStyle, c as resolveTheme, d as themes, i as ThemeOverrides, l as themeStyle, n as ThemeInput, o as ThemeTokens, r as ThemeName, s as defineTheme, t as DiscordTheme, u as themeTokenProperties } from "./themes-DjBcMvDf.mjs";
4
+ /** Display metadata for an identified mention. The host resolves additional data. */
5
+ type MentionTarget = {
6
+ id: string;
7
+ kind: "user" | "role" | "channel" | "command";
8
+ name: string;
9
+ color?: string | undefined;
10
+ };
11
+ /** Optional host actions for an author's avatar and display name. */
12
+ type UserInteractionHandlers<E> = {
13
+ onUserClick?: ((author: MessageAuthor, event: E) => void) | undefined;
14
+ onUserContextMenu?: ((author: MessageAuthor, event: E) => void) | undefined;
15
+ };
16
+ /** Identified mentions expose their display data without resolving users or roles. */
17
+ type MentionInteractionHandlers<E> = {
18
+ onMentionClick?: ((mention: MentionTarget, event: E) => void) | undefined;
19
+ onMentionContextMenu?: ((mention: MentionTarget, event: E) => void) | undefined;
20
+ };
21
+ /** Host-owned utility actions, separate from Discord component interactions. */
22
+ type MessageInteractionHandlers<E> = UserInteractionHandlers<E> & MentionInteractionHandlers<E> & {
23
+ onMessageContextMenu?: ((message: MessageView, event: E) => void) | undefined;
24
+ };
3
25
  /** Command names may contain spaces for subcommands, e.g. "config show". */
4
26
  type SlashCommand = {
5
27
  name: string;
@@ -22,6 +44,12 @@ type SlashCommandInvocation = {
22
44
  arguments: Record<string, string>;
23
45
  };
24
46
  type SlashCommandHandler = (invocation: SlashCommandInvocation) => void;
47
+ /** Format media time without depending on locale or the system clock. */
48
+ export declare function formatMediaTime(seconds: number): string;
49
+ /** Decode Discord's bounded base64 waveform without requiring a browser or Buffer. */
50
+ export declare function decodeWaveform(value: string | undefined): readonly number[] | undefined;
51
+ /** Match the fill to the center of the shared ten-pixel seek thumb. */
52
+ export declare function mediaProgressBackground(currentTime: number, duration: number): string;
25
53
  type ResolvedSelectOption = SelectOptionView & {
26
54
  value: string;
27
55
  label: string;
@@ -44,5 +72,4 @@ export declare function formatDiscordTimestamp(seconds: string, format: string,
44
72
  export declare function linkUrl(value: string | undefined): string | undefined;
45
73
  /** Local paths and image data are allowed without accepting executable schemes. */
46
74
  export declare function mediaUrl(value: string | undefined, allowRemote?: boolean, allowlist?: readonly string[]): string | undefined;
47
- export { type ActionRowView, type AvatarFallback, type BaseDisplayOptions, type ButtonView, type ChannelEntityView, type ChannelSelectMenuView, type ChannelSelectOptionView, type ChannelType, type ChannelViewModel, type ComponentHandlers, type ComponentInteractionContext, type ComponentsV2Body, type ContainerChild, type ContainerView, type DiscordTheme, type EmbedView, type EntityView, type FileView, type GalleryView, type InteractionReplyView, type LinkButtonView, type MarkdownMessageBody, type MediaView, type MentionableSelectMenuView, type MessageAuthor, type MessageButtonView, type MessageComponent, type MessageContentView, type MessageEntities, type MessageMetadata, type MessageReplyView, type MessageView, type PremiumButtonView, type ReactionToggleHandler, type ReactionView, type ReplyView, type ResolvedSelectOption, type RoleSelectMenuView, type RoleSelectOptionView, type RoleView, type SectionView, type SelectChannelType, type SelectDefaultValue, type SelectMenuView, type SelectOptionView, type SelectValues, type SelectValuesByMessage, type SeparatorView, type SlashCommand, type SlashCommandArgument, type SlashCommandHandler, type SlashCommandInvocation, type StringSelectMenuView, type StringSelectOptionView, type TextDisplayView, type TextMessageBody, type ThemeInput, type ThemeName, type ThemeOverrides, type ThemeStyle, type ThemeTokens, type ThreadMessageView, type ThreadSummaryView, type ThreadView, type ThumbnailView, type UILabels, type UnicodeEmojiOptions, type UserSelectMenuView, type UserSelectOptionView, type UserView, defaultDisplayOptions, defineTheme, resolveTheme, themeStyle, themeTokenProperties, themes };
48
- //# sourceMappingURL=index.d.mts.map
75
+ export { type ActionRowView, type AudioView, type AuthorTag, type AvatarFallback, type BaseDisplayOptions, type ButtonView, type ChannelEntityView, type ChannelSelectMenuView, type ChannelSelectOptionView, type ChannelType, type ChannelViewModel, type ComponentHandlers, type ComponentInteractionContext, type ComponentsV2Body, type ContainerChild, type ContainerView, type DiscordTheme, type EmbedView, type EntityView, type FileView, type GalleryView, type InteractionReplyView, type LinkButtonView, type MarkdownMessageBody, type MediaView, type MentionInteractionHandlers, type MentionTarget, type MentionableSelectMenuView, type MessageAuthor, type MessageButtonView, type MessageComponent, type MessageContentView, type MessageEntities, type MessageInteractionHandlers, type MessageMediaView, type MessageMetadata, type MessageReplyView, type MessageView, type PremiumButtonView, type ReactionToggleHandler, type ReactionView, type ReplyView, type ResolvedSelectOption, type RoleSelectMenuView, type RoleSelectOptionView, type RoleView, type SectionView, type SelectChannelType, type SelectDefaultValue, type SelectMenuView, type SelectOptionView, type SelectValues, type SelectValuesByMessage, type SeparatorView, type SlashCommand, type SlashCommandArgument, type SlashCommandHandler, type SlashCommandInvocation, type StickerView, type StringSelectMenuView, type StringSelectOptionView, type TextDisplayView, type TextMessageBody, type ThemeInput, type ThemeName, type ThemeOverrides, type ThemeStyle, type ThemeTokens, type ThreadMessageView, type ThreadSummaryView, type ThreadView, type ThumbnailView, type UILabels, type UnicodeEmojiOptions, type UserInteractionHandlers, type UserSelectMenuView, type UserSelectOptionView, type UserView, type VideoView, defaultDisplayOptions, defaultMediaLabels, defineTheme, resolveTheme, themeStyle, themeTokenProperties, themes };
package/dist/index.mjs CHANGED
@@ -1,6 +1,21 @@
1
1
  import { defineTheme, resolveTheme, themeStyle, themeTokenProperties, themes } from "./themes.mjs";
2
- import { n as mediaUrl, t as linkUrl } from "./urls-C7KTt8t0.mjs";
2
+ import { n as formatMediaTime, r as mediaProgressBackground, t as decodeWaveform } from "./media-DKcZ5Id4.mjs";
3
+ import { n as mediaUrl, t as linkUrl } from "./urls-BdQaTx9e.mjs";
3
4
  // src/display-options.ts
5
+ const defaultMediaLabels = {
6
+ mediaPlay: "Play",
7
+ mediaReplay: "Replay",
8
+ mediaPause: "Pause",
9
+ mediaSeek: "Playback position",
10
+ mediaVolume: "Volume",
11
+ mediaMute: "Mute",
12
+ mediaUnmute: "Unmute",
13
+ mediaFullscreen: "Fullscreen",
14
+ mediaExitFullscreen: "Exit fullscreen",
15
+ mediaPlaybackSpeed: "Playback speed",
16
+ mediaLoading: "Loading media",
17
+ mediaUnsupportedSticker: "Sticker format not supported"
18
+ };
4
19
  const defaultDisplayOptions = {
5
20
  theme: "dark",
6
21
  locale: "en-US",
@@ -9,6 +24,7 @@ const defaultDisplayOptions = {
9
24
  allowRemoteMedia: true,
10
25
  unicodeEmoji: { mode: "native" },
11
26
  labels: {
27
+ ...defaultMediaLabels,
12
28
  selectPlaceholder: "Make a selection",
13
29
  channelSelectPlaceholder: "Select a channel",
14
30
  removeSelection: "Remove {name}",
@@ -29,6 +45,7 @@ const defaultDisplayOptions = {
29
45
  replyUnavailable: "Original message unavailable",
30
46
  interactionReply: "Interaction response",
31
47
  interactionUsed: "used",
48
+ mentionedMessage: "Mentioned message",
32
49
  ephemeralNotice: "Only you can see this",
33
50
  dismissMessage: "Dismiss message",
34
51
  downloadFile: "Download {name}",
@@ -85,7 +102,8 @@ function singleSelectMenu(menu) {
85
102
  /** Parse an explicit ISO instant with a time-zone suffix, without a clock fallback. */
86
103
  function parseTimestamp(timestamp) {
87
104
  const date = new Date(timestamp);
88
- return /T.*(?:Z|[+-]\d{2}:\d{2})$/u.test(timestamp) && Number.isFinite(date.valueOf()) ? date : void 0;
105
+ const hasExplicitTimeZone = timestamp.endsWith("Z") || /^[+-]\d{2}:\d{2}$/u.test(timestamp.slice(-6));
106
+ return timestamp.includes("T") && hasExplicitTimeZone && Number.isFinite(date.valueOf()) ? date : void 0;
89
107
  }
90
108
  function formatDiscordTimestamp(seconds, format, options) {
91
109
  const value = Number(seconds);
@@ -135,6 +153,6 @@ function formatDiscordTimestamp(seconds, format, options) {
135
153
  label
136
154
  };
137
155
  }
138
- export { defaultDisplayOptions, defaultSelectValues, defineTheme, formatDiscordTimestamp, linkUrl, mediaUrl, parseTimestamp, resolveTheme, selectOptions, singleSelectMenu, themeStyle, themeTokenProperties, themes };
156
+ export { decodeWaveform, defaultDisplayOptions, defaultMediaLabels, defaultSelectValues, defineTheme, formatDiscordTimestamp, formatMediaTime, linkUrl, mediaProgressBackground, mediaUrl, parseTimestamp, resolveTheme, selectOptions, singleSelectMenu, themeStyle, themeTokenProperties, themes };
139
157
 
140
158
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/display-options.ts","../src/utils/select-menus.ts","../src/utils/timestamps.ts"],"sourcesContent":["import type { MessageEntities } from \"./model/content\";\nimport type { ThemeInput, ThemeOverrides } from \"./themes\";\n\nexport type UILabels = {\n selectPlaceholder?: string;\n channelSelectPlaceholder?: string;\n removeSelection?: string;\n selectNoResults?: string;\n selectNoOptions?: string;\n userOnline?: string;\n userIdle?: string;\n userDnd?: string;\n userOffline?: string;\n commandOptions: string;\n commandReady: string;\n removeArgument: string;\n slashCommands: string;\n cancelCommand: string;\n chooseValue: string;\n edited: string;\n reply: string;\n replyUnavailable: string;\n interactionReply: string;\n interactionUsed: string;\n ephemeralNotice: string;\n dismissMessage: string;\n downloadFile: string;\n reactions: string;\n thread: string;\n openThread: string;\n closeThread: string;\n threadMessageSingular: string;\n threadMessagePlural: string;\n threadNoRecentMessages: string;\n messages: string;\n emptyChannel: string;\n messagePlaceholder: string;\n sendMessage: string;\n spoiler: string;\n showSpoiler: string;\n hideSpoiler: string;\n mediaUnavailable: string;\n invalidTimestamp: string;\n};\n/** Twemoji files are served as `${baseUrl}/${codepoints}.svg`; no CDN is implicit. */\nexport type UnicodeEmojiOptions = { mode: \"native\" } | { mode: \"twemoji\"; baseUrl: string };\n\nexport type BaseDisplayOptions = {\n theme: ThemeInput;\n tokens?: ThemeOverrides;\n locale: string;\n timeZone: string;\n referenceTime?: string;\n entities: MessageEntities;\n allowRemoteMedia: boolean;\n /** HTTP(S) origins, directories or exact paths allowed when remote media is disabled. */\n remoteMediaAllowlist?: readonly string[];\n unicodeEmoji?: UnicodeEmojiOptions;\n labels: UILabels;\n};\n\nexport const defaultDisplayOptions: BaseDisplayOptions = {\n theme: \"dark\",\n locale: \"en-US\",\n timeZone: \"UTC\",\n // Standalone Markdown also has a deterministic fallback; Message uses its timestamp.\n entities: {},\n allowRemoteMedia: true,\n unicodeEmoji: { mode: \"native\" },\n labels: {\n selectPlaceholder: \"Make a selection\",\n channelSelectPlaceholder: \"Select a channel\",\n removeSelection: \"Remove {name}\",\n selectNoResults: \"No results found\",\n selectNoOptions: \"No options available\",\n userOnline: \"online\",\n userIdle: \"idle\",\n userDnd: \"dnd\",\n userOffline: \"offline\",\n commandOptions: \"Options\",\n commandReady: \"Ready\",\n removeArgument: \"Remove argument\",\n slashCommands: \"Slash commands\",\n cancelCommand: \"Cancel command\",\n chooseValue: \"Choose a value\",\n edited: \"(edited)\",\n reply: \"Reply to\",\n replyUnavailable: \"Original message unavailable\",\n interactionReply: \"Interaction response\",\n interactionUsed: \"used\",\n ephemeralNotice: \"Only you can see this\",\n dismissMessage: \"Dismiss message\",\n downloadFile: \"Download {name}\",\n reactions: \"Reactions\",\n thread: \"Thread\",\n openThread: \"Open thread\",\n closeThread: \"Close thread\",\n threadMessageSingular: \"{count} message\",\n threadMessagePlural: \"{count} messages\",\n threadNoRecentMessages: \"No recent messages in this thread.\",\n messages: \"Messages\",\n emptyChannel: \"No messages yet.\",\n messagePlaceholder: \"Message #{channel}\",\n sendMessage: \"Send message\",\n spoiler: \"Spoiler\",\n showSpoiler: \"Reveal spoiler\",\n hideSpoiler: \"Hide spoiler\",\n mediaUnavailable: \"Media unavailable\",\n invalidTimestamp: \"Invalid timestamp\",\n },\n};\n","import type { SelectMenuView, SelectOptionView } from \"../model/components\";\n\nexport type ResolvedSelectOption = SelectOptionView & { value: string; label: string };\n\nexport function selectOptions(menu: SelectMenuView): readonly ResolvedSelectOption[] {\n if (menu.kind === \"string-select\")\n return menu.options;\n const entities = menu.kind === \"channel-select\" && menu.channelTypes\n ? menu.entities.filter(entity => menu.channelTypes?.includes(entity.channelType))\n : menu.entities;\n return entities.map(entity => ({\n ...entity,\n value: entity.id,\n label: entity.entityType === \"user\"\n ? entity.displayName\n : entity.name,\n }));\n}\n\nexport function defaultSelectValues(menu: SelectMenuView): string[] {\n return menu.kind === \"string-select\"\n ? menu.options.filter(option => option.default).map(option => option.value)\n : menu.defaultValues?.map(value => value.id) ?? [];\n}\n\nexport function singleSelectMenu(menu: SelectMenuView): SelectMenuView {\n const base = {\n ...menu,\n id: `${menu.id}-single`,\n placeholder: \"Choose one option\",\n minValues: 1,\n maxValues: 1,\n };\n return base.kind === \"string-select\"\n ? {\n ...base,\n options: base.options.map(option => ({ ...option, default: false })),\n }\n : { ...base, defaultValues: [] };\n}\n","/** Parse an explicit ISO instant with a time-zone suffix, without a clock fallback. */\nexport function parseTimestamp(timestamp: string): Date | undefined {\n const date = new Date(timestamp);\n return /T.*(?:Z|[+-]\\d{2}:\\d{2})$/u.test(timestamp) && Number.isFinite(date.valueOf())\n ? date\n : undefined;\n}\n\nexport function formatDiscordTimestamp(seconds: string, format: string, options: { locale: string; timeZone: string; referenceTime: string; relativeStyle?: \"long\" | \"short\" | \"narrow\" }): { dateTime: string; label: string } | undefined {\n const value = Number(seconds);\n const date = new Date(value * 1000);\n if (!Number.isFinite(value) || !Number.isFinite(date.valueOf()))\n return undefined;\n const { locale, timeZone } = options;\n let label: string;\n if (format === \"R\") {\n const reference = new Date(options.referenceTime).valueOf();\n if (!Number.isFinite(reference))\n return undefined;\n const difference = (date.valueOf() - reference) / 1000;\n const units: [Intl.RelativeTimeFormatUnit, number][] = [\n [\"year\", 31536000],\n [\"month\", 2592000],\n [\"week\", 604800],\n [\"day\", 86400],\n [\"hour\", 3600],\n [\"minute\", 60],\n [\"second\", 1],\n ];\n const [unit, duration] = units.find(([, duration]) => Math.abs(difference) >= duration) ?? [\"second\", 1];\n label = new Intl.RelativeTimeFormat(locale, { numeric: \"auto\", style: options.relativeStyle ?? \"long\" }).format(Math.round(difference / duration), unit);\n }\n else {\n const formats: Record<string, Intl.DateTimeFormatOptions> = {\n t: { timeStyle: \"short\" },\n T: { timeStyle: \"medium\" },\n d: { dateStyle: \"short\" },\n D: { dateStyle: \"long\" },\n f: { dateStyle: \"long\", timeStyle: \"short\" },\n F: { dateStyle: \"full\", timeStyle: \"short\" },\n };\n label = new Intl.DateTimeFormat(locale, {\n ...(formats[format] ?? formats.f),\n timeZone,\n }).format(date);\n }\n return {\n dateTime: date.toISOString(),\n label,\n };\n}\n"],"mappings":";;;AA6DA,MAAa,wBAA4C;CACvD,OAAO;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AAsD;GAC1D,GAAG,EAAE,WAAW,QAAQ;GACxB,GAAG,EAAE,WAAW,SAAS;GACzB,GAAG,EAAE,WAAW,QAAQ;GACxB,GAAG,EAAE,WAAW,OAAO;GACvB,GAAG;IAAE,WAAW;IAAQ,WAAW;GAAQ;GAC3C,GAAG;IAAE,WAAW;IAAQ,WAAW;GAAQ;EAC7C;EACA,QAAQ,IAAI,KAAK,eAAe,QAAQ;GACtC,GAAI,QAAQ,WAAW,QAAQ;GAC/B;EACF,CAAC,CAAC,CAAC,OAAO,IAAI;CAChB;CACA,OAAO;EACL,UAAU,KAAK,YAAY;EAC3B;CACF;AACF"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/display-options.ts","../src/utils/select-menus.ts","../src/utils/timestamps.ts"],"sourcesContent":["import type { MessageEntities } from \"./model/content\";\nimport type { ThemeInput, ThemeOverrides } from \"./themes\";\n\nexport const defaultMediaLabels = {\n mediaPlay: \"Play\",\n mediaReplay: \"Replay\",\n mediaPause: \"Pause\",\n mediaSeek: \"Playback position\",\n mediaVolume: \"Volume\",\n mediaMute: \"Mute\",\n mediaUnmute: \"Unmute\",\n mediaFullscreen: \"Fullscreen\",\n mediaExitFullscreen: \"Exit fullscreen\",\n mediaPlaybackSpeed: \"Playback speed\",\n mediaLoading: \"Loading media\",\n mediaUnsupportedSticker: \"Sticker format not supported\",\n};\n\nexport type UILabels = Partial<typeof defaultMediaLabels> & {\n selectPlaceholder?: string;\n channelSelectPlaceholder?: string;\n removeSelection?: string;\n selectNoResults?: string;\n selectNoOptions?: string;\n userOnline?: string;\n userIdle?: string;\n userDnd?: string;\n userOffline?: string;\n commandOptions: string;\n commandReady: string;\n removeArgument: string;\n slashCommands: string;\n cancelCommand: string;\n chooseValue: string;\n edited: string;\n reply: string;\n replyUnavailable: string;\n interactionReply: string;\n interactionUsed: string;\n mentionedMessage?: string;\n ephemeralNotice: string;\n dismissMessage: string;\n downloadFile: string;\n reactions: string;\n thread: string;\n openThread: string;\n closeThread: string;\n threadMessageSingular: string;\n threadMessagePlural: string;\n threadNoRecentMessages: string;\n messages: string;\n emptyChannel: string;\n messagePlaceholder: string;\n sendMessage: string;\n spoiler: string;\n showSpoiler: string;\n hideSpoiler: string;\n mediaUnavailable: string;\n invalidTimestamp: string;\n};\n/** Twemoji files are served as `${baseUrl}/${codepoints}.svg`; no CDN is implicit. */\nexport type UnicodeEmojiOptions = { mode: \"native\" } | { mode: \"twemoji\"; baseUrl: string };\n\nexport type BaseDisplayOptions = {\n theme: ThemeInput;\n tokens?: ThemeOverrides;\n locale: string;\n timeZone: string;\n referenceTime?: string;\n entities: MessageEntities;\n allowRemoteMedia: boolean;\n /** HTTP(S) origins, directories or exact paths allowed when remote media is disabled. */\n remoteMediaAllowlist?: readonly string[];\n unicodeEmoji?: UnicodeEmojiOptions;\n labels: UILabels;\n};\n\nexport const defaultDisplayOptions: BaseDisplayOptions = {\n theme: \"dark\",\n locale: \"en-US\",\n timeZone: \"UTC\",\n // Standalone Markdown also has a deterministic fallback; Message uses its timestamp.\n entities: {},\n allowRemoteMedia: true,\n unicodeEmoji: { mode: \"native\" },\n labels: {\n ...defaultMediaLabels,\n selectPlaceholder: \"Make a selection\",\n channelSelectPlaceholder: \"Select a channel\",\n removeSelection: \"Remove {name}\",\n selectNoResults: \"No results found\",\n selectNoOptions: \"No options available\",\n userOnline: \"online\",\n userIdle: \"idle\",\n userDnd: \"dnd\",\n userOffline: \"offline\",\n commandOptions: \"Options\",\n commandReady: \"Ready\",\n removeArgument: \"Remove argument\",\n slashCommands: \"Slash commands\",\n cancelCommand: \"Cancel command\",\n chooseValue: \"Choose a value\",\n edited: \"(edited)\",\n reply: \"Reply to\",\n replyUnavailable: \"Original message unavailable\",\n interactionReply: \"Interaction response\",\n interactionUsed: \"used\",\n mentionedMessage: \"Mentioned message\",\n ephemeralNotice: \"Only you can see this\",\n dismissMessage: \"Dismiss message\",\n downloadFile: \"Download {name}\",\n reactions: \"Reactions\",\n thread: \"Thread\",\n openThread: \"Open thread\",\n closeThread: \"Close thread\",\n threadMessageSingular: \"{count} message\",\n threadMessagePlural: \"{count} messages\",\n threadNoRecentMessages: \"No recent messages in this thread.\",\n messages: \"Messages\",\n emptyChannel: \"No messages yet.\",\n messagePlaceholder: \"Message #{channel}\",\n sendMessage: \"Send message\",\n spoiler: \"Spoiler\",\n showSpoiler: \"Reveal spoiler\",\n hideSpoiler: \"Hide spoiler\",\n mediaUnavailable: \"Media unavailable\",\n invalidTimestamp: \"Invalid timestamp\",\n },\n};\n","import type { SelectMenuView, SelectOptionView } from \"../model/components\";\n\nexport type ResolvedSelectOption = SelectOptionView & { value: string; label: string };\n\nexport function selectOptions(menu: SelectMenuView): readonly ResolvedSelectOption[] {\n if (menu.kind === \"string-select\")\n return menu.options;\n const entities = menu.kind === \"channel-select\" && menu.channelTypes\n ? menu.entities.filter(entity => menu.channelTypes?.includes(entity.channelType))\n : menu.entities;\n return entities.map(entity => ({\n ...entity,\n value: entity.id,\n label: entity.entityType === \"user\"\n ? entity.displayName\n : entity.name,\n }));\n}\n\nexport function defaultSelectValues(menu: SelectMenuView): string[] {\n return menu.kind === \"string-select\"\n ? menu.options.filter(option => option.default).map(option => option.value)\n : menu.defaultValues?.map(value => value.id) ?? [];\n}\n\nexport function singleSelectMenu(menu: SelectMenuView): SelectMenuView {\n const base = {\n ...menu,\n id: `${menu.id}-single`,\n placeholder: \"Choose one option\",\n minValues: 1,\n maxValues: 1,\n };\n return base.kind === \"string-select\"\n ? {\n ...base,\n options: base.options.map(option => ({ ...option, default: false })),\n }\n : { ...base, defaultValues: [] };\n}\n","/** Parse an explicit ISO instant with a time-zone suffix, without a clock fallback. */\nexport function parseTimestamp(timestamp: string): Date | undefined {\n const date = new Date(timestamp);\n const hasExplicitTimeZone = timestamp.endsWith(\"Z\") || /^[+-]\\d{2}:\\d{2}$/u.test(timestamp.slice(-6));\n return timestamp.includes(\"T\") && hasExplicitTimeZone && Number.isFinite(date.valueOf())\n ? date\n : undefined;\n}\n\nexport function formatDiscordTimestamp(seconds: string, format: string, options: { locale: string; timeZone: string; referenceTime: string; relativeStyle?: \"long\" | \"short\" | \"narrow\" }): { dateTime: string; label: string } | undefined {\n const value = Number(seconds);\n const date = new Date(value * 1000);\n if (!Number.isFinite(value) || !Number.isFinite(date.valueOf()))\n return undefined;\n const { locale, timeZone } = options;\n let label: string;\n if (format === \"R\") {\n const reference = new Date(options.referenceTime).valueOf();\n if (!Number.isFinite(reference))\n return undefined;\n const difference = (date.valueOf() - reference) / 1000;\n const units: [Intl.RelativeTimeFormatUnit, number][] = [\n [\"year\", 31536000],\n [\"month\", 2592000],\n [\"week\", 604800],\n [\"day\", 86400],\n [\"hour\", 3600],\n [\"minute\", 60],\n [\"second\", 1],\n ];\n const [unit, duration] = units.find(([, duration]) => Math.abs(difference) >= duration) ?? [\"second\", 1];\n label = new Intl.RelativeTimeFormat(locale, { numeric: \"auto\", style: options.relativeStyle ?? \"long\" }).format(Math.round(difference / duration), unit);\n }\n else {\n const formats: Record<string, Intl.DateTimeFormatOptions> = {\n t: { timeStyle: \"short\" },\n T: { timeStyle: \"medium\" },\n d: { dateStyle: \"short\" },\n D: { dateStyle: \"long\" },\n f: { dateStyle: \"long\", timeStyle: \"short\" },\n F: { dateStyle: \"full\", timeStyle: \"short\" },\n };\n label = new Intl.DateTimeFormat(locale, {\n ...(formats[format] ?? formats.f),\n timeZone,\n }).format(date);\n }\n return {\n dateTime: date.toISOString(),\n label,\n };\n}\n"],"mappings":";;;;AAGA,MAAa,qBAAqB;CAChC,WAAW;CACX,aAAa;CACb,YAAY;CACZ,WAAW;CACX,aAAa;CACb,WAAW;CACX,aAAa;CACb,iBAAiB;CACjB,qBAAqB;CACrB,oBAAoB;CACpB,cAAc;CACd,yBAAyB;AAC3B;AA6DA,MAAa,wBAA4C;CACvD,OAAO;CACP,QAAQ;CACR,UAAU;CAEV,UAAU,CAAC;CACX,kBAAkB;CAClB,cAAc,EAAE,MAAM,SAAS;CAC/B,QAAQ;EACN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EACH,MAAM,UAAsD;GAC1D,GAAG,EAAE,WAAW,QAAQ;GACxB,GAAG,EAAE,WAAW,SAAS;GACzB,GAAG,EAAE,WAAW,QAAQ;GACxB,GAAG,EAAE,WAAW,OAAO;GACvB,GAAG;IAAE,WAAW;IAAQ,WAAW;GAAQ;GAC3C,GAAG;IAAE,WAAW;IAAQ,WAAW;GAAQ;EAC7C;EACA,QAAQ,IAAI,KAAK,eAAe,QAAQ;GACtC,GAAI,QAAQ,WAAW,QAAQ;GAC/B;EACF,CAAC,CAAC,CAAC,OAAO,IAAI;CAChB;CACA,OAAO;EACL,UAAU,KAAK,YAAY;EAC3B;CACF;AACF"}
@@ -26,5 +26,4 @@ export type MarkdownBlock = {
26
26
  start: number;
27
27
  items: MarkdownListItem[];
28
28
  };
29
- export declare function parseMarkdown(value: string): MarkdownBlock[];
30
- //# sourceMappingURL=markdown.d.mts.map
29
+ export declare function parseMarkdown(value: string): MarkdownBlock[];
@@ -0,0 +1,31 @@
1
+ // src/utils/media.ts
2
+ /** Format media time without depending on locale or the system clock. */
3
+ function formatMediaTime(seconds) {
4
+ const total = Number.isFinite(seconds) ? Math.max(0, Math.floor(seconds)) : 0;
5
+ return `${Math.floor(total / 60)}:${String(total % 60).padStart(2, "0")}`;
6
+ }
7
+ /** Decode Discord's bounded base64 waveform without requiring a browser or Buffer. */
8
+ function decodeWaveform(value) {
9
+ if (!value || value.length > 344 || !/^(?:[a-z\d+/]{4})*(?:[a-z\d+/]{2}(?:==)?|[a-z\d+/]{3}=?)?$/iu.test(value)) return void 0;
10
+ const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
11
+ const samples = [];
12
+ let buffer = 0;
13
+ let bits = 0;
14
+ for (const char of value.replace(/=+$/u, "")) {
15
+ buffer = buffer << 6 | alphabet.indexOf(char);
16
+ bits += 6;
17
+ if (bits >= 8) {
18
+ bits -= 8;
19
+ samples.push((buffer >> bits & 255) / 255);
20
+ }
21
+ }
22
+ return samples.length && samples.length <= 256 ? samples : void 0;
23
+ }
24
+ /** Match the fill to the center of the shared ten-pixel seek thumb. */
25
+ function mediaProgressBackground(currentTime, duration) {
26
+ const progress = Number.isFinite(currentTime) && Number.isFinite(duration) && duration > 0 ? Math.min(1, Math.max(0, currentTime / duration)) : 0;
27
+ return `calc(${progress * 100}% + ${5 - progress * 10}px) 100%`;
28
+ }
29
+ export { formatMediaTime as n, mediaProgressBackground as r, decodeWaveform as t };
30
+
31
+ //# sourceMappingURL=media-DKcZ5Id4.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-DKcZ5Id4.mjs","names":[],"sources":["../src/utils/media.ts"],"sourcesContent":["/** Format media time without depending on locale or the system clock. */\nexport function formatMediaTime(seconds: number): string {\n const total = Number.isFinite(seconds)\n ? Math.max(0, Math.floor(seconds))\n : 0;\n return `${Math.floor(total / 60)}:${String(total % 60).padStart(2, \"0\")}`;\n}\n\n/** Decode Discord's bounded base64 waveform without requiring a browser or Buffer. */\nexport function decodeWaveform(value: string | undefined): readonly number[] | undefined {\n if (!value || value.length > 344 || !/^(?:[a-z\\d+/]{4})*(?:[a-z\\d+/]{2}(?:==)?|[a-z\\d+/]{3}=?)?$/iu.test(value))\n return undefined;\n const alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n const samples: number[] = [];\n let buffer = 0;\n let bits = 0;\n for (const char of value.replace(/=+$/u, \"\")) {\n buffer = (buffer << 6) | alphabet.indexOf(char);\n bits += 6;\n if (bits >= 8) {\n bits -= 8;\n samples.push(((buffer >> bits) & 255) / 255);\n }\n }\n return samples.length && samples.length <= 256\n ? samples\n : undefined;\n}\n\n/** Match the fill to the center of the shared ten-pixel seek thumb. */\nexport function mediaProgressBackground(currentTime: number, duration: number): string {\n const progress = Number.isFinite(currentTime) && Number.isFinite(duration) && duration > 0\n ? Math.min(1, Math.max(0, currentTime / duration))\n : 0;\n return `calc(${progress * 100}% + ${5 - progress * 10}px) 100%`;\n}\n"],"mappings":";;AACA,SAAgB,gBAAgB,SAAyB;CACvD,MAAM,QAAQ,OAAO,SAAS,OAAO,IACjC,KAAK,IAAI,GAAG,KAAK,MAAM,OAAO,CAAC,IAC/B;CACJ,OAAO,GAAG,KAAK,MAAM,QAAQ,EAAE,EAAE,GAAG,OAAO,QAAQ,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;AACxE;;AAGA,SAAgB,eAAe,OAA0D;CACvF,IAAI,CAAC,SAAS,MAAM,SAAS,OAAO,CAAC,+DAA+D,KAAK,KAAK,GAC5G,OAAO,KAAA;CACT,MAAM,WAAW;CACjB,MAAM,UAAoB,CAAC;CAC3B,IAAI,SAAS;CACb,IAAI,OAAO;CACX,KAAK,MAAM,QAAQ,MAAM,QAAQ,QAAQ,EAAE,GAAG;EAC5C,SAAU,UAAU,IAAK,SAAS,QAAQ,IAAI;EAC9C,QAAQ;EACR,IAAI,QAAQ,GAAG;GACb,QAAQ;GACR,QAAQ,MAAO,UAAU,OAAQ,OAAO,GAAG;EAC7C;CACF;CACA,OAAO,QAAQ,UAAU,QAAQ,UAAU,MACvC,UACA,KAAA;AACN;;AAGA,SAAgB,wBAAwB,aAAqB,UAA0B;CACrF,MAAM,WAAW,OAAO,SAAS,WAAW,KAAK,OAAO,SAAS,QAAQ,KAAK,WAAW,IACrF,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,cAAc,QAAQ,CAAC,IAC/C;CACJ,OAAO,QAAQ,WAAW,IAAI,MAAM,IAAI,WAAW,GAAG;AACxD"}
package/dist/styles.css CHANGED
@@ -88,6 +88,35 @@ display: inline-flex;
88
88
  text-transform: uppercase;
89
89
  }
90
90
 
91
+ .dui-author-tag {
92
+ display: inline-flex;
93
+ align-items: center;
94
+ gap: 3px;
95
+ height: 18px;
96
+ padding: 0 5px;
97
+ border-radius: 4px;
98
+ color: var(--discord-ui-strong);
99
+ background: var(--discord-ui-author-tag-background);
100
+ font-size: 0.75rem;
101
+ font-weight: 600;
102
+ line-height: 1;
103
+ white-space: nowrap;
104
+ }
105
+
106
+ .dui-author-tag-badge {
107
+ flex: 0 0 auto;
108
+ width: 13px;
109
+ height: 13px;
110
+ object-fit: contain;
111
+ }
112
+
113
+ /* The font box sits slightly above the glyphs; nudge the text without moving the badge. */
114
+ .dui-author-tag-text {
115
+ position: relative;
116
+ top: 0.5px;
117
+ line-height: 1;
118
+ }
119
+
91
120
  .dui-timestamp {
92
121
  color: var(--discord-ui-muted);
93
122
  font-size: 0.75rem;
@@ -694,6 +723,9 @@ width: min(100%, 560px);
694
723
  --discord-ui-ephemeral-background: #1E1E29;
695
724
  --discord-ui-ephemeral-hover: #202133;
696
725
  --discord-ui-ephemeral-border: #5865F2;
726
+ --discord-ui-mentioned-background: #2C2520;
727
+ --discord-ui-mentioned-hover: #22201F;
728
+ --discord-ui-mentioned-border: #E99800;
697
729
  --discord-ui-row-hover: #29292E;
698
730
  --discord-ui-reaction-background: var(--discord-ui-surface);
699
731
  --discord-ui-reaction-selected-background: color-mix(in srgb, var(--discord-ui-accent) 18%, var(--discord-ui-background));
@@ -703,6 +735,7 @@ width: min(100%, 560px);
703
735
  --discord-ui-text: #dbdee1;
704
736
  --discord-ui-muted: #949ba4;
705
737
  --discord-ui-strong: #f2f3f5;
738
+ --discord-ui-author-tag-background: #333338;
706
739
  --discord-ui-link: #60b6f7;
707
740
  --discord-ui-accent: #5865f2;
708
741
  --discord-ui-warning: #f0b232;
@@ -741,7 +774,11 @@ width: min(100%, 560px);
741
774
  --discord-ui-background: #323339;
742
775
  --discord-ui-ephemeral-background: #343543;
743
776
  --discord-ui-ephemeral-hover: #35384C;
777
+ --discord-ui-mentioned-background: #423C39;
778
+ --discord-ui-mentioned-hover: #393839;
779
+ --discord-ui-mentioned-border: #FDB529;
744
780
  --discord-ui-row-hover: #3E3F46;
781
+ --discord-ui-author-tag-background: #46464D;
745
782
  --discord-ui-code-background: #343748;
746
783
  --discord-ui-spoiler-hidden: #7D7E86;
747
784
  --discord-ui-quote-border: #595A63;
@@ -763,6 +800,9 @@ width: min(100%, 560px);
763
800
  --discord-ui-background: #FBFBFB;
764
801
  --discord-ui-ephemeral-background: #F3F3FB;
765
802
  --discord-ui-ephemeral-hover: #EAEBF9;
803
+ --discord-ui-mentioned-background: #FBF4EB;
804
+ --discord-ui-mentioned-hover: #FCF0E1;
805
+ --discord-ui-mentioned-border: #945301;
766
806
  --discord-ui-row-hover: #EEEEEF;
767
807
  --discord-ui-reaction-background: #EEEEEF;
768
808
  --discord-ui-reaction-selected-background: #E6EAFF;
@@ -772,6 +812,7 @@ width: min(100%, 560px);
772
812
  --discord-ui-text: #31353b;
773
813
  --discord-ui-muted: #707885;
774
814
  --discord-ui-strong: #1f2329;
815
+ --discord-ui-author-tag-background: #E2E2E4;
775
816
  --discord-ui-link: #0b88c3;
776
817
  --discord-ui-surface: #FFF;
777
818
  --discord-ui-border: #d9dde3;
@@ -803,6 +844,15 @@ width: min(100%, 560px);
803
844
  .dui-avatar { display: inline-flex; height: 40px; border-radius: 50%; overflow: hidden; align-items: center; justify-content: center; background: var(--discord-ui-accent); color: white; font-size: 20px; font-weight: 600; padding-top: 0; }
804
845
  .dui-avatar > span { font-size: inherit; line-height: 1; }
805
846
  .dui-author-name { font-weight: 600; }
847
+ .arcscord-discord-ui .dui-utility-target { border: 0; font-family: inherit; line-height: inherit; text-align: inherit; cursor: pointer; }
848
+ .arcscord-discord-ui button.dui-author-name { padding: 0; background: transparent; color: inherit; font-size: inherit; }
849
+ .arcscord-discord-ui button.dui-mention { font-size: inherit; }
850
+ .arcscord-discord-ui button.dui-avatar { padding: 0; }
851
+ .arcscord-discord-ui .dui-utility-target:focus-visible { outline: 2px solid var(--discord-ui-accent); outline-offset: 2px; }
852
+ .arcscord-discord-ui.dui-message[tabindex]:focus-visible,
853
+ .arcscord-discord-ui .dui-message[tabindex]:focus-visible { outline: 2px solid var(--discord-ui-accent); outline-offset: -2px; }
854
+ .arcscord-discord-ui .dui-thread-open { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 0; padding: 0; background: transparent; color: inherit; font: inherit; text-align: inherit; cursor: pointer; }
855
+ .arcscord-discord-ui .dui-thread-open:focus-visible { outline: 2px solid var(--discord-ui-accent); outline-offset: 2px; }
806
856
  .dui-timestamp { color: var(--discord-ui-muted); font-size: 12px; }
807
857
  .dui-message-text { white-space: pre-wrap; overflow-wrap: anywhere; }
808
858
  .dui-markdown { overflow-wrap: anywhere; white-space: normal; }
@@ -1033,7 +1083,7 @@ button.dui-component-button:disabled { cursor: not-allowed; opacity: .5; }
1033
1083
  .dui-composer-command { padding: 0; align-items: stretch; }
1034
1084
  .dui-composer-command .dui-channel-send { position: absolute; right: 12px; bottom: 14px; }
1035
1085
  .dui-slash-fields, .dui-slash-editor { flex: 1; min-width: 0; }
1036
- .dui-slash-heading { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--discord-ui-channel-header-divider); background: color-mix(in srgb, var(--discord-ui-channel-input-background), var(--discord-ui-text) 3%); border-radius: 8px 8px 0 0; }
1086
+ .dui-slash-heading { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--discord-ui-channel-header-divider); background: color-mix(in srgb, var(--discord-ui-channel-input-background), var(--discord-ui-text) 3%); border-radius: 8px; }
1037
1087
  .dui-slash-heading strong { flex-shrink: 0; }
1038
1088
  .dui-slash-heading > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9em; }
1039
1089
  .dui-slash-heading button { display: grid; place-items: center; flex: 0 0 16px; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%; background: var(--discord-ui-muted); color: var(--discord-ui-channel-input-background); font: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
@@ -1077,3 +1127,88 @@ button.dui-component-button:disabled { cursor: not-allowed; opacity: .5; }
1077
1127
  .dui-file-download svg { flex: 0 0 18px; }
1078
1128
  .dui-file a.dui-file-download:hover { border-color: var(--discord-ui-muted); background: var(--discord-ui-secondary-hover); text-decoration: none; }
1079
1129
  .dui-file-download:focus-visible { outline: 2px solid var(--discord-ui-accent); outline-offset: 2px; }
1130
+
1131
+ /* Shared media players retain native keyboard-operable media and range controls. */
1132
+ .arcscord-discord-ui .dui-player { position: relative; box-sizing: border-box; width: 100%; max-width: 560px; min-width: 0; margin: 8px 0; border: 1px solid var(--discord-ui-border); border-radius: 8px; background: var(--discord-ui-background); color: var(--discord-ui-text); }
1133
+ /* Video chrome stays over the frame instead of extending the gallery tile. */
1134
+ .arcscord-discord-ui .dui-player-video { container-type: inline-size; border: 0; background: transparent; }
1135
+ .arcscord-discord-ui .dui-player-video .dui-player-controls { position: absolute; inset: auto 0 0; z-index: 2; flex-wrap: nowrap; border-radius: 0 0 8px 8px; background: rgb(0 0 0 / 55%); color: white; }
1136
+ .arcscord-discord-ui .dui-player-video .dui-player-controls button, .arcscord-discord-ui .dui-player-video .dui-player-time { color: white; }
1137
+ .arcscord-discord-ui .dui-player-video .dui-player-seek { background-color: rgb(255 255 255 / 35%); }
1138
+ .arcscord-discord-ui .dui-player-video .dui-player-controls[hidden], .arcscord-discord-ui .dui-player-preview-play[hidden] { display: none; }
1139
+ .arcscord-discord-ui .dui-player.dui-player-video > [role="status"] { position: absolute; z-index: 2; top: 8px; left: 8px; max-width: calc(100% - 56px); padding: 4px 8px; border-radius: 4px; background: rgb(0 0 0 / 55%); color: white; }
1140
+ .arcscord-discord-ui .dui-player-preview-play { position: absolute; top: 50%; left: 50%; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; transform: translate(-50%, -50%); border: 0; border-radius: 50%; background: rgb(0 0 0 / 60%); color: white; cursor: pointer; }
1141
+ .arcscord-discord-ui .dui-player-preview-play:hover { background: rgb(0 0 0 / 75%); }
1142
+ .arcscord-discord-ui .dui-player-download { position: absolute; z-index: 3; top: 8px; right: 8px; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid var(--discord-ui-quote-border); border-radius: 5px; background: var(--discord-ui-surface); color: var(--discord-ui-text); opacity: 0; pointer-events: none; }
1143
+ .arcscord-discord-ui .dui-player-download .dui-player-icon { width: 18px; height: 18px; }
1144
+ .arcscord-discord-ui .dui-player:hover > .dui-player-download, .arcscord-discord-ui .dui-player:focus-within > .dui-player-download { opacity: 1; pointer-events: auto; }
1145
+ .arcscord-discord-ui .dui-player-video .dui-player-download { border-color: transparent; background: rgb(0 0 0 / 60%); color: white; }
1146
+ @media (hover: none) { .arcscord-discord-ui .dui-player > .dui-player-download { opacity: 1; pointer-events: auto; } }
1147
+ @container (max-width: 240px) {
1148
+ .arcscord-discord-ui .dui-player-video .dui-player-controls { flex-wrap: wrap; gap: 4px; padding: 4px 6px; }
1149
+ .arcscord-discord-ui .dui-player-video .dui-player-timeline { order: 1; flex-basis: 100%; height: 10px; }
1150
+ .arcscord-discord-ui .dui-player-video .dui-player-controls button { min-width: 20px; min-height: 20px; }
1151
+ .arcscord-discord-ui .dui-player-video .dui-player-controls .dui-player-icon { width: 20px; height: 20px; }
1152
+ .arcscord-discord-ui .dui-player-video .dui-player-time { font-size: 10px; }
1153
+ }
1154
+ .arcscord-discord-ui .dui-player video { display: block; width: 100%; max-height: 420px; height: auto; object-fit: contain; background: var(--discord-ui-background); border-radius: 8px; }
1155
+ .arcscord-discord-ui .dui-player audio { display: none; }
1156
+ .arcscord-discord-ui .dui-player-audio { max-width: 432px; padding: 16px; }
1157
+ .arcscord-discord-ui .dui-player-file-header { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 12px; padding-right: 24px; }
1158
+ .arcscord-discord-ui .dui-player-title { display: flex; flex-direction: column; min-width: 0; font-size: 16px; line-height: 1.25; }
1159
+ .arcscord-discord-ui .dui-player-title .dui-player-name { color: var(--discord-ui-link); overflow-wrap: anywhere; text-decoration: none; }
1160
+ .arcscord-discord-ui .dui-player-title a:hover { text-decoration: underline; }
1161
+ .arcscord-discord-ui .dui-player-size { color: var(--discord-ui-muted); font-size: 12px; }
1162
+ .arcscord-discord-ui .dui-player-controls { display: flex; align-items: center; gap: 8px; padding: 6px 8px; min-width: 0; border-radius: 8px; background: light-dark(var(--discord-ui-surface), color-mix(in srgb, var(--discord-ui-background) 65%, black)); }
1163
+ .arcscord-discord-ui .dui-player-controls button, .arcscord-discord-ui .dui-player-controls a { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 24px; min-height: 24px; padding: 0; box-sizing: border-box; border: 0; border-radius: 4px; background: transparent; color: var(--discord-ui-text); font: inherit; font-size: 14px; line-height: 20px; text-decoration: none; cursor: pointer; }
1164
+ .arcscord-discord-ui .dui-player-controls button:hover, .arcscord-discord-ui .dui-player-controls a:hover { color: var(--discord-ui-strong); }
1165
+ .arcscord-discord-ui .dui-player :focus-visible { outline: 2px solid var(--discord-ui-accent); outline-offset: 3px; }
1166
+ .arcscord-discord-ui .dui-player-controls input { display: block; padding: 0; margin: 0; accent-color: var(--discord-ui-accent); cursor: pointer; }
1167
+ .arcscord-discord-ui .dui-player-controls input:disabled { cursor: default; }
1168
+ .arcscord-discord-ui .dui-player-timeline { position: relative; display: flex; align-items: center; flex: 1 1 70px; min-width: 20px; height: 24px; }
1169
+ .arcscord-discord-ui .dui-player-seek { appearance: none; width: 100%; min-width: 0; height: 6px; border: 0; border-radius: 4px; background: linear-gradient(var(--discord-ui-accent), var(--discord-ui-accent)) left / 0% 100% no-repeat color-mix(in srgb, var(--discord-ui-muted) 45%, transparent); }
1170
+ .arcscord-discord-ui .dui-player-seek::-webkit-slider-runnable-track { height: 6px; background: transparent; }
1171
+ .arcscord-discord-ui .dui-player-seek::-webkit-slider-thumb { appearance: none; margin-top: -2px; width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--discord-ui-accent); }
1172
+ .arcscord-discord-ui .dui-player-seek::-moz-range-thumb { width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--discord-ui-accent); }
1173
+ .arcscord-discord-ui .dui-player-time { flex-shrink: 0; color: var(--discord-ui-strong); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
1174
+ .arcscord-discord-ui .dui-player > [role="status"] { padding: 8px 0; font-size: 12px; color: var(--discord-ui-muted); }
1175
+ .arcscord-discord-ui .dui-player-volume-control { position: relative; display: flex; flex: 0 0 auto; }
1176
+ .arcscord-discord-ui .dui-player-volume-popover { position: absolute; z-index: 5; bottom: calc(100% + 6px); left: 50%; display: flex; align-items: center; justify-content: center; width: 28px; height: 100px; box-sizing: border-box; padding: 10px; border-radius: 14px; background: light-dark(var(--discord-ui-surface), color-mix(in srgb, var(--discord-ui-background) 65%, black)); transform: translateX(-50%); opacity: 0; visibility: hidden; pointer-events: none; }
1177
+ .arcscord-discord-ui .dui-player-volume-popover::after { content: ""; position: absolute; top: 100%; left: 0; width: 100%; height: 8px; }
1178
+ .arcscord-discord-ui .dui-player-volume-control[data-open="true"] .dui-player-volume-popover { opacity: 1; visibility: visible; pointer-events: auto; }
1179
+ .arcscord-discord-ui .dui-player-controls .dui-player-volume { appearance: none; writing-mode: vertical-lr; direction: rtl; width: 6px; height: 80px; border: 0; border-radius: 4px; background: linear-gradient(var(--discord-ui-accent), var(--discord-ui-accent)) bottom / 100% 100% no-repeat color-mix(in srgb, var(--discord-ui-muted) 45%, transparent); }
1180
+ .arcscord-discord-ui .dui-player-volume::-webkit-slider-thumb { appearance: none; width: 6px; height: 6px; border: 0; border-radius: 50%; background: var(--discord-ui-accent); }
1181
+ .arcscord-discord-ui .dui-player-volume::-moz-range-thumb { width: 6px; height: 6px; border: 0; border-radius: 50%; background: var(--discord-ui-accent); }
1182
+ .arcscord-discord-ui .dui-player-voice { width: max-content; max-width: 100%; padding: 7px; border-radius: 999px; background: var(--discord-ui-surface); }
1183
+ .arcscord-discord-ui .dui-player-voice .dui-player-controls { gap: 10px; padding: 0; background: transparent; }
1184
+ .arcscord-discord-ui .dui-player-voice .dui-player-play { width: 32px; height: 32px; border-radius: 50%; background: var(--discord-ui-accent); color: white; }
1185
+ .arcscord-discord-ui .dui-player-voice .dui-player-play .dui-player-icon { width: 18px; height: 18px; }
1186
+ .arcscord-discord-ui .dui-player-voice .dui-player-timeline { width: 64px; flex: 0 1 64px; min-width: 20px; }
1187
+ .arcscord-discord-ui .dui-player-voice .dui-player-time { color: var(--discord-ui-muted); font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; }
1188
+ .arcscord-discord-ui .dui-player-voice .dui-player-speed { min-width: 32px; min-height: 18px; padding: 0 4px; border-radius: 4px; background: var(--discord-ui-secondary-hover); color: var(--discord-ui-muted); font-size: 12px; font-weight: 700; line-height: 18px; }
1189
+ .arcscord-discord-ui .dui-waveform { display: flex; align-items: center; gap: 0; width: 100%; height: 20px; overflow: hidden; }
1190
+ .arcscord-discord-ui .dui-waveform-bar { flex: 1 1 0; min-width: 0; max-width: 6px; clip-path: inset(0 25% round 2px); border-radius: 2px; background: var(--discord-ui-muted); }
1191
+ .arcscord-discord-ui .dui-waveform-bar[data-played="true"] { background: var(--discord-ui-strong); }
1192
+ .arcscord-discord-ui .dui-player-timeline-waveform .dui-player-seek { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
1193
+ .arcscord-discord-ui .dui-player-timeline-waveform:focus-within { outline: 2px solid var(--discord-ui-accent); outline-offset: 3px; border-radius: 3px; }
1194
+ .arcscord-discord-ui .dui-player:fullscreen { display: flex; flex-direction: column; justify-content: center; max-width: none; margin: 0; border: 0; border-radius: 0; }
1195
+ .arcscord-discord-ui .dui-player:fullscreen video { max-height: calc(100vh - 72px); flex: 1; min-height: 0; }
1196
+ .arcscord-discord-ui .dui-player-icon { display: block; width: 24px; height: 24px; background: currentColor; mask-position: center; mask-size: contain; mask-repeat: no-repeat; }
1197
+ .arcscord-discord-ui .dui-player-file-icon { position: relative; flex: 0 0 24px; width: 24px; height: 32px; border-radius: 2px; clip-path: polygon(0 0, 66% 0, 100% 25%, 100% 100%, 0 100%); background: color-mix(in srgb, var(--discord-ui-accent) 25%, var(--discord-ui-strong)); }
1198
+ .arcscord-discord-ui .dui-player-file-icon::before { content: ""; position: absolute; top: 0; right: 0; width: 34%; height: 25%; border-radius: 0 0 0 2px; background: color-mix(in srgb, var(--discord-ui-accent) 55%, var(--discord-ui-strong)); }
1199
+ .arcscord-discord-ui .dui-player-file-icon::after { content: ""; position: absolute; bottom: 4px; left: 3px; width: 18px; height: 18px; background: var(--discord-ui-accent); mask-size: contain; mask-position: center; mask-repeat: no-repeat; }
1200
+ .arcscord-discord-ui .dui-player-icon-play { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M7%204.8c0-1%201.1-1.6%202-1.1l12%207.2a1.3%201.3%200%200%201%200%202.2L9%2020.3c-.9.5-2-.1-2-1.1Z%22%2F%3E%3C%2Fsvg%3E"); }
1201
+ .arcscord-discord-ui .dui-player-icon-pause { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M6%204h4v16H6zm8%200h4v16h-4z%22%2F%3E%3C%2Fsvg%3E"); }
1202
+ .arcscord-discord-ui .dui-player-icon-replay { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M12%205a7%207%200%201%201-6.4%204.2L3.8%208.4A9%209%200%201%200%2012%203V0L7%204l5%204Z%22%2F%3E%3C%2Fsvg%3E"); }
1203
+ .arcscord-discord-ui .dui-player-icon-speaker { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M2%209v6h4l6%205V4L6%209Z%22%2F%3E%3Cpath%20d%3D%22M15%208a5%205%200%200%201%200%208m3-11a9%209%200%200%201%200%2014%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E"); }
1204
+ .arcscord-discord-ui .dui-player-file-icon::after { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M2%209v6h4l6%205V4L6%209Z%22%2F%3E%3Cpath%20d%3D%22M15%208a5%205%200%200%201%200%208m3-11a9%209%200%200%201%200%2014%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E"); }
1205
+ .arcscord-discord-ui .dui-player-icon-speaker-muted { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M2%209v6h4l6%205V4L6%209Z%22%2F%3E%3Cpath%20d%3D%22m16%209%206%206m0-6-6%206%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E"); }
1206
+ .arcscord-discord-ui .dui-player-icon-fullscreen { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M3%209V3h6m6%200h6v6m0%206v6h-6m-6%200H3v-6%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%2F%3E%3C%2Fsvg%3E"); }
1207
+ .arcscord-discord-ui .dui-player-icon-exit-fullscreen { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M3%209h6V3m6%200v6h6m0%206h-6v6m-6%200v-6H3%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%2F%3E%3C%2Fsvg%3E"); }
1208
+ .arcscord-discord-ui .dui-player-icon-download { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M12%203v12m-5-5%205%205%205-5M4%2017v4h16v-4%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E"); }
1209
+ .arcscord-discord-ui .dui-sticker { display: flex; width: 160px; max-width: 100%; min-height: 80px; margin: 8px 0; }
1210
+ .arcscord-discord-ui .dui-sticker img { display: block; width: 100%; height: 160px; max-width: 100%; object-fit: contain; }
1211
+
1212
+ /* Ephemeral visibility takes precedence when the host supplies both hints. */
1213
+ .dui-message[data-mentioned]:not([data-ephemeral]) { background: var(--discord-ui-mentioned-background); border-left: 2px solid var(--discord-ui-mentioned-border); padding-left: 14px; }
1214
+ .dui-message[data-mentioned]:not([data-ephemeral]):hover, .dui-message[data-mentioned]:not([data-ephemeral]):focus-within { background: var(--discord-ui-mentioned-hover); }
@@ -10,6 +10,9 @@ declare const themeTokenProperties: {
10
10
  readonly ephemeralBackground: "--discord-ui-ephemeral-background";
11
11
  readonly ephemeralHover: "--discord-ui-ephemeral-hover";
12
12
  readonly ephemeralBorder: "--discord-ui-ephemeral-border";
13
+ readonly mentionedBackground: "--discord-ui-mentioned-background";
14
+ readonly mentionedHover: "--discord-ui-mentioned-hover";
15
+ readonly mentionedBorder: "--discord-ui-mentioned-border";
13
16
  readonly focusBackground: "--discord-ui-row-hover";
14
17
  readonly codeBackground: "--discord-ui-code-background";
15
18
  readonly spoilerBackground: "--discord-ui-spoiler-hidden";
@@ -17,6 +20,7 @@ declare const themeTokenProperties: {
17
20
  readonly text: "--discord-ui-text";
18
21
  readonly muted: "--discord-ui-muted";
19
22
  readonly strong: "--discord-ui-strong";
23
+ readonly authorTagBackground: "--discord-ui-author-tag-background";
20
24
  readonly link: "--discord-ui-link";
21
25
  readonly accent: "--discord-ui-accent";
22
26
  readonly warning: "--discord-ui-warning";
@@ -87,5 +91,4 @@ declare function defineTheme({ name, extends: parent, tokens, colorScheme }: {
87
91
  declare function resolveTheme(theme: ThemeInput, overrides?: ThemeOverrides): DiscordTheme;
88
92
  type ThemeStyle = Partial<Record<(typeof themeTokenProperties)[keyof typeof themeTokenProperties], string>>;
89
93
  declare function themeStyle(tokens: Readonly<ThemeOverrides>): ThemeStyle;
90
- export { ThemeStyle as a, resolveTheme as c, themes as d, ThemeOverrides as i, themeStyle as l, ThemeInput as n, ThemeTokens as o, ThemeName as r, defineTheme as s, DiscordTheme as t, themeTokenProperties as u };
91
- //# sourceMappingURL=themes-yWxS4t7J.d.mts.map
94
+ export { ThemeStyle as a, resolveTheme as c, themes as d, ThemeOverrides as i, themeStyle as l, ThemeInput as n, ThemeTokens as o, ThemeName as r, defineTheme as s, DiscordTheme as t, themeTokenProperties as u };
package/dist/themes.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as ThemeStyle, c as resolveTheme, d as themes, i as ThemeOverrides, l as themeStyle, n as ThemeInput, o as ThemeTokens, r as ThemeName, s as defineTheme, t as DiscordTheme, u as themeTokenProperties } from "./themes-yWxS4t7J.mjs";
1
+ import { a as ThemeStyle, c as resolveTheme, d as themes, i as ThemeOverrides, l as themeStyle, n as ThemeInput, o as ThemeTokens, r as ThemeName, s as defineTheme, t as DiscordTheme, u as themeTokenProperties } from "./themes-DjBcMvDf.mjs";
2
2
  export { DiscordTheme, ThemeInput, ThemeName, ThemeOverrides, ThemeStyle, ThemeTokens, defineTheme, resolveTheme, themeStyle, themeTokenProperties, themes };
package/dist/themes.mjs CHANGED
@@ -11,6 +11,9 @@ const themeTokenProperties = {
11
11
  ephemeralBackground: "--discord-ui-ephemeral-background",
12
12
  ephemeralHover: "--discord-ui-ephemeral-hover",
13
13
  ephemeralBorder: "--discord-ui-ephemeral-border",
14
+ mentionedBackground: "--discord-ui-mentioned-background",
15
+ mentionedHover: "--discord-ui-mentioned-hover",
16
+ mentionedBorder: "--discord-ui-mentioned-border",
14
17
  focusBackground: "--discord-ui-row-hover",
15
18
  codeBackground: "--discord-ui-code-background",
16
19
  spoilerBackground: "--discord-ui-spoiler-hidden",
@@ -18,6 +21,7 @@ const themeTokenProperties = {
18
21
  text: "--discord-ui-text",
19
22
  muted: "--discord-ui-muted",
20
23
  strong: "--discord-ui-strong",
24
+ authorTagBackground: "--discord-ui-author-tag-background",
21
25
  link: "--discord-ui-link",
22
26
  accent: "--discord-ui-accent",
23
27
  warning: "--discord-ui-warning",
@@ -1 +1 @@
1
- {"version":3,"file":"themes.mjs","names":[],"sources":["../src/themes.ts"],"sourcesContent":["/** Typed public tokens mapped to the CSS variables consumed by every primitive. */\nexport const themeTokenProperties = {\n selectChipBackground: \"--discord-ui-select-chip-background\",\n selectBackground: \"--discord-ui-select-background\",\n selectMenuBackground: \"--discord-ui-select-menu-background\",\n selectMuted: \"--discord-ui-select-muted\",\n channelHeaderDivider: \"--discord-ui-channel-header-divider\",\n channelInputBackground: \"--discord-ui-channel-input-background\",\n background: \"--discord-ui-background\",\n ephemeralBackground: \"--discord-ui-ephemeral-background\",\n ephemeralHover: \"--discord-ui-ephemeral-hover\",\n ephemeralBorder: \"--discord-ui-ephemeral-border\",\n focusBackground: \"--discord-ui-row-hover\",\n codeBackground: \"--discord-ui-code-background\",\n spoilerBackground: \"--discord-ui-spoiler-hidden\",\n quoteBorder: \"--discord-ui-quote-border\",\n text: \"--discord-ui-text\",\n muted: \"--discord-ui-muted\",\n strong: \"--discord-ui-strong\",\n link: \"--discord-ui-link\",\n accent: \"--discord-ui-accent\",\n warning: \"--discord-ui-warning\",\n border: \"--discord-ui-border\",\n surface: \"--discord-ui-surface\",\n embedBorder: \"--discord-ui-embed-border\",\n embedAccent: \"--discord-ui-embed-accent\",\n containerSurface: \"--discord-ui-container-surface\",\n containerOutline: \"--discord-ui-container-outline\",\n linkButtonBackground: \"--discord-ui-link-button-background\",\n linkButtonDisabledBackground: \"--discord-ui-link-button-disabled-background\",\n linkButtonText: \"--discord-ui-link-button-text\",\n linkButtonDisabledText: \"--discord-ui-link-button-disabled-text\",\n secondaryBackground: \"--discord-ui-secondary-bg\",\n secondaryHover: \"--discord-ui-secondary-hover\",\n secondaryActive: \"--discord-ui-secondary-active\",\n secondaryBorder: \"--discord-ui-secondary-border\",\n spoilerHover: \"--discord-ui-spoiler-hover\",\n spoilerRevealed: \"--discord-ui-spoiler-revealed\",\n mentionColor: \"--discord-ui-mention-color\",\n mentionBackground: \"--discord-ui-mention-fill\",\n mentionHover: \"--discord-ui-mention-fill-hover\",\n divider: \"--discord-ui-divider\",\n codeKeyword: \"--discord-ui-code-keyword\",\n codeString: \"--discord-ui-code-string\",\n codeNumber: \"--discord-ui-code-number\",\n codeTitle: \"--discord-ui-code-title\",\n codeComment: \"--discord-ui-code-comment\",\n} as const;\n\nexport type ThemeTokens = { [Key in keyof typeof themeTokenProperties]: string };\nexport type ThemeOverrides = Partial<ThemeTokens>;\nexport type DiscordTheme = {\n readonly name: string;\n readonly base: string;\n readonly colorScheme: \"light\" | \"dark\";\n readonly tokens: Readonly<ThemeOverrides>;\n};\n\n/** Preset colors live in styles/themes.css; no JS/CSS palette duplication. */\nexport const themes = {\n light: {\n name: \"light\",\n base: \"light\",\n colorScheme: \"light\",\n tokens: {},\n },\n ash: {\n name: \"ash\",\n base: \"ash\",\n colorScheme: \"dark\",\n tokens: {},\n },\n dark: {\n name: \"dark\",\n base: \"dark\",\n colorScheme: \"dark\",\n tokens: {},\n },\n} as const satisfies Record<string, DiscordTheme>;\n\nexport type ThemeName = keyof typeof themes;\nexport type ThemeInput = ThemeName | DiscordTheme;\n\n/** Extend a preset or another custom theme without registering global state. */\nexport function defineTheme({ name, extends: parent = \"dark\", tokens = {}, colorScheme }: {\n name: string;\n extends?: ThemeInput;\n tokens?: ThemeOverrides;\n colorScheme?: \"light\" | \"dark\";\n}): DiscordTheme {\n const base = typeof parent === \"string\"\n ? themes[parent]\n : parent;\n return {\n name,\n base: base.base,\n colorScheme: colorScheme ?? base.colorScheme,\n tokens: {\n ...base.tokens,\n ...tokens,\n },\n };\n}\n\nexport function resolveTheme(theme: ThemeInput, overrides: ThemeOverrides = {}): DiscordTheme {\n const base = typeof theme === \"string\"\n ? themes[theme]\n : theme;\n return {\n ...base,\n tokens: {\n ...base.tokens,\n ...overrides,\n },\n };\n}\n\nexport type ThemeStyle = Partial<Record<(typeof themeTokenProperties)[keyof typeof themeTokenProperties], string>>;\n\nexport function themeStyle(tokens: Readonly<ThemeOverrides>): ThemeStyle {\n return Object.fromEntries(Object.entries(tokens).map(([key, value]) => [themeTokenProperties[key as keyof ThemeTokens], value])) as ThemeStyle;\n}\n"],"mappings":";;AACA,MAAa,uBAAuB;CAClC,sBAAsB;CACtB,kBAAkB;CAClB,sBAAsB;CACtB,aAAa;CACb,sBAAsB;CACtB,wBAAwB;CACxB,YAAY;CACZ,qBAAqB;CACrB,gBAAgB;CAChB,iBAAiB;CACjB,iBAAiB;CACjB,gBAAgB;CAChB,mBAAmB;CACnB,aAAa;CACb,MAAM;CACN,OAAO;CACP,QAAQ;CACR,MAAM;CACN,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,SAAS;CACT,aAAa;CACb,aAAa;CACb,kBAAkB;CAClB,kBAAkB;CAClB,sBAAsB;CACtB,8BAA8B;CAC9B,gBAAgB;CAChB,wBAAwB;CACxB,qBAAqB;CACrB,gBAAgB;CAChB,iBAAiB;CACjB,iBAAiB;CACjB,cAAc;CACd,iBAAiB;CACjB,cAAc;CACd,mBAAmB;CACnB,cAAc;CACd,SAAS;CACT,aAAa;CACb,YAAY;CACZ,YAAY;CACZ,WAAW;CACX,aAAa;AACf;;AAYA,MAAa,SAAS;CACpB,OAAO;EACL,MAAM;EACN,MAAM;EACN,aAAa;EACb,QAAQ,CAAC;CACX;CACA,KAAK;EACH,MAAM;EACN,MAAM;EACN,aAAa;EACb,QAAQ,CAAC;CACX;CACA,MAAM;EACJ,MAAM;EACN,MAAM;EACN,aAAa;EACb,QAAQ,CAAC;CACX;AACF;;AAMA,SAAgB,YAAY,EAAE,MAAM,SAAS,SAAS,QAAQ,SAAS,CAAC,GAAG,eAK1D;CACf,MAAM,OAAO,OAAO,WAAW,WAC3B,OAAO,UACP;CACJ,OAAO;EACL;EACA,MAAM,KAAK;EACX,aAAa,eAAe,KAAK;EACjC,QAAQ;GACN,GAAG,KAAK;GACR,GAAG;EACL;CACF;AACF;AAEA,SAAgB,aAAa,OAAmB,YAA4B,CAAC,GAAiB;CAC5F,MAAM,OAAO,OAAO,UAAU,WAC1B,OAAO,SACP;CACJ,OAAO;EACL,GAAG;EACH,QAAQ;GACN,GAAG,KAAK;GACR,GAAG;EACL;CACF;AACF;AAIA,SAAgB,WAAW,QAA8C;CACvE,OAAO,OAAO,YAAY,OAAO,QAAQ,MAAM,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,qBAAqB,MAA2B,KAAK,CAAC,CAAC;AACjI"}
1
+ {"version":3,"file":"themes.mjs","names":[],"sources":["../src/themes.ts"],"sourcesContent":["/** Typed public tokens mapped to the CSS variables consumed by every primitive. */\nexport const themeTokenProperties = {\n selectChipBackground: \"--discord-ui-select-chip-background\",\n selectBackground: \"--discord-ui-select-background\",\n selectMenuBackground: \"--discord-ui-select-menu-background\",\n selectMuted: \"--discord-ui-select-muted\",\n channelHeaderDivider: \"--discord-ui-channel-header-divider\",\n channelInputBackground: \"--discord-ui-channel-input-background\",\n background: \"--discord-ui-background\",\n ephemeralBackground: \"--discord-ui-ephemeral-background\",\n ephemeralHover: \"--discord-ui-ephemeral-hover\",\n ephemeralBorder: \"--discord-ui-ephemeral-border\",\n mentionedBackground: \"--discord-ui-mentioned-background\",\n mentionedHover: \"--discord-ui-mentioned-hover\",\n mentionedBorder: \"--discord-ui-mentioned-border\",\n focusBackground: \"--discord-ui-row-hover\",\n codeBackground: \"--discord-ui-code-background\",\n spoilerBackground: \"--discord-ui-spoiler-hidden\",\n quoteBorder: \"--discord-ui-quote-border\",\n text: \"--discord-ui-text\",\n muted: \"--discord-ui-muted\",\n strong: \"--discord-ui-strong\",\n authorTagBackground: \"--discord-ui-author-tag-background\",\n link: \"--discord-ui-link\",\n accent: \"--discord-ui-accent\",\n warning: \"--discord-ui-warning\",\n border: \"--discord-ui-border\",\n surface: \"--discord-ui-surface\",\n embedBorder: \"--discord-ui-embed-border\",\n embedAccent: \"--discord-ui-embed-accent\",\n containerSurface: \"--discord-ui-container-surface\",\n containerOutline: \"--discord-ui-container-outline\",\n linkButtonBackground: \"--discord-ui-link-button-background\",\n linkButtonDisabledBackground: \"--discord-ui-link-button-disabled-background\",\n linkButtonText: \"--discord-ui-link-button-text\",\n linkButtonDisabledText: \"--discord-ui-link-button-disabled-text\",\n secondaryBackground: \"--discord-ui-secondary-bg\",\n secondaryHover: \"--discord-ui-secondary-hover\",\n secondaryActive: \"--discord-ui-secondary-active\",\n secondaryBorder: \"--discord-ui-secondary-border\",\n spoilerHover: \"--discord-ui-spoiler-hover\",\n spoilerRevealed: \"--discord-ui-spoiler-revealed\",\n mentionColor: \"--discord-ui-mention-color\",\n mentionBackground: \"--discord-ui-mention-fill\",\n mentionHover: \"--discord-ui-mention-fill-hover\",\n divider: \"--discord-ui-divider\",\n codeKeyword: \"--discord-ui-code-keyword\",\n codeString: \"--discord-ui-code-string\",\n codeNumber: \"--discord-ui-code-number\",\n codeTitle: \"--discord-ui-code-title\",\n codeComment: \"--discord-ui-code-comment\",\n} as const;\n\nexport type ThemeTokens = { [Key in keyof typeof themeTokenProperties]: string };\nexport type ThemeOverrides = Partial<ThemeTokens>;\nexport type DiscordTheme = {\n readonly name: string;\n readonly base: string;\n readonly colorScheme: \"light\" | \"dark\";\n readonly tokens: Readonly<ThemeOverrides>;\n};\n\n/** Preset colors live in styles/themes.css; no JS/CSS palette duplication. */\nexport const themes = {\n light: {\n name: \"light\",\n base: \"light\",\n colorScheme: \"light\",\n tokens: {},\n },\n ash: {\n name: \"ash\",\n base: \"ash\",\n colorScheme: \"dark\",\n tokens: {},\n },\n dark: {\n name: \"dark\",\n base: \"dark\",\n colorScheme: \"dark\",\n tokens: {},\n },\n} as const satisfies Record<string, DiscordTheme>;\n\nexport type ThemeName = keyof typeof themes;\nexport type ThemeInput = ThemeName | DiscordTheme;\n\n/** Extend a preset or another custom theme without registering global state. */\nexport function defineTheme({ name, extends: parent = \"dark\", tokens = {}, colorScheme }: {\n name: string;\n extends?: ThemeInput;\n tokens?: ThemeOverrides;\n colorScheme?: \"light\" | \"dark\";\n}): DiscordTheme {\n const base = typeof parent === \"string\"\n ? themes[parent]\n : parent;\n return {\n name,\n base: base.base,\n colorScheme: colorScheme ?? base.colorScheme,\n tokens: {\n ...base.tokens,\n ...tokens,\n },\n };\n}\n\nexport function resolveTheme(theme: ThemeInput, overrides: ThemeOverrides = {}): DiscordTheme {\n const base = typeof theme === \"string\"\n ? themes[theme]\n : theme;\n return {\n ...base,\n tokens: {\n ...base.tokens,\n ...overrides,\n },\n };\n}\n\nexport type ThemeStyle = Partial<Record<(typeof themeTokenProperties)[keyof typeof themeTokenProperties], string>>;\n\nexport function themeStyle(tokens: Readonly<ThemeOverrides>): ThemeStyle {\n return Object.fromEntries(Object.entries(tokens).map(([key, value]) => [themeTokenProperties[key as keyof ThemeTokens], value])) as ThemeStyle;\n}\n"],"mappings":";;AACA,MAAa,uBAAuB;CAClC,sBAAsB;CACtB,kBAAkB;CAClB,sBAAsB;CACtB,aAAa;CACb,sBAAsB;CACtB,wBAAwB;CACxB,YAAY;CACZ,qBAA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