@libstermynal/transcript-v2 3.3.2

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 (96) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +134 -0
  3. package/dist/downloader/images.d.ts +36 -0
  4. package/dist/downloader/images.js +114 -0
  5. package/dist/downloader/images.js.map +1 -0
  6. package/dist/generator/index.d.ts +18 -0
  7. package/dist/generator/index.js +71 -0
  8. package/dist/generator/index.js.map +1 -0
  9. package/dist/generator/renderers/attachment.d.ts +21 -0
  10. package/dist/generator/renderers/attachment.js +67 -0
  11. package/dist/generator/renderers/attachment.js.map +1 -0
  12. package/dist/generator/renderers/components/Button.d.ts +9 -0
  13. package/dist/generator/renderers/components/Button.js +9 -0
  14. package/dist/generator/renderers/components/Button.js.map +1 -0
  15. package/dist/generator/renderers/components/Container.d.ts +5 -0
  16. package/dist/generator/renderers/components/Container.js +19 -0
  17. package/dist/generator/renderers/components/Container.js.map +1 -0
  18. package/dist/generator/renderers/components/DiscordHighlightedCode.d.ts +6 -0
  19. package/dist/generator/renderers/components/DiscordHighlightedCode.js +199 -0
  20. package/dist/generator/renderers/components/DiscordHighlightedCode.js.map +1 -0
  21. package/dist/generator/renderers/components/DiscordImage.d.ts +6 -0
  22. package/dist/generator/renderers/components/DiscordImage.js +21 -0
  23. package/dist/generator/renderers/components/DiscordImage.js.map +1 -0
  24. package/dist/generator/renderers/components/Media Gallery.d.ts +5 -0
  25. package/dist/generator/renderers/components/Media Gallery.js +32 -0
  26. package/dist/generator/renderers/components/Media Gallery.js.map +1 -0
  27. package/dist/generator/renderers/components/Select Menu.d.ts +7 -0
  28. package/dist/generator/renderers/components/Select Menu.js +31 -0
  29. package/dist/generator/renderers/components/Select Menu.js.map +1 -0
  30. package/dist/generator/renderers/components/Spacing.d.ts +6 -0
  31. package/dist/generator/renderers/components/Spacing.js +14 -0
  32. package/dist/generator/renderers/components/Spacing.js.map +1 -0
  33. package/dist/generator/renderers/components/Thumbnail.d.ts +4 -0
  34. package/dist/generator/renderers/components/Thumbnail.js +13 -0
  35. package/dist/generator/renderers/components/Thumbnail.js.map +1 -0
  36. package/dist/generator/renderers/components/TranscriptHeader.d.ts +8 -0
  37. package/dist/generator/renderers/components/TranscriptHeader.js +13 -0
  38. package/dist/generator/renderers/components/TranscriptHeader.js.map +1 -0
  39. package/dist/generator/renderers/components/section/Section.d.ts +9 -0
  40. package/dist/generator/renderers/components/section/Section.js +19 -0
  41. package/dist/generator/renderers/components/section/Section.js.map +1 -0
  42. package/dist/generator/renderers/components/section/SectionAccessory.d.ts +6 -0
  43. package/dist/generator/renderers/components/section/SectionAccessory.js +16 -0
  44. package/dist/generator/renderers/components/section/SectionAccessory.js.map +1 -0
  45. package/dist/generator/renderers/components/section/SectionContent.d.ts +6 -0
  46. package/dist/generator/renderers/components/section/SectionContent.js +12 -0
  47. package/dist/generator/renderers/components/section/SectionContent.js.map +1 -0
  48. package/dist/generator/renderers/components/styles.d.ts +21 -0
  49. package/dist/generator/renderers/components/styles.js +147 -0
  50. package/dist/generator/renderers/components/styles.js.map +1 -0
  51. package/dist/generator/renderers/components/utils.d.ts +36 -0
  52. package/dist/generator/renderers/components/utils.js +98 -0
  53. package/dist/generator/renderers/components/utils.js.map +1 -0
  54. package/dist/generator/renderers/components.d.ts +11 -0
  55. package/dist/generator/renderers/components.js +65 -0
  56. package/dist/generator/renderers/components.js.map +1 -0
  57. package/dist/generator/renderers/content.d.ts +31 -0
  58. package/dist/generator/renderers/content.js +163 -0
  59. package/dist/generator/renderers/content.js.map +1 -0
  60. package/dist/generator/renderers/embed.d.ts +11 -0
  61. package/dist/generator/renderers/embed.js +44 -0
  62. package/dist/generator/renderers/embed.js.map +1 -0
  63. package/dist/generator/renderers/message.d.ts +6 -0
  64. package/dist/generator/renderers/message.js +59 -0
  65. package/dist/generator/renderers/message.js.map +1 -0
  66. package/dist/generator/renderers/reply.d.ts +6 -0
  67. package/dist/generator/renderers/reply.js +53 -0
  68. package/dist/generator/renderers/reply.js.map +1 -0
  69. package/dist/generator/renderers/systemMessage.d.ts +13 -0
  70. package/dist/generator/renderers/systemMessage.js +115 -0
  71. package/dist/generator/renderers/systemMessage.js.map +1 -0
  72. package/dist/generator/transcript.d.ts +9 -0
  73. package/dist/generator/transcript.js +76 -0
  74. package/dist/generator/transcript.js.map +1 -0
  75. package/dist/index.d.ts +25 -0
  76. package/dist/index.js +138 -0
  77. package/dist/index.js.map +1 -0
  78. package/dist/static/client.d.ts +3 -0
  79. package/dist/static/client.js +31 -0
  80. package/dist/static/client.js.map +1 -0
  81. package/dist/types.d.ts +68 -0
  82. package/dist/types.js +17 -0
  83. package/dist/types.js.map +1 -0
  84. package/dist/utils/buildProfiles.d.ts +11 -0
  85. package/dist/utils/buildProfiles.js +42 -0
  86. package/dist/utils/buildProfiles.js.map +1 -0
  87. package/dist/utils/embeds.d.ts +2 -0
  88. package/dist/utils/embeds.js +17 -0
  89. package/dist/utils/embeds.js.map +1 -0
  90. package/dist/utils/extend.d.ts +8 -0
  91. package/dist/utils/extend.js +8 -0
  92. package/dist/utils/extend.js.map +1 -0
  93. package/dist/utils/utils.d.ts +15 -0
  94. package/dist/utils/utils.js +50 -0
  95. package/dist/utils/utils.js.map +1 -0
  96. package/package.json +70 -0
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Attachments = Attachments;
4
+ exports.Attachment = Attachment;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const types_1 = require("../../types");
7
+ const utils_1 = require("../../utils/utils");
8
+ const DiscordImage_1 = require("./components/DiscordImage");
9
+ /**
10
+ * Renders all attachments for a message
11
+ * @param message
12
+ * @param context
13
+ * @returns
14
+ */
15
+ async function Attachments(props) {
16
+ if (props.message.attachments.size === 0)
17
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
18
+ return props.message.attachments.map((attachment, id) => ((0, jsx_runtime_1.jsx)(Attachment, { attachment: attachment, message: props.message, context: props.context }, id)));
19
+ }
20
+ /**
21
+ * Renders one Discord Attachment
22
+ * @param props - the attachment and rendering context
23
+ */
24
+ async function Attachment({ attachment, context, message, }) {
25
+ let url = attachment.url;
26
+ const attachmentType = getAttachmentType(attachment);
27
+ const [bytes, bytesUnit] = (0, utils_1.formatBytes)(attachment.size);
28
+ // if the attachment is an image, download it to a data url
29
+ switch (attachmentType) {
30
+ case types_1.AttachmentTypes.Image: {
31
+ const downloaded = await context.callbacks.resolveImageSrc(attachment.toJSON(), message.toJSON());
32
+ if (downloaded !== null) {
33
+ url = downloaded !== null && downloaded !== void 0 ? downloaded : url;
34
+ }
35
+ return (0, jsx_runtime_1.jsx)(DiscordImage_1.DiscordImageAttachment, { url: url, alt: attachment.name }, attachment.id);
36
+ }
37
+ case types_1.AttachmentTypes.Video: {
38
+ return (0, jsx_runtime_1.jsx)("discord-video-attachment", { slot: "attachments", href: url }, attachment.id);
39
+ }
40
+ case types_1.AttachmentTypes.Audio: {
41
+ return ((0, jsx_runtime_1.jsx)("discord-audio-attachment", { slot: "attachments", href: url, bytes: bytes, bytesUnit: bytesUnit, name: attachment.name }, attachment.id));
42
+ }
43
+ case types_1.AttachmentTypes.File: {
44
+ return ((0, jsx_runtime_1.jsx)("discord-file-attachment", { slot: "attachments", href: url, bytes: bytes, "bytes-unit": bytesUnit, name: attachment.name }, attachment.id));
45
+ }
46
+ }
47
+ }
48
+ /**
49
+ * Parses the attachment content type.
50
+ * @param attachment Discord.js attachment object
51
+ * @returns
52
+ */
53
+ function getAttachmentType(attachment) {
54
+ var _a, _b;
55
+ switch ((_b = (_a = attachment.contentType) === null || _a === void 0 ? void 0 : _a.split('/')) === null || _b === void 0 ? void 0 : _b[0]) {
56
+ case 'audio':
57
+ return types_1.AttachmentTypes.Audio;
58
+ case 'image':
59
+ return types_1.AttachmentTypes.Image;
60
+ case 'video':
61
+ return types_1.AttachmentTypes.Video;
62
+ case undefined:
63
+ default:
64
+ return types_1.AttachmentTypes.File;
65
+ }
66
+ }
67
+ //# sourceMappingURL=attachment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment.js","sourceRoot":"","sources":["../../../src/generator/renderers/attachment.tsx"],"names":[],"mappings":";;AAYA,kCAMC;AAMD,gCA0DC;;AAhFD,uCAA8C;AAC9C,6CAAgD;AAChD,4DAAmE;AAEnE;;;;;GAKG;AACI,KAAK,UAAU,WAAW,CAAC,KAA0D;IAC1F,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,kDAAK,CAAC;IAEvD,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,EAAE,EAAE,CAAC,CACvD,uBAAC,UAAU,IAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,IAAO,EAAE,CAAI,CAChG,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,UAAU,CAAC,EAC/B,UAAU,EACV,OAAO,EACP,OAAO,GAKR;IACC,IAAI,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC;IACzB,MAAM,cAAc,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACrD,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,GAAG,IAAA,mBAAW,EAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAExD,2DAA2D;IAC3D,QAAQ,cAAc,EAAE,CAAC;QACvB,KAAK,uBAAe,CAAC,KAAK,CAAC,CAAC,CAAC;YAC3B,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,eAAe,CACxD,UAAU,CAAC,MAAM,EAAmB,EACpC,OAAO,CAAC,MAAM,EAAgB,CAC/B,CAAC;YAEF,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;gBACxB,GAAG,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,GAAG,CAAC;YAC1B,CAAC;YAED,OAAO,uBAAC,qCAAsB,IAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,CAAC,IAAI,IAAO,UAAU,CAAC,EAAE,CAAI,CAAC;QACxF,CAAC;QAED,KAAK,uBAAe,CAAC,KAAK,CAAC,CAAC,CAAC;YAC3B,OAAO,qDAA8C,IAAI,EAAC,aAAa,EAAC,IAAI,EAAE,GAAG,IAA3C,UAAU,CAAC,EAAE,CAAkC,CAAC;QACxF,CAAC;QAED,KAAK,uBAAe,CAAC,KAAK,CAAC,CAAC,CAAC;YAC3B,OAAO,CACL,qDACE,IAAI,EAAC,aAAa,EAElB,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,UAAU,CAAC,IAAI,IAJhB,UAAU,CAAC,EAAE,CAKlB,CACH,CAAC;QACJ,CAAC;QAED,KAAK,uBAAe,CAAC,IAAI,CAAC,CAAC,CAAC;YAC1B,OAAO,CACL,oDACE,IAAI,EAAC,aAAa,EAElB,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,KAAK,gBACA,SAAS,EACrB,IAAI,EAAE,UAAU,CAAC,IAAI,IAJhB,UAAU,CAAC,EAAE,CAKlB,CACH,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,UAA0B;;IACnD,QAAQ,MAAA,MAAA,UAAU,CAAC,WAAW,0CAAE,KAAK,CAAC,GAAG,CAAC,0CAAG,CAAC,CAAC,EAAE,CAAC;QAChD,KAAK,OAAO;YACV,OAAO,uBAAe,CAAC,KAAK,CAAC;QAC/B,KAAK,OAAO;YACV,OAAO,uBAAe,CAAC,KAAK,CAAC;QAC/B,KAAK,OAAO;YACV,OAAO,uBAAe,CAAC,KAAK,CAAC;QAE/B,KAAK,SAAS,CAAC;QACf;YACE,OAAO,uBAAe,CAAC,IAAI,CAAC;IAChC,CAAC;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface DiscordButtonProps {
3
+ type: string;
4
+ url?: string;
5
+ emoji?: string;
6
+ children: React.ReactNode;
7
+ }
8
+ export declare function DiscordButton({ type, url, emoji, children }: DiscordButtonProps): import("react/jsx-runtime").JSX.Element;
9
+ export default DiscordButton;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DiscordButton = DiscordButton;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ function DiscordButton({ type, url, emoji, children }) {
6
+ return ((0, jsx_runtime_1.jsxs)("a", { href: url, target: "_blank", className: `discord-button discord-button-${type}`, children: [emoji && ((0, jsx_runtime_1.jsx)("span", { style: { display: 'flex', alignItems: 'center' }, children: (0, jsx_runtime_1.jsx)("img", { src: emoji, alt: "emoji", style: { width: '16px', height: '16px', marginRight: '8px' } }) })), (0, jsx_runtime_1.jsx)("span", { style: { display: 'flex', alignItems: 'center' }, children: children }), url && ((0, jsx_runtime_1.jsx)("span", { style: { marginLeft: '8px', display: 'flex', alignItems: 'center' }, children: (0, jsx_runtime_1.jsxs)("svg", { role: "img", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none", viewBox: "0 0 24 24", children: [(0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M15 2a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0V4.41l-4.3 4.3a1 1 0 1 1-1.4-1.42L19.58 3H16a1 1 0 0 1-1-1Z" }), (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M5 2a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-6a1 1 0 1 0-2 0v6a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h6a1 1 0 1 0 0-2H5Z" })] }) }))] }));
7
+ }
8
+ exports.default = DiscordButton;
9
+ //# sourceMappingURL=Button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/generator/renderers/components/Button.tsx"],"names":[],"mappings":";;AASA,sCAyBC;;AAzBD,SAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAsB;IAC9E,OAAO,CACL,+BAAG,IAAI,EAAE,GAAG,EAAE,MAAM,EAAC,QAAQ,EAAC,SAAS,EAAE,iCAAiC,IAAI,EAAE,aAC7E,KAAK,IAAI,CACR,iCAAM,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,YACpD,gCAAK,GAAG,EAAE,KAAK,EAAE,GAAG,EAAC,OAAO,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,GAAI,GACxF,CACR,EACD,iCAAM,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAG,QAAQ,GAAQ,EACxE,GAAG,IAAI,CACN,iCAAM,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,YACvE,iCAAK,IAAI,EAAC,KAAK,EAAC,KAAK,EAAC,4BAA4B,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW,aACvG,iCACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,gHAAgH,GAClH,EACF,iCACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,0IAA0I,GAC5I,IACE,GACD,CACR,IACC,CACL,CAAC;AACJ,CAAC;AAED,kBAAe,aAAa,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ declare function DiscordContainer({ children }: {
3
+ children: React.ReactNode;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ export default DiscordContainer;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ function DiscordContainer({ children }) {
5
+ return ((0, jsx_runtime_1.jsx)("div", { style: {
6
+ display: 'flex',
7
+ width: '500px',
8
+ flexDirection: 'column',
9
+ backgroundColor: '#3f4248',
10
+ padding: '16px',
11
+ border: '1px solid #4f5359',
12
+ marginTop: '2px',
13
+ marginBottom: '2px',
14
+ borderRadius: '10px',
15
+ gap: '8px',
16
+ }, children: children }));
17
+ }
18
+ exports.default = DiscordContainer;
19
+ //# sourceMappingURL=Container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Container.js","sourceRoot":"","sources":["../../../../src/generator/renderers/components/Container.tsx"],"names":[],"mappings":";;;AAEA,SAAS,gBAAgB,CAAC,EAAE,QAAQ,EAAiC;IACnE,OAAO,CACL,gCACE,KAAK,EAAE;YACL,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,OAAO;YACd,aAAa,EAAE,QAAQ;YACvB,eAAe,EAAE,SAAS;YAC1B,OAAO,EAAE,MAAM;YACf,MAAM,EAAE,mBAAmB;YAC3B,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE,KAAK;YACnB,YAAY,EAAE,MAAM;YACpB,GAAG,EAAE,KAAK;SACX,YAEA,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,kBAAe,gBAAgB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export type CodeBlockProps = {
2
+ content: string;
3
+ language?: string;
4
+ };
5
+ export declare const DiscordHighlightStyles = "\n .hljs-ansi-control-sequence {\n \tdisplay: none;\n }\n\n .hljs-ansi-style-bold {\n\t font-weight: 700;\n }\n\n .hljs-ansi-style-underline {\n \ttext-decoration: underline;\n }\n\n .hljs-ansi-foreground-black .hljs-ansi-background-black,\n .hljs-ansi-foreground-black .hljs-ansi-background-blue,\n .hljs-ansi-foreground-black .hljs-ansi-background-cyan,\n .hljs-ansi-foreground-black .hljs-ansi-background-green,\n .hljs-ansi-foreground-black .hljs-ansi-background-magenta,\n .hljs-ansi-foreground-black .hljs-ansi-background-red,\n .hljs-ansi-foreground-black .hljs-ansi-background-white,\n .hljs-ansi-foreground-black .hljs-ansi-background-yellow {\n \tcolor: #073642;\n }\n\n .hljs-ansi-foreground-red {\n\tcolor: #dc322f;\n }\n\n .hljs-ansi-foreground-green {\n\tcolor: #859900;\n }\n\n .hljs-ansi-foreground-yellow {\n\tcolor: #b58900;\n }\n\n .hljs-ansi-foreground-blue {\n\tcolor: #268bd2;\n }\n\n .hljs-ansi-foreground-magenta {\n\tcolor: #d33682;\n }\n\n .hljs-ansi-foreground-cyan {\n\tcolor: #2aa198;\n }\n\n .hljs-ansi-foreground-white {\n\tcolor: var(--interactive-active);\n }\n\n .hljs-ansi-foreground-white .hljs-ansi-background-black,\n .hljs-ansi-foreground-white .hljs-ansi-background-blue,\n .hljs-ansi-foreground-white .hljs-ansi-background-cyan,\n .hljs-ansi-foreground-white .hljs-ansi-background-green,\n .hljs-ansi-foreground-white .hljs-ansi-background-magenta,\n .hljs-ansi-foreground-white .hljs-ansi-background-red,\n .hljs-ansi-foreground-white .hljs-ansi-background-white,\n .hljs-ansi-foreground-white .hljs-ansi-background-yellow {\n\tcolor: #eee8d5;\n }\n\n .hljs-ansi-background-black {\n\tbackground-color: #002b36;\n }\n\n .hljs-ansi-background-red {\n\tbackground-color: #cb4b16;\n }\n\n .hljs-ansi-background-green {\n\tbackground-color: #586e75;\n }\n\n .hljs-ansi-background-yellow {\n\tbackground-color: #657b83;\n }\n\n .hljs-ansi-background-blue {\n\tbackground-color: #839496;\n }\n\n .hljs-ansi-background-magenta {\n\tbackground-color: #6c71c4;\n }\n\n .hljs-ansi-background-cyan {\n\tbackground-color: #93a1a1;\n }\n\n .hljs-ansi-background-white {\n\tbackground-color: #fdf6e3;\n }\n\n .hljs-doctag,\n .hljs-keyword,\n .hljs-meta .hljs-keyword,\n .hljs-template-tag,\n .hljs-template-variable,\n .hljs-type,\n .hljs-variable.language_ {\n\tcolor: #ff7b72;\n }\n\n .hljs-title,\n .hljs-title.class_,\n .hljs-title.class_.inherited__,\n .hljs-title.function_ {\n\tcolor: #d2a8ff;\n }\n\n .hljs-attr,\n .hljs-attribute,\n .hljs-literal,\n .hljs-meta,\n .hljs-number,\n .hljs-operator,\n .hljs-selector-attr,\n .hljs-selector-class,\n .hljs-selector-id,\n .hljs-variable {\n\tcolor: #79c0ff;\n }\n\n .hljs-meta .hljs-string,\n .hljs-regexp,\n .hljs-string {\n\tcolor: #a5d6ff;\n }\n\n .hljs-built_in,\n .hljs-symbol {\n\tcolor: #ffa657;\n }\n\n .hljs-code,\n .hljs-comment,\n .hljs-formula {\n\tcolor: #8b949e;\n }\n\n .hljs-name,\n .hljs-quote,\n .hljs-selector-pseudo,\n .hljs-selector-tag {\n\tcolor: #7ee787;\n }\n\n .hljs-subst {\n\tcolor: #c9d1d9;\n }\n\n .hljs-section {\n\tcolor: #1f6feb;\n\tfont-weight: 700;\n }\n\n .hljs-bullet {\n\tcolor: #f2cc60;\n }\n\n .hljs-emphasis {\n\tcolor: #c9d1d9;\n\tfont-style: italic;\n }\n\n .hljs-strong {\n\tcolor: #c9d1d9;\n\tfont-weight: 700;\n }\n\n .hljs-addition {\n\tcolor: #aff5b4;\n\tbackground-color: #033a16;\n }\n\n .hljs-deletion {\n\tcolor: #ffdcd7;\n\tbackground-color: #67060c;\n }\n";
6
+ export declare function DiscordHighlightedCode(props: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,199 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DiscordHighlightStyles = void 0;
7
+ exports.DiscordHighlightedCode = DiscordHighlightedCode;
8
+ const jsx_runtime_1 = require("react/jsx-runtime");
9
+ const highlight_js_1 = __importDefault(require("highlight.js"));
10
+ // styles from https://github.com/cherryblossom000/discord-syntax-highlighting/tree/main
11
+ exports.DiscordHighlightStyles = `
12
+ .hljs-ansi-control-sequence {
13
+ display: none;
14
+ }
15
+
16
+ .hljs-ansi-style-bold {
17
+ font-weight: 700;
18
+ }
19
+
20
+ .hljs-ansi-style-underline {
21
+ text-decoration: underline;
22
+ }
23
+
24
+ .hljs-ansi-foreground-black .hljs-ansi-background-black,
25
+ .hljs-ansi-foreground-black .hljs-ansi-background-blue,
26
+ .hljs-ansi-foreground-black .hljs-ansi-background-cyan,
27
+ .hljs-ansi-foreground-black .hljs-ansi-background-green,
28
+ .hljs-ansi-foreground-black .hljs-ansi-background-magenta,
29
+ .hljs-ansi-foreground-black .hljs-ansi-background-red,
30
+ .hljs-ansi-foreground-black .hljs-ansi-background-white,
31
+ .hljs-ansi-foreground-black .hljs-ansi-background-yellow {
32
+ color: #073642;
33
+ }
34
+
35
+ .hljs-ansi-foreground-red {
36
+ color: #dc322f;
37
+ }
38
+
39
+ .hljs-ansi-foreground-green {
40
+ color: #859900;
41
+ }
42
+
43
+ .hljs-ansi-foreground-yellow {
44
+ color: #b58900;
45
+ }
46
+
47
+ .hljs-ansi-foreground-blue {
48
+ color: #268bd2;
49
+ }
50
+
51
+ .hljs-ansi-foreground-magenta {
52
+ color: #d33682;
53
+ }
54
+
55
+ .hljs-ansi-foreground-cyan {
56
+ color: #2aa198;
57
+ }
58
+
59
+ .hljs-ansi-foreground-white {
60
+ color: var(--interactive-active);
61
+ }
62
+
63
+ .hljs-ansi-foreground-white .hljs-ansi-background-black,
64
+ .hljs-ansi-foreground-white .hljs-ansi-background-blue,
65
+ .hljs-ansi-foreground-white .hljs-ansi-background-cyan,
66
+ .hljs-ansi-foreground-white .hljs-ansi-background-green,
67
+ .hljs-ansi-foreground-white .hljs-ansi-background-magenta,
68
+ .hljs-ansi-foreground-white .hljs-ansi-background-red,
69
+ .hljs-ansi-foreground-white .hljs-ansi-background-white,
70
+ .hljs-ansi-foreground-white .hljs-ansi-background-yellow {
71
+ color: #eee8d5;
72
+ }
73
+
74
+ .hljs-ansi-background-black {
75
+ background-color: #002b36;
76
+ }
77
+
78
+ .hljs-ansi-background-red {
79
+ background-color: #cb4b16;
80
+ }
81
+
82
+ .hljs-ansi-background-green {
83
+ background-color: #586e75;
84
+ }
85
+
86
+ .hljs-ansi-background-yellow {
87
+ background-color: #657b83;
88
+ }
89
+
90
+ .hljs-ansi-background-blue {
91
+ background-color: #839496;
92
+ }
93
+
94
+ .hljs-ansi-background-magenta {
95
+ background-color: #6c71c4;
96
+ }
97
+
98
+ .hljs-ansi-background-cyan {
99
+ background-color: #93a1a1;
100
+ }
101
+
102
+ .hljs-ansi-background-white {
103
+ background-color: #fdf6e3;
104
+ }
105
+
106
+ .hljs-doctag,
107
+ .hljs-keyword,
108
+ .hljs-meta .hljs-keyword,
109
+ .hljs-template-tag,
110
+ .hljs-template-variable,
111
+ .hljs-type,
112
+ .hljs-variable.language_ {
113
+ color: #ff7b72;
114
+ }
115
+
116
+ .hljs-title,
117
+ .hljs-title.class_,
118
+ .hljs-title.class_.inherited__,
119
+ .hljs-title.function_ {
120
+ color: #d2a8ff;
121
+ }
122
+
123
+ .hljs-attr,
124
+ .hljs-attribute,
125
+ .hljs-literal,
126
+ .hljs-meta,
127
+ .hljs-number,
128
+ .hljs-operator,
129
+ .hljs-selector-attr,
130
+ .hljs-selector-class,
131
+ .hljs-selector-id,
132
+ .hljs-variable {
133
+ color: #79c0ff;
134
+ }
135
+
136
+ .hljs-meta .hljs-string,
137
+ .hljs-regexp,
138
+ .hljs-string {
139
+ color: #a5d6ff;
140
+ }
141
+
142
+ .hljs-built_in,
143
+ .hljs-symbol {
144
+ color: #ffa657;
145
+ }
146
+
147
+ .hljs-code,
148
+ .hljs-comment,
149
+ .hljs-formula {
150
+ color: #8b949e;
151
+ }
152
+
153
+ .hljs-name,
154
+ .hljs-quote,
155
+ .hljs-selector-pseudo,
156
+ .hljs-selector-tag {
157
+ color: #7ee787;
158
+ }
159
+
160
+ .hljs-subst {
161
+ color: #c9d1d9;
162
+ }
163
+
164
+ .hljs-section {
165
+ color: #1f6feb;
166
+ font-weight: 700;
167
+ }
168
+
169
+ .hljs-bullet {
170
+ color: #f2cc60;
171
+ }
172
+
173
+ .hljs-emphasis {
174
+ color: #c9d1d9;
175
+ font-style: italic;
176
+ }
177
+
178
+ .hljs-strong {
179
+ color: #c9d1d9;
180
+ font-weight: 700;
181
+ }
182
+
183
+ .hljs-addition {
184
+ color: #aff5b4;
185
+ background-color: #033a16;
186
+ }
187
+
188
+ .hljs-deletion {
189
+ color: #ffdcd7;
190
+ background-color: #67060c;
191
+ }
192
+ `;
193
+ function DiscordHighlightedCode(props) {
194
+ const highlighted = props.language
195
+ ? highlight_js_1.default.highlight(props.content, { language: props.language })
196
+ : highlight_js_1.default.highlightAuto(props.content);
197
+ return (0, jsx_runtime_1.jsx)("discord-code", { multiline: true, className: "theme-dark hljs", dangerouslySetInnerHTML: { __html: highlighted.value } });
198
+ }
199
+ //# sourceMappingURL=DiscordHighlightedCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiscordHighlightedCode.js","sourceRoot":"","sources":["../../../../src/generator/renderers/components/DiscordHighlightedCode.tsx"],"names":[],"mappings":";;;;;;AA+LA,wDAMC;;AArMD,gEAAgC;AAOhC,wFAAwF;AAC3E,QAAA,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqLrC,CAAC;AAEF,SAAgB,sBAAsB,CAAC,KAAqB;IAC1D,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ;QAChC,CAAC,CAAC,sBAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;QAC7D,CAAC,CAAC,sBAAI,CAAC,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAEtC,OAAO,yCAAc,SAAS,QAAC,SAAS,EAAC,iBAAiB,EAAC,uBAAuB,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,KAAK,EAAE,GAAI,CAAC;AACxH,CAAC"}
@@ -0,0 +1,6 @@
1
+ export type DiscordImageAttachmentProps = {
2
+ url: string;
3
+ alt?: string;
4
+ };
5
+ export declare const DiscordAttachmentStyles = "\n .discord-attachment-container {\n display: block;\n position: relative;\n max-width: min(100%, 525px);\n }\n\n .discord-attachment-container > img {\n max-width: 100%;\n border-radius: 8px;\n }\n";
6
+ export declare function DiscordImageAttachment(props: DiscordImageAttachmentProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DiscordAttachmentStyles = void 0;
4
+ exports.DiscordImageAttachment = DiscordImageAttachment;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ exports.DiscordAttachmentStyles = `
7
+ .discord-attachment-container {
8
+ display: block;
9
+ position: relative;
10
+ max-width: min(100%, 525px);
11
+ }
12
+
13
+ .discord-attachment-container > img {
14
+ max-width: 100%;
15
+ border-radius: 8px;
16
+ }
17
+ `;
18
+ function DiscordImageAttachment(props) {
19
+ return ((0, jsx_runtime_1.jsx)("div", { slot: "attachments", className: "discord-attachment-container", children: (0, jsx_runtime_1.jsx)("img", { src: props.url, alt: props.alt }) }));
20
+ }
21
+ //# sourceMappingURL=DiscordImage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiscordImage.js","sourceRoot":"","sources":["../../../../src/generator/renderers/components/DiscordImage.tsx"],"names":[],"mappings":";;;AAoBA,wDAMC;;AAnBY,QAAA,uBAAuB,GAAG;;;;;;;;;;;CAWtC,CAAC;AAEF,SAAgB,sBAAsB,CAAC,KAAkC;IACvE,OAAO,CACL,gCAAK,IAAI,EAAC,aAAa,EAAC,SAAS,EAAC,8BAA8B,YAC9D,gCAAK,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,GAAI,GACnC,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { MediaGalleryComponent } from 'discord.js';
2
+ declare function DiscordMediaGallery({ component }: {
3
+ component: MediaGalleryComponent;
4
+ }): import("react/jsx-runtime").JSX.Element | null;
5
+ export default DiscordMediaGallery;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const utils_1 = require("./utils");
5
+ function DiscordMediaGallery({ component }) {
6
+ if (!component.items || component.items.length === 0) {
7
+ return null;
8
+ }
9
+ const count = component.items.length;
10
+ const imagesToShow = component.items.slice(0, 10);
11
+ const hasMore = component.items.length > 10;
12
+ return ((0, jsx_runtime_1.jsx)("div", { style: (0, utils_1.getGalleryLayout)(count), children: imagesToShow.map((media, idx) => ((0, jsx_runtime_1.jsxs)("div", { style: (0, utils_1.getImageStyle)(idx, count), children: [(0, jsx_runtime_1.jsx)("img", { src: media.media.url, alt: media.description || 'Media content', style: {
13
+ width: '100%',
14
+ height: '100%',
15
+ objectFit: 'cover',
16
+ } }), hasMore && idx === imagesToShow.length - 1 && ((0, jsx_runtime_1.jsxs)("div", { style: {
17
+ position: 'absolute',
18
+ top: 0,
19
+ left: 0,
20
+ width: '100%',
21
+ height: '100%',
22
+ display: 'flex',
23
+ alignItems: 'center',
24
+ justifyContent: 'center',
25
+ backgroundColor: 'rgba(0, 0, 0, 0.7)',
26
+ color: 'white',
27
+ fontSize: '20px',
28
+ fontWeight: 'bold',
29
+ }, children: ["+", component.items.length - 10] }))] }, idx))) }));
30
+ }
31
+ exports.default = DiscordMediaGallery;
32
+ //# sourceMappingURL=Media%20Gallery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Media Gallery.js","sourceRoot":"","sources":["../../../../src/generator/renderers/components/Media Gallery.tsx"],"names":[],"mappings":";;;AACA,mCAA0D;AAE1D,SAAS,mBAAmB,CAAC,EAAE,SAAS,EAAwC;IAC9E,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,SAAS,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC;IACrC,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;IAE5C,OAAO,CACL,gCAAK,KAAK,EAAE,IAAA,wBAAgB,EAAC,KAAK,CAAC,YAChC,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,iCAAe,KAAK,EAAE,IAAA,qBAAa,EAAC,GAAG,EAAE,KAAK,CAAC,aAC7C,gCACE,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,EACpB,GAAG,EAAE,KAAK,CAAC,WAAW,IAAI,eAAe,EACzC,KAAK,EAAE;wBACL,KAAK,EAAE,MAAM;wBACb,MAAM,EAAE,MAAM;wBACd,SAAS,EAAE,OAAO;qBACnB,GACD,EACD,OAAO,IAAI,GAAG,KAAK,YAAY,CAAC,MAAM,GAAG,CAAC,IAAI,CAC7C,iCACE,KAAK,EAAE;wBACL,QAAQ,EAAE,UAAU;wBACpB,GAAG,EAAE,CAAC;wBACN,IAAI,EAAE,CAAC;wBACP,KAAK,EAAE,MAAM;wBACb,MAAM,EAAE,MAAM;wBACd,OAAO,EAAE,MAAM;wBACf,UAAU,EAAE,QAAQ;wBACpB,cAAc,EAAE,QAAQ;wBACxB,eAAe,EAAE,oBAAoB;wBACrC,KAAK,EAAE,OAAO;wBACd,QAAQ,EAAE,MAAM;wBAChB,UAAU,EAAE,MAAM;qBACnB,kBAEC,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,IACzB,CACP,KA7BO,GAAG,CA8BP,CACP,CAAC,GACE,CACP,CAAC;AACJ,CAAC;AAED,kBAAe,mBAAmB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type MessageActionRowComponent, ComponentType } from 'discord.js';
2
+ declare function DiscordSelectMenu({ component, }: {
3
+ component: Exclude<MessageActionRowComponent, {
4
+ type: ComponentType.Button;
5
+ }>;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ export default DiscordSelectMenu;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const discord_js_1 = require("discord.js");
5
+ const utils_1 = require("../../../utils/utils");
6
+ const utils_2 = require("./utils");
7
+ function DiscordSelectMenu({ component, }) {
8
+ const isStringSelect = component.type === discord_js_1.ComponentType.StringSelect;
9
+ const placeholder = component.placeholder || (0, utils_2.getSelectTypeLabel)(component.type);
10
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "discord-select-menu", children: [(0, jsx_runtime_1.jsx)("div", { style: { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }, children: placeholder }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', alignItems: 'center', marginLeft: '8px' }, children: (0, jsx_runtime_1.jsx)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M7 10L12 15L17 10H7Z" }) }) }), isStringSelect && component.options && component.options.length > 0 && ((0, jsx_runtime_1.jsx)("div", { style: {
11
+ display: 'none',
12
+ position: 'absolute',
13
+ top: '44px',
14
+ left: '0',
15
+ width: '100%',
16
+ backgroundColor: '#2b2d31',
17
+ borderRadius: '4px',
18
+ zIndex: 10,
19
+ border: '1px solid #1e1f22',
20
+ maxHeight: '320px',
21
+ overflowY: 'auto',
22
+ }, children: component.options.map((option, idx) => ((0, jsx_runtime_1.jsxs)("div", { style: {
23
+ padding: '8px 12px',
24
+ cursor: 'pointer',
25
+ display: 'flex',
26
+ alignItems: 'center',
27
+ borderBottom: idx < component.options.length - 1 ? '1px solid #1e1f22' : 'none',
28
+ }, children: [option.emoji && (0, jsx_runtime_1.jsx)("span", { style: { marginRight: '8px' }, children: (0, utils_1.parseDiscordEmoji)(option.emoji) }), (0, jsx_runtime_1.jsx)("span", { children: option.label })] }, idx))) }))] }));
29
+ }
30
+ exports.default = DiscordSelectMenu;
31
+ //# sourceMappingURL=Select%20Menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select Menu.js","sourceRoot":"","sources":["../../../../src/generator/renderers/components/Select Menu.tsx"],"names":[],"mappings":";;;AAAA,2CAA2E;AAC3E,gDAAyD;AACzD,mCAA6C;AAE7C,SAAS,iBAAiB,CAAC,EACzB,SAAS,GAGV;IACC,MAAM,cAAc,GAAG,SAAS,CAAC,IAAI,KAAK,0BAAa,CAAC,YAAY,CAAC;IACrE,MAAM,WAAW,GAAG,SAAS,CAAC,WAAW,IAAI,IAAA,0BAAkB,EAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAEhF,OAAO,CACL,iCAAK,SAAS,EAAC,qBAAqB,aAClC,gCAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAG,WAAW,GAAO,EACvG,gCAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,YACtE,gCAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,YAC7C,iCAAM,IAAI,EAAC,cAAc,EAAC,CAAC,EAAC,sBAAsB,GAAG,GACjD,GACF,EACL,cAAc,IAAI,SAAS,CAAC,OAAO,IAAI,SAAS,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CACtE,gCACE,KAAK,EAAE;oBACL,OAAO,EAAE,MAAM;oBACf,QAAQ,EAAE,UAAU;oBACpB,GAAG,EAAE,MAAM;oBACX,IAAI,EAAE,GAAG;oBACT,KAAK,EAAE,MAAM;oBACb,eAAe,EAAE,SAAS;oBAC1B,YAAY,EAAE,KAAK;oBACnB,MAAM,EAAE,EAAE;oBACV,MAAM,EAAE,mBAAmB;oBAC3B,SAAS,EAAE,OAAO;oBAClB,SAAS,EAAE,MAAM;iBAClB,YAEA,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CACtC,iCAEE,KAAK,EAAE;wBACL,OAAO,EAAE,UAAU;wBACnB,MAAM,EAAE,SAAS;wBACjB,OAAO,EAAE,MAAM;wBACf,UAAU,EAAE,QAAQ;wBACpB,YAAY,EAAE,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM;qBAChF,aAEA,MAAM,CAAC,KAAK,IAAI,iCAAM,KAAK,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,YAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,KAAK,CAAC,GAAQ,EAC9F,2CAAO,MAAM,CAAC,KAAK,GAAQ,KAVtB,GAAG,CAWJ,CACP,CAAC,GACE,CACP,IACG,CACP,CAAC;AACJ,CAAC;AAED,kBAAe,iBAAiB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { SeparatorSpacingSize } from 'discord.js';
2
+ declare function DiscordSeparator({ divider, spacing }: {
3
+ divider: boolean;
4
+ spacing: SeparatorSpacingSize;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ export default DiscordSeparator;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const discord_js_1 = require("discord.js");
5
+ function DiscordSeparator({ divider, spacing }) {
6
+ return ((0, jsx_runtime_1.jsx)("div", { style: {
7
+ width: '100%',
8
+ height: divider ? '1px' : '0px',
9
+ backgroundColor: '#4f5359',
10
+ margin: spacing === discord_js_1.SeparatorSpacingSize.Large ? '8px 0' : '0',
11
+ } }));
12
+ }
13
+ exports.default = DiscordSeparator;
14
+ //# sourceMappingURL=Spacing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spacing.js","sourceRoot":"","sources":["../../../../src/generator/renderers/components/Spacing.tsx"],"names":[],"mappings":";;;AAAA,2CAAkD;AAElD,SAAS,gBAAgB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAuD;IACjG,OAAO,CACL,gCACE,KAAK,EAAE;YACL,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK;YAC/B,eAAe,EAAE,SAAS;YAC1B,MAAM,EAAE,OAAO,KAAK,iCAAoB,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;SAC/D,GACD,CACH,CAAC;AACJ,CAAC;AAED,kBAAe,gBAAgB,CAAC"}
@@ -0,0 +1,4 @@
1
+ declare function DiscordThumbnail({ url }: {
2
+ url: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ export default DiscordThumbnail;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ function DiscordThumbnail({ url }) {
5
+ return ((0, jsx_runtime_1.jsx)("img", { src: url, alt: "Thumbnail", style: {
6
+ width: '85px',
7
+ height: '85px',
8
+ objectFit: 'cover',
9
+ borderRadius: '8px',
10
+ } }));
11
+ }
12
+ exports.default = DiscordThumbnail;
13
+ //# sourceMappingURL=Thumbnail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Thumbnail.js","sourceRoot":"","sources":["../../../../src/generator/renderers/components/Thumbnail.tsx"],"names":[],"mappings":";;;AAAA,SAAS,gBAAgB,CAAC,EAAE,GAAG,EAAmB;IAChD,OAAO,CACL,gCACE,GAAG,EAAE,GAAG,EACR,GAAG,EAAC,WAAW,EACf,KAAK,EAAE;YACL,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,MAAM;YACd,SAAS,EAAE,OAAO;YAClB,YAAY,EAAE,KAAK;SACpB,GACD,CACH,CAAC;AACJ,CAAC;AAED,kBAAe,gBAAgB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type ReactNode } from 'react';
2
+ export type TranscriptHeaderProps = {
3
+ guildName: string;
4
+ channelName: string;
5
+ guildIcon?: string;
6
+ children?: ReactNode;
7
+ };
8
+ export declare function TranscriptHeader(props: TranscriptHeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TranscriptHeader = TranscriptHeader;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ function TranscriptHeader(props) {
6
+ // If guild has no icon, we take first letter of guild name words
7
+ // i.e. Guild A -> GA
8
+ // and OneWordGuildName -> O
9
+ const split = props.guildName.split(' ');
10
+ const placeholder = split.length > 1 ? split[0][0] + split[1][0] : split[0][0];
11
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "discord-header", children: [(0, jsx_runtime_1.jsx)("div", { className: "discord-header-icon", children: props.guildIcon ? ((0, jsx_runtime_1.jsx)("img", { src: props.guildIcon, alt: "guild icon" })) : ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("span", { children: placeholder }) })) }), (0, jsx_runtime_1.jsxs)("div", { className: "discord-header-text", children: [(0, jsx_runtime_1.jsx)("div", { className: "discord-header-text-guild", children: props.guildName }), (0, jsx_runtime_1.jsxs)("div", { className: "discord-header-text-channel", children: ["#", props.channelName] }), props.children] })] }));
12
+ }
13
+ //# sourceMappingURL=TranscriptHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TranscriptHeader.js","sourceRoot":"","sources":["../../../../src/generator/renderers/components/TranscriptHeader.tsx"],"names":[],"mappings":";;AASA,4CAyBC;;AAzBD,SAAgB,gBAAgB,CAAC,KAA4B;IAC3D,iEAAiE;IACjE,qBAAqB;IACrB,4BAA4B;IAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzC,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE/E,OAAO,CACL,iCAAK,SAAS,EAAC,gBAAgB,aAC7B,gCAAK,SAAS,EAAC,qBAAqB,YACjC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CACjB,gCAAK,GAAG,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,EAAC,YAAY,GAAG,CAC/C,CAAC,CAAC,CAAC,CACF,0CACE,2CAAO,WAAW,GAAQ,GACtB,CACP,GACG,EACN,iCAAK,SAAS,EAAC,qBAAqB,aAClC,gCAAK,SAAS,EAAC,2BAA2B,YAAE,KAAK,CAAC,SAAS,GAAO,EAClE,iCAAK,SAAS,EAAC,6BAA6B,kBAAG,KAAK,CAAC,WAAW,IAAO,EACtE,KAAK,CAAC,QAAQ,IACX,IACF,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { ButtonComponent, ThumbnailComponent } from 'discord.js';
3
+ interface DiscordSectionProps {
4
+ children: React.ReactNode;
5
+ accessory?: ButtonComponent | ThumbnailComponent;
6
+ id: number;
7
+ }
8
+ declare function DiscordSection({ children, accessory, id }: DiscordSectionProps): import("react/jsx-runtime").JSX.Element;
9
+ export default DiscordSection;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const components_1 = require("../../components");
8
+ const SectionContent_1 = __importDefault(require("./SectionContent"));
9
+ const SectionAccessory_1 = __importDefault(require("./SectionAccessory"));
10
+ function DiscordSection({ children, accessory, id }) {
11
+ return ((0, jsx_runtime_1.jsxs)("div", { style: {
12
+ display: 'flex',
13
+ flexDirection: 'row',
14
+ width: '100%',
15
+ maxWidth: '500px',
16
+ }, children: [(0, jsx_runtime_1.jsx)(SectionContent_1.default, { children: children }), (0, jsx_runtime_1.jsx)(SectionAccessory_1.default, { children: accessory && (0, jsx_runtime_1.jsx)(components_1.Component, { component: accessory, id: id }) })] }));
17
+ }
18
+ exports.default = DiscordSection;
19
+ //# sourceMappingURL=Section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Section.js","sourceRoot":"","sources":["../../../../../src/generator/renderers/components/section/Section.tsx"],"names":[],"mappings":";;;;;;AAEA,iDAA6C;AAC7C,sEAA8C;AAC9C,0EAAkD;AAQlD,SAAS,cAAc,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAuB;IACtE,OAAO,CACL,iCACE,KAAK,EAAE;YACL,OAAO,EAAE,MAAM;YACf,aAAa,EAAE,KAAK;YACpB,KAAK,EAAE,MAAM;YACb,QAAQ,EAAE,OAAO;SAClB,aAED,uBAAC,wBAAc,cAAE,QAAQ,GAAkB,EAC3C,uBAAC,0BAAgB,cAAE,SAAS,IAAI,uBAAC,sBAAS,IAAC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,GAAI,GAAoB,IAC3F,CACP,CAAC;AACJ,CAAC;AAED,kBAAe,cAAc,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface SectionAccessoryProps {
3
+ children?: React.ReactNode;
4
+ }
5
+ declare function SectionAccessory({ children }: SectionAccessoryProps): import("react/jsx-runtime").JSX.Element | null;
6
+ export default SectionAccessory;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ function SectionAccessory({ children }) {
5
+ if (!children)
6
+ return null;
7
+ return ((0, jsx_runtime_1.jsx)("div", { style: {
8
+ display: 'flex',
9
+ width: '100%',
10
+ maxWidth: '500px',
11
+ justifyContent: 'flex-end',
12
+ alignItems: 'center',
13
+ }, children: children }));
14
+ }
15
+ exports.default = SectionAccessory;
16
+ //# sourceMappingURL=SectionAccessory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SectionAccessory.js","sourceRoot":"","sources":["../../../../../src/generator/renderers/components/section/SectionAccessory.tsx"],"names":[],"mappings":";;;AAMA,SAAS,gBAAgB,CAAC,EAAE,QAAQ,EAAyB;IAC3D,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAE3B,OAAO,CACL,gCACE,KAAK,EAAE;YACL,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,MAAM;YACb,QAAQ,EAAE,OAAO;YACjB,cAAc,EAAE,UAAU;YAC1B,UAAU,EAAE,QAAQ;SACrB,YAEA,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,kBAAe,gBAAgB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface SectionContentProps {
3
+ children: React.ReactNode;
4
+ }
5
+ declare function SectionContent({ children }: SectionContentProps): import("react/jsx-runtime").JSX.Element;
6
+ export default SectionContent;