transcriptify 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +78 -0
  3. package/dist/src/generateHtml.d.ts +3 -0
  4. package/dist/src/generateHtml.js +303 -0
  5. package/dist/src/index.d.ts +5 -0
  6. package/dist/src/index.js +252 -0
  7. package/dist/src/transcript.d.ts +12 -0
  8. package/dist/src/transcript.js +179 -0
  9. package/dist/src/types/entities.d.ts +30 -0
  10. package/dist/src/types/entities.js +2 -0
  11. package/dist/src/utils/assetManager.d.ts +12 -0
  12. package/dist/src/utils/assetManager.js +295 -0
  13. package/dist/src/utils/authors.d.ts +4 -0
  14. package/dist/src/utils/authors.js +115 -0
  15. package/dist/src/utils/cache.d.ts +16 -0
  16. package/dist/src/utils/cache.js +29 -0
  17. package/dist/src/utils/extractors.d.ts +112 -0
  18. package/dist/src/utils/extractors.js +223 -0
  19. package/dist/src/utils/polls.d.ts +2 -0
  20. package/dist/src/utils/polls.js +91 -0
  21. package/dist/src/utils/transformer.d.ts +6 -0
  22. package/dist/src/utils/transformer.js +78 -0
  23. package/dist/src/utils/user.d.ts +4 -0
  24. package/dist/src/utils/user.js +56 -0
  25. package/dist/src/web/client.d.ts +20 -0
  26. package/dist/src/web/client.js +21 -0
  27. package/dist/src/web/discord-components/AudioPlayer.d.ts +5 -0
  28. package/dist/src/web/discord-components/AudioPlayer.js +231 -0
  29. package/dist/src/web/discord-components/Button.d.ts +3 -0
  30. package/dist/src/web/discord-components/Button.js +27 -0
  31. package/dist/src/web/discord-components/ChannelPinnedMessage.d.ts +7 -0
  32. package/dist/src/web/discord-components/ChannelPinnedMessage.js +11 -0
  33. package/dist/src/web/discord-components/DateSeperator.d.ts +3 -0
  34. package/dist/src/web/discord-components/DateSeperator.js +19 -0
  35. package/dist/src/web/discord-components/Embed.d.ts +2 -0
  36. package/dist/src/web/discord-components/Embed.js +78 -0
  37. package/dist/src/web/discord-components/ForwardedMessage.d.ts +2 -0
  38. package/dist/src/web/discord-components/ForwardedMessage.js +44 -0
  39. package/dist/src/web/discord-components/Message.d.ts +2 -0
  40. package/dist/src/web/discord-components/Message.js +543 -0
  41. package/dist/src/web/discord-components/PinnedMessagesModal.d.ts +6 -0
  42. package/dist/src/web/discord-components/PinnedMessagesModal.js +119 -0
  43. package/dist/src/web/discord-components/PinnedMessagesOverview.d.ts +5 -0
  44. package/dist/src/web/discord-components/PinnedMessagesOverview.js +22 -0
  45. package/dist/src/web/discord-components/Reply.d.ts +2 -0
  46. package/dist/src/web/discord-components/Reply.js +42 -0
  47. package/dist/src/web/discord-components/StickerPreview.d.ts +6 -0
  48. package/dist/src/web/discord-components/StickerPreview.js +40 -0
  49. package/dist/src/web/discord-components/ThemeSwitcher.d.ts +2 -0
  50. package/dist/src/web/discord-components/ThemeSwitcher.js +54 -0
  51. package/dist/src/web/discord-components/Transcript.d.ts +2 -0
  52. package/dist/src/web/discord-components/Transcript.js +174 -0
  53. package/dist/src/web/discord-components/UserJoinMessage.d.ts +3 -0
  54. package/dist/src/web/discord-components/UserJoinMessage.js +33 -0
  55. package/dist/src/web/discord-components/VideoPlayer.d.ts +6 -0
  56. package/dist/src/web/discord-components/VideoPlayer.js +222 -0
  57. package/dist/src/web/discord-components/icons/ChevronDownIcon.d.ts +1 -0
  58. package/dist/src/web/discord-components/icons/ChevronDownIcon.js +7 -0
  59. package/dist/src/web/discord-components/icons/CloseIcon.d.ts +1 -0
  60. package/dist/src/web/discord-components/icons/CloseIcon.js +7 -0
  61. package/dist/src/web/discord-components/icons/ExternalLinkIcon.d.ts +1 -0
  62. package/dist/src/web/discord-components/icons/ExternalLinkIcon.js +7 -0
  63. package/dist/src/web/discord-components/icons/FileAudioIcon.d.ts +1 -0
  64. package/dist/src/web/discord-components/icons/FileAudioIcon.js +7 -0
  65. package/dist/src/web/discord-components/icons/FileCodeIcon.d.ts +1 -0
  66. package/dist/src/web/discord-components/icons/FileCodeIcon.js +7 -0
  67. package/dist/src/web/discord-components/icons/FileDocumentIcon.d.ts +1 -0
  68. package/dist/src/web/discord-components/icons/FileDocumentIcon.js +7 -0
  69. package/dist/src/web/discord-components/icons/PinIcon.d.ts +1 -0
  70. package/dist/src/web/discord-components/icons/PinIcon.js +7 -0
  71. package/dist/src/web/discord-components/icons/VerifiedIcon.d.ts +1 -0
  72. package/dist/src/web/discord-components/icons/VerifiedIcon.js +7 -0
  73. package/dist/src/web/discord-components/index.d.ts +11 -0
  74. package/dist/src/web/discord-components/index.js +24 -0
  75. package/dist/src/web/discord-components/messageHelpers.d.ts +8 -0
  76. package/dist/src/web/discord-components/messageHelpers.js +72 -0
  77. package/dist/src/web/discord-components/themeColors.d.ts +9 -0
  78. package/dist/src/web/discord-components/themeColors.js +320 -0
  79. package/dist/src/web/discord-components/transcriptHelpers.d.ts +19 -0
  80. package/dist/src/web/discord-components/transcriptHelpers.js +120 -0
  81. package/dist/src/web/discord-components/types.d.ts +1 -0
  82. package/dist/src/web/discord-components/types.js +2 -0
  83. package/dist/src/web/discord-components/utils/date.d.ts +3 -0
  84. package/dist/src/web/discord-components/utils/date.js +50 -0
  85. package/dist/src/web/discord-components/utils/markdown.d.ts +11 -0
  86. package/dist/src/web/discord-components/utils/markdown.js +538 -0
  87. package/dist/src/web/discord-components/utils/markdownUtils.d.ts +12 -0
  88. package/dist/src/web/discord-components/utils/markdownUtils.js +140 -0
  89. package/dist/src/web/helpers/avatarHelpers.d.ts +2 -0
  90. package/dist/src/web/helpers/avatarHelpers.js +15 -0
  91. package/dist/src/web/helpers/cdnHelpers.d.ts +5 -0
  92. package/dist/src/web/helpers/cdnHelpers.js +48 -0
  93. package/dist/src/web/helpers/contentHelpers.d.ts +9 -0
  94. package/dist/src/web/helpers/contentHelpers.js +41 -0
  95. package/dist/src/web/helpers/renderContent.d.ts +2 -0
  96. package/dist/src/web/helpers/renderContent.js +15 -0
  97. package/dist/src/web/helpers/scrollHelpers.d.ts +2 -0
  98. package/dist/src/web/helpers/scrollHelpers.js +31 -0
  99. package/dist/src/web/helpers/timestampHelpers.d.ts +6 -0
  100. package/dist/src/web/helpers/timestampHelpers.js +66 -0
  101. package/dist/src/web/hooks/useMessageContent.d.ts +5 -0
  102. package/dist/src/web/hooks/useMessageContent.js +37 -0
  103. package/dist/src/web/index.d.ts +1 -0
  104. package/dist/src/web/index.js +17 -0
  105. package/dist/src/web/types/attachment.d.ts +6 -0
  106. package/dist/src/web/types/attachment.js +2 -0
  107. package/dist/src/web/types/author.d.ts +14 -0
  108. package/dist/src/web/types/author.js +2 -0
  109. package/dist/src/web/types/channel.d.ts +8 -0
  110. package/dist/src/web/types/channel.js +2 -0
  111. package/dist/src/web/types/embed.d.ts +52 -0
  112. package/dist/src/web/types/embed.js +2 -0
  113. package/dist/src/web/types/interaction.d.ts +8 -0
  114. package/dist/src/web/types/interaction.js +2 -0
  115. package/dist/src/web/types/markdown.d.ts +5 -0
  116. package/dist/src/web/types/markdown.js +2 -0
  117. package/dist/src/web/types/message.d.ts +73 -0
  118. package/dist/src/web/types/message.js +2 -0
  119. package/dist/src/web/types/poll.d.ts +11 -0
  120. package/dist/src/web/types/poll.js +2 -0
  121. package/dist/src/web/types/props.d.ts +155 -0
  122. package/dist/src/web/types/props.js +2 -0
  123. package/dist/src/web/types/reaction.d.ts +6 -0
  124. package/dist/src/web/types/reaction.js +2 -0
  125. package/dist/src/web/types/theme.d.ts +14 -0
  126. package/dist/src/web/types/theme.js +2 -0
  127. package/dist/src/web/types/ui.d.ts +10 -0
  128. package/dist/src/web/types/ui.js +2 -0
  129. package/dist/types/download.d.ts +12 -0
  130. package/dist/types/download.js +2 -0
  131. package/dist/types/exportableTranscript.d.ts +169 -0
  132. package/dist/types/exportableTranscript.js +2 -0
  133. package/dist/types/general.d.ts +90 -0
  134. package/dist/types/general.js +2 -0
  135. package/package.json +46 -0
@@ -0,0 +1,320 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.colorThemePreviews = exports.defaultThemePreviews = exports.colorThemeColors = exports.defaultThemeColors = void 0;
4
+ exports.getThemeColors = getThemeColors;
5
+ exports.getThemeGradient = getThemeGradient;
6
+ exports.defaultThemeColors = {
7
+ light: {
8
+ bg: "#ffffff",
9
+ text: "#0f172a",
10
+ header: "#f3f4f6",
11
+ border: "#e5e7eb",
12
+ subtext: "#475569",
13
+ accent: "#0f172a"
14
+ },
15
+ ash: {
16
+ bg: "#36393f",
17
+ text: "#dcddde",
18
+ header: "#2f3136",
19
+ border: "#202225",
20
+ subtext: "#96989d",
21
+ accent: "#b9bbbe"
22
+ },
23
+ dark: {
24
+ bg: "#1d1d21",
25
+ text: "#dcddde",
26
+ header: "#19191b",
27
+ border: "#222225",
28
+ subtext: "#9aa0a6",
29
+ accent: "#b9bbbe"
30
+ },
31
+ onyx: {
32
+ bg: "#070709",
33
+ text: "#ffffff",
34
+ header: "#0d0d10",
35
+ border: "#1b1b1f",
36
+ subtext: "#72767D",
37
+ accent: "#B0BEC5"
38
+ }
39
+ };
40
+ exports.colorThemeColors = {
41
+ mint_apple: {
42
+ bg: "#d0f4e3",
43
+ text: "#0a7d4f",
44
+ header: "#b8f0d5",
45
+ border: "#a0eccc",
46
+ subtext: "#2d9970",
47
+ accent: "#0a7d4f"
48
+ },
49
+ citrus_sherbert: {
50
+ bg: "#fff5d6",
51
+ text: "#9d6e0f",
52
+ header: "#ffedb3",
53
+ border: "#ffe699",
54
+ subtext: "#b8850f",
55
+ accent: "#9d6e0f"
56
+ },
57
+ retro_raincloud: {
58
+ bg: "#d5e0f0",
59
+ text: "#3a4d66",
60
+ header: "#c5d5e8",
61
+ border: "#b5cbdd",
62
+ subtext: "#5a7099",
63
+ accent: "#3a4d66"
64
+ },
65
+ hanami: {
66
+ bg: "#f9e0f0",
67
+ text: "#8a3d5f",
68
+ header: "#f2cce6",
69
+ border: "#ecb3db",
70
+ subtext: "#a85a7f",
71
+ accent: "#8a3d5f"
72
+ },
73
+ sunrise: {
74
+ bg: "#ffefd1",
75
+ text: "#a6470f",
76
+ header: "#ffe3ad",
77
+ border: "#ffd699",
78
+ subtext: "#c87a40",
79
+ accent: "#a6470f"
80
+ },
81
+ cotton_candy: {
82
+ bg: "#f5e8fa",
83
+ text: "#6a2d7f",
84
+ header: "#e8d4f2",
85
+ border: "#ddc0e8",
86
+ subtext: "#8a5fa0",
87
+ accent: "#6a2d7f"
88
+ },
89
+ lofi_vibes: {
90
+ bg: "#e8d8c8",
91
+ text: "#5a4a3a",
92
+ header: "#dcc8b8",
93
+ border: "#d0b8a8",
94
+ subtext: "#7a6a5a",
95
+ accent: "#5a4a3a"
96
+ },
97
+ desert_khaki: {
98
+ bg: "#e8e0cf",
99
+ text: "#6d5f3f",
100
+ header: "#dcceb8",
101
+ border: "#d0bfa0",
102
+ subtext: "#8d7f5f",
103
+ accent: "#6d5f3f"
104
+ },
105
+ sunset: {
106
+ bg: "#3d1a2f",
107
+ text: "#ffc8e0",
108
+ header: "#2f0f1f",
109
+ border: "#4d2a3f",
110
+ subtext: "#d9a8c8",
111
+ accent: "#ffc8e0"
112
+ },
113
+ chroma_glow: {
114
+ bg: "#1f1f3f",
115
+ text: "#f0ebff",
116
+ header: "#17172f",
117
+ border: "#2f2d4f",
118
+ subtext: "#c0b8d9",
119
+ accent: "#f0ebff"
120
+ },
121
+ forest: {
122
+ bg: "#2f3e2f",
123
+ text: "#d8f0d8",
124
+ header: "#223022",
125
+ border: "#3f523f",
126
+ subtext: "#afd0af",
127
+ accent: "#d8f0d8"
128
+ },
129
+ crimson_moon: {
130
+ bg: "#330a0a",
131
+ text: "#ffd9d9",
132
+ header: "#2a0808",
133
+ border: "#551515",
134
+ subtext: "#ff9999",
135
+ accent: "#ffd9d9"
136
+ },
137
+ midnight_blurple: {
138
+ bg: "#2a2c4d",
139
+ text: "#e8ebff",
140
+ header: "#1e1f3a",
141
+ border: "#3a3d5f",
142
+ subtext: "#b0b3e0",
143
+ accent: "#e8ebff"
144
+ },
145
+ mars: {
146
+ bg: "#4d3028",
147
+ text: "#ffd9c8",
148
+ header: "#3a2218",
149
+ border: "#664d3f",
150
+ subtext: "#d9b8a8",
151
+ accent: "#ffd9c8"
152
+ },
153
+ dusk: {
154
+ bg: "#3a2e50",
155
+ text: "#ede6ff",
156
+ header: "#2a2240",
157
+ border: "#4a4a66",
158
+ subtext: "#c9b8e0",
159
+ accent: "#ede6ff"
160
+ },
161
+ under_the_sea: {
162
+ bg: "#1f4a4a",
163
+ text: "#d0ffff",
164
+ header: "#143030",
165
+ border: "#2f6f6f",
166
+ subtext: "#a0e8e8",
167
+ accent: "#d0ffff"
168
+ },
169
+ retro_storm: {
170
+ bg: "#1f2a3f",
171
+ text: "#d0e0f0",
172
+ header: "#162535",
173
+ border: "#2f4d66",
174
+ subtext: "#9fbfd9",
175
+ accent: "#d0e0f0"
176
+ },
177
+ neon_nights: {
178
+ bg: "#0f0f2a",
179
+ text: "#e8e8ff",
180
+ border: "#2a2a4f",
181
+ header: "#0a0a1f",
182
+ subtext: "#b0b0e0",
183
+ accent: "#e8e8ff"
184
+ },
185
+ strawberry_lemonade: {
186
+ bg: "#ffebf5",
187
+ text: "#9d2a4f",
188
+ header: "#ffe0ed",
189
+ border: "#ffcce0",
190
+ subtext: "#c85f7f",
191
+ accent: "#9d2a4f"
192
+ },
193
+ aurora: {
194
+ bg: "#1f3a4a",
195
+ text: "#d0ecff",
196
+ header: "#142a3a",
197
+ border: "#2f6088",
198
+ subtext: "#a0d4f0",
199
+ accent: "#d0ecff"
200
+ },
201
+ sepia: {
202
+ bg: "#f5eae0",
203
+ text: "#5a4528",
204
+ header: "#ead6c0",
205
+ border: "#dcc5a8",
206
+ subtext: "#7a6a50",
207
+ accent: "#5a4528"
208
+ },
209
+ blurple_twilight: {
210
+ bg: "#1f1a3f",
211
+ text: "#e8ebff",
212
+ header: "#15102a",
213
+ border: "#3a375f",
214
+ subtext: "#b0b3e0",
215
+ accent: "#e8ebff"
216
+ }
217
+ };
218
+ function getThemeColors(theme, systemPrefersDark) {
219
+ if (theme === "system") {
220
+ return systemPrefersDark ? exports.defaultThemeColors.onyx : exports.defaultThemeColors.light;
221
+ }
222
+ if (theme in exports.defaultThemeColors) {
223
+ return exports.defaultThemeColors[theme];
224
+ }
225
+ if (theme in exports.colorThemeColors) {
226
+ return exports.colorThemeColors[theme];
227
+ }
228
+ return exports.defaultThemeColors.onyx;
229
+ }
230
+ function getThemeGradient(theme) {
231
+ if (theme in exports.colorThemePreviews) {
232
+ return exports.colorThemePreviews[theme].gradient;
233
+ }
234
+ return null;
235
+ }
236
+ exports.defaultThemePreviews = {
237
+ light: {
238
+ primary: "#ffffff"
239
+ },
240
+ ash: {
241
+ primary: "#36393f"
242
+ },
243
+ dark: {
244
+ primary: "#1d1d21"
245
+ },
246
+ onyx: {
247
+ primary: "#070709"
248
+ },
249
+ system: {
250
+ primary: "transparent"
251
+ }
252
+ };
253
+ exports.colorThemePreviews = {
254
+ mint_apple: {
255
+ gradient: "linear-gradient(180deg, #56b69f 6.15%, #63bc61 48.7%, #9eca67 93.07%)"
256
+ },
257
+ citrus_sherbert: {
258
+ gradient: "linear-gradient(180deg, #f3b336 31.1%, #ee8558 67.09%)"
259
+ },
260
+ retro_raincloud: {
261
+ gradient: "linear-gradient(148.71deg, #3a7ca1 5.64%, #7f7eb9 26.38%, #7f7eb9 49.92%, #3a7ca1 73.12%)"
262
+ },
263
+ hanami: {
264
+ gradient: "linear-gradient(38.08deg, #efaab3 3.56%, #efd696 35.49%, #a6daa2 68.78%)"
265
+ },
266
+ sunrise: {
267
+ gradient: "linear-gradient(154.19deg, #9f4175 8.62%, #c49064 48.07%, #a6953d 76.04%)"
268
+ },
269
+ cotton_candy: {
270
+ gradient: "linear-gradient(180.14deg, #f4abb8 8.5%, #b1c2fc 94.28%)"
271
+ },
272
+ lofi_vibes: {
273
+ gradient: "linear-gradient(179.52deg, #a4c0f7 7.08%, #a9e4e8 34.94%, #b0e2b8 65.12%, #cfdfa2 96.23%)"
274
+ },
275
+ desert_khaki: {
276
+ gradient: "linear-gradient(38.99deg, #e7dbd0 12.92%, #dfd0b2 32.92%, #e0d6a3 52.11%)"
277
+ },
278
+ sunset: {
279
+ gradient: "linear-gradient(141.68deg, #48288c 27.57%, #db7f4b 71.25%)"
280
+ },
281
+ chroma_glow: {
282
+ gradient: "linear-gradient(128.92deg, #0eb5bf 3.94%, #4c0ce0 26.1%, #a308a7 39.82%, #9a53ff 56.89%, #218be0 76.45%)"
283
+ },
284
+ forest: {
285
+ gradient: "linear-gradient(162.27deg, #142215 11.2%, #2d4d39 29.93%, #454c32 48.64%, #5a7c58 67.85%, #a98e4b 83.54%)"
286
+ },
287
+ crimson_moon: {
288
+ gradient: "linear-gradient(64.92deg, #950909 16.17%, #000000 72%)"
289
+ },
290
+ midnight_blurple: {
291
+ gradient: "linear-gradient(48.17deg, #5348ca 11.21%, #140730 61.92%)"
292
+ },
293
+ mars: {
294
+ gradient: "linear-gradient(170.82deg, #895240 14.61%, #8f4343 74.62%)"
295
+ },
296
+ dusk: {
297
+ gradient: "linear-gradient(180deg, #665069 12.84%, #91a3d1 85.99%)"
298
+ },
299
+ under_the_sea: {
300
+ gradient: "linear-gradient(179.14deg, #647962 1.91%, #588575 48.99%, #6a8482 96.35%)"
301
+ },
302
+ retro_storm: {
303
+ gradient: "linear-gradient(148.71deg, #3a7ca1 5.64%, #58579a 26.38%, #58579a 49.92%, #3a7ca1 73.12%)"
304
+ },
305
+ neon_nights: {
306
+ gradient: "linear-gradient(180deg, #01a89e 0%, #7d60ba 50%, #b43898 100%)"
307
+ },
308
+ strawberry_lemonade: {
309
+ gradient: "linear-gradient(161.03deg, #af1a6c 18.79%, #c26b20 49.76%, #e7a525 80.72%)"
310
+ },
311
+ aurora: {
312
+ gradient: "linear-gradient(239.16deg, #062053 10.39%, #191fbb 26.87%, #13929a 48.31%, #218573 64.98%, #051a81 92.5%)"
313
+ },
314
+ sepia: {
315
+ gradient: "linear-gradient(69.98deg, #857664 14.14%, #5b4421 60.35%)"
316
+ },
317
+ blurple_twilight: {
318
+ gradient: "linear-gradient(47.61deg, #2c3fe7 11.18%, #261d83 64.54%)"
319
+ }
320
+ };
@@ -0,0 +1,19 @@
1
+ import type { MessageProps } from "../types/message";
2
+ import type { Reaction } from "../types/reaction";
3
+ export declare function buildAuthor(m: any, resolvedUsers: Record<string, any>): {
4
+ id: string;
5
+ name: any;
6
+ username: any;
7
+ avatar: any;
8
+ bot: any;
9
+ verified: any;
10
+ color: any;
11
+ guildTag: any;
12
+ };
13
+ export declare function buildReactions(reactions: any[] | undefined): Reaction[] | undefined;
14
+ export declare function buildReplyTo(m: any, byOriginal: Map<string, any>): {
15
+ id: any;
16
+ content: any;
17
+ author: any;
18
+ };
19
+ export declare function mapMessage(m: any, byOriginal: Map<string, any>, resolvedUsers?: Record<string, any>, resolvedRoles?: Record<string, any>): MessageProps;
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildAuthor = buildAuthor;
4
+ exports.buildReactions = buildReactions;
5
+ exports.buildReplyTo = buildReplyTo;
6
+ exports.mapMessage = mapMessage;
7
+ const avatarHelpers_1 = require("../helpers/avatarHelpers");
8
+ const cdnHelpers_1 = require("../helpers/cdnHelpers");
9
+ function buildAuthor(m, resolvedUsers) {
10
+ let authorData = m.author;
11
+ const originalAuthorRef = typeof m.author === "string" ? m.author : undefined;
12
+ if (typeof authorData === "string") {
13
+ authorData = resolvedUsers[authorData] || { id: authorData };
14
+ }
15
+ const authorId = authorData?.id || originalAuthorRef;
16
+ const name = authorData?.name || authorData?.username || "Unknown";
17
+ const avatar = authorData?.avatar;
18
+ let url = avatar;
19
+ if (typeof avatar === "string" && authorId) {
20
+ url = (0, avatarHelpers_1.buildAvatarUrl)(String(authorId), avatar);
21
+ }
22
+ return {
23
+ id: String(authorId || "0"),
24
+ name: name || "Unknown",
25
+ username: authorData?.username || name || "Unknown",
26
+ avatar: url,
27
+ bot: authorData?.bot || false,
28
+ verified: authorData?.verified || false,
29
+ color: authorData?.color || undefined,
30
+ guildTag: authorData?.guildTag || undefined
31
+ };
32
+ }
33
+ function buildReactions(reactions) {
34
+ if (!reactions?.length)
35
+ return undefined;
36
+ return reactions.map((r) => {
37
+ const emoji = r.emoji || {};
38
+ const emojiId = emoji.id;
39
+ const emojiName = emoji.name || "?";
40
+ let emojiUrl = emoji.url;
41
+ if (emojiId && !emoji.animated) {
42
+ emojiUrl = (0, cdnHelpers_1.buildEmojiCdnUrl)(String(emojiId), false, 96);
43
+ }
44
+ else if (emojiId && emoji.animated) {
45
+ emojiUrl = (0, cdnHelpers_1.buildEmojiCdnUrl)(String(emojiId), true, 96);
46
+ }
47
+ return {
48
+ emoji: emojiName,
49
+ emojiUrl: emojiUrl || undefined,
50
+ count: r.count || 1
51
+ };
52
+ });
53
+ }
54
+ function buildReplyTo(m, byOriginal) {
55
+ if (!m.replyTo && !m.referencedMessageId)
56
+ return undefined;
57
+ const replyId = m.replyTo?.id || String(m.referencedMessageId);
58
+ if (!replyId)
59
+ return undefined;
60
+ const resolved = byOriginal.get(replyId);
61
+ if (resolved) {
62
+ return {
63
+ id: replyId,
64
+ content: resolved.content,
65
+ author: resolved.author
66
+ };
67
+ }
68
+ return {
69
+ id: replyId,
70
+ content: "Message not in transcript",
71
+ author: { name: "Unknown User", username: "unknown" }
72
+ };
73
+ }
74
+ function mapMessage(m, byOriginal, resolvedUsers = {}, resolvedRoles = {}) {
75
+ let forwardedFrom = null;
76
+ let forwardedMessage = null;
77
+ if (m.forwarded) {
78
+ const orig = m.forwarded.original || null;
79
+ forwardedFrom = {
80
+ id: m.forwarded.fromMessageId || orig?.id,
81
+ name: m.forwarded.fromMessageId ? `Message ${m.forwarded.fromMessageId}` : undefined
82
+ };
83
+ if (orig) {
84
+ forwardedMessage = {
85
+ id: String(orig.id || m.forwarded.fromMessageId || "fwd"),
86
+ content: orig.content || "",
87
+ embeds: orig.embeds || [],
88
+ attachments: (orig.attachments || []).map((a) => a?.url || a).filter(Boolean),
89
+ stickers: orig.stickers || []
90
+ };
91
+ }
92
+ }
93
+ return {
94
+ id: String(m.id || "0"),
95
+ author: buildAuthor(m, resolvedUsers),
96
+ content: m.content || "",
97
+ timestamp: m.timestamp || m.createdAt,
98
+ editedAt: m.edited_timestamp || m.editedAt ? new Date(m.edited_timestamp || m.editedAt).toISOString() : null,
99
+ reactions: buildReactions(m.reactions),
100
+ replyTo: buildReplyTo(m, byOriginal),
101
+ interaction: m.interaction,
102
+ poll: m.poll,
103
+ attachments: m.attachments,
104
+ embeds: m.embeds,
105
+ stickers: m.stickers,
106
+ forwardedFrom,
107
+ forwardedMessage,
108
+ messageType: m.messageType,
109
+ pinned: m.pinned || false,
110
+ buttons: ((m.actionRows || []).flatMap((ar) => ar.components || []).filter((c) => c && c.type === 2) || []).length
111
+ ? (m.actionRows || []).flatMap((ar) => ar.components || []).filter((c) => c && c.type === 2)
112
+ : m.buttons || [],
113
+ selects: ((m.actionRows || []).flatMap((ar) => ar.components || []).filter((c) => c && c.type === 8) || []).length
114
+ ? (m.actionRows || []).flatMap((ar) => ar.components || []).filter((c) => c && c.type === 8)
115
+ : m.selects || [],
116
+ resolvedUsers,
117
+ resolvedRoles,
118
+ referencedMessageId: m.referencedMessageId || m.referenced_message_id || undefined
119
+ };
120
+ }
@@ -0,0 +1 @@
1
+ export type { TranscriptThemes } from "../types/theme";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export declare function formatDate(input?: string | Date | null): string;
2
+ export declare function formatTime(input?: string | Date | null): string;
3
+ export declare function formatDateShort(input?: string | Date | null): string;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatDate = formatDate;
4
+ exports.formatTime = formatTime;
5
+ exports.formatDateShort = formatDateShort;
6
+ function formatDate(input) {
7
+ if (!input)
8
+ return "";
9
+ const d = typeof input === "string" ? new Date(input) : input;
10
+ if (!d || Number.isNaN(d.getTime()))
11
+ return "";
12
+ const day = String(d.getDate()).padStart(2, "0");
13
+ const month = String(d.getMonth() + 1).padStart(2, "0");
14
+ const year = d.getFullYear();
15
+ let hours = d.getHours();
16
+ const minutes = String(d.getMinutes()).padStart(2, "0");
17
+ const ampm = hours >= 12 ? "PM" : "AM";
18
+ hours = hours % 12 || 12;
19
+ const hourStr = String(hours).padStart(2, "0");
20
+ return `${day}.${month}.${year} ${hourStr}:${minutes} ${ampm}`;
21
+ }
22
+ function formatTime(input) {
23
+ if (!input)
24
+ return "";
25
+ const d = typeof input === "string" ? new Date(input) : input;
26
+ if (!d || Number.isNaN(d.getTime()))
27
+ return "";
28
+ let hours = d.getHours();
29
+ const minutes = String(d.getMinutes()).padStart(2, "0");
30
+ const ampm = hours >= 12 ? "PM" : "AM";
31
+ hours = hours % 12 || 12;
32
+ const hourStr = String(hours).padStart(2, "0");
33
+ return `${hourStr}:${minutes} ${ampm}`;
34
+ }
35
+ function formatDateShort(input) {
36
+ if (!input)
37
+ return "";
38
+ const d = typeof input === "string" ? new Date(input) : input;
39
+ if (!d || Number.isNaN(d.getTime()))
40
+ return "";
41
+ const day = String(d.getDate()).padStart(2, "0");
42
+ const month = String(d.getMonth() + 1).padStart(2, "0");
43
+ const year = d.getFullYear();
44
+ let hours = d.getHours();
45
+ const minutes = String(d.getMinutes()).padStart(2, "0");
46
+ const ampm = hours >= 12 ? "PM" : "AM";
47
+ hours = hours % 12 || 12;
48
+ const hourStr = String(hours).padStart(2, "0");
49
+ return `${day}.${month}.${year} ${hourStr}:${minutes} ${ampm}`;
50
+ }
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ export declare function parseMarkdown(text: unknown, resolvedUsers?: Record<string, {
3
+ displayName?: string;
4
+ username?: string;
5
+ }>, resolvedRoles?: Record<string, {
6
+ name?: string;
7
+ color?: string | number;
8
+ }>, resolvedChannels?: Record<string, {
9
+ name?: string | null;
10
+ guildId?: string | null;
11
+ }>, currentGuildId?: string | null): React.ReactNode;