Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code quality: Fix typos #67304

Open
wants to merge 13 commits into
base: trunk
Choose a base branch
from
4 changes: 2 additions & 2 deletions backport-changelog/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The filename is the Core PR number.

For example, if your Core PR number is `1234` and is slated to be part of the WordPress 6.9 release, the filename will be `1234.md`, and will be placed in the `/backport-changelog/6.9` directory.

The content of the markdown file should be the Github URL of the Core PR, followed by a list of Gutenberg PR Github URLs whose changes are backported in the Core PR.
The content of the markdown file should be the GitHub URL of the Core PR, followed by a list of Gutenberg PR GitHub URLs whose changes are backported in the Core PR.

A single Core PR may contain changes from one or multiple Gutenberg PRs.

Expand Down Expand Up @@ -51,7 +51,7 @@ For the backport changelog, Gutenberg uses individual files as opposed to a sing

Some Gutenberg PRs may be flagged as needing a core backport PR when they don't, for example when the PR contains minor comment changes, or the changes already exist in Core.

For individual PRs, there are two Github labels that can be used to exclude a PR from the backport changelog CI check:
For individual PRs, there are two GitHub labels that can be used to exclude a PR from the backport changelog CI check:

- `Backport from WordPress Core` - Indicates that the PR is a backport from WordPress Core and doesn't need a Core PR.
- `No Core Sync Required` - Indicates that any changes do not need to be synced to WordPress Core.
Expand Down
4 changes: 2 additions & 2 deletions bin/api-docs/gen-block-lib-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ function processObjWithInnerKeys( obj ) {
* not disabled. So adding { color: 'link' } support also brings along
* background and text.
*
* @param {Object} supports - keys supported by blokc
* @param {Object} supports - keys supported by block
* @return {Object} supports augmented with defaults
*/
function augmentSupports( supports ) {
if ( 'color' in supports ) {
// If backgroud or text is not specified (true or false)
// If background or text is not specified (true or false)
// then add it as true.a
if ( ! ( 'background' in supports.color ) ) {
supports.color.background = true;
Expand Down
8 changes: 4 additions & 4 deletions bin/plugin/commands/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const LABEL_TYPE_MAPPING = {
};

/**
* Mapping of label names to arbitary features in the release notes.
* Mapping of label names to arbitrary features in the release notes.
*
* Mapping a given label to a feature will guarantee it will be categorised
* under that feature name in the changelog within each section.
Expand Down Expand Up @@ -274,7 +274,7 @@ function mapLabelsToFeatures( labels ) {
*
* @param {string[]} labels Label names.
*
* @return {boolean} whether or not the issue's is labbeled as block specific
* @return {boolean} whether or not the issue's is labeled as block specific
*/
function getIsBlockSpecificIssue( labels ) {
return !! labels.find( ( label ) => label.startsWith( '[Block] ' ) );
Expand Down Expand Up @@ -343,7 +343,7 @@ function getIssueFeature( issue ) {

// 1. Prefer explicit mapping of label to feature.
if ( featureCandidates.length ) {
// Get occurances of the feature labels.
// Get occurrences of the feature labels.
const featureCounts = featureCandidates.reduce(
/**
* @param {Record<string,number>} acc Accumulator
Expand Down Expand Up @@ -941,7 +941,7 @@ function skipCreatedByBots( pullRequests ) {
}

/**
* Produces the formatted markdown for the contributor props seciton.
* Produces the formatted markdown for the contributor props section.
*
* @param {IssuesListForRepoResponseItem[]} pullRequests List of pull requests.
*
Expand Down
2 changes: 1 addition & 1 deletion bin/plugin/commands/test/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ describe( 'getIssueFeature', () => {
name: '[Package] This package',
},
{
name: '[Feature] Cool Feature', // Should have priority despite prescence of block specific label.
name: '[Feature] Cool Feature', // Should have priority despite presence of block specific label.
},
{
name: '[Package] Another One',
Expand Down
2 changes: 1 addition & 1 deletion docs/contributors/code/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ It's important to check that:
- the plugin from the directory works as expected
- the ZIP contents (see [Downloads](https://plugins.trac.wordpress.org/browser/gutenberg/)) looks correct (doesn't have anything obvious missing)
- the [Gutenberg SVN repo](https://plugins.trac.wordpress.org/browser/gutenberg/) has two new commits (see [the log](https://plugins.trac.wordpress.org/browser/gutenberg/)):
- the `trunk` folder should have "Commiting version X.Y.Z"
- the `trunk` folder should have "Committing version X.Y.Z"
- there is a new `tags/X.Y.Z` folder with the same contents as `trunk` whose latest commit is "Tagging version X.Y.Z"

Most likely, the tag folder couldn't be created. This is a [known issue](https://plugins.trac.wordpress.org/browser/gutenberg/) that [can be fixed manually](https://github.com/WordPress/gutenberg/issues/55295#issuecomment-1759292978).
Expand Down
2 changes: 1 addition & 1 deletion docs/reference-guides/block-api/block-bindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ The function to register a custom source is `registerBlockBindingsSource( args )

- `args`: `object` with the following structure:
- `name`: `string` with the unique and machine-readable name.
- `label`: `string` with the human readable name of the custom source. In case it was defined already on the server, the server label will be overriden by this one, in that case, it is not recommended to be defined here. (optional)
- `label`: `string` with the human readable name of the custom source. In case it was defined already on the server, the server label will be overridden by this one, in that case, it is not recommended to be defined here. (optional)
- `usesContext`: `array` with the block context that the custom source may need. In case it was defined already on the server, it should not be defined here. (optional)
- `getValues`: `function` that retrieves the values from the source. (optional)
- `setValues`: `function` that allows updating the values connected to the source. (optional)
Expand Down
2 changes: 1 addition & 1 deletion docs/reference-guides/data/data-core-block-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ Returns the list of patterns based on their declared `blockTypes` and a block's
_Parameters_

- _state_ `Object`: Editor state.
- _blockNames_ `string|string[]`: Block's name or array of block names to find matching pattens.
- _blockNames_ `string|string[]`: Block's name or array of block names to find matching patterns.
- _rootClientId_ `?string`: Optional target root client ID.

_Returns_
Expand Down
2 changes: 1 addition & 1 deletion docs/reference-guides/data/data-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ _Returns_

### redo

Action triggered to redo the last undoed edit to an entity record, if any.
Action triggered to redo the last undone edit to an entity record, if any.

### saveEditedEntityRecord

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ These are the core principles of TypeScript's interaction with the Interactivity

- **Inferred client types**: When you create a store using the `store` function, TypeScript automatically infers the types of the store's properties (`state`, `actions`, etc.). This means that you can often get away with just writing plain JavaScript objects, and TypeScript will figure out the types for you.
- **Explicit server types**: When dealing with data defined on the server, like local context or the initial values of the global state, you can explicitly define its types to ensure that everything is correctly typed.
- **Mutiple store parts**: Even if your store is split into multiple parts, you can define or infer the types of each part of the store and then merge them into a single type that represents the entire store.
- **Multiple store parts**: Even if your store is split into multiple parts, you can define or infer the types of each part of the store and then merge them into a single type that represents the entire store.
- **Typed external stores**: You can import typed stores from external namespaces, allowing you to use other plugins' functionality with type safety.

## Installing `@wordpress/interactivity` locally
Expand Down Expand Up @@ -269,7 +269,7 @@ That's it! Now you can access the context properties with the correct types.

The derived state is data that is calculated based on the global state or local context. In the client store definition, it is defined using a getter in the `state` object.

_Please, visit the [Understanding global state, local context and derived state](./undestanding-global-state-local-context-and-derived-state.md) guide to learn more about how derived state works in the Interactivity API._
_Please, visit the [Understanding global state, local context and derived state](./understanding-global-state-local-context-and-derived-state.md) guide to learn more about how derived state works in the Interactivity API._
gziolo marked this conversation as resolved.
Show resolved Hide resolved
t-hamano marked this conversation as resolved.
Show resolved Hide resolved

Following our previous example, let's create a derived state that is the double of our counter.

Expand Down Expand Up @@ -495,7 +495,7 @@ There's something to keep in mind when when using asynchronous actions. Just lik
counter: 0,
},
actions: {
*delayedReturn(): Generator< uknown, number, uknown > {
*delayedReturn(): Generator< unknown, number, unknown > {
yield new Promise( ( r ) => setTimeout( r, 1000 ) );
return state.counter; // Now this is correctly inferred.
},
Expand Down
2 changes: 1 addition & 1 deletion docs/reference-guides/interactivity-api/iapi-about.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Additionally, with a standard, **WordPress can absorb the maximum amount of comp

_Complexities absorbed by the standard_

<img alt="Two columns table comparing some aspects with and without a standard. Without a standard, block developers have to take care of everything, while having a standard. Totally handled by the standard: Tooling, hydration, integrating it with WordPress, SSR of the interactive parts, inter-block communication, and frontend performance. Partially handled: Security, accessibility, and best practices. Developer responsibility: Block logic. In the without a standard column, everything is under the developer responsability." width=60% src="https://make.wordpress.org/core/files/2023/03/standard-graph.png">
<img alt="Two columns table comparing some aspects with and without a standard. Without a standard, block developers have to take care of everything, while having a standard. Totally handled by the standard: Tooling, hydration, integrating it with WordPress, SSR of the interactive parts, inter-block communication, and frontend performance. Partially handled: Security, accessibility, and best practices. Developer responsibility: Block logic. In the without a standard column, everything is under the developer responsibility." width=60% src="https://make.wordpress.org/core/files/2023/03/standard-graph.png">


With this absorption, less knowledge is required to create interactive blocks, and developers have fewer decisions to worry about.
Expand Down
2 changes: 1 addition & 1 deletion lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -3417,7 +3417,7 @@ protected static function should_override_preset( $theme_json, $path, $override

/**
* Returns the default slugs for all the presets in an associative array
* whose keys are the preset paths and the leafs is the list of slugs.
* whose keys are the preset paths and the leaves is the list of slugs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This typo is already fixed in the core, so a backport changelog should not be necessary.

https://github.com/WordPress/wordpress-develop/blob/07be2445e45066147105206da08acf31bcee974d/src/wp-includes/class-wp-theme-json.php#L3386

*
* For example:
*
Expand Down
8 changes: 4 additions & 4 deletions lib/experimental/media/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,24 +300,24 @@ function gutenberg_add_crossorigin_attributes( string $html ): string {

$processor->set_bookmark( 'resume' );

$seeked = false;
$sought = false;

$crossorigin = $processor->get_attribute( 'crossorigin' );

$url = $processor->get_attribute( $tags[ $tag ] );

if ( is_string( $url ) && ! str_starts_with( $url, $site_url ) && ! str_starts_with( $url, '/' ) && ! is_string( $crossorigin ) ) {
if ( 'SOURCE' === $tag ) {
$seeked = $processor->seek( 'audio-video-parent' );
$sought = $processor->seek( 'audio-video-parent' );

if ( $seeked ) {
if ( $sought ) {
$processor->set_attribute( 'crossorigin', 'anonymous' );
}
} else {
$processor->set_attribute( 'crossorigin', 'anonymous' );
}

if ( $seeked ) {
if ( $sought ) {
$processor->seek( 'resume' );
$processor->release_bookmark( 'audio-video-parent' );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/experimental/sync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The signaling server allows multiple clients to exchange messages with each other through various communication topics.

Topics are not defined upfront, but clients define them by subscribing to them. By subscribing to a given topic, the client tells the server to keep track of its unread messages in the given topic. By unsubscribing from a topic, the client tells the server to free the bookeeping it maintains for the given client and topic.
Topics are not defined upfront, but clients define them by subscribing to them. By subscribing to a given topic, the client tells the server to keep track of its unread messages in the given topic. By unsubscribing from a topic, the client tells the server to free the bookkeeping it maintains for the given client and topic.

Every client communicates with the server via `GET` or `POST`. Clients must have a unique identifier, which can be randomly generated. This identifier should be included as a parameter named `subscriber_id` in every request.

Expand Down
4 changes: 2 additions & 2 deletions packages/babel-plugin-makepot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const REGEXP_TRANSLATOR_COMMENT = /^\s*translators:\s*([\s\S]+)/im;

/**
* Given an argument node (or recursed node), attempts to return a string
* represenation of that node's value.
* representation of that node's value.
*
* @param {Object} node AST node.
*
Expand Down Expand Up @@ -265,7 +265,7 @@ module.exports = () => {
);
}

// Attempt to exract nplurals from header.
// Attempt to extract nplurals from header.
const pluralsMatch = (
baseData.headers[ 'plural-forms' ] || ''
).match( /nplurals\s*=\s*(\d+);/ );
Expand Down
2 changes: 1 addition & 1 deletion packages/base-styles/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ $radio-input-size: 16px;
$radio-input-size-sm: 24px; // Width & height for small viewports.

// Deprecated, please avoid using these.
$block-padding: 14px; // Used to define space between block footprint and surrouding borders.
$block-padding: 14px; // Used to define space between block footprint and surrounding borders.
$radius-block-ui: $radius-small;
$shadow-popover: $elevation-x-small;
$shadow-modal: $elevation-large;
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@

### Enhancements

- Embed the `ObserveTyping` behavior within the `BlockList` component making to simplify instanciations of third-party block editors.
- Embed the `ObserveTyping` behavior within the `BlockList` component making to simplify instantiations of third-party block editors.

## 12.8.0 (2023-08-16)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
svg {
fill: currentColor;

// Optimizate for high contrast modes.
// Optimize for high contrast modes.
// See also https://blogs.windows.com/msedgedev/2020/09/17/styling-for-windows-high-contrast-with-new-standards-for-forced-colors/.
@media (forced-colors: active) {
fill: CanvasText;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
svg {
fill: currentColor;

// Optimizate for high contrast modes.
// Optimize for high contrast modes.
// See also https://blogs.windows.com/msedgedev/2020/09/17/styling-for-windows-high-contrast-with-new-standards-for-forced-colors/.
@media (forced-colors: active) {
fill: CanvasText;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function useFocusHandler( clientId ) {
return;
}

// If an inner block is focussed, that block is resposible for
// If an inner block is focussed, that block is responsible for
// setting the selected block.
if ( ! isInsideRootBlock( node, event.target ) ) {
return;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// These rules ensure the preview scales smoothly regardless of the container size.
.block-editor-block-preview__container {
// In the component, a top padding is provided as an inline style to provid an aspect-ratio.
// In the component, a top padding is provided as an inline style to provide an aspect-ratio.
// This positioning enables the content to sit on top of that padding to fit.
position: relative;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function StylePreview( { onPress, isActive, style, url } ) {

function onLayout() {
const columnsNum =
// To indicate scroll availabilty, there is a need to display additional half the column.
// To indicate scroll availability, there is a need to display additional half the column.
Math.floor( BottomSheet.getWidth() / MAX_ITEM_WIDTH ) + HALF_COLUMN;
setItemWidth( BottomSheet.getWidth() / columnsNum );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ import BlockVariationTransformations from './block-variation-transformations';
* @return {Record<string, Object[]>} The grouped block transformations.
*/
function useGroupedTransforms( possibleBlockTransformations ) {
const priorityContentTranformationBlocks = {
const priorityContentTransformationBlocks = {
'core/paragraph': 1,
'core/heading': 2,
'core/list': 3,
'core/quote': 4,
};
const transformations = useMemo( () => {
const priorityTextTranformsNames = Object.keys(
priorityContentTranformationBlocks
const priorityTextTransformsNames = Object.keys(
priorityContentTransformationBlocks
);
const groupedPossibleTransforms = possibleBlockTransformations.reduce(
( accumulator, item ) => {
const { name } = item;
if ( priorityTextTranformsNames.includes( name ) ) {
if ( priorityTextTransformsNames.includes( name ) ) {
accumulator.priorityTextTransformations.push( item );
} else {
accumulator.restTransformations.push( item );
Expand Down Expand Up @@ -71,8 +71,8 @@ function useGroupedTransforms( possibleBlockTransformations ) {
// Order the priority text transformations.
transformations.priorityTextTransformations.sort(
( { name: currentName }, { name: nextName } ) => {
return priorityContentTranformationBlocks[ currentName ] <
priorityContentTranformationBlocks[ nextName ]
return priorityContentTransformationBlocks[ currentName ] <
priorityContentTransformationBlocks[ nextName ]
? -1
: 1;
}
Expand Down Expand Up @@ -125,7 +125,7 @@ const BlockTransformationsMenu = ( {
/>
) }
{ priorityTextTransformations.map( ( item ) => (
<BlockTranformationItem
<BlockTransformationItem
key={ item.name }
item={ item }
onSelect={ onSelect }
Expand All @@ -151,7 +151,7 @@ function RestTransformationItems( {
setHoveredTransformItemName,
} ) {
return restTransformations.map( ( item ) => (
<BlockTranformationItem
<BlockTransformationItem
key={ item.name }
item={ item }
onSelect={ onSelect }
Expand All @@ -160,7 +160,7 @@ function RestTransformationItems( {
) );
}

function BlockTranformationItem( {
function BlockTransformationItem( {
item,
onSelect,
setHoveredTransformItemName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const BlockVariationTransformations = ( {
/>
) }
{ transformations?.map( ( item ) => (
<BlockVariationTranformationItem
<BlockVariationTransformationItem
key={ item.name }
item={ item }
onSelect={ onSelect }
Expand All @@ -85,7 +85,7 @@ const BlockVariationTransformations = ( {
);
};

function BlockVariationTranformationItem( {
function BlockVariationTransformationItem( {
item,
onSelect,
setHoveredTransformItemName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function BlockSwitcherDropdownMenuContents( {
);
}
}
// Simple block tranformation based on the `Block Transforms` API.
// Simple block transformation based on the `Block Transforms` API.
function onBlockTransform( name ) {
const newBlocks = switchToBlockType( blocks, name );
replaceBlocks( clientIds, newBlocks );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const getPatternTransformedBlocks = (
// No need to loop through other pattern's blocks.
break;
}
// Bail eary if a selected block has not been matched.
// Bail early if a selected block has not been matched.
if ( ! isMatch ) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import UngroupButton from '../ungroup-button';
import { BlockSettingsButton } from '../block-settings';
import { store as blockEditorStore } from '../../store';

const REMOVE_EMPY_PARENT_BLOCKS = [
const REMOVE_EMPTY_PARENT_BLOCKS = [
'core/buttons',
'core/columns',
'core/social-links',
Expand Down Expand Up @@ -69,7 +69,7 @@ export default function BlockToolbar( { anchorNodeRef } ) {
// have inner blocks, ideally we should match the behavior as in
// the Web editor and show a placeholder instead of removing the parent.
if (
REMOVE_EMPY_PARENT_BLOCKS.includes( parentBlockName ) &&
REMOVE_EMPTY_PARENT_BLOCKS.includes( parentBlockName ) &&
parentNumberOfInnerBlocks === 1
) {
removeBlock( rootClientId );
Expand Down
Loading
Loading