commandkit 1.0.0-dev.20250512144558 → 1.0.0-dev.20250513132158
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.
- package/dist/index.d.ts +4 -2
- package/dist/index.js +19 -5
- package/dist/index.js.map +1 -1
- package/jsx-runtime.cjs +7 -0
- package/jsx-runtime.d.ts +1 -0
- package/package.json +19 -4
package/dist/index.d.ts
CHANGED
|
@@ -652,7 +652,9 @@ interface SeparatorProps extends Omit<SeparatorComponentData, 'type'> {
|
|
|
652
652
|
}
|
|
653
653
|
declare function Separator(props: SeparatorProps): SeparatorBuilder;
|
|
654
654
|
|
|
655
|
-
interface TextDisplayProps extends Omit<TextDisplayComponentData, 'type'> {
|
|
655
|
+
interface TextDisplayProps extends Omit<TextDisplayComponentData, 'type' | 'content'> {
|
|
656
|
+
children?: string | string[];
|
|
657
|
+
content?: string;
|
|
656
658
|
}
|
|
657
659
|
declare function TextDisplay(props: TextDisplayProps): TextDisplayBuilder;
|
|
658
660
|
|
|
@@ -1947,4 +1949,4 @@ declare function getEventWorkerContext(): EventWorkerContext;
|
|
|
1947
1949
|
*/
|
|
1948
1950
|
declare function bootstrapCommandkitCLI(argv: string[], options?: commander.ParseOptions | undefined): Promise<void>;
|
|
1949
1951
|
|
|
1950
|
-
export { ActionRow, type ActionRowProps, type AnyCommandExecute, type AnyCommandKitElement, AppCommandHandler, type AsyncFunction, type AutocompleteCommand, type AutocompleteCommandContext, type AutocompleteCommandMiddlewareContext, type BootstrapFunction, Button, type ButtonChildrenLike, ButtonKit, type ButtonKitPredicate, type ButtonProps, COMMANDKIT_BOOTSTRAP_MODE, COMMANDKIT_CACHE_TAG, COMMANDKIT_IS_DEV, COMMANDKIT_IS_TEST, ChannelSelectMenu, ChannelSelectMenuKit, type ChannelSelectMenuKitPredicate, type ChannelSelectMenuProps, type ChatInputCommand, type ChatInputCommandContext, type Command, type CommandBuilderLike, type CommandContext, type CommandContextOptions, type CommandData, CommandExecutionMode, CommandKit, type CommandKitButtonBuilderInteractionCollectorDispatch, type CommandKitButtonBuilderInteractionCollectorDispatchContextData, type CommandKitButtonBuilderOnEnd, type CommandKitConfiguration, type CommandKitElement, type CommandKitElementData, CommandKitEnvironment, type CommandKitEnvironmentInternalData, CommandKitEnvironmentType, type CommandKitHMREvent, type CommandKitLoggerOptions, type CommandKitModalBuilderInteractionCollectorDispatch, type CommandKitModalBuilderInteractionCollectorDispatchContextData, type CommandKitModalBuilderOnEnd, type CommandKitOptions, type CommandKitPlugin, CommandKitPluginRuntime, type CommandKitSelectMenuBuilderInteractionCollectorDispatch, type CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, type CommandKitSelectMenuBuilderOnEnd, CommandRegistrar, type CommandSource, type CommandTypeData, CommandsRouter, type CommandsRouterOptions, type CommonBuilderKit, CommonDirectiveTransformer, type CommonDirectiveTransformerOptions, type CommonPluginRuntime, type CommonSelectMenuProps, CompilerPlugin, CompilerPluginRuntime, Container, type ContainerProps, Context, type ContextParameters, DefaultLogger, ElementType, EventInterceptor, type EventInterceptorContextData, type EventInterceptorErrorHandler, type EventWorkerContext, EventsRouter, type EventsRouterOptions, type EventsTree, File, type FileProps, Fragment, type FragmentElementProps, type GenericFunction, HMREventType, type ILogger, type InteractionCommandContext, type InteractionCommandMiddlewareContext, type LoadedCommand, type Loader, type Location, Logger, type LoggerImpl, type MaybeArray, type MaybeFalsey, MediaGallery, MediaGalleryItem, type MediaGalleryItemProps, type MediaGalleryProps, MentionableSelectMenu, MentionableSelectMenuKit, type MentionableSelectMenuKitPredicate, type MentionableSelectMenuProps, type Message, type MessageCommand, type MessageCommandContext, type MessageCommandMiddlewareContext, MessageCommandOptions, type MessageCommandOptionsSchema, MessageCommandParser, type MessageContextMenuCommand, type MessageContextMenuCommandContext, type MessageContextMenuCommandMiddlewareContext, type Middleware, MiddlewareContext, type MiddlewareContextArgs, Modal, ModalKit, type ModalKitPredicate, type ModalProps, type OnButtonKitClick, type OnButtonKitEnd, type OnChannelSelectMenuKitSubmit, type OnLoadArgs, type OnLoadOptions, type OnLoadResult, type OnMentionableSelectMenuKitSubmit, type OnModalKitEnd, type OnModalKitSubmit, type OnResolveArgs, type OnResolveOptions, type OnResolveResult, type OnRoleSelectMenuKitSubmit, type OnSelectMenuKitEnd, type OnSelectMenuKitSubmit, type OnStringSelectMenuKitSubmit, type OnUserSelectMenuKitSubmit, ParagraphInput, type ParsedCommandData, type ParsedEvent, type ParsedMessageCommand, type PluginTransformParameters, type PreRegisterCommandsEvent, type PreparedAppCommandExecution, type ResolvableCommand, type ResolveBuilderInteraction, type ResolveKind, type ResolveResult, RoleSelectMenu, RoleSelectMenuKit, type RoleSelectMenuKitPredicate, type RoleSelectMenuProps, type RunCommand, RuntimePlugin, Section, type SectionProps, type SelectMenuKitPredicate, type SelectMenuProps, Separator, type SeparatorProps, type Setup, ShortInput, type SlashCommandMiddlewareContext, StopEventPropagationError, StringSelectMenu, StringSelectMenuKit, type StringSelectMenuKitPredicate, StringSelectMenuOption, type StringSelectMenuOptionProps, type StringSelectMenuProps, TextDisplay, type TextDisplayProps, TextInput, type TextInputProps, Thumbnail, type ThumbnailProps, type TransformedResult, type UserContextMenuCommand, type UserContextMenuCommandContext, type UserContextMenuCommandMiddlewareContext, UserSelectMenu, UserSelectMenuKit, type UserSelectMenuKitPredicate, type UserSelectMenuProps, after, bootstrapCommandkitCLI, cancelAfter, commandkit, createElement, createLogger, debounce, CommandKit as default, defineConfig, devOnly, eventWorkerContext, exitContext, exitMiddleware, fromEsbuildPlugin, getCommandKit, getConfig, getContext, getCurrentDirectory, getElement, getEventWorkerContext, getSourceDirectories, isCommandKitElement, isCompilerPlugin, isInteractionSource, isMessageSource, isRuntimePlugin, makeContextAwareFunction, onApplicationBootstrap, onBootstrap, provideContext, redirect, rethrow, runInEventWorkerContext, stopEvents, useEnvironment, version };
|
|
1952
|
+
export { ActionRow, type ActionRowProps, type AnyCommandExecute, type AnyCommandKitElement, AppCommandHandler, type AsyncFunction, type AutocompleteCommand, type AutocompleteCommandContext, type AutocompleteCommandMiddlewareContext, type BootstrapFunction, Button, type ButtonChildrenLike, ButtonKit, type ButtonKitPredicate, type ButtonProps, COMMANDKIT_BOOTSTRAP_MODE, COMMANDKIT_CACHE_TAG, COMMANDKIT_IS_DEV, COMMANDKIT_IS_TEST, ChannelSelectMenu, ChannelSelectMenuKit, type ChannelSelectMenuKitPredicate, type ChannelSelectMenuProps, type ChatInputCommand, type ChatInputCommandContext, type Command, type CommandBuilderLike, type CommandContext, type CommandContextOptions, type CommandData, CommandExecutionMode, CommandKit, type CommandKitButtonBuilderInteractionCollectorDispatch, type CommandKitButtonBuilderInteractionCollectorDispatchContextData, type CommandKitButtonBuilderOnEnd, type CommandKitConfiguration, type CommandKitElement, type CommandKitElementData, CommandKitEnvironment, type CommandKitEnvironmentInternalData, CommandKitEnvironmentType, type CommandKitHMREvent, type CommandKitLoggerOptions, type CommandKitModalBuilderInteractionCollectorDispatch, type CommandKitModalBuilderInteractionCollectorDispatchContextData, type CommandKitModalBuilderOnEnd, type CommandKitOptions, type CommandKitPlugin, CommandKitPluginRuntime, type CommandKitSelectMenuBuilderInteractionCollectorDispatch, type CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, type CommandKitSelectMenuBuilderOnEnd, CommandRegistrar, type CommandSource, type CommandTypeData, CommandsRouter, type CommandsRouterOptions, type CommonBuilderKit, CommonDirectiveTransformer, type CommonDirectiveTransformerOptions, type CommonPluginRuntime, type CommonSelectMenuProps, CompilerPlugin, CompilerPluginRuntime, Container, type ContainerProps, Context, type ContextParameters, DefaultLogger, ElementType, EventInterceptor, type EventInterceptorContextData, type EventInterceptorErrorHandler, type EventWorkerContext, EventsRouter, type EventsRouterOptions, type EventsTree, File, type FileProps, Fragment, type FragmentElementProps, type GenericFunction, HMREventType, type ILogger, type InteractionCommandContext, type InteractionCommandMiddlewareContext, type LoadedCommand, type Loader, type Location, Logger, type LoggerImpl, type MaybeArray, type MaybeFalsey, MediaGallery, MediaGalleryItem, type MediaGalleryItemProps, type MediaGalleryProps, MentionableSelectMenu, MentionableSelectMenuKit, type MentionableSelectMenuKitPredicate, type MentionableSelectMenuProps, type Message, type MessageCommand, type MessageCommandContext, type MessageCommandMiddlewareContext, MessageCommandOptions, type MessageCommandOptionsSchema, MessageCommandParser, type MessageContextMenuCommand, type MessageContextMenuCommandContext, type MessageContextMenuCommandMiddlewareContext, type Middleware, MiddlewareContext, type MiddlewareContextArgs, Modal, ModalKit, type ModalKitPredicate, type ModalProps, type OnButtonKitClick, type OnButtonKitEnd, type OnChannelSelectMenuKitSubmit, type OnLoadArgs, type OnLoadOptions, type OnLoadResult, type OnMentionableSelectMenuKitSubmit, type OnModalKitEnd, type OnModalKitSubmit, type OnResolveArgs, type OnResolveOptions, type OnResolveResult, type OnRoleSelectMenuKitSubmit, type OnSelectMenuKitEnd, type OnSelectMenuKitSubmit, type OnStringSelectMenuKitSubmit, type OnUserSelectMenuKitSubmit, ParagraphInput, type ParsedCommandData, type ParsedEvent, type ParsedMessageCommand, type PluginTransformParameters, type PreRegisterCommandsEvent, type PreparedAppCommandExecution, type ResolvableCommand, type ResolveBuilderInteraction, type ResolveKind, type ResolveResult, RoleSelectMenu, RoleSelectMenuKit, type RoleSelectMenuKitPredicate, type RoleSelectMenuProps, type RunCommand, RuntimePlugin, Section, type SectionProps, type SelectMenuKitPredicate, type SelectMenuProps, Separator, type SeparatorProps, type Setup, ShortInput, type SlashCommandMiddlewareContext, StopEventPropagationError, StringSelectMenu, StringSelectMenuKit, type StringSelectMenuKitPredicate, StringSelectMenuOption, type StringSelectMenuOptionProps, type StringSelectMenuProps, TextDisplay, type TextDisplayProps, TextInput, type TextInputProps, Thumbnail, type ThumbnailProps, type TransformedResult, type UserContextMenuCommand, type UserContextMenuCommandContext, type UserContextMenuCommandMiddlewareContext, UserSelectMenu, UserSelectMenuKit, type UserSelectMenuKitPredicate, type UserSelectMenuProps, after, bootstrapCommandkitCLI, cancelAfter, commandkit, createElement, createLogger, debounce, CommandKit as default, defineConfig, devOnly, eventWorkerContext, exitContext, exitMiddleware, fromEsbuildPlugin, getCommandKit, getConfig, getContext, getCurrentDirectory, getElement, getEventWorkerContext, getSourceDirectories, isCommandKitElement, isCompilerPlugin, isInteractionSource, isMessageSource, isRuntimePlugin, createElement as jsx, createElement as jsxs, makeContextAwareFunction, onApplicationBootstrap, onBootstrap, provideContext, redirect, rethrow, runInEventWorkerContext, stopEvents, useEnvironment, version };
|
package/dist/index.js
CHANGED
|
@@ -1710,6 +1710,13 @@ var init_separator = __esm({
|
|
|
1710
1710
|
// src/components/v2/text-display.ts
|
|
1711
1711
|
function TextDisplay(props) {
|
|
1712
1712
|
const textDisplay = new import_discord17.TextDisplayBuilder(props);
|
|
1713
|
+
if (!props.content && props.children) {
|
|
1714
|
+
if (Array.isArray(props.children)) {
|
|
1715
|
+
textDisplay.setContent(props.children.join(" "));
|
|
1716
|
+
} else {
|
|
1717
|
+
textDisplay.setContent(props.children);
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1713
1720
|
return textDisplay;
|
|
1714
1721
|
}
|
|
1715
1722
|
var import_discord17;
|
|
@@ -1771,11 +1778,11 @@ function getElement(element) {
|
|
|
1771
1778
|
}
|
|
1772
1779
|
function Fragment(props) {
|
|
1773
1780
|
warnUnstable("CommandKit JSX");
|
|
1774
|
-
return Array.isArray(props.children) ? props.children.flat() : props.children;
|
|
1781
|
+
return Array.isArray(props.children) ? props.children.flat() : [props.children];
|
|
1775
1782
|
}
|
|
1776
1783
|
function createElement(type, props, ...children) {
|
|
1777
1784
|
warnUnstable("CommandKit JSX");
|
|
1778
|
-
return type({ ...props, children });
|
|
1785
|
+
return type({ ...props, children: props.children ?? children });
|
|
1779
1786
|
}
|
|
1780
1787
|
var ElementType;
|
|
1781
1788
|
var init_element = __esm({
|
|
@@ -5615,7 +5622,7 @@ var init_version = __esm({
|
|
|
5615
5622
|
"use strict";
|
|
5616
5623
|
init_cjs_shims();
|
|
5617
5624
|
version = /* @__MACRO__ $version */
|
|
5618
|
-
"1.0.0-dev.
|
|
5625
|
+
"1.0.0-dev.20250513132158";
|
|
5619
5626
|
}
|
|
5620
5627
|
});
|
|
5621
5628
|
|
|
@@ -5841,8 +5848,11 @@ async function buildApplication({
|
|
|
5841
5848
|
shims: true,
|
|
5842
5849
|
keepNames: true,
|
|
5843
5850
|
minify: false,
|
|
5844
|
-
|
|
5845
|
-
|
|
5851
|
+
esbuildOptions: /* @__PURE__ */ __name((options) => {
|
|
5852
|
+
options.jsx = "automatic";
|
|
5853
|
+
options.jsxImportSource = "commandkit";
|
|
5854
|
+
return options;
|
|
5855
|
+
}, "esbuildOptions"),
|
|
5846
5856
|
minifyIdentifiers: false,
|
|
5847
5857
|
minifySyntax: false,
|
|
5848
5858
|
silent: !!isDev,
|
|
@@ -6571,6 +6581,8 @@ __export(index_exports, {
|
|
|
6571
6581
|
isInteractionSource: () => isInteractionSource,
|
|
6572
6582
|
isMessageSource: () => isMessageSource,
|
|
6573
6583
|
isRuntimePlugin: () => isRuntimePlugin,
|
|
6584
|
+
jsx: () => createElement,
|
|
6585
|
+
jsxs: () => createElement,
|
|
6574
6586
|
makeContextAwareFunction: () => makeContextAwareFunction,
|
|
6575
6587
|
onApplicationBootstrap: () => onApplicationBootstrap,
|
|
6576
6588
|
onBootstrap: () => onBootstrap,
|
|
@@ -6768,6 +6780,8 @@ var index_default = CommandKit;
|
|
|
6768
6780
|
isInteractionSource,
|
|
6769
6781
|
isMessageSource,
|
|
6770
6782
|
isRuntimePlugin,
|
|
6783
|
+
jsx,
|
|
6784
|
+
jsxs,
|
|
6771
6785
|
makeContextAwareFunction,
|
|
6772
6786
|
onApplicationBootstrap,
|
|
6773
6787
|
onBootstrap,
|