feat(builders): modal select menus in builders v1 (#11138)

* feat(builders): modal select menus

* chore: fix test

* fix: move setRequired up

* fix: pack

* chore: forwardport https://github.com/discordjs/discord.js/pull/11139

* types: expect errors

* fix: id validator being required

* fix: validators 2

* Apply suggestion from @Jiralite

* Apply suggestion from @Jiralite

* Apply suggestion from @Jiralite

* fix: replace tests

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Vlad Frangu
2025-10-08 10:21:41 +03:00
committed by GitHub
parent 437bb94349
commit ac683b9d04
17 changed files with 700 additions and 2737 deletions

View File

@@ -100,7 +100,7 @@ describe('Text Input Components', () => {
.setPlaceholder('hello')
.setStyle(TextInputStyle.Paragraph)
.toJSON();
}).toThrowError();
}).not.toThrowError();
});
test('GIVEN valid input THEN valid JSON outputs are given', () => {

View File

@@ -1,8 +1,8 @@
import { type APIContainerComponent, ComponentType, SeparatorSpacingSize } from 'discord-api-types/v10';
import { describe, test, expect } from 'vitest';
import { ButtonBuilder } from '../../../dist/index.mjs';
import { ActionRowBuilder } from '../../../src/components/ActionRow.js';
import { createComponentBuilder } from '../../../src/components/Components.js';
import { ButtonBuilder } from '../../../src/components/button/Button.js';
import { ContainerBuilder } from '../../../src/components/v2/Container.js';
import { FileBuilder } from '../../../src/components/v2/File.js';
import { MediaGalleryBuilder } from '../../../src/components/v2/MediaGallery.js';

View File

@@ -68,7 +68,7 @@
"@discordjs/formatters": "workspace:^",
"@discordjs/util": "workspace:^",
"@sapphire/shapeshift": "^4.0.0",
"discord-api-types": "^0.38.16",
"discord-api-types": "^0.38.26",
"fast-deep-equal": "^3.1.3",
"ts-mixer": "^6.0.4",
"tslib": "^2.6.3"

View File

@@ -5,6 +5,7 @@ import type {
APIBaseComponent,
ComponentType,
APIMessageComponent,
APIModalComponent,
} from 'discord-api-types/v10';
import { idValidator } from './Assertions';
@@ -14,7 +15,8 @@ import { idValidator } from './Assertions';
export type AnyAPIActionRowComponent =
| APIActionRowComponent<APIComponentInActionRow>
| APIComponentInActionRow
| APIMessageComponent;
| APIMessageComponent
| APIModalComponent;
/**
* The base component builder that contains common symbols for all sorts of components.

View File

@@ -8,6 +8,7 @@ import {
} from './ActionRow.js';
import { ComponentBuilder } from './Component.js';
import { ButtonBuilder } from './button/Button.js';
import { LabelBuilder } from './label/Label.js';
import { ChannelSelectMenuBuilder } from './selectMenu/ChannelSelectMenu.js';
import { MentionableSelectMenuBuilder } from './selectMenu/MentionableSelectMenu.js';
import { RoleSelectMenuBuilder } from './selectMenu/RoleSelectMenu.js';
@@ -100,6 +101,10 @@ export interface MappedComponentTypes {
* The media gallery component type is associated with a {@link MediaGalleryBuilder}.
*/
[ComponentType.MediaGallery]: MediaGalleryBuilder;
/**
* The label component type is associated with a {@link LabelBuilder}.
*/
[ComponentType.Label]: LabelBuilder;
}
/**
@@ -161,6 +166,8 @@ export function createComponentBuilder(
return new ThumbnailBuilder(data);
case ComponentType.MediaGallery:
return new MediaGalleryBuilder(data);
case ComponentType.Label:
return new LabelBuilder(data);
default:
// @ts-expect-error This case can still occur if we get a newer unsupported component type
throw new Error(`Cannot properly serialize component type: ${data.type}`);

View File

@@ -0,0 +1,29 @@
import { s } from '@sapphire/shapeshift';
import { ComponentType } from 'discord-api-types/v10';
import { isValidationEnabled } from '../../util/validation.js';
import { idValidator } from '../Assertions.js';
import {
selectMenuChannelPredicate,
selectMenuMentionablePredicate,
selectMenuRolePredicate,
selectMenuStringPredicate,
selectMenuUserPredicate,
} from '../selectMenu/Assertions.js';
import { textInputPredicate } from '../textInput/Assertions.js';
export const labelPredicate = s
.object({
id: idValidator.optional(),
type: s.literal(ComponentType.Label),
label: s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(45),
description: s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100).optional(),
component: s.union([
textInputPredicate,
selectMenuUserPredicate,
selectMenuRolePredicate,
selectMenuMentionablePredicate,
selectMenuChannelPredicate,
selectMenuStringPredicate,
]),
})
.setValidationEnabled(isValidationEnabled);

View File

@@ -0,0 +1,198 @@
import type {
APIChannelSelectComponent,
APILabelComponent,
APIMentionableSelectComponent,
APIRoleSelectComponent,
APIStringSelectComponent,
APITextInputComponent,
APIUserSelectComponent,
} from 'discord-api-types/v10';
import { ComponentType } from 'discord-api-types/v10';
import { ComponentBuilder } from '../Component.js';
import { createComponentBuilder, resolveBuilder } from '../Components.js';
import { ChannelSelectMenuBuilder } from '../selectMenu/ChannelSelectMenu.js';
import { MentionableSelectMenuBuilder } from '../selectMenu/MentionableSelectMenu.js';
import { RoleSelectMenuBuilder } from '../selectMenu/RoleSelectMenu.js';
import { StringSelectMenuBuilder } from '../selectMenu/StringSelectMenu.js';
import { UserSelectMenuBuilder } from '../selectMenu/UserSelectMenu.js';
import { TextInputBuilder } from '../textInput/TextInput.js';
import { labelPredicate } from './Assertions.js';
export interface LabelBuilderData extends Partial<Omit<APILabelComponent, 'component'>> {
component?:
| ChannelSelectMenuBuilder
| MentionableSelectMenuBuilder
| RoleSelectMenuBuilder
| StringSelectMenuBuilder
| TextInputBuilder
| UserSelectMenuBuilder;
}
/**
* A builder that creates API-compatible JSON data for labels.
*/
export class LabelBuilder extends ComponentBuilder<LabelBuilderData> {
/**
* @internal
*/
public override readonly data: LabelBuilderData;
/**
* Creates a new label.
*
* @param data - The API data to create this label with
* @example
* Creating a label from an API data object:
* ```ts
* const label = new LabelBuilder({
* label: "label",
* component,
* });
* ```
* @example
* Creating a label using setters and API data:
* ```ts
* const label = new LabelBuilder({
* label: 'label',
* component,
* }).setLabel('new text');
* ```
*/
public constructor(data: Partial<APILabelComponent> = {}) {
super({ type: ComponentType.Label });
const { component, ...rest } = data;
this.data = {
...rest,
component: component ? createComponentBuilder(component) : undefined,
type: ComponentType.Label,
};
}
/**
* Sets the label for this label.
*
* @param label - The label to use
*/
public setLabel(label: string) {
this.data.label = label;
return this;
}
/**
* Sets the description for this label.
*
* @param description - The description to use
*/
public setDescription(description: string) {
this.data.description = description;
return this;
}
/**
* Clears the description for this label.
*/
public clearDescription() {
this.data.description = undefined;
return this;
}
/**
* Sets a string select menu component to this label.
*
* @param input - A function that returns a component builder or an already built builder
*/
public setStringSelectMenuComponent(
input:
| APIStringSelectComponent
| StringSelectMenuBuilder
| ((builder: StringSelectMenuBuilder) => StringSelectMenuBuilder),
): this {
this.data.component = resolveBuilder(input, StringSelectMenuBuilder);
return this;
}
/**
* Sets a user select menu component to this label.
*
* @param input - A function that returns a component builder or an already built builder
*/
public setUserSelectMenuComponent(
input: APIUserSelectComponent | UserSelectMenuBuilder | ((builder: UserSelectMenuBuilder) => UserSelectMenuBuilder),
): this {
this.data.component = resolveBuilder(input, UserSelectMenuBuilder);
return this;
}
/**
* Sets a role select menu component to this label.
*
* @param input - A function that returns a component builder or an already built builder
*/
public setRoleSelectMenuComponent(
input: APIRoleSelectComponent | RoleSelectMenuBuilder | ((builder: RoleSelectMenuBuilder) => RoleSelectMenuBuilder),
): this {
this.data.component = resolveBuilder(input, RoleSelectMenuBuilder);
return this;
}
/**
* Sets a mentionable select menu component to this label.
*
* @param input - A function that returns a component builder or an already built builder
*/
public setMentionableSelectMenuComponent(
input:
| APIMentionableSelectComponent
| MentionableSelectMenuBuilder
| ((builder: MentionableSelectMenuBuilder) => MentionableSelectMenuBuilder),
): this {
this.data.component = resolveBuilder(input, MentionableSelectMenuBuilder);
return this;
}
/**
* Sets a channel select menu component to this label.
*
* @param input - A function that returns a component builder or an already built builder
*/
public setChannelSelectMenuComponent(
input:
| APIChannelSelectComponent
| ChannelSelectMenuBuilder
| ((builder: ChannelSelectMenuBuilder) => ChannelSelectMenuBuilder),
): this {
this.data.component = resolveBuilder(input, ChannelSelectMenuBuilder);
return this;
}
/**
* Sets a text input component to this label.
*
* @param input - A function that returns a component builder or an already built builder
*/
public setTextInputComponent(
input: APITextInputComponent | TextInputBuilder | ((builder: TextInputBuilder) => TextInputBuilder),
): this {
this.data.component = resolveBuilder(input, TextInputBuilder);
return this;
}
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
public override toJSON(): APILabelComponent {
const { component, ...rest } = this.data;
const data = {
...rest,
// The label predicate validates the component.
component: component?.toJSON(),
};
labelPredicate.parse(data);
return data as APILabelComponent;
}
}

View File

@@ -0,0 +1,92 @@
import { Result, s } from '@sapphire/shapeshift';
import { ChannelType, ComponentType, SelectMenuDefaultValueType } from 'discord-api-types/v10';
import { isValidationEnabled } from '../../util/validation.js';
import { customIdValidator, emojiValidator, idValidator } from '../Assertions.js';
import { labelValidator } from '../textInput/Assertions.js';
const selectMenuBasePredicate = s.object({
id: idValidator.optional(),
placeholder: s.string().lengthLessThanOrEqual(150).optional(),
min_values: s.number().greaterThanOrEqual(0).lessThanOrEqual(25).optional(),
max_values: s.number().greaterThanOrEqual(0).lessThanOrEqual(25).optional(),
custom_id: customIdValidator,
disabled: s.boolean().optional(),
});
export const selectMenuChannelPredicate = selectMenuBasePredicate
.extend({
type: s.literal(ComponentType.ChannelSelect),
channel_types: s.nativeEnum(ChannelType).array().optional(),
default_values: s
.object({ id: s.string(), type: s.literal(SelectMenuDefaultValueType.Channel) })
.array()
.lengthLessThanOrEqual(25)
.optional(),
})
.setValidationEnabled(isValidationEnabled);
export const selectMenuMentionablePredicate = selectMenuBasePredicate
.extend({
type: s.literal(ComponentType.MentionableSelect),
default_values: s
.object({
id: s.string(),
type: s.literal([SelectMenuDefaultValueType.Role, SelectMenuDefaultValueType.User]),
})
.array()
.lengthLessThanOrEqual(25)
.optional(),
})
.setValidationEnabled(isValidationEnabled);
export const selectMenuRolePredicate = selectMenuBasePredicate
.extend({
type: s.literal(ComponentType.RoleSelect),
default_values: s
.object({ id: s.string(), type: s.literal(SelectMenuDefaultValueType.Role) })
.array()
.lengthLessThanOrEqual(25)
.optional(),
})
.setValidationEnabled(isValidationEnabled);
export const selectMenuUserPredicate = selectMenuBasePredicate
.extend({
type: s.literal(ComponentType.UserSelect),
default_values: s
.object({ id: s.string(), type: s.literal(SelectMenuDefaultValueType.User) })
.array()
.lengthLessThanOrEqual(25)
.optional(),
})
.setValidationEnabled(isValidationEnabled);
export const selectMenuStringOptionPredicate = s
.object({
label: labelValidator,
value: s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100),
description: s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100).optional(),
emoji: emojiValidator.optional(),
default: s.boolean().optional(),
})
.setValidationEnabled(isValidationEnabled);
export const selectMenuStringPredicate = selectMenuBasePredicate
.extend({
type: s.literal(ComponentType.StringSelect),
options: selectMenuStringOptionPredicate.array().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(25),
})
.reshape((value) => {
if (value.min_values !== undefined && value.options.length < value.min_values) {
return Result.err(new RangeError(`The number of options must be greater than or equal to min_values`));
}
if (value.min_values !== undefined && value.max_values !== undefined && value.min_values > value.max_values) {
return Result.err(
new RangeError(`The maximum amount of options must be greater than or equal to the minimum amount of options`),
);
}
return Result.ok(value);
})
.setValidationEnabled(isValidationEnabled);

View File

@@ -1,6 +1,7 @@
import type { APISelectMenuComponent } from 'discord-api-types/v10';
import { customIdValidator, disabledValidator, minMaxValidator, placeholderValidator } from '../Assertions.js';
import { ComponentBuilder } from '../Component.js';
import { requiredValidator } from '../textInput/Assertions.js';
/**
* The base select menu builder that contains common symbols for select menu builders.
@@ -60,6 +61,17 @@ export abstract class BaseSelectMenuBuilder<
return this;
}
/**
* Sets whether this select menu is required.
*
* @remarks Only for use in modals.
* @param required - Whether this select menu is required
*/
public setRequired(required = true) {
this.data.required = requiredValidator.parse(required);
return this;
}
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/

View File

@@ -1,9 +1,9 @@
import { s } from '@sapphire/shapeshift';
import { TextInputStyle } from 'discord-api-types/v10';
import { ComponentType, TextInputStyle } from 'discord-api-types/v10';
import { isValidationEnabled } from '../../util/validation.js';
import { customIdValidator } from '../Assertions.js';
import { customIdValidator, idValidator } from '../Assertions.js';
export const textInputStyleValidator = s.nativeEnum(TextInputStyle);
export const textInputStyleValidator = s.nativeEnum(TextInputStyle).setValidationEnabled(isValidationEnabled);
export const minLengthValidator = s
.number()
.int()
@@ -16,7 +16,7 @@ export const maxLengthValidator = s
.greaterThanOrEqual(1)
.lessThanOrEqual(4_000)
.setValidationEnabled(isValidationEnabled);
export const requiredValidator = s.boolean();
export const requiredValidator = s.boolean().setValidationEnabled(isValidationEnabled);
export const valueValidator = s.string().lengthLessThanOrEqual(4_000).setValidationEnabled(isValidationEnabled);
export const placeholderValidator = s.string().lengthLessThanOrEqual(100).setValidationEnabled(isValidationEnabled);
export const labelValidator = s
@@ -25,8 +25,21 @@ export const labelValidator = s
.lengthLessThanOrEqual(45)
.setValidationEnabled(isValidationEnabled);
export function validateRequiredParameters(customId?: string, style?: TextInputStyle, label?: string) {
export const textInputPredicate = s
.object({
type: s.literal(ComponentType.TextInput),
custom_id: customIdValidator,
style: textInputStyleValidator,
id: idValidator.optional(),
min_length: minLengthValidator.optional(),
max_length: maxLengthValidator.optional(),
placeholder: placeholderValidator.optional(),
value: valueValidator.optional(),
required: requiredValidator.optional(),
})
.setValidationEnabled(isValidationEnabled);
export function validateRequiredParameters(customId?: string, style?: TextInputStyle) {
customIdValidator.parse(customId);
textInputStyleValidator.parse(style);
labelValidator.parse(label);
}

View File

@@ -30,7 +30,7 @@ export class TextInputBuilder
* ```ts
* const textInput = new TextInputBuilder({
* custom_id: 'a cool text input',
* label: 'Type something',
* placeholder: 'Type something',
* style: TextInputStyle.Short,
* });
* ```
@@ -38,7 +38,7 @@ export class TextInputBuilder
* Creating a text input using setters and API data:
* ```ts
* const textInput = new TextInputBuilder({
* label: 'Type something else',
* placeholder: 'Type something else',
* })
* .setCustomId('woah')
* .setStyle(TextInputStyle.Paragraph);
@@ -62,6 +62,7 @@ export class TextInputBuilder
* Sets the label for this text input.
*
* @param label - The label to use
* @deprecated Use a label builder to create a label (and optionally a description) instead.
*/
public setLabel(label: string) {
this.data.label = labelValidator.parse(label);
@@ -132,7 +133,7 @@ export class TextInputBuilder
* {@inheritDoc ComponentBuilder.toJSON}
*/
public toJSON(): APITextInputComponent {
validateRequiredParameters(this.data.custom_id, this.data.style, this.data.label);
validateRequiredParameters(this.data.custom_id, this.data.style);
return {
...this.data,

View File

@@ -34,6 +34,9 @@ export {
export * from './components/selectMenu/StringSelectMenuOption.js';
export * from './components/selectMenu/UserSelectMenu.js';
export * from './components/label/Label.js';
export * as LabelAssertions from './components/label/Assertions.js';
export * as ComponentsV2Assertions from './components/v2/Assertions.js';
export * from './components/v2/Container.js';
export * from './components/v2/File.js';

View File

@@ -1,6 +1,7 @@
import { s } from '@sapphire/shapeshift';
import { ActionRowBuilder, type ModalActionRowComponentBuilder } from '../../components/ActionRow.js';
import { customIdValidator } from '../../components/Assertions.js';
import { LabelBuilder } from '../../components/label/Label.js';
import { isValidationEnabled } from '../../util/validation.js';
export const titleValidator = s
@@ -9,7 +10,7 @@ export const titleValidator = s
.lengthLessThanOrEqual(45)
.setValidationEnabled(isValidationEnabled);
export const componentsValidator = s
.instance(ActionRowBuilder)
.union([s.instance(ActionRowBuilder), s.instance(LabelBuilder)])
.array()
.lengthGreaterThanOrEqual(1)
.setValidationEnabled(isValidationEnabled);
@@ -17,7 +18,7 @@ export const componentsValidator = s
export function validateRequiredParameters(
customId?: string,
title?: string,
components?: ActionRowBuilder<ModalActionRowComponentBuilder>[],
components?: (ActionRowBuilder<ModalActionRowComponentBuilder> | LabelBuilder)[],
) {
customIdValidator.parse(customId);
titleValidator.parse(title);

View File

@@ -2,13 +2,18 @@
import type { JSONEncodable } from '@discordjs/util';
import type {
APITextInputComponent,
APIActionRowComponent,
APIComponentInModalActionRow,
APILabelComponent,
APIModalInteractionResponseCallbackData,
} from 'discord-api-types/v10';
import { ComponentType } from 'discord-api-types/v10';
import { ActionRowBuilder, type ModalActionRowComponentBuilder } from '../../components/ActionRow.js';
import { customIdValidator } from '../../components/Assertions.js';
import { createComponentBuilder } from '../../components/Components.js';
import { createComponentBuilder, resolveBuilder } from '../../components/Components.js';
import { LabelBuilder } from '../../components/label/Label.js';
import { TextInputBuilder } from '../../components/textInput/TextInput.js';
import { normalizeArray, type RestOrArray } from '../../util/normalizeArray.js';
import { titleValidator, validateRequiredParameters } from './Assertions.js';
@@ -24,7 +29,7 @@ export class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCa
/**
* The components within this modal.
*/
public readonly components: ActionRowBuilder<ModalActionRowComponentBuilder>[] = [];
public readonly components: (ActionRowBuilder<ModalActionRowComponentBuilder> | LabelBuilder)[] = [];
/**
* Creates a new modal from API data.
@@ -33,8 +38,10 @@ export class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCa
*/
public constructor({ components, ...data }: Partial<APIModalInteractionResponseCallbackData> = {}) {
this.data = { ...data };
this.components = (components?.map((component) => createComponentBuilder(component)) ??
[]) as ActionRowBuilder<ModalActionRowComponentBuilder>[];
this.components = (components?.map((component) => createComponentBuilder(component)) ?? []) as (
| ActionRowBuilder<ModalActionRowComponentBuilder>
| LabelBuilder
)[];
}
/**
@@ -61,28 +68,150 @@ export class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCa
* Adds components to this modal.
*
* @param components - The components to add
* @deprecated Use {@link ModalBuilder.addLabelComponents} or {@link ModalBuilder.addActionRowComponents} instead
*/
public addComponents(
...components: RestOrArray<
ActionRowBuilder<ModalActionRowComponentBuilder> | APIActionRowComponent<APIComponentInModalActionRow>
| ActionRowBuilder<ModalActionRowComponentBuilder>
| APIActionRowComponent<APIComponentInModalActionRow>
| APILabelComponent
| APITextInputComponent
| LabelBuilder
| TextInputBuilder
>
) {
this.components.push(
...normalizeArray(components).map((component) =>
component instanceof ActionRowBuilder
? component
: new ActionRowBuilder<ModalActionRowComponentBuilder>(component),
),
...normalizeArray(components).map((component, idx) => {
if (component instanceof ActionRowBuilder || component instanceof LabelBuilder) {
return component;
}
if (component instanceof TextInputBuilder) {
return new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(component);
}
if ('type' in component) {
if (component.type === ComponentType.ActionRow) {
return new ActionRowBuilder<ModalActionRowComponentBuilder>(component);
}
if (component.type === ComponentType.Label) {
return new LabelBuilder(component);
}
if (component.type === ComponentType.TextInput) {
return new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(
new TextInputBuilder(component),
);
}
}
throw new TypeError(`Invalid component passed in ModalBuilder.addComponents at index ${idx}!`);
}),
);
return this;
}
/**
* Adds label components to this modal.
*
* @param components - The components to add
*/
public addLabelComponents(
...components: RestOrArray<APILabelComponent | LabelBuilder | ((builder: LabelBuilder) => LabelBuilder)>
) {
const normalized = normalizeArray(components);
const resolved = normalized.map((label) => resolveBuilder(label, LabelBuilder));
this.components.push(...resolved);
return this;
}
/**
* Adds action rows to this modal.
*
* @param components - The components to add
* @deprecated Use {@link ModalBuilder.addLabelComponents} instead
*/
public addActionRowComponents(
...components: RestOrArray<
| ActionRowBuilder<ModalActionRowComponentBuilder>
| APIActionRowComponent<APIComponentInModalActionRow>
| ((
builder: ActionRowBuilder<ModalActionRowComponentBuilder>,
) => ActionRowBuilder<ModalActionRowComponentBuilder>)
>
) {
const normalized = normalizeArray(components);
const resolved = normalized.map((row) => resolveBuilder(row, ActionRowBuilder<ModalActionRowComponentBuilder>));
this.components.push(...resolved);
return this;
}
/**
* Sets the labels for this modal.
*
* @param components - The components to set
*/
public setLabelComponents(
...components: RestOrArray<APILabelComponent | LabelBuilder | ((builder: LabelBuilder) => LabelBuilder)>
) {
const normalized = normalizeArray(components);
this.spliceLabelComponents(0, this.components.length, ...normalized);
return this;
}
/**
* Removes, replaces, or inserts labels for this modal.
*
* @remarks
* This method behaves similarly
* to {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/splice | Array.prototype.splice()}.
* The maximum amount of labels that can be added is 5.
*
* It's useful for modifying and adjusting order of the already-existing labels of a modal.
* @example
* Remove the first label:
* ```ts
* modal.spliceLabelComponents(0, 1);
* ```
* @example
* Remove the first n labels:
* ```ts
* const n = 4;
* modal.spliceLabelComponents(0, n);
* ```
* @example
* Remove the last label:
* ```ts
* modal.spliceLabelComponents(-1, 1);
* ```
* @param index - The index to start at
* @param deleteCount - The number of labels to remove
* @param labels - The replacing label objects
*/
public spliceLabelComponents(
index: number,
deleteCount: number,
...labels: (APILabelComponent | LabelBuilder | ((builder: LabelBuilder) => LabelBuilder))[]
): this {
const resolved = labels.map((label) => resolveBuilder(label, LabelBuilder));
this.components.splice(index, deleteCount, ...resolved);
return this;
}
/**
* Sets components for this modal.
*
* @param components - The components to set
* @deprecated Use {@link ModalBuilder.setLabelComponents} instead
*/
public setComponents(...components: RestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder>>) {
public setComponents(...components: RestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder> | LabelBuilder>) {
this.components.splice(0, this.components.length, ...normalizeArray(components));
return this;
}

View File

@@ -314,8 +314,9 @@ export class ActionRowBuilder<
>,
);
public static from<ComponentType extends AnyComponentBuilder = AnyComponentBuilder>(
other:
| JSONEncodable<APIActionRowComponent<ReturnType<ComponentType['toJSON']>>>
other: // @ts-expect-error builders/1.x.
| JSONEncodable<APIActionRowComponent<ReturnType<ComponentType['toJSON']>>>
// @ts-expect-error builders/1.x.
| APIActionRowComponent<ReturnType<ComponentType['toJSON']>>,
): ActionRowBuilder<ComponentType>;
}
@@ -6461,6 +6462,7 @@ export interface BaseMessageOptions {
)[];
components?: readonly (
| JSONEncodable<APIActionRowComponent<APIComponentInMessageActionRow>>
// @ts-expect-error builders/1.x.
| ActionRowData<MessageActionRowComponentData | MessageActionRowComponentBuilder>
| APIActionRowComponent<APIComponentInMessageActionRow>
)[];

File diff suppressed because it is too large Load Diff

296
pnpm-lock.yaml generated
View File

@@ -680,8 +680,8 @@ importers:
specifier: ^4.0.0
version: 4.0.0
discord-api-types:
specifier: ^0.38.16
version: 0.38.16
specifier: ^0.38.26
version: 0.38.26
fast-deep-equal:
specifier: ^3.1.3
version: 3.1.3
@@ -2601,12 +2601,12 @@ packages:
resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
engines: {node: '>=12'}
'@definitelytyped/header-parser@0.2.19':
resolution: {integrity: sha512-zu+RxQpUCgorYUQZoyyrRIn9CljL1CeM4qak3NDeMO1r7tjAkodfpAGnVzx/6JR2OUk0tAgwmZxNMSwd9LVgxw==}
'@definitelytyped/header-parser@0.2.20':
resolution: {integrity: sha512-97YPAlUo8XjWNtZ+6k+My+50/ljE2iX6KEPjOZ1Az1RsZdKwJ6taAX3F5g6SY1SJr50bzdm2RZzyQNdRmHcs4w==}
engines: {node: '>=18.18.0'}
'@definitelytyped/typescript-versions@0.1.8':
resolution: {integrity: sha512-iz6q9aTwWW7CzN2g8jFQfZ955D63LA+wdIAKz4+2pCc/7kokmEHie1/jVWSczqLFOlmH+69bWQxIurryBP/sig==}
'@definitelytyped/typescript-versions@0.1.9':
resolution: {integrity: sha512-Qjalw9eNlcTjXhzx0Q6kHKuRCOUt/M5RGGRGKsiYlm/nveGvPX9liZSQlGXZVwyQ5I9qvq/GdaWiPchQ+ZXOrQ==}
engines: {node: '>=18.18.0'}
'@definitelytyped/utils@0.1.8':
@@ -7490,6 +7490,15 @@ packages:
supports-color:
optional: true
debug@4.4.3:
resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==}
engines: {node: '>=6.0'}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
decamelize-keys@1.1.1:
resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==}
engines: {node: '>=0.10.0'}
@@ -7644,6 +7653,9 @@ packages:
discord-api-types@0.38.16:
resolution: {integrity: sha512-Cz42dC5WqJD17Yk0bRy7YLTJmh3NKo4FGpxZuA8MHqT0RPxKSrll5YhlODZ2z5DiEV/gpHMeTSrTFTWpSXjT1Q==}
discord-api-types@0.38.26:
resolution: {integrity: sha512-xpmPviHjIJ6dFu1eNwNDIGQ3N6qmPUUYFVAx/YZ64h7ZgPkTcKjnciD8bZe8Vbeji7yS5uYljyciunpq0J5NSw==}
dlv@1.1.3:
resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
@@ -8656,8 +8668,8 @@ packages:
resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==}
engines: {node: '>= 0.4'}
get-tsconfig@4.10.0:
resolution: {integrity: sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==}
get-tsconfig@4.10.1:
resolution: {integrity: sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ==}
get-tsconfig@4.7.6:
resolution: {integrity: sha512-ZAqrLlu18NbDdRaHq+AKXzAmqIUPswPWKUchfytdAjiRFnCe5ojG2bstg6mRiZabkKfCoL/e98pbBELIV/YCeA==}
@@ -11434,6 +11446,11 @@ packages:
engines: {node: '>=14'}
hasBin: true
prettier@3.6.2:
resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==}
engines: {node: '>=14'}
hasBin: true
pretty-format@24.9.0:
resolution: {integrity: sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==}
engines: {node: '>= 6'}
@@ -12078,6 +12095,11 @@ packages:
engines: {node: '>=10'}
hasBin: true
semver@7.7.2:
resolution: {integrity: sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==}
engines: {node: '>=10'}
hasBin: true
send@0.18.0:
resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==}
engines: {node: '>= 0.8.0'}
@@ -12817,6 +12839,9 @@ packages:
tslib@2.6.3:
resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==}
tslib@2.8.1:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
tslint@5.14.0:
resolution: {integrity: sha512-IUla/ieHVnB8Le7LdQFRGlVJid2T/gaJe5VkjzRVSRR6pA2ODYrnfR1hmxi+5+au9l50jBwpbBL34txgv4NnTQ==}
engines: {node: '>=4.8.0'}
@@ -14686,7 +14711,7 @@ snapshots:
'@commitlint/is-ignored@19.2.2':
dependencies:
'@commitlint/types': 19.0.3
semver: 7.6.3
semver: 7.7.2
'@commitlint/lint@19.2.2':
dependencies:
@@ -14855,13 +14880,13 @@ snapshots:
dependencies:
'@jridgewell/trace-mapping': 0.3.9
'@definitelytyped/header-parser@0.2.19':
'@definitelytyped/header-parser@0.2.20':
dependencies:
'@definitelytyped/typescript-versions': 0.1.8
'@definitelytyped/typescript-versions': 0.1.9
'@definitelytyped/utils': 0.1.8
semver: 7.6.3
semver: 7.7.2
'@definitelytyped/typescript-versions@0.1.8': {}
'@definitelytyped/typescript-versions@0.1.9': {}
'@definitelytyped/utils@0.1.8':
dependencies:
@@ -14887,7 +14912,7 @@ snapshots:
'@vladfrangu/async_event_emitter': 2.4.6
discord-api-types: 0.37.83
magic-bytes.js: 1.10.0
tslib: 2.6.3
tslib: 2.8.1
undici: 6.13.0
'@discordjs/util@1.1.0': {}
@@ -14901,7 +14926,7 @@ snapshots:
'@types/ws': 8.5.12
'@vladfrangu/async_event_emitter': 2.4.6
discord-api-types: 0.37.83
tslib: 2.6.3
tslib: 2.8.1
ws: 8.18.0(bufferutil@4.0.8)(utf-8-validate@6.0.4)
transitivePeerDependencies:
- bufferutil
@@ -14952,7 +14977,7 @@ snapshots:
'@emnapi/runtime@1.2.0':
dependencies:
tslib: 2.6.3
tslib: 2.8.1
optional: true
'@emotion/use-insertion-effect-with-fallbacks@1.1.0(react@18.3.1)':
@@ -14968,7 +14993,7 @@ snapshots:
'@esbuild-plugins/node-resolve@0.1.4(esbuild@0.18.20)':
dependencies:
'@types/resolve': 1.20.6
debug: 4.4.0
debug: 4.4.3
esbuild: 0.18.20
escape-string-regexp: 4.0.0
resolve: 1.22.10
@@ -15264,26 +15289,26 @@ snapshots:
'@formatjs/ecma402-abstract@2.0.0':
dependencies:
'@formatjs/intl-localematcher': 0.5.4
tslib: 2.6.3
tslib: 2.8.1
'@formatjs/fast-memoize@2.2.0':
dependencies:
tslib: 2.6.3
tslib: 2.8.1
'@formatjs/icu-messageformat-parser@2.7.8':
dependencies:
'@formatjs/ecma402-abstract': 2.0.0
'@formatjs/icu-skeleton-parser': 1.8.2
tslib: 2.6.3
tslib: 2.8.1
'@formatjs/icu-skeleton-parser@1.8.2':
dependencies:
'@formatjs/ecma402-abstract': 2.0.0
tslib: 2.6.3
tslib: 2.8.1
'@formatjs/intl-localematcher@0.5.4':
dependencies:
tslib: 2.6.3
tslib: 2.8.1
'@grpc/grpc-js@1.11.1':
dependencies:
@@ -15454,14 +15479,14 @@ snapshots:
'@jest/test-result': 29.7.0
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
'@types/node': 18.19.45
'@types/node': 18.19.74
ansi-escapes: 4.3.2
chalk: 4.1.2
ci-info: 3.9.0
exit: 0.1.2
graceful-fs: 4.2.11
jest-changed-files: 29.7.0
jest-config: 29.7.0(@types/node@18.19.45)(ts-node@10.9.2(@types/node@16.18.105)(typescript@5.5.4))
jest-config: 29.7.0(@types/node@18.19.74)(ts-node@10.9.2(@types/node@16.18.105)(typescript@5.5.4))
jest-haste-map: 29.7.0
jest-message-util: 29.7.0
jest-regex-util: 29.6.3
@@ -15489,14 +15514,14 @@ snapshots:
'@jest/test-result': 29.7.0
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
'@types/node': 18.19.45
'@types/node': 18.19.74
ansi-escapes: 4.3.2
chalk: 4.1.2
ci-info: 3.9.0
exit: 0.1.2
graceful-fs: 4.2.11
jest-changed-files: 29.7.0
jest-config: 29.7.0(@types/node@18.19.45)(ts-node@10.9.2(@types/node@18.19.45)(typescript@5.5.4))
jest-config: 29.7.0(@types/node@18.19.74)(ts-node@10.9.2(@types/node@18.19.45)(typescript@5.5.4))
jest-haste-map: 29.7.0
jest-message-util: 29.7.0
jest-regex-util: 29.6.3
@@ -15637,7 +15662,7 @@ snapshots:
'@jest/schemas': 29.6.3
'@types/istanbul-lib-coverage': 2.0.6
'@types/istanbul-reports': 3.0.4
'@types/node': 18.19.45
'@types/node': 18.19.74
'@types/yargs': 17.0.33
chalk: 4.1.2
@@ -15683,7 +15708,7 @@ snapshots:
'@js-temporal/polyfill@0.4.4':
dependencies:
jsbi: 4.3.0
tslib: 2.6.3
tslib: 2.8.1
'@jsdoc/salty@0.2.8':
dependencies:
@@ -18432,7 +18457,7 @@ snapshots:
globby: 14.0.2
jscodeshift: 0.15.2(@babel/preset-env@7.25.4(@babel/core@7.25.2))
lodash: 4.17.21
prettier: 3.3.3
prettier: 3.6.2
recast: 0.23.9
tiny-invariant: 1.3.3
transitivePeerDependencies:
@@ -18468,7 +18493,7 @@ snapshots:
'@storybook/node-logger': 7.6.20
'@storybook/types': 7.6.20
'@types/find-cache-dir': 3.2.1
'@types/node': 18.19.45
'@types/node': 18.19.74
'@types/node-fetch': 2.6.11
'@types/pretty-hrtime': 1.0.3
chalk: 4.1.2
@@ -18503,7 +18528,7 @@ snapshots:
dependencies:
'@storybook/csf': 0.1.11
'@types/express': 4.17.21
'@types/node': 18.19.45
'@types/node': 18.19.74
browser-assert: 1.2.1
esbuild: 0.21.5
esbuild-register: 3.6.0(esbuild@0.21.5)
@@ -18645,7 +18670,7 @@ snapshots:
'@storybook/theming': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))
'@types/escodegen': 0.0.6
'@types/estree': 0.0.51
'@types/node': 18.19.45
'@types/node': 18.19.74
acorn: 7.4.1
acorn-jsx: 5.3.2(acorn@7.4.1)
acorn-walk: 7.2.0
@@ -18740,16 +18765,16 @@ snapshots:
'@swc/helpers@0.5.11':
dependencies:
tslib: 2.6.3
tslib: 2.8.1
'@swc/helpers@0.5.12':
dependencies:
tslib: 2.6.3
tslib: 2.8.1
'@swc/helpers@0.5.5':
dependencies:
'@swc/counter': 0.1.3
tslib: 2.6.3
tslib: 2.8.1
'@tailwindcss/typography@0.5.14(tailwindcss@3.4.10(ts-node@10.9.2(@types/node@18.19.45)(typescript@5.5.4)))':
dependencies:
@@ -19116,7 +19141,7 @@ snapshots:
'@types/prompts@2.4.9':
dependencies:
'@types/node': 18.19.45
'@types/node': 18.19.74
kleur: 3.0.3
'@types/prop-types@15.7.12': {}
@@ -19155,7 +19180,7 @@ snapshots:
dependencies:
'@types/cookiejar': 2.1.5
'@types/methods': 1.1.4
'@types/node': 18.19.45
'@types/node': 18.19.74
form-data: 4.0.0
'@types/supertest@6.0.2':
@@ -19181,7 +19206,7 @@ snapshots:
'@types/ws@8.5.12':
dependencies:
'@types/node': 16.18.105
'@types/node': 18.19.74
'@types/yargs-parser@21.0.3': {}
@@ -19331,7 +19356,7 @@ snapshots:
dependencies:
'@typescript-eslint/types': 5.62.0
'@typescript-eslint/visitor-keys': 5.62.0
debug: 4.4.0
debug: 4.4.3
globby: 11.1.0
is-glob: 4.0.3
semver: 7.5.4
@@ -19345,11 +19370,11 @@ snapshots:
dependencies:
'@typescript-eslint/types': 7.11.0
'@typescript-eslint/visitor-keys': 7.11.0
debug: 4.4.0
debug: 4.4.3
globby: 11.1.0
is-glob: 4.0.3
minimatch: 9.0.5
semver: 7.6.3
semver: 7.7.2
ts-api-utils: 1.3.0(typescript@5.5.4)
optionalDependencies:
typescript: 5.5.4
@@ -20090,7 +20115,7 @@ snapshots:
agent-base@6.0.2:
dependencies:
debug: 4.4.0
debug: 4.4.3
transitivePeerDependencies:
- supports-color
@@ -20214,7 +20239,7 @@ snapshots:
aria-hidden@1.2.4:
dependencies:
tslib: 2.6.3
tslib: 2.8.1
aria-query@5.1.3:
dependencies:
@@ -20342,11 +20367,11 @@ snapshots:
ast-types@0.13.4:
dependencies:
tslib: 2.6.3
tslib: 2.8.1
ast-types@0.16.1:
dependencies:
tslib: 2.6.3
tslib: 2.8.1
astring@1.8.6: {}
@@ -20681,7 +20706,7 @@ snapshots:
camel-case@4.1.2:
dependencies:
pascal-case: 3.1.2
tslib: 2.6.3
tslib: 2.8.1
camelcase-css@2.0.1: {}
@@ -21384,6 +21409,10 @@ snapshots:
dependencies:
ms: 2.1.3
debug@4.4.3:
dependencies:
ms: 2.1.3
decamelize-keys@1.1.1:
dependencies:
decamelize: 1.2.0
@@ -21522,6 +21551,8 @@ snapshots:
discord-api-types@0.38.16: {}
discord-api-types@0.38.26: {}
dlv@1.1.3: {}
dmd@6.2.3:
@@ -21571,7 +21602,7 @@ snapshots:
dts-critic@3.3.11(typescript@5.5.4):
dependencies:
'@definitelytyped/header-parser': 0.2.19
'@definitelytyped/header-parser': 0.2.20
command-exists: 1.2.9
rimraf: 3.0.2
semver: 6.3.1
@@ -21581,8 +21612,8 @@ snapshots:
dtslint@4.2.1(typescript@5.5.4):
dependencies:
'@definitelytyped/header-parser': 0.2.19
'@definitelytyped/typescript-versions': 0.1.8
'@definitelytyped/header-parser': 0.2.20
'@definitelytyped/typescript-versions': 0.1.9
'@definitelytyped/utils': 0.1.8
dts-critic: 3.3.11(typescript@5.5.4)
fs-extra: 6.0.1
@@ -22105,7 +22136,7 @@ snapshots:
remark-parse: 11.0.0
remark-stringify: 11.0.0
synckit: 0.9.1
tslib: 2.6.3
tslib: 2.8.1
unified: 11.0.5
unified-engine: 11.2.1
unist-util-visit: 5.0.0
@@ -22164,12 +22195,12 @@ snapshots:
eslint-plugin-i@2.29.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0):
dependencies:
debug: 4.4.0
debug: 4.4.3
doctrine: 3.0.0
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-i@2.29.1)(eslint@8.57.0))(eslint@8.57.0)
get-tsconfig: 4.10.0
get-tsconfig: 4.10.1
is-glob: 4.0.3
minimatch: 3.1.2
semver: 7.5.4
@@ -22231,7 +22262,7 @@ snapshots:
remark-mdx: 3.0.1
remark-parse: 11.0.0
remark-stringify: 11.0.0
tslib: 2.6.3
tslib: 2.8.1
unified: 11.0.5
vfile: 6.0.2
transitivePeerDependencies:
@@ -22290,7 +22321,7 @@ snapshots:
eslint: 8.57.0
eslint-etc: 5.2.1(eslint@8.57.0)(typescript@5.5.4)
requireindex: 1.2.0
tslib: 2.6.3
tslib: 2.8.1
typescript: 5.5.4
transitivePeerDependencies:
- supports-color
@@ -22304,7 +22335,7 @@ snapshots:
eslint-etc: 5.2.1(eslint@8.57.0)(typescript@5.5.4)
requireindex: 1.2.0
rxjs-report-usage: 1.0.6
tslib: 2.6.3
tslib: 2.8.1
tsutils: 3.21.0(typescript@5.5.4)
tsutils-etc: 1.4.2(tsutils@3.21.0(typescript@5.5.4))(typescript@5.5.4)
typescript: 5.5.4
@@ -22965,7 +22996,7 @@ snapshots:
es-errors: 1.3.0
get-intrinsic: 1.2.4
get-tsconfig@4.10.0:
get-tsconfig@4.10.1:
dependencies:
resolve-pkg-maps: 1.0.0
@@ -22977,7 +23008,7 @@ snapshots:
dependencies:
basic-ftp: 5.0.5
data-uri-to-buffer: 6.0.2
debug: 4.4.0
debug: 4.4.3
fs-extra: 11.2.0
transitivePeerDependencies:
- supports-color
@@ -23437,7 +23468,7 @@ snapshots:
dependencies:
'@tootallnate/once': 2.0.0
agent-base: 6.0.2
debug: 4.4.0
debug: 4.4.3
transitivePeerDependencies:
- supports-color
@@ -23457,7 +23488,7 @@ snapshots:
https-proxy-agent@5.0.1:
dependencies:
agent-base: 6.0.2
debug: 4.4.0
debug: 4.4.3
transitivePeerDependencies:
- supports-color
@@ -23587,7 +23618,7 @@ snapshots:
'@formatjs/ecma402-abstract': 2.0.0
'@formatjs/fast-memoize': 2.2.0
'@formatjs/icu-messageformat-parser': 2.7.8
tslib: 2.6.3
tslib: 2.8.1
invariant@2.2.4:
dependencies:
@@ -23875,7 +23906,7 @@ snapshots:
istanbul-lib-source-maps@4.0.1:
dependencies:
debug: 4.4.0
debug: 4.4.3
istanbul-lib-coverage: 3.2.2
source-map: 0.6.1
transitivePeerDependencies:
@@ -24015,37 +24046,6 @@ snapshots:
- babel-plugin-macros
- supports-color
jest-config@29.7.0(@types/node@18.19.45)(ts-node@10.9.2(@types/node@16.18.105)(typescript@5.5.4)):
dependencies:
'@babel/core': 7.25.2
'@jest/test-sequencer': 29.7.0
'@jest/types': 29.6.3
babel-jest: 29.7.0(@babel/core@7.25.2)
chalk: 4.1.2
ci-info: 3.9.0
deepmerge: 4.3.1
glob: 7.2.3
graceful-fs: 4.2.11
jest-circus: 29.7.0
jest-environment-node: 29.7.0
jest-get-type: 29.6.3
jest-regex-util: 29.6.3
jest-resolve: 29.7.0
jest-runner: 29.7.0
jest-util: 29.7.0
jest-validate: 29.7.0
micromatch: 4.0.7
parse-json: 5.2.0
pretty-format: 29.7.0
slash: 3.0.0
strip-json-comments: 3.1.1
optionalDependencies:
'@types/node': 18.19.45
ts-node: 10.9.2(@types/node@16.18.105)(typescript@5.5.4)
transitivePeerDependencies:
- babel-plugin-macros
- supports-color
jest-config@29.7.0(@types/node@18.19.45)(ts-node@10.9.2(@types/node@18.19.45)(typescript@5.5.4)):
dependencies:
'@babel/core': 7.25.2
@@ -24077,6 +24077,68 @@ snapshots:
- babel-plugin-macros
- supports-color
jest-config@29.7.0(@types/node@18.19.74)(ts-node@10.9.2(@types/node@16.18.105)(typescript@5.5.4)):
dependencies:
'@babel/core': 7.25.2
'@jest/test-sequencer': 29.7.0
'@jest/types': 29.6.3
babel-jest: 29.7.0(@babel/core@7.25.2)
chalk: 4.1.2
ci-info: 3.9.0
deepmerge: 4.3.1
glob: 7.2.3
graceful-fs: 4.2.11
jest-circus: 29.7.0
jest-environment-node: 29.7.0
jest-get-type: 29.6.3
jest-regex-util: 29.6.3
jest-resolve: 29.7.0
jest-runner: 29.7.0
jest-util: 29.7.0
jest-validate: 29.7.0
micromatch: 4.0.7
parse-json: 5.2.0
pretty-format: 29.7.0
slash: 3.0.0
strip-json-comments: 3.1.1
optionalDependencies:
'@types/node': 18.19.74
ts-node: 10.9.2(@types/node@16.18.105)(typescript@5.5.4)
transitivePeerDependencies:
- babel-plugin-macros
- supports-color
jest-config@29.7.0(@types/node@18.19.74)(ts-node@10.9.2(@types/node@18.19.45)(typescript@5.5.4)):
dependencies:
'@babel/core': 7.25.2
'@jest/test-sequencer': 29.7.0
'@jest/types': 29.6.3
babel-jest: 29.7.0(@babel/core@7.25.2)
chalk: 4.1.2
ci-info: 3.9.0
deepmerge: 4.3.1
glob: 7.2.3
graceful-fs: 4.2.11
jest-circus: 29.7.0
jest-environment-node: 29.7.0
jest-get-type: 29.6.3
jest-regex-util: 29.6.3
jest-resolve: 29.7.0
jest-runner: 29.7.0
jest-util: 29.7.0
jest-validate: 29.7.0
micromatch: 4.0.7
parse-json: 5.2.0
pretty-format: 29.7.0
slash: 3.0.0
strip-json-comments: 3.1.1
optionalDependencies:
'@types/node': 18.19.74
ts-node: 10.9.2(@types/node@18.19.45)(typescript@5.5.4)
transitivePeerDependencies:
- babel-plugin-macros
- supports-color
jest-diff@29.7.0:
dependencies:
chalk: 4.1.2
@@ -24699,7 +24761,7 @@ snapshots:
lower-case@2.0.2:
dependencies:
tslib: 2.6.3
tslib: 2.8.1
lru-cache@10.4.3: {}
@@ -25708,7 +25770,7 @@ snapshots:
micromark@2.11.4:
dependencies:
debug: 4.4.0
debug: 4.4.3
parse-entities: 2.0.0
transitivePeerDependencies:
- supports-color
@@ -25716,7 +25778,7 @@ snapshots:
micromark@3.2.0:
dependencies:
'@types/debug': 4.1.12
debug: 4.4.0
debug: 4.4.3
decode-named-character-reference: 1.0.2
micromark-core-commonmark: 1.1.0
micromark-factory-space: 1.1.0
@@ -25738,7 +25800,7 @@ snapshots:
micromark@4.0.0:
dependencies:
'@types/debug': 4.1.12
debug: 4.4.0
debug: 4.4.3
decode-named-character-reference: 1.0.2
devlop: 1.1.0
micromark-core-commonmark: 2.0.1
@@ -26006,7 +26068,7 @@ snapshots:
no-case@3.0.4:
dependencies:
lower-case: 2.0.2
tslib: 2.6.3
tslib: 2.8.1
node-dir@0.1.17:
dependencies:
@@ -26453,7 +26515,7 @@ snapshots:
pascal-case@3.1.2:
dependencies:
no-case: 3.0.4
tslib: 2.6.3
tslib: 2.8.1
path-browserify@1.0.1: {}
@@ -26692,6 +26754,8 @@ snapshots:
prettier@3.3.3: {}
prettier@3.6.2: {}
pretty-format@24.9.0:
dependencies:
'@jest/types': 24.9.0
@@ -26987,7 +27051,7 @@ snapshots:
dependencies:
react: 18.3.1
react-style-singleton: 2.2.1(@types/react@18.3.4)(react@18.3.1)
tslib: 2.6.3
tslib: 2.8.1
optionalDependencies:
'@types/react': 18.3.4
@@ -26995,7 +27059,7 @@ snapshots:
dependencies:
react: 19.0.0-rc-f994737d14-20240522
react-style-singleton: 2.2.1(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522)
tslib: 2.6.3
tslib: 2.8.1
optionalDependencies:
'@types/react': 18.3.4
@@ -27004,7 +27068,7 @@ snapshots:
react: 18.3.1
react-remove-scroll-bar: 2.3.6(@types/react@18.3.4)(react@18.3.1)
react-style-singleton: 2.2.1(@types/react@18.3.4)(react@18.3.1)
tslib: 2.6.3
tslib: 2.8.1
use-callback-ref: 1.3.2(@types/react@18.3.4)(react@18.3.1)
use-sidecar: 1.1.2(@types/react@18.3.4)(react@18.3.1)
optionalDependencies:
@@ -27015,7 +27079,7 @@ snapshots:
react: 19.0.0-rc-f994737d14-20240522
react-remove-scroll-bar: 2.3.6(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522)
react-style-singleton: 2.2.1(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522)
tslib: 2.6.3
tslib: 2.8.1
use-callback-ref: 1.3.2(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522)
use-sidecar: 1.1.2(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522)
optionalDependencies:
@@ -27026,7 +27090,7 @@ snapshots:
react: 19.0.0-rc-f994737d14-20240522
react-remove-scroll-bar: 2.3.6(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522)
react-style-singleton: 2.2.1(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522)
tslib: 2.6.3
tslib: 2.8.1
use-callback-ref: 1.3.2(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522)
use-sidecar: 1.1.2(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522)
optionalDependencies:
@@ -27064,7 +27128,7 @@ snapshots:
get-nonce: 1.0.1
invariant: 2.2.4
react: 18.3.1
tslib: 2.6.3
tslib: 2.8.1
optionalDependencies:
'@types/react': 18.3.4
@@ -27073,7 +27137,7 @@ snapshots:
get-nonce: 1.0.1
invariant: 2.2.4
react: 19.0.0-rc-f994737d14-20240522
tslib: 2.6.3
tslib: 2.8.1
optionalDependencies:
'@types/react': 18.3.4
@@ -27149,7 +27213,7 @@ snapshots:
esprima: 4.0.1
source-map: 0.6.1
tiny-invariant: 1.3.3
tslib: 2.6.3
tslib: 2.8.1
redent@3.0.0:
dependencies:
@@ -27524,7 +27588,7 @@ snapshots:
rxjs@7.8.1:
dependencies:
tslib: 2.6.3
tslib: 2.8.1
sade@1.8.1:
dependencies:
@@ -27592,6 +27656,8 @@ snapshots:
semver@7.6.3: {}
semver@7.7.2: {}
send@0.18.0:
dependencies:
debug: 2.6.9
@@ -27758,7 +27824,7 @@ snapshots:
socks-proxy-agent@7.0.0:
dependencies:
agent-base: 6.0.2
debug: 4.4.0
debug: 4.4.3
socks: 2.8.3
transitivePeerDependencies:
- supports-color
@@ -27895,7 +27961,7 @@ snapshots:
jscodeshift: 0.15.2(@babel/preset-env@7.25.4(@babel/core@7.25.2))
leven: 3.1.0
ora: 5.4.1
prettier: 3.3.3
prettier: 3.6.2
prompts: 2.4.2
semver: 7.5.4
strip-json-comments: 3.1.1
@@ -28156,7 +28222,7 @@ snapshots:
synckit@0.9.1:
dependencies:
'@pkgr/core': 0.1.1
tslib: 2.6.3
tslib: 2.8.1
table-layout@0.4.5:
dependencies:
@@ -28474,6 +28540,8 @@ snapshots:
tslib@2.6.3: {}
tslib@2.8.1: {}
tslint@5.14.0(typescript@5.5.4):
dependencies:
babel-code-frame: 6.26.0
@@ -29073,14 +29141,14 @@ snapshots:
use-callback-ref@1.3.2(@types/react@18.3.4)(react@18.3.1):
dependencies:
react: 18.3.1
tslib: 2.6.3
tslib: 2.8.1
optionalDependencies:
'@types/react': 18.3.4
use-callback-ref@1.3.2(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522):
dependencies:
react: 19.0.0-rc-f994737d14-20240522
tslib: 2.6.3
tslib: 2.8.1
optionalDependencies:
'@types/react': 18.3.4
@@ -29094,7 +29162,7 @@ snapshots:
dependencies:
detect-node-es: 1.1.0
react: 18.3.1
tslib: 2.6.3
tslib: 2.8.1
optionalDependencies:
'@types/react': 18.3.4
@@ -29102,7 +29170,7 @@ snapshots:
dependencies:
detect-node-es: 1.1.0
react: 19.0.0-rc-f994737d14-20240522
tslib: 2.6.3
tslib: 2.8.1
optionalDependencies:
'@types/react': 18.3.4