commandkit 1.2.0-rc.9 → 1.2.1

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 (421) hide show
  1. package/LICENSE +19 -3
  2. package/README.md +45 -26
  3. package/bin/index.mjs +1 -1
  4. package/cli.d.ts +19 -0
  5. package/config.cjs +3 -0
  6. package/config.d.ts +1 -0
  7. package/dist/{ActionRow-DKnFVDME.d.ts → ActionRow-Bt9qi0Mb.d.ts} +4 -5
  8. package/dist/{Button-4ZUXdA56.d.ts → Button-DxJLcZIU.d.ts} +7 -8
  9. package/dist/{ButtonKit-C7r7RPNf.d.ts → ButtonKit-BfcyvWfj.d.ts} +4 -5
  10. package/dist/{ChannelSelectMenuKit-BrXvBYNH.d.ts → ChannelSelectMenuKit-DYkudikb.d.ts} +5 -6
  11. package/dist/{CommandsRouter-CoOA7hkf.d.ts → CommandsRouter-DiNoF0dq.d.ts} +2 -3
  12. package/dist/{EventInterceptor-x-R2qshQ.d.ts → EventInterceptor-D9JKMcfi.d.ts} +2 -2
  13. package/dist/{EventsRouter-BacqK6z3.d.ts → EventsRouter-EuuSu6NH.d.ts} +2 -2
  14. package/dist/{MentionableSelectMenuKit-CPTKqx-O.d.ts → MentionableSelectMenuKit-Mu4xqP6B.d.ts} +5 -6
  15. package/dist/{MessageCommandParser-ROLibZPX.d.ts → MessageCommandParser-DPCbHXCS.d.ts} +4 -5
  16. package/dist/{Modal-C6UTRdYQ.d.ts → Modal-v9rrcMl-.d.ts} +25 -12
  17. package/dist/{ModalKit-Btz58KYn.d.ts → ModalKit-XJSM65SV.d.ts} +4 -5
  18. package/dist/{RoleSelectMenuKit-C26lU3sN.d.ts → RoleSelectMenuKit-CCjcp3HY.d.ts} +5 -6
  19. package/dist/{SelectMenu-Diy87_ba.d.ts → SelectMenu-CY0vvoSu.d.ts} +17 -14
  20. package/dist/{StringSelectMenuKit-Bhs8U6WI.d.ts → StringSelectMenuKit-G5nBTicX.d.ts} +5 -6
  21. package/dist/{UserSelectMenuKit-CfqFJdxz.d.ts → UserSelectMenuKit-D3SO_fXA.d.ts} +5 -6
  22. package/dist/analytics/analytics-engine.d.ts +1 -31
  23. package/dist/analytics/analytics-engine.js +2 -36
  24. package/dist/analytics/analytics-provider.d.ts +1 -31
  25. package/dist/analytics/analytics-provider.js +1 -0
  26. package/dist/analytics/constants.js +26 -3
  27. package/dist/analytics/constants.js.map +1 -0
  28. package/dist/analytics/utils.js +2 -36
  29. package/dist/{analytics-engine-B7JNRnEN.d.ts → analytics-engine-DnRsHBId.d.ts} +48 -34
  30. package/dist/app/commands/AppCommandRunner.d.ts +1 -31
  31. package/dist/app/commands/AppCommandRunner.js +2 -36
  32. package/dist/app/commands/Context.d.ts +1 -31
  33. package/dist/app/commands/Context.js +2 -36
  34. package/dist/app/commands/MessageCommandParser.d.ts +1 -1
  35. package/dist/app/commands/MessageCommandParser.js +261 -4
  36. package/dist/app/commands/MessageCommandParser.js.map +1 -0
  37. package/dist/app/commands/helpers.d.ts +1 -1
  38. package/dist/app/commands/helpers.js +25 -3
  39. package/dist/app/commands/helpers.js.map +1 -0
  40. package/dist/app/events/EventWorkerContext.d.ts +42 -33
  41. package/dist/app/events/EventWorkerContext.js +48 -5
  42. package/dist/app/events/EventWorkerContext.js.map +1 -0
  43. package/dist/app/handlers/AppCommandHandler.d.ts +1 -31
  44. package/dist/app/handlers/AppCommandHandler.js +2 -36
  45. package/dist/app/handlers/AppEventsHandler.d.ts +1 -31
  46. package/dist/app/handlers/AppEventsHandler.js +2 -36
  47. package/dist/app/index.d.ts +4 -31
  48. package/dist/app/index.js +13 -45
  49. package/dist/app/interrupt/signals.d.ts +1 -1
  50. package/dist/app/interrupt/signals.js +54 -7
  51. package/dist/app/interrupt/signals.js.map +1 -0
  52. package/dist/app/middlewares/permissions.d.ts +1 -31
  53. package/dist/app/middlewares/permissions.js +2 -36
  54. package/dist/app/register/CommandRegistrar.d.ts +1 -31
  55. package/dist/app/register/CommandRegistrar.js +2 -36
  56. package/dist/app/router/CommandsRouter.d.ts +1 -1
  57. package/dist/app/router/CommandsRouter.js +210 -2
  58. package/dist/app/router/CommandsRouter.js.map +1 -0
  59. package/dist/app/router/EventsRouter.d.ts +1 -1
  60. package/dist/app/router/EventsRouter.js +128 -2
  61. package/dist/app/router/EventsRouter.js.map +1 -0
  62. package/dist/app/router/index.d.ts +2 -3
  63. package/dist/app/router/index.js +5 -5
  64. package/dist/{chunk-nOFOJqeH.js → chunk-BE-pF4vm.js} +11 -7
  65. package/dist/cli/app-process.d.ts +2 -3
  66. package/dist/cli/app-process.js +60 -7
  67. package/dist/cli/app-process.js.map +1 -0
  68. package/dist/cli/build.d.ts +2 -31
  69. package/dist/cli/build.js +171 -41
  70. package/dist/cli/build.js.map +1 -0
  71. package/dist/cli/common.d.ts +10 -34
  72. package/dist/cli/common.js +182 -11
  73. package/dist/cli/common.js.map +1 -0
  74. package/dist/cli/development.d.ts +18 -1
  75. package/dist/cli/development.js +52 -78
  76. package/dist/cli/development.js.map +1 -1
  77. package/dist/cli/env.d.ts +4 -0
  78. package/dist/cli/env.js +73 -9
  79. package/dist/cli/env.js.map +1 -0
  80. package/dist/cli/generators.js +10 -13
  81. package/dist/cli/generators.js.map +1 -1
  82. package/dist/cli/information.js +11 -10
  83. package/dist/cli/information.js.map +1 -1
  84. package/dist/cli/init.d.ts +12 -2
  85. package/dist/cli/init.js +83 -38
  86. package/dist/cli/init.js.map +1 -0
  87. package/dist/cli/production.d.ts +2 -3
  88. package/dist/cli/production.js +19 -52
  89. package/dist/cli/production.js.map +1 -1
  90. package/dist/cli/type-checker.js +83 -6
  91. package/dist/cli/type-checker.js.map +1 -0
  92. package/dist/cli/utils.d.ts +0 -1
  93. package/dist/cli/utils.js +18 -2
  94. package/dist/cli/utils.js.map +1 -0
  95. package/dist/{commandkit-Bm0gLN8i.js → commandkit-Bh7C1_c7.js} +3219 -2616
  96. package/dist/commandkit-Bh7C1_c7.js.map +1 -0
  97. package/dist/commandkit.d.ts +1 -31
  98. package/dist/commandkit.js +2 -36
  99. package/dist/{common-DOCvOVC4.d.ts → common-CCvvgnxi.d.ts} +4 -5
  100. package/dist/components/common/EventInterceptor.d.ts +1 -1
  101. package/dist/components/common/EventInterceptor.js +137 -2
  102. package/dist/components/common/EventInterceptor.js.map +1 -0
  103. package/dist/components/common/element.d.ts +2 -5
  104. package/dist/components/common/element.js +10 -8
  105. package/dist/components/common/types.d.ts +1 -1
  106. package/dist/components/common/types.js +1 -1
  107. package/dist/components/{v2 → display}/common.d.ts +1 -2
  108. package/dist/components/display/common.js +4 -0
  109. package/dist/components/display/container.d.ts +2 -0
  110. package/dist/components/display/container.js +4 -0
  111. package/dist/components/display/file.d.ts +2 -0
  112. package/dist/{file-DVOELoNv.js → components/display/file.js} +5 -10
  113. package/dist/components/display/file.js.map +1 -0
  114. package/dist/components/display/index.d.ts +9 -0
  115. package/dist/components/display/index.js +19 -0
  116. package/dist/components/display/label.d.ts +2 -0
  117. package/dist/components/display/label.js +4 -0
  118. package/dist/components/display/media-gallery.d.ts +2 -0
  119. package/dist/components/display/media-gallery.js +5 -0
  120. package/dist/components/display/poll.d.ts +2 -0
  121. package/dist/components/display/poll.js +86 -0
  122. package/dist/components/display/poll.js.map +1 -0
  123. package/dist/components/display/section.d.ts +2 -0
  124. package/dist/components/display/section.js +5 -0
  125. package/dist/components/display/separator.d.ts +2 -0
  126. package/dist/{separator-DL6QH5H1.js → components/display/separator.js} +5 -10
  127. package/dist/components/display/separator.js.map +1 -0
  128. package/dist/components/display/text-display.d.ts +2 -0
  129. package/dist/{text-display-DbMumig_.js → components/display/text-display.js} +5 -10
  130. package/dist/components/display/text-display.js.map +1 -0
  131. package/dist/components/index.d.ts +23 -24
  132. package/dist/components/index.js +29 -53
  133. package/dist/components/interactive/action-row/ActionRow.d.ts +2 -0
  134. package/dist/{ActionRow-CbdGFWMT.js → components/interactive/action-row/ActionRow.js} +5 -10
  135. package/dist/components/interactive/action-row/ActionRow.js.map +1 -0
  136. package/dist/components/interactive/button/Button.d.ts +2 -0
  137. package/dist/components/interactive/button/Button.js +4 -0
  138. package/dist/components/interactive/button/ButtonKit.d.ts +2 -0
  139. package/dist/components/interactive/button/ButtonKit.js +4 -0
  140. package/dist/components/interactive/modal/Modal.d.ts +2 -0
  141. package/dist/components/interactive/modal/Modal.js +8 -0
  142. package/dist/components/interactive/modal/ModalKit.d.ts +2 -0
  143. package/dist/components/interactive/modal/ModalKit.js +4 -0
  144. package/dist/components/interactive/select-menu/ChannelSelectMenuKit.d.ts +2 -0
  145. package/dist/components/interactive/select-menu/ChannelSelectMenuKit.js +4 -0
  146. package/dist/components/interactive/select-menu/MentionableSelectMenuKit.d.ts +2 -0
  147. package/dist/components/interactive/select-menu/MentionableSelectMenuKit.js +4 -0
  148. package/dist/components/interactive/select-menu/RoleSelectMenuKit.d.ts +2 -0
  149. package/dist/components/interactive/select-menu/RoleSelectMenuKit.js +4 -0
  150. package/dist/components/interactive/select-menu/SelectMenu.d.ts +2 -0
  151. package/dist/components/interactive/select-menu/SelectMenu.js +9 -0
  152. package/dist/components/interactive/select-menu/StringSelectMenuKit.d.ts +2 -0
  153. package/dist/components/interactive/select-menu/StringSelectMenuKit.js +4 -0
  154. package/dist/components/interactive/select-menu/UserSelectMenuKit.d.ts +2 -0
  155. package/dist/components/interactive/select-menu/UserSelectMenuKit.js +4 -0
  156. package/dist/components/interactive/select-menu/common.d.ts +2 -0
  157. package/dist/components/interactive/select-menu/common.js +1 -0
  158. package/dist/config/config.d.ts +15 -33
  159. package/dist/config/config.js +2 -36
  160. package/dist/config/default.d.ts +1 -31
  161. package/dist/config/default.js +2 -36
  162. package/dist/config/loader.d.ts +1 -31
  163. package/dist/config/loader.js +2 -36
  164. package/dist/config/types.d.ts +1 -31
  165. package/dist/config/types.js +1 -0
  166. package/dist/config/utils.d.ts +1 -31
  167. package/dist/config/utils.js +29 -2
  168. package/dist/config/utils.js.map +1 -0
  169. package/dist/{constants-D8PMA9on.d.ts → constants-DqtJY0t-.d.ts} +3 -3
  170. package/dist/{constants-MKu-Q1jh.d.ts → constants-DwxpkIeH.d.ts} +8 -2
  171. package/dist/{container-DHBELeJ3.d.ts → container-CYojOA9d.d.ts} +3 -4
  172. package/dist/context/async-context.d.ts +1 -31
  173. package/dist/context/async-context.js +2 -36
  174. package/dist/context/environment.d.ts +1 -31
  175. package/dist/context/environment.js +2 -36
  176. package/dist/{element-CAXu1XtK.d.ts → element-DeLvTMfZ.d.ts} +5 -5
  177. package/dist/events/CommandKitEventsChannel.d.ts +1 -31
  178. package/dist/events/CommandKitEventsChannel.js +83 -2
  179. package/dist/events/CommandKitEventsChannel.js.map +1 -0
  180. package/dist/{file-DTrr-p09.d.ts → file-DLO1zEcH.d.ts} +3 -4
  181. package/dist/flags/FlagProvider.d.ts +1 -31
  182. package/dist/flags/FlagProvider.js +1 -0
  183. package/dist/flags/FlagProvider.js.map +1 -1
  184. package/dist/flags/feature-flags.d.ts +1 -31
  185. package/dist/flags/feature-flags.js +5 -40
  186. package/dist/flags/store.d.ts +1 -31
  187. package/dist/flags/store.js +13 -2
  188. package/dist/flags/store.js.map +1 -0
  189. package/dist/{helpers-Wg6P5fRQ.d.ts → helpers-zmC44Mcu.d.ts} +2 -3
  190. package/dist/index-BIsCUWAs.d.ts +1 -0
  191. package/dist/index-CwHYpK-f.d.ts +1 -0
  192. package/dist/index-DHrsNvX1.d.ts +1 -0
  193. package/dist/index.d.ts +41 -42
  194. package/dist/index.js +80 -98
  195. package/dist/kv/constants.d.ts +1 -1
  196. package/dist/kv/constants.js +22 -2
  197. package/dist/kv/constants.js.map +1 -0
  198. package/dist/kv/dotprops.js +26 -3
  199. package/dist/kv/dotprops.js.map +1 -0
  200. package/dist/kv/kv.d.ts +1 -2
  201. package/dist/kv/kv.js +15 -18
  202. package/dist/kv/kv.js.map +1 -1
  203. package/dist/kv/serde.d.ts +12 -3
  204. package/dist/kv/serde.js +87 -4
  205. package/dist/kv/serde.js.map +1 -0
  206. package/dist/label-DqGRqodo.d.ts +28 -0
  207. package/dist/logger/DefaultLogger.d.ts +66 -3
  208. package/dist/logger/DefaultLogger.js +2 -36
  209. package/dist/logger/ILogger.d.ts +64 -2
  210. package/dist/logger/ILogger.js +1 -1
  211. package/dist/logger/Logger.d.ts +36 -3
  212. package/dist/logger/Logger.js +2 -36
  213. package/dist/logger/NoopLogger.d.ts +1 -2
  214. package/dist/logger/NoopLogger.js +1 -0
  215. package/dist/logger/NoopLogger.js.map +1 -1
  216. package/dist/{media-gallery-BMsXSot3.d.ts → media-gallery-Ca8es-eB.d.ts} +3 -4
  217. package/dist/plugins/CompilerPlugin.d.ts +1 -31
  218. package/dist/plugins/CompilerPlugin.js +33 -4
  219. package/dist/plugins/CompilerPlugin.js.map +1 -0
  220. package/dist/plugins/PluginCommon.d.ts +1 -31
  221. package/dist/plugins/PluginCommon.js +55 -4
  222. package/dist/plugins/PluginCommon.js.map +1 -0
  223. package/dist/plugins/RuntimePlugin.d.ts +1 -31
  224. package/dist/plugins/RuntimePlugin.js +124 -4
  225. package/dist/plugins/RuntimePlugin.js.map +1 -0
  226. package/dist/plugins/index.d.ts +1 -31
  227. package/dist/plugins/index.js +8 -40
  228. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +1 -31
  229. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +2 -36
  230. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +1 -31
  231. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +2 -36
  232. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +1 -31
  233. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +2 -36
  234. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +1 -31
  235. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +2 -36
  236. package/dist/plugins/plugin-runtime/runtime.d.ts +1 -31
  237. package/dist/plugins/plugin-runtime/runtime.js +1 -1
  238. package/dist/plugins/types.d.ts +1 -31
  239. package/dist/plugins/types.js +1 -1
  240. package/dist/poll-DQ6DX_Tt.d.ts +88 -0
  241. package/dist/{section-Dh_FhPeC.d.ts → section-Q8nwx_-q.d.ts} +3 -4
  242. package/dist/{separator-CMf6Cyy5.d.ts → separator-B8P-kdIK.d.ts} +3 -4
  243. package/dist/{signals-SHg7J1U_.d.ts → signals-CBXwugBW.d.ts} +2 -2
  244. package/dist/{text-display-DRw3r_lK.d.ts → text-display-CL9C2yMc.d.ts} +3 -4
  245. package/dist/{types-CJ-XvOFN.d.ts → types-DZy7U-Ld.d.ts} +2 -2
  246. package/dist/types.d.ts +2 -32
  247. package/dist/types.js +1 -0
  248. package/dist/utils/colors.js +9 -3
  249. package/dist/utils/colors.js.map +1 -0
  250. package/dist/utils/constants.d.ts +2 -2
  251. package/dist/utils/constants.js +50 -7
  252. package/dist/utils/constants.js.map +1 -0
  253. package/dist/utils/dev-hooks.d.ts +1 -31
  254. package/dist/utils/dev-hooks.js +2 -36
  255. package/dist/utils/error-codes.d.ts +54 -2
  256. package/dist/utils/error-codes.js +53 -5
  257. package/dist/utils/error-codes.js.map +1 -0
  258. package/dist/utils/resolve-file-url.d.ts +11 -2
  259. package/dist/utils/resolve-file-url.js +18 -2
  260. package/dist/utils/resolve-file-url.js.map +1 -0
  261. package/dist/utils/types-package.js +61 -4
  262. package/dist/utils/types-package.js.map +1 -0
  263. package/dist/utils/useful-stuff/async-queue.js +2 -2
  264. package/dist/utils/useful-stuff/async-queue.js.map +1 -1
  265. package/dist/utils/useful-stuff/mutex.js +1 -0
  266. package/dist/utils/useful-stuff/mutex.js.map +1 -1
  267. package/dist/utils/useful-stuff/ratelimiter.js +2 -2
  268. package/dist/utils/useful-stuff/ratelimiter.js.map +1 -1
  269. package/dist/utils/useful-stuff/semaphore.js +2 -3
  270. package/dist/utils/useful-stuff/semaphore.js.map +1 -1
  271. package/dist/utils/utilities.d.ts +113 -2
  272. package/dist/utils/utilities.js +5 -37
  273. package/dist/utils/{warn-unstable.d.ts → warning.d.ts} +12 -3
  274. package/dist/utils/{warn-unstable.js → warning.js} +15 -2
  275. package/dist/utils/warning.js.map +1 -0
  276. package/dist/version.d.ts +8 -2
  277. package/dist/version.js +13 -2
  278. package/dist/version.js.map +1 -0
  279. package/hooks.cjs +11 -4
  280. package/package.json +22 -18
  281. package/ratelimit.cjs +0 -1
  282. package/dist/ActionRow-CbdGFWMT.js.map +0 -1
  283. package/dist/CommandKitEventsChannel-BtRzr3Tz.js +0 -88
  284. package/dist/CommandKitEventsChannel-BtRzr3Tz.js.map +0 -1
  285. package/dist/CommandsRouter-Cgcy6cK9.js +0 -220
  286. package/dist/CommandsRouter-Cgcy6cK9.js.map +0 -1
  287. package/dist/CompilerPlugin-M8r3yNAl.js +0 -43
  288. package/dist/CompilerPlugin-M8r3yNAl.js.map +0 -1
  289. package/dist/DefaultLogger-XCOl5nLd.d.ts +0 -67
  290. package/dist/EventInterceptor-CQEXyUTp.js +0 -142
  291. package/dist/EventInterceptor-CQEXyUTp.js.map +0 -1
  292. package/dist/EventWorkerContext-BMk7IXpC.d.ts +0 -43
  293. package/dist/EventWorkerContext-Dq29tieI.js +0 -69
  294. package/dist/EventWorkerContext-Dq29tieI.js.map +0 -1
  295. package/dist/EventsRouter-3Gygh-km.js +0 -137
  296. package/dist/EventsRouter-3Gygh-km.js.map +0 -1
  297. package/dist/ILogger-BW8GM-YZ.d.ts +0 -64
  298. package/dist/ILogger-dQ7Y9X1f.js +0 -0
  299. package/dist/Logger-DyfkPk7u.d.ts +0 -37
  300. package/dist/MessageCommandParser-CEuO6Ex3.js +0 -269
  301. package/dist/MessageCommandParser-CEuO6Ex3.js.map +0 -1
  302. package/dist/PluginCommon-Cvl5yYM_.js +0 -71
  303. package/dist/PluginCommon-Cvl5yYM_.js.map +0 -1
  304. package/dist/RuntimePlugin-BUecuBIU.js +0 -134
  305. package/dist/RuntimePlugin-BUecuBIU.js.map +0 -1
  306. package/dist/app-HN1cVg8J.js +0 -0
  307. package/dist/app-process-DoG6Spkf.js +0 -68
  308. package/dist/app-process-DoG6Spkf.js.map +0 -1
  309. package/dist/build-C9ltqPmn.js +0 -175
  310. package/dist/build-C9ltqPmn.js.map +0 -1
  311. package/dist/colors-DL3ucTiT.js +0 -15
  312. package/dist/colors-DL3ucTiT.js.map +0 -1
  313. package/dist/commandkit-Bm0gLN8i.js.map +0 -1
  314. package/dist/common-CcfjYnPG.js +0 -0
  315. package/dist/common-Dxr9-XPa.js +0 -211
  316. package/dist/common-Dxr9-XPa.js.map +0 -1
  317. package/dist/common-vnMIelAE.js +0 -17
  318. package/dist/common-vnMIelAE.js.map +0 -1
  319. package/dist/components/v1/action-row/ActionRow.d.ts +0 -6
  320. package/dist/components/v1/action-row/ActionRow.js +0 -3
  321. package/dist/components/v1/button/Button.d.ts +0 -7
  322. package/dist/components/v1/button/Button.js +0 -38
  323. package/dist/components/v1/button/ButtonKit.d.ts +0 -3
  324. package/dist/components/v1/button/ButtonKit.js +0 -38
  325. package/dist/components/v1/modal/Modal.d.ts +0 -7
  326. package/dist/components/v1/modal/Modal.js +0 -41
  327. package/dist/components/v1/modal/ModalKit.d.ts +0 -3
  328. package/dist/components/v1/modal/ModalKit.js +0 -38
  329. package/dist/components/v1/select-menu/ChannelSelectMenuKit.d.ts +0 -4
  330. package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +0 -38
  331. package/dist/components/v1/select-menu/MentionableSelectMenuKit.d.ts +0 -4
  332. package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +0 -38
  333. package/dist/components/v1/select-menu/RoleSelectMenuKit.d.ts +0 -4
  334. package/dist/components/v1/select-menu/RoleSelectMenuKit.js +0 -38
  335. package/dist/components/v1/select-menu/SelectMenu.d.ts +0 -10
  336. package/dist/components/v1/select-menu/SelectMenu.js +0 -43
  337. package/dist/components/v1/select-menu/StringSelectMenuKit.d.ts +0 -4
  338. package/dist/components/v1/select-menu/StringSelectMenuKit.js +0 -38
  339. package/dist/components/v1/select-menu/UserSelectMenuKit.d.ts +0 -4
  340. package/dist/components/v1/select-menu/UserSelectMenuKit.js +0 -38
  341. package/dist/components/v1/select-menu/common.d.ts +0 -3
  342. package/dist/components/v1/select-menu/common.js +0 -1
  343. package/dist/components/v2/common.js +0 -3
  344. package/dist/components/v2/container.d.ts +0 -2
  345. package/dist/components/v2/container.js +0 -4
  346. package/dist/components/v2/file.d.ts +0 -2
  347. package/dist/components/v2/file.js +0 -3
  348. package/dist/components/v2/index.d.ts +0 -8
  349. package/dist/components/v2/index.js +0 -17
  350. package/dist/components/v2/media-gallery.d.ts +0 -2
  351. package/dist/components/v2/media-gallery.js +0 -5
  352. package/dist/components/v2/section.d.ts +0 -2
  353. package/dist/components/v2/section.js +0 -5
  354. package/dist/components/v2/separator.d.ts +0 -2
  355. package/dist/components/v2/separator.js +0 -3
  356. package/dist/components/v2/text-display.d.ts +0 -2
  357. package/dist/components/v2/text-display.js +0 -3
  358. package/dist/config-BhVxyjmZ.d.ts +0 -16
  359. package/dist/constants-4oxxvaJA.js +0 -27
  360. package/dist/constants-4oxxvaJA.js.map +0 -1
  361. package/dist/constants-B5_Ta7PR.js +0 -70
  362. package/dist/constants-B5_Ta7PR.js.map +0 -1
  363. package/dist/constants-BOOGN85p.js +0 -37
  364. package/dist/constants-BOOGN85p.js.map +0 -1
  365. package/dist/container-C6GtfAPW.js +0 -44
  366. package/dist/container-C6GtfAPW.js.map +0 -1
  367. package/dist/dotprops-tnhpnszJ.js +0 -36
  368. package/dist/dotprops-tnhpnszJ.js.map +0 -1
  369. package/dist/element-Bak9llw_.js +0 -84
  370. package/dist/element-Bak9llw_.js.map +0 -1
  371. package/dist/env-_68PRRoA.js +0 -109
  372. package/dist/env-_68PRRoA.js.map +0 -1
  373. package/dist/error-codes-B4TyW4Ct.d.ts +0 -54
  374. package/dist/error-codes-Ds0bnPvT.js +0 -73
  375. package/dist/error-codes-Ds0bnPvT.js.map +0 -1
  376. package/dist/feature-flags-nZJB7-e5.js +0 -160
  377. package/dist/feature-flags-nZJB7-e5.js.map +0 -1
  378. package/dist/file-DVOELoNv.js.map +0 -1
  379. package/dist/helpers-BSwwrKJW.js +0 -36
  380. package/dist/helpers-BSwwrKJW.js.map +0 -1
  381. package/dist/index-DKcmsWXw.d.ts +0 -1
  382. package/dist/index-DSBMRX9A.d.ts +0 -1
  383. package/dist/index-DdqikUQD.d.ts +0 -1
  384. package/dist/index.js.map +0 -1
  385. package/dist/init-Cy_bcUt4.js +0 -95
  386. package/dist/init-Cy_bcUt4.js.map +0 -1
  387. package/dist/init-DOr-Y3GQ.d.ts +0 -13
  388. package/dist/media-gallery-zDtJ3kxb.js +0 -62
  389. package/dist/media-gallery-zDtJ3kxb.js.map +0 -1
  390. package/dist/resolve-file-url-ChIyw-Vf.js +0 -23
  391. package/dist/resolve-file-url-ChIyw-Vf.js.map +0 -1
  392. package/dist/resolve-file-url-yO8bUxok.d.ts +0 -11
  393. package/dist/router-Dn35v30f.js +0 -0
  394. package/dist/runtime-DB9CiPfe.js +0 -0
  395. package/dist/section-DlvrDoJK.js +0 -60
  396. package/dist/section-DlvrDoJK.js.map +0 -1
  397. package/dist/separator-DL6QH5H1.js.map +0 -1
  398. package/dist/serde-BYaKrsOV.d.ts +0 -12
  399. package/dist/serde-Cc8iUa9J.js +0 -97
  400. package/dist/serde-Cc8iUa9J.js.map +0 -1
  401. package/dist/signals-ChFMD7mB.js +0 -74
  402. package/dist/signals-ChFMD7mB.js.map +0 -1
  403. package/dist/store-CM6pWVZh.js +0 -19
  404. package/dist/store-CM6pWVZh.js.map +0 -1
  405. package/dist/text-display-DbMumig_.js.map +0 -1
  406. package/dist/type-checker-DR7RZFs5.js +0 -90
  407. package/dist/type-checker-DR7RZFs5.js.map +0 -1
  408. package/dist/types-CUZOquUl.js +0 -0
  409. package/dist/types-package-BWArjyBF.js +0 -75
  410. package/dist/types-package-BWArjyBF.js.map +0 -1
  411. package/dist/types-q0Nm882H.js +0 -0
  412. package/dist/utilities-DtdPlr4c.d.ts +0 -87
  413. package/dist/utils/warn-unstable.js.map +0 -1
  414. package/dist/utils-DCSnVAZ6.js +0 -23
  415. package/dist/utils-DCSnVAZ6.js.map +0 -1
  416. package/dist/utils-KsNof0Xz.js +0 -34
  417. package/dist/utils-KsNof0Xz.js.map +0 -1
  418. package/dist/v2-DofkPKHs.js +0 -0
  419. package/dist/version-CtJtBJXI.d.ts +0 -8
  420. package/dist/version-DRSQMx0w.js +0 -18
  421. package/dist/version-DRSQMx0w.js.map +0 -1
@@ -1,32 +1,2 @@
1
- import { BootstrapFunction, CommandKit, CommandKitConfiguration, commandkit, onApplicationBootstrap, onBootstrap } from "./analytics-engine-B7JNRnEN.js";
2
- import "./EventInterceptor-x-R2qshQ.js";
3
- import "./ButtonKit-C7r7RPNf.js";
4
- import "./ModalKit-Btz58KYn.js";
5
- import "./element-CAXu1XtK.js";
6
- import "./ActionRow-DKnFVDME.js";
7
- import "./types-CJ-XvOFN.js";
8
- import "./Button-4ZUXdA56.js";
9
- import "./Modal-C6UTRdYQ.js";
10
- import "./common-DOCvOVC4.js";
11
- import "./StringSelectMenuKit-Bhs8U6WI.js";
12
- import "./ChannelSelectMenuKit-BrXvBYNH.js";
13
- import "./MentionableSelectMenuKit-CPTKqx-O.js";
14
- import "./UserSelectMenuKit-CfqFJdxz.js";
15
- import "./RoleSelectMenuKit-C26lU3sN.js";
16
- import "./SelectMenu-Diy87_ba.js";
17
- import "./container-DHBELeJ3.js";
18
- import "./file-DTrr-p09.js";
19
- import "./media-gallery-BMsXSot3.js";
20
- import "./section-Dh_FhPeC.js";
21
- import "./separator-CMf6Cyy5.js";
22
- import "./text-display-DRw3r_lK.js";
23
- import "./index-DSBMRX9A.js";
24
- import "./index-DdqikUQD.js";
25
- import "./MessageCommandParser-ROLibZPX.js";
26
- import "./signals-SHg7J1U_.js";
27
- import "./helpers-Wg6P5fRQ.js";
28
- import "./CommandsRouter-CoOA7hkf.js";
29
- import "./EventsRouter-BacqK6z3.js";
30
- import "./index-DKcmsWXw.js";
31
- import "./constants-MKu-Q1jh.js";
1
+ import { c as CommandKitConfiguration, d as onBootstrap, l as commandkit, o as BootstrapFunction, s as CommandKit, u as onApplicationBootstrap } from "./analytics-engine-DnRsHBId.js";
32
2
  export { BootstrapFunction, CommandKit, CommandKitConfiguration, commandkit, onApplicationBootstrap, onBootstrap };
@@ -1,39 +1,5 @@
1
- require('./colors-DL3ucTiT.js');
2
- require('./ActionRow-CbdGFWMT.js');
3
- require('./error-codes-Ds0bnPvT.js');
4
- const require_commandkit = require('./commandkit-Bm0gLN8i.js');
5
- require('./common-CcfjYnPG.js');
6
- require('./common-vnMIelAE.js');
7
- require('./container-C6GtfAPW.js');
8
- require('./file-DVOELoNv.js');
9
- require('./media-gallery-zDtJ3kxb.js');
10
- require('./section-DlvrDoJK.js');
11
- require('./separator-DL6QH5H1.js');
12
- require('./text-display-DbMumig_.js');
13
- require('./v2-DofkPKHs.js');
14
- require('./element-Bak9llw_.js');
15
- require('./types-CUZOquUl.js');
16
- require('./EventInterceptor-CQEXyUTp.js');
17
- require('./constants-B5_Ta7PR.js');
18
- require('./PluginCommon-Cvl5yYM_.js');
19
- require('./CompilerPlugin-M8r3yNAl.js');
20
- require('./RuntimePlugin-BUecuBIU.js');
21
- require('./types-q0Nm882H.js');
22
- require('./resolve-file-url-ChIyw-Vf.js');
23
- require('./runtime-DB9CiPfe.js');
24
- require('./utils-KsNof0Xz.js');
25
- require('./types-package-BWArjyBF.js');
26
- require('./constants-BOOGN85p.js');
27
- require('./EventWorkerContext-Dq29tieI.js');
28
- require('./signals-ChFMD7mB.js');
29
- require('./MessageCommandParser-CEuO6Ex3.js');
30
- require('./helpers-BSwwrKJW.js');
31
- require('./CommandsRouter-Cgcy6cK9.js');
32
- require('./EventsRouter-3Gygh-km.js');
33
- require('./router-Dn35v30f.js');
34
- require('./common-Dxr9-XPa.js');
35
- require('./CommandKitEventsChannel-BtRzr3Tz.js');
36
- require('./store-CM6pWVZh.js');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_commandkit = require('./commandkit-Bh7C1_c7.js');
37
3
 
38
4
  exports.CommandKit = require_commandkit.CommandKit;
39
5
  exports.commandkit = require_commandkit.commandkit;
@@ -1,8 +1,7 @@
1
- import { EventInterceptorContextData } from "./EventInterceptor-x-R2qshQ.js";
1
+ import { n as EventInterceptorContextData } from "./EventInterceptor-D9JKMcfi.js";
2
2
  import { Awaitable, Events } from "discord.js";
3
3
 
4
- //#region src/components/v1/select-menu/common.d.ts
5
-
4
+ //#region src/components/interactive/select-menu/common.d.ts
6
5
  /**
7
6
  * The predicate function that filters select menu interactions.
8
7
  * It receives an interaction and returns a boolean or a Promise that resolves to a boolean.
@@ -26,5 +25,5 @@ type CommandKitSelectMenuBuilderInteractionCollectorDispatch<T, C> = (interactio
26
25
  type CommandKitSelectMenuBuilderOnEnd = (reason: string) => Awaitable<void>;
27
26
  type CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData = EventInterceptorContextData<Events.InteractionCreate>;
28
27
  //#endregion
29
- export { CommandKitSelectMenuBuilderInteractionCollectorDispatch, CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, CommandKitSelectMenuBuilderOnEnd, OnSelectMenuKitEnd, OnSelectMenuKitSubmit, SelectMenuKitPredicate };
30
- //# sourceMappingURL=common-DOCvOVC4.d.ts.map
28
+ export { OnSelectMenuKitSubmit as a, OnSelectMenuKitEnd as i, CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData as n, SelectMenuKitPredicate as o, CommandKitSelectMenuBuilderOnEnd as r, CommandKitSelectMenuBuilderInteractionCollectorDispatch as t };
29
+ //# sourceMappingURL=common-CCvvgnxi.d.ts.map
@@ -1,2 +1,2 @@
1
- import { EventInterceptor, EventInterceptorContextData, EventInterceptorErrorHandler } from "../../EventInterceptor-x-R2qshQ.js";
1
+ import { n as EventInterceptorContextData, r as EventInterceptorErrorHandler, t as EventInterceptor } from "../../EventInterceptor-D9JKMcfi.js";
2
2
  export { EventInterceptor, EventInterceptorContextData, EventInterceptorErrorHandler };
@@ -1,3 +1,138 @@
1
- const require_EventInterceptor = require('../../EventInterceptor-CQEXyUTp.js');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
- exports.EventInterceptor = require_EventInterceptor.EventInterceptor;
3
+ //#region src/components/common/EventInterceptor.ts
4
+ /**
5
+ * The event interceptor class that allows subscribing to events and handling them with custom logic.
6
+ * It also supports automatic cleanup of expired subscriptions.
7
+ */
8
+ var EventInterceptor = class {
9
+ subscribers = /* @__PURE__ */ new Map();
10
+ globalHandlers = /* @__PURE__ */ new Map();
11
+ cleanupTimer = null;
12
+ /**
13
+ * Creates the event interceptor.
14
+ */
15
+ constructor(client) {
16
+ this.client = client;
17
+ this.#cleanupLoop();
18
+ }
19
+ #cleanupLoop() {
20
+ if (this.cleanupTimer) clearInterval(this.cleanupTimer);
21
+ this.cleanupTimer = setInterval(() => {
22
+ for (const [event, handlers] of this.subscribers) for (const handler of handlers) {
23
+ const options = Reflect.get(handler, "options");
24
+ if (options.time && Date.now() - options.registeredAt > options.time) this.unsubscribe(event, handler, "time");
25
+ }
26
+ }, 6e4).unref();
27
+ }
28
+ /**
29
+ * Destroys the event interceptor.
30
+ */
31
+ destroy() {
32
+ if (this.cleanupTimer) {
33
+ clearInterval(this.cleanupTimer);
34
+ this.cleanupTimer = null;
35
+ }
36
+ for (const [event, handlers] of this.subscribers) for (const handler of handlers) this.unsubscribe(event, handler, "destroy");
37
+ this.subscribers.clear();
38
+ this.globalHandlers.clear();
39
+ }
40
+ /**
41
+ * Whether the event has subscribers.
42
+ * @param event The event to check.
43
+ */
44
+ hasSubscribers(event) {
45
+ return this.subscribers.has(event);
46
+ }
47
+ /**
48
+ * Returns the number of subscribers for the event.
49
+ * @param event The event to check.
50
+ */
51
+ getSubscriberCount(event) {
52
+ const handlers = this.subscribers.get(event);
53
+ return (handlers === null || handlers === void 0 ? void 0 : handlers.size) ?? 0;
54
+ }
55
+ /**
56
+ * Whether the event has global handlers.
57
+ */
58
+ hasGlobalHandlers() {
59
+ return this.globalHandlers.size > 0;
60
+ }
61
+ /**
62
+ * Returns the number of global handlers.
63
+ */
64
+ getGlobalHandlersCount() {
65
+ return this.subscribers.size;
66
+ }
67
+ /**
68
+ * Subscribes to an event.
69
+ * @param event The event to subscribe to.
70
+ * @param listener The listener to call when the event is emitted.
71
+ * @returns A function to unsubscribe from the event.
72
+ */
73
+ subscribe(event, listener, options) {
74
+ if (!this.subscribers.has(event)) {
75
+ this.subscribers.set(event, /* @__PURE__ */ new Set());
76
+ this.client.on(event, this.createGlobalHandler(event));
77
+ this.client.setMaxListeners(this.client.getMaxListeners() + 1);
78
+ }
79
+ options ??= {};
80
+ options.registeredAt = Date.now();
81
+ Reflect.set(listener, "options", options);
82
+ this.subscribers.get(event).add(listener);
83
+ return () => {
84
+ this.unsubscribe(event, listener);
85
+ };
86
+ }
87
+ /**
88
+ * Unsubscribes from an event.
89
+ * @param event The event to unsubscribe from.
90
+ */
91
+ unsubscribe(event, listener, reason) {
92
+ var _Reflect$get$onEnd, _Reflect$get;
93
+ const handlers = this.subscribers.get(event);
94
+ if (!handlers) return;
95
+ handlers.delete(listener);
96
+ if (handlers.size < 1) {
97
+ this.subscribers.delete(event);
98
+ this.client.removeListener(event, this.globalHandlers.get(event));
99
+ this.globalHandlers.delete(event);
100
+ this.client.setMaxListeners(Math.max(this.client.getMaxListeners() - 1, 0));
101
+ }
102
+ (_Reflect$get$onEnd = (_Reflect$get = Reflect.get(listener, "options")).onEnd) === null || _Reflect$get$onEnd === void 0 || _Reflect$get$onEnd.call(_Reflect$get, reason ?? "unsubscribe");
103
+ }
104
+ /**
105
+ * Creates a global handler for the event.
106
+ * @param event The event to create a global handler for.
107
+ * @returns The global handler.
108
+ */
109
+ createGlobalHandler(event) {
110
+ if (this.globalHandlers.has(event)) return this.globalHandlers.get(event);
111
+ const handler = async (...args) => {
112
+ const subscribers = this.subscribers.get(event);
113
+ if (subscribers && subscribers.size > 0) for (const subscriber of subscribers) {
114
+ const options = Reflect.get(subscriber, "options");
115
+ if (options.time && Date.now() - options.registeredAt > options.time) {
116
+ this.unsubscribe(event, subscriber, "time");
117
+ continue;
118
+ }
119
+ if (options.autoReset) options.registeredAt = Date.now();
120
+ if (options.filter && !await options.filter(...args)) continue;
121
+ try {
122
+ await subscriber(...args);
123
+ } catch (e) {
124
+ if (options.onError) await options.onError(e);
125
+ else throw e;
126
+ } finally {
127
+ if (options.once) this.unsubscribe(event, subscriber, "once");
128
+ }
129
+ }
130
+ };
131
+ this.globalHandlers.set(event, handler);
132
+ return handler;
133
+ }
134
+ };
135
+
136
+ //#endregion
137
+ exports.EventInterceptor = EventInterceptor;
138
+ //# sourceMappingURL=EventInterceptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventInterceptor.js","names":[],"sources":["../../../src/components/common/EventInterceptor.ts"],"sourcesContent":["import { Awaitable, Client, ClientEvents, Events } from 'discord.js';\n\nexport interface EventInterceptorContextData<E extends keyof ClientEvents> {\n /**\n * The filter to use for the collector.\n */\n filter?: (...args: ClientEvents[E]) => Awaitable<boolean>;\n /**\n * The duration (in ms) that the collector should run for.\n */\n time?: number;\n /**\n * If the collector should automatically reset the timer when a button is clicked.\n */\n autoReset?: boolean;\n /**\n * Whether the collector should run only once.\n */\n once?: boolean;\n /**\n * The handler to run when the collector ends.\n */\n onEnd?: (reason: string) => Awaitable<void>;\n /**\n * The handler to run upon an error.\n */\n onError?: EventInterceptorErrorHandler;\n}\n\n/**\n * The error handler for the event interceptor.\n */\nexport type EventInterceptorErrorHandler = (error: Error) => Awaitable<void>;\n\n/**\n * The event interceptor class that allows subscribing to events and handling them with custom logic.\n * It also supports automatic cleanup of expired subscriptions.\n */\nexport class EventInterceptor {\n private subscribers = new Map<\n keyof ClientEvents,\n Set<(...args: any[]) => void>\n >();\n private globalHandlers = new Map<\n keyof ClientEvents,\n (...args: any[]) => void\n >();\n private cleanupTimer: NodeJS.Timeout | null = null;\n\n /**\n * Creates the event interceptor.\n */\n public constructor(public readonly client: Client) {\n this.#cleanupLoop();\n }\n\n #cleanupLoop() {\n if (this.cleanupTimer) clearInterval(this.cleanupTimer);\n\n this.cleanupTimer = setInterval(() => {\n for (const [event, handlers] of this.subscribers) {\n for (const handler of handlers) {\n const options = Reflect.get(\n handler,\n 'options',\n ) as EventInterceptorContextData<keyof ClientEvents> & {\n registeredAt: number;\n };\n\n const isExpired =\n options.time && Date.now() - options.registeredAt > options.time;\n\n if (isExpired) {\n this.unsubscribe(event, handler, 'time');\n }\n }\n }\n }, 60_000).unref();\n }\n\n /**\n * Destroys the event interceptor.\n */\n public destroy(): void {\n if (this.cleanupTimer) {\n clearInterval(this.cleanupTimer);\n this.cleanupTimer = null;\n }\n\n for (const [event, handlers] of this.subscribers) {\n for (const handler of handlers) {\n this.unsubscribe(event, handler, 'destroy');\n }\n }\n\n this.subscribers.clear();\n this.globalHandlers.clear();\n }\n\n /**\n * Whether the event has subscribers.\n * @param event The event to check.\n */\n public hasSubscribers(event: keyof ClientEvents): boolean {\n return this.subscribers.has(event);\n }\n\n /**\n * Returns the number of subscribers for the event.\n * @param event The event to check.\n */\n public getSubscriberCount(event: keyof ClientEvents): number {\n const handlers = this.subscribers.get(event);\n return handlers?.size ?? 0;\n }\n\n /**\n * Whether the event has global handlers.\n */\n public hasGlobalHandlers(): boolean {\n return this.globalHandlers.size > 0;\n }\n\n /**\n * Returns the number of global handlers.\n */\n public getGlobalHandlersCount(): number {\n return this.subscribers.size;\n }\n\n /**\n * Subscribes to an event.\n * @param event The event to subscribe to.\n * @param listener The listener to call when the event is emitted.\n * @returns A function to unsubscribe from the event.\n */\n public subscribe<Event extends keyof ClientEvents>(\n event: Event,\n listener: (...args: ClientEvents[Event]) => void,\n options?: EventInterceptorContextData<Event>,\n ): () => void {\n if (!this.subscribers.has(event)) {\n this.subscribers.set(event, new Set());\n this.client.on(event, this.createGlobalHandler(event));\n this.client.setMaxListeners(this.client.getMaxListeners() + 1);\n }\n\n options ??= {};\n\n // @ts-ignore\n options.registeredAt = Date.now();\n\n Reflect.set(listener, 'options', options);\n\n this.subscribers.get(event)!.add(listener);\n\n return () => {\n this.unsubscribe(event, listener);\n };\n }\n\n /**\n * Unsubscribes from an event.\n * @param event The event to unsubscribe from.\n */\n public unsubscribe<Event extends keyof ClientEvents>(\n event: Event,\n listener: (...args: ClientEvents[Event]) => void,\n reason?: string,\n ): void {\n const handlers = this.subscribers.get(event);\n if (!handlers) return;\n\n handlers.delete(listener);\n\n if (handlers.size < 1) {\n this.subscribers.delete(event);\n this.client.removeListener(event, this.globalHandlers.get(event)!);\n this.globalHandlers.delete(event);\n this.client.setMaxListeners(\n Math.max(this.client.getMaxListeners() - 1, 0),\n );\n }\n\n Reflect.get(listener, 'options').onEnd?.(reason ?? 'unsubscribe');\n }\n\n /**\n * Creates a global handler for the event.\n * @param event The event to create a global handler for.\n * @returns The global handler.\n */\n private createGlobalHandler<Event extends keyof ClientEvents>(\n event: Event,\n ): (...args: ClientEvents[Event]) => void {\n if (this.globalHandlers.has(event)) {\n return this.globalHandlers.get(event)!;\n }\n\n const handler = async (...args: ClientEvents[Event]) => {\n const subscribers = this.subscribers.get(event);\n if (subscribers && subscribers.size > 0) {\n for (const subscriber of subscribers) {\n const options = Reflect.get(\n subscriber,\n 'options',\n ) as EventInterceptorContextData<Event> & { registeredAt: number };\n\n const isExpired =\n options.time && Date.now() - options.registeredAt > options.time;\n\n if (isExpired) {\n this.unsubscribe(event, subscriber, 'time');\n continue;\n }\n\n if (options.autoReset) {\n options.registeredAt = Date.now();\n }\n\n if (options.filter && !(await options.filter(...args))) {\n continue;\n }\n\n try {\n await subscriber(...args);\n } catch (e) {\n if (options.onError) {\n await options.onError(<Error>e);\n } else {\n throw e;\n }\n } finally {\n if (options.once) {\n this.unsubscribe(event, subscriber, 'once');\n }\n }\n }\n }\n };\n\n this.globalHandlers.set(event, handler);\n\n return handler;\n }\n}\n"],"mappings":";;;;;;;AAsCA,IAAa,mBAAb,MAA8B;CAC5B,AAAQ,8BAAc,IAAI,KAGzB;CACD,AAAQ,iCAAiB,IAAI,KAG5B;CACD,AAAQ,eAAsC;;;;CAK9C,AAAO,YAAY,AAAgB,QAAgB;EAAhB;AACjC,QAAK,aAAc;;CAGrB,eAAe;AACb,MAAI,KAAK,aAAc,eAAc,KAAK,aAAa;AAEvD,OAAK,eAAe,kBAAkB;AACpC,QAAK,MAAM,CAAC,OAAO,aAAa,KAAK,YACnC,MAAK,MAAM,WAAW,UAAU;IAC9B,MAAM,UAAU,QAAQ,IACtB,SACA,UACD;AAOD,QAFA,QAAE,QAAc,KAAE,KAAQ,GAAG,QAAE,eAAqB,QAAE,KAGpD,MAAK,YAAY,OAAO,SAAS,OAAO;;KAI7C,IAAO,CAAC,OAAO;;;;;CAMpB,AAAO,UAAgB;AACrB,MAAI,KAAK,cAAc;AACrB,iBAAc,KAAK,aAAa;AAChC,QAAK,eAAe;;AAGtB,OAAK,MAAM,CAAC,OAAO,aAAa,KAAK,YACnC,MAAK,MAAM,WAAW,SACpB,MAAK,YAAY,OAAO,SAAS,UAAU;AAI/C,OAAK,YAAY,OAAO;AACxB,OAAK,eAAe,OAAO;;;;;;CAO7B,AAAO,eAAe,OAAoC;AACxD,SAAO,KAAK,YAAY,IAAI,MAAM;;;;;;CAOpC,AAAO,mBAAmB,OAAmC;EAC3D,MAAM,WAAW,KAAK,YAAY,IAAI,MAAM;AAC5C,8DAAO,SAAU,SAAQ;;;;;CAM3B,AAAO,oBAA6B;AAClC,SAAO,KAAK,eAAe,OAAO;;;;;CAMpC,AAAO,yBAAiC;AACtC,SAAO,KAAK,YAAY;;;;;;;;CAS1B,AAAO,UACP,OACA,UACA,SACa;AACX,MAAI,CAAC,KAAK,YAAY,IAAI,MAAM,EAAE;AAChC,QAAK,YAAY,IAAI,uBAAO,IAAI,KAAK,CAAC;AACtC,QAAK,OAAO,GAAG,OAAO,KAAK,oBAAoB,MAAM,CAAC;AACtD,QAAK,OAAO,gBAAgB,KAAK,OAAO,iBAAiB,GAAG,EAAE;;AAGhE,cAAY,EAAE;AAGd,UAAQ,eAAe,KAAK,KAAK;AAEjC,UAAQ,IAAI,UAAU,WAAW,QAAQ;AAEzC,OAAK,YAAY,IAAI,MAAM,CAAE,IAAI,SAAS;AAE1C,eAAa;AACX,QAAK,YAAY,OAAO,SAAS;;;;;;;CAQrC,AAAO,YACP,OACA,UACA,QACO;;EACL,MAAM,WAAW,KAAK,YAAY,IAAI,MAAM;AAC5C,MAAI,CAAC,SAAU;AAEf,WAAS,OAAO,SAAS;AAEzB,MAAI,SAAS,OAAO,GAAG;AACrB,QAAK,YAAY,OAAO,MAAM;AAC9B,QAAK,OAAO,eAAe,OAAO,KAAK,eAAe,IAAI,MAAM,CAAE;AAClE,QAAK,eAAe,OAAO,MAAM;AACjC,QAAK,OAAO,gBACV,KAAK,IAAI,KAAK,OAAO,iBAAiB,GAAG,GAAG,EAAE,CAC/C;;AAGH,gDAAQ,IAAI,UAAU,UAAU,EAAC,0FAAQ,UAAU,cAAc;;;;;;;CAQnE,AAAQ,oBACR,OACyC;AACvC,MAAI,KAAK,eAAe,IAAI,MAAM,CAChC,QAAO,KAAK,eAAe,IAAI,MAAM;EAGvC,MAAM,UAAU,OAAO,GAAG,SAA8B;GACtD,MAAM,cAAc,KAAK,YAAY,IAAI,MAAM;AAC/C,OAAI,eAAe,YAAY,OAAO,EACpC,MAAK,MAAM,cAAc,aAAa;IACpC,MAAM,UAAU,QAAQ,IACtB,YACA,UACD;AAKD,QAFA,QAAE,QAAc,KAAE,KAAQ,GAAG,QAAE,eAAqB,QAAE,MAEvC;AACb,UAAK,YAAY,OAAO,YAAY,OAAO;AAC3C;;AAGF,QAAI,QAAQ,UACV,SAAQ,eAAe,KAAK,KAAK;AAGnC,QAAI,QAAQ,UAAU,CAAE,MAAM,QAAQ,OAAO,GAAG,KAAK,CACnD;AAGF,QAAI;AACF,WAAM,WAAW,GAAG,KAAK;aAClB,GAAG;AACV,SAAI,QAAQ,QACV,OAAM,QAAQ,QAAgB,EAAC;SAE/B,OAAM;cAEA;AACR,SAAI,QAAQ,KACV,MAAK,YAAY,OAAO,YAAY,OAAO;;;;AAOrD,OAAK,eAAe,IAAI,OAAO,QAAQ;AAEvC,SAAO"}
@@ -1,5 +1,2 @@
1
- import "../../EventInterceptor-x-R2qshQ.js";
2
- import "../../ButtonKit-C7r7RPNf.js";
3
- import "../../ModalKit-Btz58KYn.js";
4
- import { AnyCommandKitElement, CommandKitElement, CommandKitElementData, ElementType, Fragment, FragmentElementProps, createElement, getElement, isCommandKitElement } from "../../element-CAXu1XtK.js";
5
- export { AnyCommandKitElement, CommandKitElement, CommandKitElementData, ElementType, Fragment, FragmentElementProps, createElement, createElement as jsx, createElement as jsxs, getElement, isCommandKitElement };
1
+ import { a as Fragment, c as createElement, i as ElementType, l as getElement, n as CommandKitElement, o as FragmentElementProps, r as CommandKitElementData, s as applyDefaultOptionalComponentBehavior, t as AnyCommandKitElement, u as isCommandKitElement } from "../../element-DeLvTMfZ.js";
2
+ export { AnyCommandKitElement, CommandKitElement, CommandKitElementData, ElementType, Fragment, FragmentElementProps, applyDefaultOptionalComponentBehavior, createElement, createElement as jsx, createElement as jsxs, getElement, isCommandKitElement };
@@ -1,9 +1,11 @@
1
- const require_element = require('../../element-Bak9llw_.js');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_commandkit = require('../../commandkit-Bh7C1_c7.js');
2
3
 
3
- exports.ElementType = require_element.ElementType;
4
- exports.Fragment = require_element.Fragment;
5
- exports.createElement = require_element.createElement;
6
- exports.jsx = require_element.createElement;
7
- exports.jsxs = require_element.createElement;
8
- exports.getElement = require_element.getElement;
9
- exports.isCommandKitElement = require_element.isCommandKitElement;
4
+ exports.ElementType = require_commandkit.ElementType;
5
+ exports.Fragment = require_commandkit.Fragment;
6
+ exports.applyDefaultOptionalComponentBehavior = require_commandkit.applyDefaultOptionalComponentBehavior;
7
+ exports.createElement = require_commandkit.createElement;
8
+ exports.jsx = require_commandkit.createElement;
9
+ exports.jsxs = require_commandkit.createElement;
10
+ exports.getElement = require_commandkit.getElement;
11
+ exports.isCommandKitElement = require_commandkit.isCommandKitElement;
@@ -1,2 +1,2 @@
1
- import { MaybeArray } from "../../types-CJ-XvOFN.js";
1
+ import { t as MaybeArray } from "../../types-DZy7U-Ld.js";
2
2
  export { MaybeArray };
@@ -1 +1 @@
1
- require('../../types-CUZOquUl.js');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
@@ -1,7 +1,6 @@
1
1
  import { ComponentBuilder } from "discord.js";
2
2
 
3
- //#region src/components/v2/common.d.ts
4
-
3
+ //#region src/components/display/common.d.ts
5
4
  /**
6
5
  * @private
7
6
  */
@@ -0,0 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_commandkit = require('../../commandkit-Bh7C1_c7.js');
3
+
4
+ exports.applyId = require_commandkit.applyId;
@@ -0,0 +1,2 @@
1
+ import { n as ContainerProps, t as Container } from "../../container-CYojOA9d.js";
2
+ export { Container, ContainerProps };
@@ -0,0 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_commandkit = require('../../commandkit-Bh7C1_c7.js');
3
+
4
+ exports.Container = require_commandkit.Container;
@@ -0,0 +1,2 @@
1
+ import { n as FileProps, t as File } from "../../file-DLO1zEcH.js";
2
+ export { File, FileProps };
@@ -1,8 +1,8 @@
1
- const require_chunk = require('./chunk-nOFOJqeH.js');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_chunk = require('../../chunk-BE-pF4vm.js');
2
3
  let discord_js = require("discord.js");
3
- discord_js = require_chunk.__toESM(discord_js);
4
4
 
5
- //#region src/components/v2/file.ts
5
+ //#region src/components/display/file.ts
6
6
  /**
7
7
  * The file component
8
8
  * @param props - The properties for the file component.
@@ -20,10 +20,5 @@ function File(props) {
20
20
  }
21
21
 
22
22
  //#endregion
23
- Object.defineProperty(exports, 'File', {
24
- enumerable: true,
25
- get: function () {
26
- return File;
27
- }
28
- });
29
- //# sourceMappingURL=file-DVOELoNv.js.map
23
+ exports.File = File;
24
+ //# sourceMappingURL=file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.js","names":[],"sources":["../../../src/components/display/file.ts"],"sourcesContent":["import { FileBuilder, FileComponentData } from 'discord.js';\n\n/**\n * Represents the properties for a file component.\n */\nexport interface FileProps extends Omit<FileComponentData, 'type' | 'file'> {\n url: string;\n}\n\n/**\n * The file component\n * @param props - The properties for the file component.\n * @returns The file builder instance.\n * @example ```tsx\n * import { File } from 'commandkit';\n *\n * const file = <File url=\"https://example.com/file.png\" />;\n * ```\n */\nexport function File(props: FileProps) {\n const file = new FileBuilder(props);\n\n if (props.url != null) {\n file.setURL(props.url);\n }\n\n return file;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,SAAgB,KAAK,OAAkB;CACrC,MAAM,OAAO,IAAI,uBAAY,MAAM;AAEnC,KAAI,MAAM,OAAO,KACf,MAAK,OAAO,MAAM,IAAI;AAGxB,QAAO"}
@@ -0,0 +1,9 @@
1
+ import { n as ContainerProps, t as Container } from "../../container-CYojOA9d.js";
2
+ import { n as FileProps, t as File } from "../../file-DLO1zEcH.js";
3
+ import { i as MediaGalleryProps, n as MediaGalleryItem, r as MediaGalleryItemProps, t as MediaGallery } from "../../media-gallery-Ca8es-eB.js";
4
+ import { i as ThumbnailProps, n as SectionProps, r as Thumbnail, t as Section } from "../../section-Q8nwx_-q.js";
5
+ import { n as SeparatorProps, t as Separator } from "../../separator-B8P-kdIK.js";
6
+ import { n as TextDisplay, r as TextDisplayProps, t as StringEncodable } from "../../text-display-CL9C2yMc.js";
7
+ import { n as LabelProps, t as Label } from "../../label-DqGRqodo.js";
8
+ import { a as PollProps, i as PollChildrenType, n as PollAnswer, o as PollQuestion, r as PollAnswerProps, s as PollQuestionProps, t as Poll } from "../../poll-DQ6DX_Tt.js";
9
+ export { Container, ContainerProps, File, FileProps, Label, LabelProps, MediaGallery, MediaGalleryItem, MediaGalleryItemProps, MediaGalleryProps, Poll, PollAnswer, PollAnswerProps, PollChildrenType, PollProps, PollQuestion, PollQuestionProps, Section, SectionProps, Separator, SeparatorProps, StringEncodable, TextDisplay, TextDisplayProps, Thumbnail, ThumbnailProps };
@@ -0,0 +1,19 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_commandkit = require('../../commandkit-Bh7C1_c7.js');
3
+ const require_components_display_file = require('./file.js');
4
+ const require_components_display_separator = require('./separator.js');
5
+ const require_components_display_text_display = require('./text-display.js');
6
+ const require_components_display_poll = require('./poll.js');
7
+
8
+ exports.Container = require_commandkit.Container;
9
+ exports.File = require_components_display_file.File;
10
+ exports.Label = require_commandkit.Label;
11
+ exports.MediaGallery = require_commandkit.MediaGallery;
12
+ exports.MediaGalleryItem = require_commandkit.MediaGalleryItem;
13
+ exports.Poll = require_components_display_poll.Poll;
14
+ exports.PollAnswer = require_components_display_poll.PollAnswer;
15
+ exports.PollQuestion = require_components_display_poll.PollQuestion;
16
+ exports.Section = require_commandkit.Section;
17
+ exports.Separator = require_components_display_separator.Separator;
18
+ exports.TextDisplay = require_components_display_text_display.TextDisplay;
19
+ exports.Thumbnail = require_commandkit.Thumbnail;
@@ -0,0 +1,2 @@
1
+ import { n as LabelProps, t as Label } from "../../label-DqGRqodo.js";
2
+ export { Label, LabelProps };
@@ -0,0 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_commandkit = require('../../commandkit-Bh7C1_c7.js');
3
+
4
+ exports.Label = require_commandkit.Label;
@@ -0,0 +1,2 @@
1
+ import { i as MediaGalleryProps, n as MediaGalleryItem, r as MediaGalleryItemProps, t as MediaGallery } from "../../media-gallery-Ca8es-eB.js";
2
+ export { MediaGallery, MediaGalleryItem, MediaGalleryItemProps, MediaGalleryProps };
@@ -0,0 +1,5 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_commandkit = require('../../commandkit-Bh7C1_c7.js');
3
+
4
+ exports.MediaGallery = require_commandkit.MediaGallery;
5
+ exports.MediaGalleryItem = require_commandkit.MediaGalleryItem;
@@ -0,0 +1,2 @@
1
+ import { a as PollProps, i as PollChildrenType, n as PollAnswer, o as PollQuestion, r as PollAnswerProps, s as PollQuestionProps, t as Poll } from "../../poll-DQ6DX_Tt.js";
2
+ export { Poll, PollAnswer, PollAnswerProps, PollChildrenType, PollProps, PollQuestion, PollQuestionProps };
@@ -0,0 +1,86 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_chunk = require('../../chunk-BE-pF4vm.js');
3
+ let discord_js = require("discord.js");
4
+
5
+ //#region src/components/display/poll.ts
6
+ var PollChildType = /* @__PURE__ */ function(PollChildType) {
7
+ PollChildType[PollChildType["Answer"] = 0] = "Answer";
8
+ PollChildType[PollChildType["Question"] = 1] = "Question";
9
+ return PollChildType;
10
+ }(PollChildType || {});
11
+ /**
12
+ * The poll component creates a Discord poll with a question and multiple answer options.
13
+ * @param props The poll properties.
14
+ * @returns The poll data object.
15
+ * @example ```tsx
16
+ * import { Poll, PollQuestion, PollAnswer } from 'commandkit';
17
+ *
18
+ * const poll = <Poll duration={24} allowMultiselect={false}>
19
+ * <PollQuestion>What's your favorite color?</PollQuestion>
20
+ * <PollAnswer emoji="🟥">Red</PollAnswer>
21
+ * <PollAnswer emoji="🟦">Blue</PollAnswer>
22
+ * <PollAnswer emoji="🟩">Green</PollAnswer>
23
+ * </Poll>;
24
+ * ```
25
+ */
26
+ function Poll({ children, ...props }) {
27
+ const question = children.find((child) => child.$$typeof === PollChildType.Question);
28
+ if (!question) throw new Error("Poll question is required");
29
+ const answers = children.filter((child) => child.$$typeof === PollChildType.Answer);
30
+ const { children: questionChildren, ...questionProps } = question;
31
+ const { duration, allowMultiselect, layoutType, ...restProps } = props;
32
+ return {
33
+ duration: duration ?? 24,
34
+ allowMultiselect: allowMultiselect ?? false,
35
+ layoutType: layoutType ?? discord_js.PollLayoutType.Default,
36
+ ...restProps,
37
+ question: {
38
+ text: questionChildren,
39
+ ...questionProps
40
+ },
41
+ answers: answers.map(({ children: answerChildren, $$typeof, ...answerProps }) => ({
42
+ text: answerChildren,
43
+ ...answerProps
44
+ }))
45
+ };
46
+ }
47
+ /**
48
+ * The poll question component defines the question text for a Discord poll.
49
+ * @param props The poll question properties.
50
+ * @returns The poll question media object.
51
+ * @example ```tsx
52
+ * import { PollQuestion } from 'commandkit';
53
+ *
54
+ * const question = <PollQuestion>What's your favorite programming language?</PollQuestion>;
55
+ * ```
56
+ */
57
+ function PollQuestion({ children, ...props }) {
58
+ return {
59
+ ...props,
60
+ text: children,
61
+ $$typeof: PollChildType.Question
62
+ };
63
+ }
64
+ /**
65
+ * The poll answer component defines an answer option for a Discord poll.
66
+ * @param props The poll answer properties.
67
+ * @returns The poll answer data object.
68
+ * @example ```tsx
69
+ * import { PollAnswer } from 'commandkit';
70
+ *
71
+ * const answer = <PollAnswer emoji="🟦">TypeScript</PollAnswer>;
72
+ * ```
73
+ */
74
+ function PollAnswer({ children, ...props }) {
75
+ return {
76
+ ...props,
77
+ text: children,
78
+ $$typeof: PollChildType.Answer
79
+ };
80
+ }
81
+
82
+ //#endregion
83
+ exports.Poll = Poll;
84
+ exports.PollAnswer = PollAnswer;
85
+ exports.PollQuestion = PollQuestion;
86
+ //# sourceMappingURL=poll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"poll.js","names":[],"sources":["../../../src/components/display/poll.ts"],"sourcesContent":["import {\n PollLayoutType,\n type PollAnswerData,\n type PollData,\n type PollQuestionMedia,\n} from 'discord.js';\n\n/**\n * The poll properties for the poll component.\n */\nexport interface PollProps extends Partial<\n Omit<PollData, 'question' | 'answers'>\n> {\n /**\n * The poll children components (question and answers).\n */\n children: PollChildrenType[];\n}\n\nenum PollChildType {\n Answer,\n Question,\n}\n\ntype PollChild<T, Type extends PollChildType> = T & {\n $$typeof: Type;\n};\n\nexport type PollChildrenType =\n | PollChild<PollQuestionProps, PollChildType.Question>\n | PollChild<PollAnswerProps, PollChildType.Answer>;\n\n/**\n * The poll component creates a Discord poll with a question and multiple answer options.\n * @param props The poll properties.\n * @returns The poll data object.\n * @example ```tsx\n * import { Poll, PollQuestion, PollAnswer } from 'commandkit';\n *\n * const poll = <Poll duration={24} allowMultiselect={false}>\n * <PollQuestion>What's your favorite color?</PollQuestion>\n * <PollAnswer emoji=\"🟥\">Red</PollAnswer>\n * <PollAnswer emoji=\"🟦\">Blue</PollAnswer>\n * <PollAnswer emoji=\"🟩\">Green</PollAnswer>\n * </Poll>;\n * ```\n */\nexport function Poll({ children, ...props }: PollProps): PollData {\n const question = children.find(\n (child): child is PollChild<PollQuestionProps, PollChildType.Question> =>\n child.$$typeof === PollChildType.Question,\n );\n\n if (!question) {\n throw new Error('Poll question is required');\n }\n\n const answers = children.filter(\n (child): child is PollChild<PollAnswerProps, PollChildType.Answer> =>\n child.$$typeof === PollChildType.Answer,\n );\n\n const { children: questionChildren, ...questionProps } = question;\n const { duration, allowMultiselect, layoutType, ...restProps } = props;\n\n return {\n duration: duration ?? 24,\n allowMultiselect: allowMultiselect ?? false,\n layoutType: layoutType ?? PollLayoutType.Default,\n ...restProps,\n question: { text: questionChildren, ...questionProps },\n answers: answers.map(\n ({ children: answerChildren, $$typeof, ...answerProps }) => ({\n text: answerChildren,\n ...answerProps,\n }),\n ),\n };\n}\n\n/**\n * The poll question properties for the poll question component.\n */\nexport interface PollQuestionProps extends Omit<PollQuestionMedia, 'text'> {\n /**\n * The question text content.\n */\n children: PollQuestionMedia['text'];\n}\n\n/**\n * The poll question component defines the question text for a Discord poll.\n * @param props The poll question properties.\n * @returns The poll question media object.\n * @example ```tsx\n * import { PollQuestion } from 'commandkit';\n *\n * const question = <PollQuestion>What's your favorite programming language?</PollQuestion>;\n * ```\n */\nexport function PollQuestion({\n children,\n ...props\n}: PollQuestionProps): PollChild<PollQuestionMedia, PollChildType.Question> {\n return { ...props, text: children, $$typeof: PollChildType.Question };\n}\n\n/**\n * The poll answer properties for the poll answer component.\n */\nexport interface PollAnswerProps extends Omit<PollAnswerData, 'text'> {\n /**\n * The answer text content.\n */\n children: PollAnswerData['text'];\n}\n\n/**\n * The poll answer component defines an answer option for a Discord poll.\n * @param props The poll answer properties.\n * @returns The poll answer data object.\n * @example ```tsx\n * import { PollAnswer } from 'commandkit';\n *\n * const answer = <PollAnswer emoji=\"🟦\">TypeScript</PollAnswer>;\n * ```\n */\nexport function PollAnswer({\n children,\n ...props\n}: PollAnswerProps): PollChild<PollAnswerData, PollChildType.Answer> {\n return { ...props, text: children, $$typeof: PollChildType.Answer };\n}\n"],"mappings":";;;;;AAmBA,IAAK,gBAAL;AACE;AACA;;EAFG,oBAGL;;;;;;;;;;;;;;;;AAyBA,SAAgB,KAAK,EAAE,UAAU,GAAG,SAA8B;CAChE,MAAM,WAAW,SAAS,MACvB,UACD,MAAE,aAAiB,cAAE,SACtB;AAED,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,4BAA4B;CAG9C,MAAM,UAAU,SAAS,QACtB,UACD,MAAE,aAAiB,cAAE,OACtB;CAED,MAAM,EAAE,UAAU,kBAAkB,GAAG,kBAAkB;CACzD,MAAM,EAAE,UAAU,kBAAkB,YAAY,GAAG,cAAc;AAEjE,QAAO;EACL,UAAU,YAAY;EACtB,kBAAkB,oBAAoB;EACtC,YAAY,cAAc,0BAAe;EACzC,GAAG;EACH,UAAU;GAAE,MAAM;GAAkB,GAAG;GAAe;EACtD,SAAS,QAAQ,KACd,EAAE,UAAU,gBAAgB,UAAU,GAAG,mBAAmB;GAC3D,MAAM;GACN,GAAG;GACJ,EACF;EACF;;;;;;;;;;;;AAuBH,SAAgB,aAAa,EAC3B,UACA,GAAG,SACuE;AAC1E,QAAO;EAAE,GAAG;EAAO,MAAM;EAAU,UAAU,cAAc;EAAU;;;;;;;;;;;;AAuBvE,SAAgB,WAAW,EACzB,UACA,GAAG,SACgE;AACnE,QAAO;EAAE,GAAG;EAAO,MAAM;EAAU,UAAU,cAAc;EAAQ"}
@@ -0,0 +1,2 @@
1
+ import { i as ThumbnailProps, n as SectionProps, r as Thumbnail, t as Section } from "../../section-Q8nwx_-q.js";
2
+ export { Section, SectionProps, Thumbnail, ThumbnailProps };
@@ -0,0 +1,5 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_commandkit = require('../../commandkit-Bh7C1_c7.js');
3
+
4
+ exports.Section = require_commandkit.Section;
5
+ exports.Thumbnail = require_commandkit.Thumbnail;
@@ -0,0 +1,2 @@
1
+ import { n as SeparatorProps, t as Separator } from "../../separator-B8P-kdIK.js";
2
+ export { Separator, SeparatorProps };
@@ -1,8 +1,8 @@
1
- const require_chunk = require('./chunk-nOFOJqeH.js');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_chunk = require('../../chunk-BE-pF4vm.js');
2
3
  let discord_js = require("discord.js");
3
- discord_js = require_chunk.__toESM(discord_js);
4
4
 
5
- //#region src/components/v2/separator.ts
5
+ //#region src/components/display/separator.ts
6
6
  /**
7
7
  * The components v2 separator component
8
8
  * @param props The properties for the separator component.
@@ -18,10 +18,5 @@ function Separator(props) {
18
18
  }
19
19
 
20
20
  //#endregion
21
- Object.defineProperty(exports, 'Separator', {
22
- enumerable: true,
23
- get: function () {
24
- return Separator;
25
- }
26
- });
27
- //# sourceMappingURL=separator-DL6QH5H1.js.map
21
+ exports.Separator = Separator;
22
+ //# sourceMappingURL=separator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"separator.js","names":[],"sources":["../../../src/components/display/separator.ts"],"sourcesContent":["import { SeparatorBuilder, SeparatorComponentData } from 'discord.js';\n\n/**\n * Represents the properties for a separator component.\n */\nexport interface SeparatorProps extends Omit<SeparatorComponentData, 'type'> {}\n\n/**\n * The components v2 separator component\n * @param props The properties for the separator component.\n * @returns The separator builder instance.\n * @example ```tsx\n * import { Separator } from 'commandkit';\n *\n * const separator = <Separator />;\n * ```\n */\nexport function Separator(props: SeparatorProps) {\n const separator = new SeparatorBuilder(props);\n return separator;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAiBA,SAAgB,UAAU,OAAuB;AAE/C,QADkB,IAAI,4BAAiB,MAAM"}
@@ -0,0 +1,2 @@
1
+ import { n as TextDisplay, r as TextDisplayProps, t as StringEncodable } from "../../text-display-CL9C2yMc.js";
2
+ export { StringEncodable, TextDisplay, TextDisplayProps };
@@ -1,8 +1,8 @@
1
- const require_chunk = require('./chunk-nOFOJqeH.js');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_chunk = require('../../chunk-BE-pF4vm.js');
2
3
  let discord_js = require("discord.js");
3
- discord_js = require_chunk.__toESM(discord_js);
4
4
 
5
- //#region src/components/v2/text-display.ts
5
+ //#region src/components/display/text-display.ts
6
6
  /**
7
7
  * The components v2 text display component
8
8
  * @param props The properties for the text display component.
@@ -23,10 +23,5 @@ function TextDisplay(props) {
23
23
  }
24
24
 
25
25
  //#endregion
26
- Object.defineProperty(exports, 'TextDisplay', {
27
- enumerable: true,
28
- get: function () {
29
- return TextDisplay;
30
- }
31
- });
32
- //# sourceMappingURL=text-display-DbMumig_.js.map
26
+ exports.TextDisplay = TextDisplay;
27
+ //# sourceMappingURL=text-display.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-display.js","names":[],"sources":["../../../src/components/display/text-display.ts"],"sourcesContent":["import { TextDisplayBuilder, TextDisplayComponentData } from 'discord.js';\n\n/**\n * Represents a type that can be encoded as a string.\n */\nexport type StringEncodable = string | number | boolean;\n\n/**\n * Represents the properties for a text display component.\n * This interface extends the TextDisplayComponentData type from discord.js,\n * excluding the 'type' and 'content' properties.\n */\nexport interface TextDisplayProps extends Omit<\n TextDisplayComponentData,\n 'type' | 'content'\n> {\n children?: StringEncodable | StringEncodable[];\n content?: string;\n}\n\n/**\n * The components v2 text display component\n * @param props The properties for the text display component.\n * @returns The text display builder instance.\n * @example ```tsx\n * import { TextDisplay } from 'commandkit';\n *\n * const textDisplay = <TextDisplay content=\"Hello, world!\" />;\n * // or\n * const textDisplay = <TextDisplay>Some text content</TextDisplay>;\n * ```\n */\nexport function TextDisplay(props: TextDisplayProps) {\n const textDisplay = new TextDisplayBuilder(props);\n\n if (!props.content && props.children) {\n if (Array.isArray(props.children)) {\n textDisplay.setContent(props.children.join(' '));\n } else {\n textDisplay.setContent(\n typeof props.children === 'string'\n ? props.children\n : String(props.children),\n );\n }\n }\n\n return textDisplay;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,SAAgB,YAAY,OAAyB;CACnD,MAAM,cAAc,IAAI,8BAAmB,MAAM;AAEjD,KAAI,CAAC,MAAM,WAAW,MAAM,SAC1B,KAAI,MAAM,QAAQ,MAAM,SAAS,CAC/B,aAAY,WAAW,MAAM,SAAS,KAAK,IAAI,CAAC;KAEhD,aAAY,WACV,OAAO,MAAM,aAAa,WAC1B,MAAI,WACJ,OAAI,MAAO,SAAM,CAClB;AAIL,QAAO"}