Update Stimulus JSDoc to use US English spelling

pull/12952/head
LB 2025-03-08 16:31:05 +10:00
rodzic c793d302b4
commit 83ec67d6c1
5 zmienionych plików z 9 dodań i 9 usunięć

Wyświetl plik

@ -29,7 +29,7 @@ export class CountController extends Controller<HTMLFormElement> {
declare containerValue: string;
/** selector string, used to find the elements to count within the container */
declare findValue: string;
/** override pluralisation strings, e.g. `data-w-count-labels-value='["One item","Many items"]'` */
/** override pluralization strings, e.g. `data-w-count-labels-value='["One item","Many items"]'` */
declare labelsValue: string[];
/** minimum value, anything equal or below will trigger blank labels in the UI */
declare minValue: number;

Wyświetl plik

@ -3,7 +3,7 @@ import { WAGTAIL_CONFIG } from '../config/wagtailConfig';
/**
* Updates the server, using a PATCH request when the toggle is clicked on a dismissible
* element initialised by DismissibleController
* element initialized by DismissibleController
*
* @param data - The dismissible represented as an object with keys as
* the id and its new state: whether it is dismissed (boolean)
@ -29,8 +29,8 @@ export const updateDismissibles = (
/**
* Adds the ability to make an element dismissible so that it updates it's class and makes an async request.
* Initialise such elements with a default handler that performs the dismissal.
* This only initialises elements that are rendered by the server (if they have the data attr), so elements
* Initialize such elements with a default handler that performs the dismissal.
* This only initializes elements that are rendered by the server (if they have the data attr), so elements
* that are rendered by the client (e.g. React) needs to be handled separately.
*
* @example

Wyświetl plik

@ -557,7 +557,7 @@ export class PreviewController extends Controller<HTMLElement> {
* @returns whether the data is valid
*/
async checkAndUpdatePreview() {
// Small performance optimisation: the hasChanges() method will not be called
// Small performance optimization: the hasChanges() method will not be called
// if there is a pending update due to the || operator short-circuiting
if (this.updatePromise || !this.hasChanges()) return undefined;
return this.setPreviewData();

Wyświetl plik

@ -79,7 +79,7 @@ export class SlugController extends Controller<HTMLInputElement> {
* or can be used to simply return the transformed value.
*
* The urlify (Django port) function performs extra processing on the string &
* is more suitable for creating a slug from the title, rather than sanitising manually.
* is more suitable for creating a slug from the title, rather than sanitizing manually.
* If the urlify util returns an empty string it will fall back to the slugify method.
*
* If a custom event with detail.value is provided, that value will be used

Wyświetl plik

@ -91,7 +91,7 @@ export class SwapController extends Controller<
replaceLazy?: { (...args: any[]): void; cancel(): void };
/** Debounced function to search results and then replace the DOM */
searchLazy?: { (...args: any[]): void; cancel(): void };
/** Debounced function to submit the serialised form and then replace the DOM */
/** Debounced function to submit the serialized form and then replace the DOM */
submitLazy?: { (...args: any[]): void; cancel(): void };
/** A function that writes the HTML to the target */
writeDeferred?: () => Promise<string>;
@ -227,7 +227,7 @@ export class SwapController extends Controller<
/**
* Update the target element's content with the response from a request based on the input's form
* values serialised. Do not account for anything in the main location/URL, simply replace the content within
* values serialized. Do not account for anything in the main location/URL, simply replace the content within
* the target element.
*/
submit() {
@ -235,7 +235,7 @@ export class SwapController extends Controller<
let data: FormData | undefined = new FormData(form);
let url = this.srcValue;
// serialise the form to a query string if it's a GET request
// serialize the form to a query string if it's a GET request
if (form.getAttribute('method')?.toUpperCase() === 'GET') {
// cast as any to avoid https://github.com/microsoft/TypeScript/issues/43797
url += '?' + new URLSearchParams(data as any).toString();