From 8ba7ed01cc9e2d68370cd6f13fb42eb05aeec96e Mon Sep 17 00:00:00 2001 From: twlite <46562212+twlite@users.noreply.github.com> Date: Sat, 25 Oct 2025 21:56:14 +0545 Subject: [PATCH 1/2] feat: file upload component --- .gitignore | 3 +- .prettierignore | 1 + .../app/commands/(interactions)/prompt.tsx | 4 ++ .../commandkit/classes/app-events-handler.mdx | 2 +- .../commandkit/functions/file-upload.mdx | 36 ++++++++++++++ .../commandkit/functions/modal.mdx | 2 +- .../commandkit/functions/paragraph-input.mdx | 2 +- .../commandkit/functions/short-input.mdx | 2 +- .../commandkit/functions/text-input.mdx | 2 +- .../app-events-handler-loaded-data.mdx | 2 +- .../interfaces/file-upload-props.mdx | 44 +++++++++++++++++ .../commandkit/interfaces/loaded-event.mdx | 2 +- .../commandkit/interfaces/modal-props.mdx | 2 +- .../interfaces/text-input-props.mdx | 2 +- .../commandkit/types/event-listener.mdx | 6 +++ examples/basic-js/package.json | 2 +- examples/basic-ts/package.json | 2 +- examples/deno-ts/package.json | 2 +- examples/with-ai/package.json | 2 +- examples/with-leveling-system/package.json | 2 +- examples/without-cli/package.json | 2 +- .../src/components/interactive/modal/Modal.ts | 44 ++++++++++++++++- pnpm-lock.yaml | 48 +++++++++---------- pnpm-workspace.yaml | 2 +- 24 files changed, 176 insertions(+), 42 deletions(-) create mode 100644 apps/website/docs/api-reference/commandkit/functions/file-upload.mdx create mode 100644 apps/website/docs/api-reference/commandkit/interfaces/file-upload-props.mdx diff --git a/.gitignore b/.gitignore index c85d94a0..053cffdd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules dist .DS_Store -.turbo \ No newline at end of file +.turbo +apps/docs \ No newline at end of file diff --git a/.prettierignore b/.prettierignore index ad824971..34d0ab31 100644 --- a/.prettierignore +++ b/.prettierignore @@ -8,6 +8,7 @@ node_modules **/devtools/ui dist build +.next .commandkit .DS_Store diff --git a/apps/test-bot/src/app/commands/(interactions)/prompt.tsx b/apps/test-bot/src/app/commands/(interactions)/prompt.tsx index 7b0facd5..f9ef311e 100644 --- a/apps/test-bot/src/app/commands/(interactions)/prompt.tsx +++ b/apps/test-bot/src/app/commands/(interactions)/prompt.tsx @@ -9,6 +9,7 @@ import { ChatInputCommandContext, StringSelectMenu, StringSelectMenuOption, + FileUpload, } from 'commandkit'; import { ComponentType, MessageFlags } from 'discord.js'; @@ -42,6 +43,9 @@ export async function chatInput(ctx: ChatInputCommandContext) { placeholder="Lorem ipsum dolor sit amet..." /> +