diff --git a/backport-changelog/readme.md b/backport-changelog/readme.md index 8066cc6a6fca2..02b1983dd38e1 100644 --- a/backport-changelog/readme.md +++ b/backport-changelog/readme.md @@ -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. @@ -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. diff --git a/bin/api-docs/gen-block-lib-list.js b/bin/api-docs/gen-block-lib-list.js index 0c79def198999..309a3931b1218 100644 --- a/bin/api-docs/gen-block-lib-list.js +++ b/bin/api-docs/gen-block-lib-list.js @@ -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; diff --git a/bin/plugin/commands/changelog.js b/bin/plugin/commands/changelog.js index eac0f7b268d5b..edb81aa0ca651 100644 --- a/bin/plugin/commands/changelog.js +++ b/bin/plugin/commands/changelog.js @@ -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. @@ -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] ' ) ); @@ -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} acc Accumulator @@ -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. * diff --git a/bin/plugin/commands/test/changelog.js b/bin/plugin/commands/test/changelog.js index 9c9d423d18d1c..eb7e3377fe55b 100644 --- a/bin/plugin/commands/test/changelog.js +++ b/bin/plugin/commands/test/changelog.js @@ -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', diff --git a/docs/contributors/code/release.md b/docs/contributors/code/release.md index ec3af0d7bd4cb..d8dbdbd94a665 100644 --- a/docs/contributors/code/release.md +++ b/docs/contributors/code/release.md @@ -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). diff --git a/docs/manifest.json b/docs/manifest.json index 8f267e79ef4fe..a2facf0b1d14a 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -517,7 +517,7 @@ }, { "title": "Understanding global state, local context and derived state", - "slug": "undestanding-global-state-local-context-and-derived-state", + "slug": "understanding-global-state-local-context-and-derived-state", "markdown_source": "../docs/reference-guides/interactivity-api/core-concepts/undestanding-global-state-local-context-and-derived-state.md", "parent": "core-concepts" }, diff --git a/docs/reference-guides/block-api/block-bindings.md b/docs/reference-guides/block-api/block-bindings.md index 479396abc13c9..c26ade45e8b5e 100644 --- a/docs/reference-guides/block-api/block-bindings.md +++ b/docs/reference-guides/block-api/block-bindings.md @@ -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) diff --git a/docs/reference-guides/data/data-core-block-editor.md b/docs/reference-guides/data/data-core-block-editor.md index 437f7be20f770..d3cf80934fbb9 100644 --- a/docs/reference-guides/data/data-core-block-editor.md +++ b/docs/reference-guides/data/data-core-block-editor.md @@ -521,7 +521,7 @@ _Properties_ - _name_ `string`: The type of block. - _attributes_ `?Object`: Attributes to pass to the newly created block. -- _attributesToCopy_ `?Array`: Attributes to be copied from adjecent blocks when inserted. +- _attributesToCopy_ `?Array`: Attributes to be copied from adjacent blocks when inserted. ### getDraggedBlockClientIds @@ -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_ diff --git a/docs/reference-guides/data/data-core.md b/docs/reference-guides/data/data-core.md index 474207aa20460..6b13b7ccddbf1 100644 --- a/docs/reference-guides/data/data-core.md +++ b/docs/reference-guides/data/data-core.md @@ -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 diff --git a/docs/reference-guides/interactivity-api/core-concepts/server-side-rendering.md b/docs/reference-guides/interactivity-api/core-concepts/server-side-rendering.md index 075c2cb977bdf..30deb39d92718 100644 --- a/docs/reference-guides/interactivity-api/core-concepts/server-side-rendering.md +++ b/docs/reference-guides/interactivity-api/core-concepts/server-side-rendering.md @@ -175,7 +175,7 @@ store( 'myFruitPlugin', { The derived state, regardless of whether it derives from the global state, local context, or both, can also be processed on the server by the Server Directive Processing. -_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._ ### Derived state that can be defined statically diff --git a/docs/reference-guides/interactivity-api/core-concepts/undestanding-global-state-local-context-and-derived-state.md b/docs/reference-guides/interactivity-api/core-concepts/understanding-global-state-local-context-and-derived-state.md similarity index 100% rename from docs/reference-guides/interactivity-api/core-concepts/undestanding-global-state-local-context-and-derived-state.md rename to docs/reference-guides/interactivity-api/core-concepts/understanding-global-state-local-context-and-derived-state.md diff --git a/docs/reference-guides/interactivity-api/core-concepts/using-typescript.md b/docs/reference-guides/interactivity-api/core-concepts/using-typescript.md index ed0bdd88211d1..bc2fde0dc66bf 100644 --- a/docs/reference-guides/interactivity-api/core-concepts/using-typescript.md +++ b/docs/reference-guides/interactivity-api/core-concepts/using-typescript.md @@ -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 @@ -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._ Following our previous example, let's create a derived state that is the double of our counter. @@ -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. }, diff --git a/docs/reference-guides/interactivity-api/iapi-about.md b/docs/reference-guides/interactivity-api/iapi-about.md index 08689be03aa38..acebd37a23a79 100644 --- a/docs/reference-guides/interactivity-api/iapi-about.md +++ b/docs/reference-guides/interactivity-api/iapi-about.md @@ -186,7 +186,7 @@ Additionally, with a standard, **WordPress can absorb the maximum amount of comp _Complexities absorbed by the standard_ -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. +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. With this absorption, less knowledge is required to create interactive blocks, and developers have fewer decisions to worry about. diff --git a/lib/class-wp-theme-json-gutenberg.php b/lib/class-wp-theme-json-gutenberg.php index 083ce3516b71a..63b3f63e60493 100644 --- a/lib/class-wp-theme-json-gutenberg.php +++ b/lib/class-wp-theme-json-gutenberg.php @@ -3415,7 +3415,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. * * For example: * diff --git a/lib/experimental/media/load.php b/lib/experimental/media/load.php index bcb02accf62a6..69a5915a98bf2 100644 --- a/lib/experimental/media/load.php +++ b/lib/experimental/media/load.php @@ -300,7 +300,7 @@ function gutenberg_add_crossorigin_attributes( string $html ): string { $processor->set_bookmark( 'resume' ); - $seeked = false; + $sought = false; $crossorigin = $processor->get_attribute( 'crossorigin' ); @@ -308,16 +308,16 @@ function gutenberg_add_crossorigin_attributes( string $html ): string { 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' ); } diff --git a/lib/experimental/sync/README.md b/lib/experimental/sync/README.md index 83a105adddf7a..c8f09d7f1ca5a 100644 --- a/lib/experimental/sync/README.md +++ b/lib/experimental/sync/README.md @@ -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. diff --git a/packages/babel-plugin-makepot/index.js b/packages/babel-plugin-makepot/index.js index 0ae8a763d0335..3f24f733cec0d 100644 --- a/packages/babel-plugin-makepot/index.js +++ b/packages/babel-plugin-makepot/index.js @@ -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. * @@ -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+);/ ); diff --git a/packages/base-styles/_variables.scss b/packages/base-styles/_variables.scss index ec0bdf91f2489..562a568084c81 100644 --- a/packages/base-styles/_variables.scss +++ b/packages/base-styles/_variables.scss @@ -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; diff --git a/packages/block-editor/CHANGELOG.md b/packages/block-editor/CHANGELOG.md index 3c1e63c75c75f..28e3e156aabcf 100644 --- a/packages/block-editor/CHANGELOG.md +++ b/packages/block-editor/CHANGELOG.md @@ -95,7 +95,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) diff --git a/packages/block-editor/src/components/block-icon/content.scss b/packages/block-editor/src/components/block-icon/content.scss index 033e0d3129d74..ba2446d89f043 100644 --- a/packages/block-editor/src/components/block-icon/content.scss +++ b/packages/block-editor/src/components/block-icon/content.scss @@ -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; diff --git a/packages/block-editor/src/components/block-icon/style.scss b/packages/block-editor/src/components/block-icon/style.scss index 033e0d3129d74..ba2446d89f043 100644 --- a/packages/block-editor/src/components/block-icon/style.scss +++ b/packages/block-editor/src/components/block-icon/style.scss @@ -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; diff --git a/packages/block-editor/src/components/block-list/use-block-props/use-focus-handler.js b/packages/block-editor/src/components/block-list/use-block-props/use-focus-handler.js index 4e9ffa4572500..9bf02ae981a05 100644 --- a/packages/block-editor/src/components/block-list/use-block-props/use-focus-handler.js +++ b/packages/block-editor/src/components/block-list/use-block-props/use-focus-handler.js @@ -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; diff --git a/packages/block-editor/src/components/block-preview/style.scss b/packages/block-editor/src/components/block-preview/style.scss index 9bdd85f66445f..c304f46fa6ad2 100644 --- a/packages/block-editor/src/components/block-preview/style.scss +++ b/packages/block-editor/src/components/block-preview/style.scss @@ -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; diff --git a/packages/block-editor/src/components/block-styles/preview.native.js b/packages/block-editor/src/components/block-styles/preview.native.js index 005c6fac3f2c1..3db7dda724d62 100644 --- a/packages/block-editor/src/components/block-styles/preview.native.js +++ b/packages/block-editor/src/components/block-styles/preview.native.js @@ -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 ); } diff --git a/packages/block-editor/src/components/block-switcher/block-transformations-menu.js b/packages/block-editor/src/components/block-switcher/block-transformations-menu.js index 271b7fabd5173..f2c66e389b650 100644 --- a/packages/block-editor/src/components/block-switcher/block-transformations-menu.js +++ b/packages/block-editor/src/components/block-switcher/block-transformations-menu.js @@ -27,20 +27,20 @@ import BlockVariationTransformations from './block-variation-transformations'; * @return {Record} 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 ); @@ -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; } @@ -125,7 +125,7 @@ const BlockTransformationsMenu = ( { /> ) } { priorityTextTransformations.map( ( item ) => ( - ( - ) } { transformations?.map( ( item ) => ( - { return colors === newValue; } ); - const settedValue = duotonePreset + const duotoneValue = duotonePreset ? `var:preset|duotone|${ duotonePreset.slug }` : newValue; - onChange( setImmutably( value, [ 'filter', 'duotone' ], settedValue ) ); + onChange( setImmutably( value, [ 'filter', 'duotone' ], duotoneValue ) ); }; const hasDuotone = () => !! value?.filter?.duotone; const resetDuotone = () => setDuotone( undefined ); diff --git a/packages/block-editor/src/components/global-styles/test/typography-utils.js b/packages/block-editor/src/components/global-styles/test/typography-utils.js index b094d1e827783..a27c3ea1024b1 100644 --- a/packages/block-editor/src/components/global-styles/test/typography-utils.js +++ b/packages/block-editor/src/components/global-styles/test/typography-utils.js @@ -585,7 +585,7 @@ describe( 'typography utils', () => { 'clamp(14px, 0.875rem + ((1vw - 3.2px) * 0.078), 15px)', }, - // Equivalent custom config PHP unit tests in `test_should_covert_font_sizes_to_fluid_values()`. + // Equivalent custom config PHP unit tests in `test_should_convert_font_sizes_to_fluid_values()`. { message: 'should return clamp value using custom fluid config', preset: { diff --git a/packages/block-editor/src/components/global-styles/use-global-styles-output.js b/packages/block-editor/src/components/global-styles/use-global-styles-output.js index 7bdc95d222142..94485cbaa0820 100644 --- a/packages/block-editor/src/components/global-styles/use-global-styles-output.js +++ b/packages/block-editor/src/components/global-styles/use-global-styles-output.js @@ -1337,12 +1337,12 @@ export function processCSSNesting( css, blockSelector ) { processedCSS += `:root :where(${ blockSelector }){${ part.trim() }}`; } else { // If the part contains braces, it's a nested CSS rule. - const splittedPart = part.replace( '}', '' ).split( '{' ); - if ( splittedPart.length !== 2 ) { + const splitPart = part.replace( '}', '' ).split( '{' ); + if ( splitPart.length !== 2 ) { return; } - const [ nestedSelector, cssValue ] = splittedPart; + const [ nestedSelector, cssValue ] = splitPart; // Handle pseudo elements such as ::before, ::after, etc. Regex will also // capture any leading combinator such as >, +, or ~, as well as spaces. diff --git a/packages/block-editor/src/components/iframe/get-compatibility-styles.js b/packages/block-editor/src/components/iframe/get-compatibility-styles.js index fd14e02a219bf..05ec5968082e2 100644 --- a/packages/block-editor/src/components/iframe/get-compatibility-styles.js +++ b/packages/block-editor/src/components/iframe/get-compatibility-styles.js @@ -2,7 +2,7 @@ let compatibilityStyles = null; /** * Returns a list of stylesheets that target the editor canvas. A stylesheet is - * considered targetting the editor a canvas if it contains the + * considered targeting the editor a canvas if it contains the * `editor-styles-wrapper`, `wp-block`, or `wp-block-*` class selectors. * * Ideally, this hook should be removed in the future and styles should be added diff --git a/packages/block-editor/src/components/iframe/index.js b/packages/block-editor/src/components/iframe/index.js index f8b7c25084e38..364f480965a4c 100644 --- a/packages/block-editor/src/components/iframe/index.js +++ b/packages/block-editor/src/components/iframe/index.js @@ -630,7 +630,7 @@ function Iframe( { > { iframeDocument && createPortal( - // We want to prevent React events from bubbling throught the iframe + // We want to prevent React events from bubbling through the iframe // we bubble these manually. /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ ` also allows for on the fly creation of links based on the **current content of the `` element**. When enabled, a default "Create new" search suggestion is appended to all non-URL-like search results. @@ -79,7 +79,7 @@ The resulting default properties of `value` include: - `title` (`string`, optional): Link title. - `opensInNewTab` (`boolean`, optional): Whether link should open in a new browser tab. This value is only assigned when not providing a custom `settings` prop. -Note: `` maintains an internal state tracking temporary user edits to the link `value` prior to submission. To avoid unwanted synchronization of this internal value, it is advised that the `value` prop is stablized (likely via memozation) before it is passed to the component. This will avoid unwanted loss of any changes users have may made whilst interacting with the control. +Note: `` maintains an internal state tracking temporary user edits to the link `value` prior to submission. To avoid unwanted synchronization of this internal value, it is advised that the `value` prop is stabilized (likely via memozation) before it is passed to the component. This will avoid unwanted loss of any changes users have may made whilst interacting with the control. ```jsx const memoizedValue = useMemo( diff --git a/packages/block-editor/src/components/link-control/index.js b/packages/block-editor/src/components/link-control/index.js index 0f2ae4a0e05d2..aba3aa015b974 100644 --- a/packages/block-editor/src/components/link-control/index.js +++ b/packages/block-editor/src/components/link-control/index.js @@ -264,7 +264,7 @@ function LinkControl( { const handleSelectSuggestion = ( updatedValue ) => { // Suggestions may contains "settings" values (e.g. `opensInNewTab`) - // which should not overide any existing settings values set by the + // which should not override any existing settings values set by the // user. This filters out any settings values from the suggestion. const nonSettingsChanges = Object.keys( updatedValue ).reduce( ( acc, key ) => { diff --git a/packages/block-editor/src/components/link-control/test/index.js b/packages/block-editor/src/components/link-control/test/index.js index bd97fec4ba007..b56fcc528c96f 100644 --- a/packages/block-editor/src/components/link-control/test/index.js +++ b/packages/block-editor/src/components/link-control/test/index.js @@ -31,7 +31,7 @@ const mockFetchSearchSuggestions = jest.fn(); /** * The call to the real method `fetchRichUrlData` is wrapped in a promise in order to make it cancellable. * Therefore if we pass any value as the mock of `fetchRichUrlData` then ALL of the tests will require - * addition code to handle the async nature of `fetchRichUrlData`. This is unecessary. Instead we default + * addition code to handle the async nature of `fetchRichUrlData`. This is unnecessary. Instead we default * to an undefined value which will ensure that the code under test does not call `fetchRichUrlData`. Only * when we are testing the "rich previews" to we update this value with a true mock. */ @@ -354,7 +354,7 @@ describe( 'Basic rendering', () => { it( 'should display human friendly error message if value URL prop is empty when component is forced into no-editing (preview) mode', async () => { // Why do we need this test? - // Occasionally `forceIsEditingLink` is set explictly to `false` which causes the Link UI to render + // Occasionally `forceIsEditingLink` is set explicitly to `false` which causes the Link UI to render // it's preview even if the `value` has no URL. // for an example of this see the usage in the following file whereby forceIsEditingLink is used to start/stop editing mode: // https://github.com/WordPress/gutenberg/blob/fa5728771df7cdc86369f7157d6aa763649937a7/packages/format-library/src/link/inline.js#L151. @@ -2422,7 +2422,7 @@ describe( 'Controlling link title text', () => { it.each( [ [ '', 'Testing' ], - [ '(with leading and traling whitespace)', ' Testing ' ], + [ '(with leading and trailing whitespace)', ' Testing ' ], [ // Note: link control should always preserve the original value. // The consumer is responsible for filtering or otherwise handling the value. diff --git a/packages/block-editor/src/components/link-control/use-search-handler.js b/packages/block-editor/src/components/link-control/use-search-handler.js index 455d228be1974..e081dcb471248 100644 --- a/packages/block-editor/src/components/link-control/use-search-handler.js +++ b/packages/block-editor/src/components/link-control/use-search-handler.js @@ -94,7 +94,7 @@ const handleEntitySearch = async ( return isURLLike( val ) || ! withCreateSuggestion ? results : results.concat( { - // the `id` prop is intentionally ommitted here because it + // the `id` prop is intentionally omitted here because it // is never exposed as part of the component's public API. // see: https://github.com/WordPress/gutenberg/pull/19775#discussion_r378931316. title: val, // Must match the existing ``s text value. diff --git a/packages/block-editor/src/components/list-view/README.md b/packages/block-editor/src/components/list-view/README.md index 0db077c641249..ae8836b763588 100644 --- a/packages/block-editor/src/components/list-view/README.md +++ b/packages/block-editor/src/components/list-view/README.md @@ -15,7 +15,7 @@ In addition to presenting the structure of the blocks in the editor, the ListVie ### Usage -Renders a list view with default syles. +Renders a list view with default styles. ```jsx import { ListView } from '@wordpress/block-editor'; diff --git a/packages/block-editor/src/components/list-view/style.scss b/packages/block-editor/src/components/list-view/style.scss index 2916622efabee..28cbe8e0f8cd6 100644 --- a/packages/block-editor/src/components/list-view/style.scss +++ b/packages/block-editor/src/components/list-view/style.scss @@ -44,7 +44,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; @@ -484,7 +484,7 @@ $block-navigation-max-indent: 8; .block-editor-list-view-leaf[aria-level="#{ $i + 1 }"] .block-editor-list-view__expander { @if $i - 1 >= 0 { - margin-left: ($grid-unit-30 * $i); // Effectivly centers the expander below the parent's icon. + margin-left: ($grid-unit-30 * $i); // Effectively centers the expander below the parent's icon. } @else { margin-left: 0; } diff --git a/packages/block-editor/src/components/observe-typing/index.js b/packages/block-editor/src/components/observe-typing/index.js index 75afc4bbdf0f9..b9307dc11bad3 100644 --- a/packages/block-editor/src/components/observe-typing/index.js +++ b/packages/block-editor/src/components/observe-typing/index.js @@ -111,7 +111,7 @@ export function useMouseMoveTypingReset() { * Sets and removes the `isTyping` flag based on user actions: * * - Sets the flag if the user types within the given element. - * - Removes the flag when the user selects some text, focusses a non-text + * - Removes the flag when the user selects some text, focuses a non-text * field, presses ESC or TAB, or moves the mouse in the document. */ export function useTypingObserver() { diff --git a/packages/block-editor/src/components/provider/use-block-sync.js b/packages/block-editor/src/components/provider/use-block-sync.js index fa148109d510f..3cc2b21b141e6 100644 --- a/packages/block-editor/src/components/provider/use-block-sync.js +++ b/packages/block-editor/src/components/provider/use-block-sync.js @@ -33,7 +33,7 @@ const noop = () => {}; * the template part in the block editor back to the entity and vice-versa. * * Here are some of its basic functions: - * - Initalizes the block-editor store for the given clientID to the blocks + * - Initializes the block-editor store for the given clientID to the blocks * given via props. * - Adds incoming changes (like undo) to the block-editor store. * - Adds outgoing changes (like editing content) to the controlling entity, @@ -49,7 +49,7 @@ const noop = () => {}; * root controller rather than an inner block * controller. * @param {Object[]} props.value The control value for the blocks. This value - * is used to initalize the block-editor store + * is used to initialize the block-editor store * and for resetting the blocks to incoming * changes like undo. * @param {Object} props.selection The selection state responsible to restore the selection on undo/redo. diff --git a/packages/block-editor/src/components/rich-text/README.md b/packages/block-editor/src/components/rich-text/README.md index 11ea1c75204dd..f08d75c5bec45 100644 --- a/packages/block-editor/src/components/rich-text/README.md +++ b/packages/block-editor/src/components/rich-text/README.md @@ -52,7 +52,7 @@ _Optional._ By default, all registered formats are allowed. This setting can be tagName="h2" identifier="content" value={ attributes.content } - allowedFormats={ [ 'core/bold', 'core/italic' ] } // Allow the content to be made bold or italic, but do not allow othe formatting options + allowedFormats={ [ 'core/bold', 'core/italic' ] } // Allow the content to be made bold or italic, but do not allow other formatting options onChange={ ( content ) => setAttributes( { content } ) } placeholder={ __( 'Heading...' ) } /> diff --git a/packages/block-editor/src/components/rich-text/event-listeners/input-rules.js b/packages/block-editor/src/components/rich-text/event-listeners/input-rules.js index 4a1e8400e35a1..4618e17b11fbb 100644 --- a/packages/block-editor/src/components/rich-text/event-listeners/input-rules.js +++ b/packages/block-editor/src/components/rich-text/event-listeners/input-rules.js @@ -112,12 +112,12 @@ export default ( props ) => ( element ) => { const value = getValue(); const transformed = formatTypes.reduce( - ( accumlator, { __unstableInputRule } ) => { + ( accumulator, { __unstableInputRule } ) => { if ( __unstableInputRule ) { - accumlator = __unstableInputRule( accumlator ); + accumulator = __unstableInputRule( accumulator ); } - return accumlator; + return accumulator; }, preventEventDiscovery( value ) ); diff --git a/packages/block-editor/src/components/rich-text/native/use-format-types.js b/packages/block-editor/src/components/rich-text/native/use-format-types.js index ff65d7421ae5c..f5535826b5b78 100644 --- a/packages/block-editor/src/components/rich-text/native/use-format-types.js +++ b/packages/block-editor/src/components/rich-text/native/use-format-types.js @@ -35,7 +35,7 @@ const interactiveContentTags = new Set( [ * @param {Object} $0 Options * @param {string} $0.clientId Block client ID. * @param {string} $0.identifier Block attribute. - * @param {boolean} $0.withoutInteractiveFormatting Whether to clean the interactive formattings or not. + * @param {boolean} $0.withoutInteractiveFormatting Whether to clean the interactive formatting or not. * @param {Array} $0.allowedFormats Allowed formats */ export function useFormatTypes( { diff --git a/packages/block-editor/src/components/rich-text/use-format-types.js b/packages/block-editor/src/components/rich-text/use-format-types.js index 3c9b3b62ef78a..0bbebbf262367 100644 --- a/packages/block-editor/src/components/rich-text/use-format-types.js +++ b/packages/block-editor/src/components/rich-text/use-format-types.js @@ -59,7 +59,7 @@ function getPrefixedSelectKeys( selected, prefix ) { * @param {Object} $0 Options * @param {string} $0.clientId Block client ID. * @param {string} $0.identifier Block attribute. - * @param {boolean} $0.withoutInteractiveFormatting Whether to clean the interactive formattings or not. + * @param {boolean} $0.withoutInteractiveFormatting Whether to clean the interactive formatting or not. * @param {Array} $0.allowedFormats Allowed formats */ export function useFormatTypes( { diff --git a/packages/block-editor/src/components/text-transform-control/README.md b/packages/block-editor/src/components/text-transform-control/README.md index 2d40cc16ba86f..baf902819d9d3 100644 --- a/packages/block-editor/src/components/text-transform-control/README.md +++ b/packages/block-editor/src/components/text-transform-control/README.md @@ -2,7 +2,7 @@ The `TextTransformControl` component is responsible for rendering a control element that allows users to select and apply text transformation options to blocks or elements in the Gutenberg editor. It provides an intuitive interface for changing the text appearance by applying different transformations such as `none`, `uppercase`, `lowercase`, `capitalize`. -![TextTransformConrol Element in Inspector Control](https://raw.githubusercontent.com/WordPress/gutenberg/HEAD/docs/assets/text-transform-component.png?raw=true) +![TextTransformControl Element in Inspector Control](https://raw.githubusercontent.com/WordPress/gutenberg/HEAD/docs/assets/text-transform-component.png?raw=true) ## Development guidelines diff --git a/packages/block-editor/src/components/typewriter/index.js b/packages/block-editor/src/components/typewriter/index.js index b5e230d314a7e..76a6870788c80 100644 --- a/packages/block-editor/src/components/typewriter/index.js +++ b/packages/block-editor/src/components/typewriter/index.js @@ -193,7 +193,7 @@ export function useTypewriter() { } /** - * Checks if the current situation is elegible for scroll: + * Checks if the current situation is eligible for scroll: * - There should be one and only one block selected. * - The component must contain the selection. * - The active element must be contenteditable. diff --git a/packages/block-editor/src/components/use-block-commands/index.js b/packages/block-editor/src/components/use-block-commands/index.js index ff919710a2284..9c932d3c86f54 100644 --- a/packages/block-editor/src/components/use-block-commands/index.js +++ b/packages/block-editor/src/components/use-block-commands/index.js @@ -89,7 +89,7 @@ const getTransformCommands = () => } } - // 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 ); diff --git a/packages/block-editor/src/components/use-moving-animation/index.js b/packages/block-editor/src/components/use-moving-animation/index.js index 602b683150d0c..b7f3d681bba31 100644 --- a/packages/block-editor/src/components/use-moving-animation/index.js +++ b/packages/block-editor/src/components/use-moving-animation/index.js @@ -89,7 +89,7 @@ function useMovingAnimation( { triggerAnimationOnChange, clientId } ) { // motion, if the user is typing (insertion by Enter), or if the block // count exceeds the threshold (insertion caused all the blocks that // follow to animate). - // To do: consider enableing the _moving_ animation even for large + // To do: consider enabling the _moving_ animation even for large // posts, while only disabling the _insertion_ animation? const disableAnimation = window.matchMedia( '(prefers-reduced-motion: reduce)' ).matches || diff --git a/packages/block-editor/src/components/use-settings/README.md b/packages/block-editor/src/components/use-settings/README.md index 68f580aa357be..a444a9531a9e7 100644 --- a/packages/block-editor/src/components/use-settings/README.md +++ b/packages/block-editor/src/components/use-settings/README.md @@ -5,7 +5,7 @@ It does the lookup of the settings in the following order: 1. Third parties can provide the settings for the block using the filter `blockEditor.useSetting.before`. -2. If no third parties have provided this setting, then it looks up in the block instance hierachy starting from the current block and working its way upwards to its ancestors. +2. If no third parties have provided this setting, then it looks up in the block instance hierarchy starting from the current block and working its way upwards to its ancestors. 3. If that doesn't prove to be successful in getting a value, then it falls back to the settings from the block editor store. 4. If none of the above steps prove to be successful, then it's likely to be a deprecated setting and the deprecated setting is used instead. diff --git a/packages/block-editor/src/components/warning/content.scss b/packages/block-editor/src/components/warning/content.scss index 9380a224b2ff9..7796dbc831abb 100644 --- a/packages/block-editor/src/components/warning/content.scss +++ b/packages/block-editor/src/components/warning/content.scss @@ -18,7 +18,7 @@ margin: 0; } - // Required extra-specifity to override paragraph block styles. + // Required extra-specificity to override paragraph block styles. p.block-editor-warning__message.block-editor-warning__message { min-height: auto; } diff --git a/packages/block-editor/src/components/writing-flow/test/index.js b/packages/block-editor/src/components/writing-flow/test/index.js index 4d19417cf36e5..edb594a6a7d18 100644 --- a/packages/block-editor/src/components/writing-flow/test/index.js +++ b/packages/block-editor/src/components/writing-flow/test/index.js @@ -50,7 +50,7 @@ describe( 'isNavigationCandidate', () => { } ); } ); - it( 'should return false if vertically navigating inputs with vertial support like number', () => { + it( 'should return false if vertically navigating inputs with vertical support like number', () => { [ UP, DOWN ].forEach( ( keyCode ) => { const result = isNavigationCandidate( elements.inputNumber, diff --git a/packages/block-editor/src/store/actions.js b/packages/block-editor/src/store/actions.js index 6edc5cb4da039..32362968325ef 100644 --- a/packages/block-editor/src/store/actions.js +++ b/packages/block-editor/src/store/actions.js @@ -1266,7 +1266,7 @@ export const mergeBlocks = offset !== undefined && // We cannot restore text selection if the RichText identifier // is not a defined block attribute key. This can be the case if the - // fallback intance ID is used to store selection (and no RichText + // fallback instance ID is used to store selection (and no RichText // identifier is set), or when the identifier is wrong. !! attributeDefinition; diff --git a/packages/block-editor/src/store/selectors.js b/packages/block-editor/src/store/selectors.js index ac1d178f43de7..9d4c31bb68e4d 100644 --- a/packages/block-editor/src/store/selectors.js +++ b/packages/block-editor/src/store/selectors.js @@ -1965,7 +1965,7 @@ const canIncludeBlockTypeInInserter = ( state, blockType, rootClientId ) => { }; /** - * Return a function to be used to tranform a block variation to an inserter item + * Return a function to be used to transform a block variation to an inserter item * * @param {Object} state Global State * @param {Object} item Denormalized inserter item @@ -2028,7 +2028,7 @@ const calculateFrecency = ( time, count ) => { /** * Returns a function that accepts a block type and builds an item to be shown * in a specific context. It's used for building items for Inserter and available - * block Transfroms list. + * block Transforms list. * * @param {Object} state Editor state. * @param {Object} options Options object for handling the building of a block type. @@ -2402,7 +2402,7 @@ export const __experimentalGetAllowedBlocks = createSelector( * @typedef {Object} WPDirectInsertBlock * @property {string} name The type of block. * @property {?Object} attributes Attributes to pass to the newly created block. - * @property {?Array} attributesToCopy Attributes to be copied from adjecent blocks when inserted. + * @property {?Array} attributesToCopy Attributes to be copied from adjacent blocks when inserted. */ export function getDirectInsertBlock( state, rootClientId = null ) { if ( ! rootClientId ) { @@ -2520,7 +2520,7 @@ export const __experimentalGetAllowedPatterns = createRegistrySelector( * or blocks transformations. * * @param {Object} state Editor state. - * @param {string|string[]} blockNames Block's name or array of block names to find matching pattens. + * @param {string|string[]} blockNames Block's name or array of block names to find matching patterns. * @param {?string} rootClientId Optional target root client ID. * * @return {Array} The list of matched block patterns based on declared `blockTypes` and block name. @@ -2939,7 +2939,7 @@ export const __unstableGetVisibleBlocks = createSelector( ); export function __unstableHasActiveBlockOverlayActive( state, clientId ) { - // Prevent overlay on blocks with a non-default editing mode. If the mdoe is + // Prevent overlay on blocks with a non-default editing mode. If the mode is // 'disabled' then the overlay is redundant since the block can't be // selected. If the mode is 'contentOnly' then the overlay is redundant // since there will be no controls to interact with once selected. @@ -3113,7 +3113,7 @@ export const getBlockEditingMode = createRegistrySelector( return isContent ? 'contentOnly' : 'disabled'; } - // In normal mode, consider that an explicitely set editing mode takes over. + // In normal mode, consider that an explicitly set editing mode takes over. const blockEditingMode = state.blockEditingModes.get( clientId ); if ( blockEditingMode ) { return blockEditingMode; diff --git a/packages/block-editor/src/store/test/private-selectors.js b/packages/block-editor/src/store/test/private-selectors.js index fb1d736e175af..391930075716e 100644 --- a/packages/block-editor/src/store/test/private-selectors.js +++ b/packages/block-editor/src/store/test/private-selectors.js @@ -165,7 +165,7 @@ describe( 'private selectors', () => { ).toBe( true ); } ); - it( 'should return true when top level block is disabled via inheritence and there are no editing modes within it', () => { + it( 'should return true when top level block is disabled via inheritance and there are no editing modes within it', () => { const state = { ...baseState, blockEditingModes: new Map( [ [ '', 'disabled' ] ] ), @@ -210,7 +210,7 @@ describe( 'private selectors', () => { ).toBe( false ); } ); - it( 'should return false when top level block is disabled via inheritence and there are non-disabled editing modes within it', () => { + it( 'should return false when top level block is disabled via inheritance and there are non-disabled editing modes within it', () => { const state = { ...baseState, blockEditingModes: new Map( [ diff --git a/packages/block-editor/src/store/test/selectors.js b/packages/block-editor/src/store/test/selectors.js index 7c0361449c5fc..0c43a702a7c86 100644 --- a/packages/block-editor/src/store/test/selectors.js +++ b/packages/block-editor/src/store/test/selectors.js @@ -3536,7 +3536,7 @@ describe( 'selectors', () => { beforeAll( () => { registerBlockType( 'core/with-tranforms-a', { category: 'text', - title: 'Tranforms a', + title: 'Transforms a', edit: () => {}, save: () => {}, transforms: { @@ -3565,7 +3565,7 @@ describe( 'selectors', () => { } ); registerBlockType( 'core/with-tranforms-b', { category: 'text', - title: 'Tranforms b', + title: 'Transforms b', edit: () => {}, save: () => {}, transforms: { @@ -3580,7 +3580,7 @@ describe( 'selectors', () => { } ); registerBlockType( 'core/with-tranforms-c', { category: 'text', - title: 'Tranforms c', + title: 'Transforms c', edit: () => {}, save: () => {}, transforms: { diff --git a/packages/block-editor/src/utils/test/sorting.js b/packages/block-editor/src/utils/test/sorting.js index f1038cda5809c..faf2f02ad6756 100644 --- a/packages/block-editor/src/utils/test/sorting.js +++ b/packages/block-editor/src/utils/test/sorting.js @@ -37,7 +37,7 @@ describe( 'orderBy', () => { expect( orderBy( input, 'x' ) ).toEqual( expected ); } ); - it( 'should maintain original order of equal items in descencing order', () => { + it( 'should maintain original order of equal items in descending order', () => { const a = { x: 1, a: 1 }; const b = { x: 1, b: 2 }; const c = { x: 0 }; diff --git a/packages/block-editor/src/utils/transform-styles/index.js b/packages/block-editor/src/utils/transform-styles/index.js index 170f770d63d5d..b05a625a1e80e 100644 --- a/packages/block-editor/src/utils/transform-styles/index.js +++ b/packages/block-editor/src/utils/transform-styles/index.js @@ -160,7 +160,7 @@ function transformStyle( /** * @typedef {Object} EditorStyle * @property {string} css the CSS block(s), as a single string. - * @property {?string} baseURL the base URL to be used as the reference when rewritting urls. + * @property {?string} baseURL the base URL to be used as the reference when rewriting urls. * @property {?string[]} ignoredSelectors the selectors not to wrap. */ diff --git a/packages/block-library/src/audio/test/transforms.native.js b/packages/block-library/src/audio/test/transforms.native.js index 0ed1a1f6306fb..a36e7dfd28255 100644 --- a/packages/block-library/src/audio/test/transforms.native.js +++ b/packages/block-library/src/audio/test/transforms.native.js @@ -15,8 +15,8 @@ const initialHtml = `
`; -const tranformsWithInnerBlocks = [ 'Columns', 'Group' ]; -const blockTransforms = [ 'File', ...tranformsWithInnerBlocks ]; +const transformsWithInnerBlocks = [ 'Columns', 'Group' ]; +const blockTransforms = [ 'File', ...transformsWithInnerBlocks ]; setupCoreBlocks(); @@ -25,7 +25,7 @@ describe( `${ block } block transformations`, () => { const screen = await initializeEditor( { initialHtml } ); const newBlock = await transformBlock( screen, block, blockTransform, { isMediaBlock: false, - hasInnerBlocks: tranformsWithInnerBlocks.includes( blockTransform ), + hasInnerBlocks: transformsWithInnerBlocks.includes( blockTransform ), } ); expect( newBlock ).toBeVisible(); expect( getEditorHtml() ).toMatchSnapshot(); diff --git a/packages/block-library/src/columns/edit.js b/packages/block-library/src/columns/edit.js index f8cf0297302cc..3de25b0778131 100644 --- a/packages/block-library/src/columns/edit.js +++ b/packages/block-library/src/columns/edit.js @@ -211,7 +211,7 @@ function ColumnsEditContainer( { attributes, setAttributes, clientId } ) { /** * Update all child Column blocks with a new vertical alignment setting * based on whatever alignment is passed in. This allows change to parent - * to overide anything set on a individual column basis. + * to override anything set on a individual column basis. * * @param {string} newVerticalAlignment The vertical alignment setting. */ diff --git a/packages/block-library/src/columns/edit.native.js b/packages/block-library/src/columns/edit.native.js index 07655981edcad..abbc458307f5c 100644 --- a/packages/block-library/src/columns/edit.native.js +++ b/packages/block-library/src/columns/edit.native.js @@ -287,7 +287,7 @@ const ColumnsEditContainerWrapper = withDispatch( /** * Update all child Column blocks with a new vertical alignment setting * based on whatever alignment is passed in. This allows change to parent - * to overide anything set on a individual column basis. + * to override anything set on a individual column basis. * * @param {string} verticalAlignment the vertical alignment setting */ diff --git a/packages/block-library/src/comment-template/edit.js b/packages/block-library/src/comment-template/edit.js index 50d83289e1ed9..038583e68c85c 100644 --- a/packages/block-library/src/comment-template/edit.js +++ b/packages/block-library/src/comment-template/edit.js @@ -168,7 +168,7 @@ const CommentTemplatePreview = ( { }; // We have to hide the preview block if the `comment` props points to - // the curently active block! + // the currently active block! // Or, to put it differently, every preview block is visible unless it is the // currently active block - in this case we render its inner blocks. @@ -222,7 +222,7 @@ const CommentsList = ( { // "placeholder" and that the block is most likely being used in the // site editor. In this case, we have to set the commentId to `null` // because otherwise the (non-existent) comment with a negative ID - // would be reqested from the REST API. + // would be requested from the REST API. commentId: commentId < 0 ? null : commentId, } } > diff --git a/packages/block-library/src/cover/deprecated.js b/packages/block-library/src/cover/deprecated.js index 6dfad9735457f..6966c1971d7be 100644 --- a/packages/block-library/src/cover/deprecated.js +++ b/packages/block-library/src/cover/deprecated.js @@ -885,7 +885,7 @@ const v11 = { migrate: migrateTag, }; -// Deprecation for blocks that renders fixed background as backgroud from the main block container. +// Deprecation for blocks that renders fixed background as background from the main block container. const v10 = { attributes: v8ToV11BlockAttributes, supports: v7toV11BlockSupports, diff --git a/packages/block-library/src/cover/test/edit.native.js b/packages/block-library/src/cover/test/edit.native.js index 1b8a7133926d9..461a75f69e075 100644 --- a/packages/block-library/src/cover/test/edit.native.js +++ b/packages/block-library/src/cover/test/edit.native.js @@ -101,7 +101,7 @@ const attributes = { }; beforeAll( () => { - // Mock Image.getSize to avoid failed attempt to size non-existant image. + // Mock Image.getSize to avoid failed attempt to size non-existent image. const getSizeSpy = jest.spyOn( Image, 'getSize' ); getSizeSpy.mockImplementation( ( _url, callback ) => callback( 300, 200 ) ); @@ -541,7 +541,7 @@ describe( 'color settings', () => { expect( getEditorHtml() ).toMatchSnapshot(); } ); - it( 'clears the selected overlay color and mantains the inner blocks', async () => { + it( 'clears the selected overlay color and maintains the inner blocks', async () => { const screen = await initializeEditor( { initialHtml: COVER_BLOCK_SOLID_COLOR_HTML, } ); diff --git a/packages/block-library/src/cover/test/transforms.native.js b/packages/block-library/src/cover/test/transforms.native.js index 4232570eb0779..6a47ffe32ac4f 100644 --- a/packages/block-library/src/cover/test/transforms.native.js +++ b/packages/block-library/src/cover/test/transforms.native.js @@ -23,16 +23,16 @@ const initialHtmlWithVideo = ` `; -const tranformsWithInnerBlocks = [ 'Columns', 'Group' ]; +const transformsWithInnerBlocks = [ 'Columns', 'Group' ]; const blockTransformsWithImage = [ 'Image', 'Media & Text', - ...tranformsWithInnerBlocks, + ...transformsWithInnerBlocks, ]; const blockTransformsWithVideo = [ 'Video', 'Media & Text', - ...tranformsWithInnerBlocks, + ...transformsWithInnerBlocks, ]; setupCoreBlocks(); @@ -52,7 +52,7 @@ describe( `${ block } block transformations`, () => { { isMediaBlock: true, hasInnerBlocks: - tranformsWithInnerBlocks.includes( blockTransform ), + transformsWithInnerBlocks.includes( blockTransform ), } ); expect( newBlock ).toBeVisible(); @@ -88,7 +88,7 @@ describe( `${ block } block transformations`, () => { { isMediaBlock: true, hasInnerBlocks: - tranformsWithInnerBlocks.includes( blockTransform ), + transformsWithInnerBlocks.includes( blockTransform ), } ); expect( newBlock ).toBeVisible(); diff --git a/packages/block-library/src/editor.scss b/packages/block-library/src/editor.scss index a16d5a6c2c69c..87780e93a1765 100644 --- a/packages/block-library/src/editor.scss +++ b/packages/block-library/src/editor.scss @@ -66,7 +66,7 @@ // Font sizes (not used now, kept because of backward compatibility). // // The reason we add the editor class wrapper here is -// to avoid enqueing the classes twice: here and in ./editor.scss +// to avoid enqueuing the classes twice: here and in ./editor.scss :where(.editor-styles-wrapper) .has-regular-font-size { font-size: 16px; } diff --git a/packages/block-library/src/embed/test/index.js b/packages/block-library/src/embed/test/index.js index 7cc3645611ea7..7c09d7656454d 100644 --- a/packages/block-library/src/embed/test/index.js +++ b/packages/block-library/src/embed/test/index.js @@ -69,7 +69,7 @@ describe( 'utils', () => { expect( getClassNames( html, '', false ) ).toEqual( expected ); } ); - it( 'should preserve exsiting class names when removing responsive classes', () => { + it( 'should preserve existing class names when removing responsive classes', () => { const html = ''; const expected = 'lovely'; expect( diff --git a/packages/block-library/src/embed/util.js b/packages/block-library/src/embed/util.js index eae45cc397e7b..a58f1a8efc5c3 100644 --- a/packages/block-library/src/embed/util.js +++ b/packages/block-library/src/embed/util.js @@ -42,7 +42,7 @@ export const getEmbedInfoByProvider = ( provider ) => * Returns true if any of the regular expressions match the URL. * * @param {string} url The URL to test. - * @param {Array} patterns The list of regular expressions to test agains. + * @param {Array} patterns The list of regular expressions to test against. * @return {boolean} True if any of the regular expressions match the URL. */ export const matchesPatterns = ( url, patterns = [] ) => diff --git a/packages/block-library/src/file/test/transforms.native.js b/packages/block-library/src/file/test/transforms.native.js index efaa507348c1c..2f57eddf16299 100644 --- a/packages/block-library/src/file/test/transforms.native.js +++ b/packages/block-library/src/file/test/transforms.native.js @@ -15,8 +15,8 @@ const initialHtml = ` `; -const tranformsWithInnerBlocks = [ 'Columns', 'Group' ]; -const blockTransforms = [ ...tranformsWithInnerBlocks ]; +const transformsWithInnerBlocks = [ 'Columns', 'Group' ]; +const blockTransforms = [ ...transformsWithInnerBlocks ]; setupCoreBlocks(); @@ -25,7 +25,7 @@ describe( `${ block } block transformations`, () => { const screen = await initializeEditor( { initialHtml } ); const newBlock = await transformBlock( screen, block, blockTransform, { isMediaBlock: false, - hasInnerBlocks: tranformsWithInnerBlocks.includes( blockTransform ), + hasInnerBlocks: transformsWithInnerBlocks.includes( blockTransform ), } ); expect( newBlock ).toBeVisible(); expect( getEditorHtml() ).toMatchSnapshot(); diff --git a/packages/block-library/src/file/transforms.js b/packages/block-library/src/file/transforms.js index c381a62f78386..0e129b9fe64ba 100644 --- a/packages/block-library/src/file/transforms.js +++ b/packages/block-library/src/file/transforms.js @@ -14,7 +14,7 @@ const transforms = { isMatch( files ) { return files.length > 0; }, - // We define a lower priorty (higher number) than the default of 10. This + // We define a lower priority (higher number) than the default of 10. This // ensures that the File block is only created as a fallback. priority: 15, transform: ( files ) => { diff --git a/packages/block-library/src/file/utils/index.js b/packages/block-library/src/file/utils/index.js index a60e9e131c4e4..8e8bb811dd038 100644 --- a/packages/block-library/src/file/utils/index.js +++ b/packages/block-library/src/file/utils/index.js @@ -10,7 +10,7 @@ export const browserSupportsPdfs = () => { return false; } - // Android tablets are the noteable exception. + // Android tablets are the notable exception. if ( window.navigator.userAgent.indexOf( 'Android' ) > -1 ) { return false; } diff --git a/packages/block-library/src/form-input/edit.js b/packages/block-library/src/form-input/edit.js index 5f3713e83975f..104124a13cda1 100644 --- a/packages/block-library/src/form-input/edit.js +++ b/packages/block-library/src/form-input/edit.js @@ -77,7 +77,7 @@ function InputFieldBlock( { attributes, setAttributes, className } ) { } ); } } help={ __( - 'Affects the "name" atribute of the input element, and is used as a name for the form submission results.' + 'Affects the "name" attribute of the input element, and is used as a name for the form submission results.' ) } /> diff --git a/packages/block-library/src/gallery/test/transforms.native.js b/packages/block-library/src/gallery/test/transforms.native.js index d155c1bc01064..be64302f9b8b0 100644 --- a/packages/block-library/src/gallery/test/transforms.native.js +++ b/packages/block-library/src/gallery/test/transforms.native.js @@ -25,8 +25,8 @@ const initialHtml = ` `; -const tranformsWithInnerBlocks = [ 'Columns', 'Group' ]; -const blockTransforms = [ 'Image', ...tranformsWithInnerBlocks ]; +const transformsWithInnerBlocks = [ 'Columns', 'Group' ]; +const blockTransforms = [ 'Image', ...transformsWithInnerBlocks ]; setupCoreBlocks(); @@ -35,7 +35,7 @@ describe( `${ block } block transformations`, () => { const screen = await initializeEditor( { initialHtml } ); const newBlock = await transformBlock( screen, block, blockTransform, { isMediaBlock: true, - hasInnerBlocks: tranformsWithInnerBlocks.includes( blockTransform ), + hasInnerBlocks: transformsWithInnerBlocks.includes( blockTransform ), } ); expect( newBlock ).toBeVisible(); expect( getEditorHtml() ).toMatchSnapshot(); diff --git a/packages/block-library/src/gallery/transforms.js b/packages/block-library/src/gallery/transforms.js index f040fdb12fb23..6dc2f526f44a0 100644 --- a/packages/block-library/src/gallery/transforms.js +++ b/packages/block-library/src/gallery/transforms.js @@ -25,7 +25,7 @@ const parseShortcodeIds = ( ids ) => { /** * Third party block plugins don't have an easy way to detect if the * innerBlocks version of the Gallery is running when they run a - * 3rdPartyBlock -> GalleryBlock transform so this tranform filter + * 3rdPartyBlock -> GalleryBlock transform so this transform filter * will handle this. Once the innerBlocks version is the default * in a core release, this could be deprecated and removed after * plugin authors have been given time to update transforms. @@ -189,7 +189,7 @@ const transforms = { // When created by drag and dropping multiple files on an insertion point. Because multiple // files must not be transformed to a gallery when dropped within a gallery there is another transform // within the image block to handle that case. Therefore this transform has to have priority 1 - // set so that it overrrides the image block transformation when mulitple images are dropped outside + // set so that it overrides the image block transformation when multiple images are dropped outside // of a gallery block. type: 'files', priority: 1, diff --git a/packages/block-library/src/gallery/use-get-new-images.js b/packages/block-library/src/gallery/use-get-new-images.js index 056cf1d2ff6ba..b59c97a0ae480 100644 --- a/packages/block-library/src/gallery/use-get-new-images.js +++ b/packages/block-library/src/gallery/use-get-new-images.js @@ -56,7 +56,7 @@ export default function useGetNewImages( images, imageData ) { currentImage.clientId === image.clientId ) && imageData?.find( ( img ) => img.id === image.id ) && - ! image.fromSavedConent + ! image.fromSavedContent ); if ( imagesUpdated || newImages?.length > 0 ) { diff --git a/packages/block-library/src/image/editor.scss b/packages/block-library/src/image/editor.scss index 35b05a063c299..a7386205d9108 100644 --- a/packages/block-library/src/image/editor.scss +++ b/packages/block-library/src/image/editor.scss @@ -32,7 +32,7 @@ figure.wp-block-image:not(.wp-block) { } } -// Shown while image is being uploded but cannot be previewed. +// Shown while image is being uploaded but cannot be previewed. .wp-block-image__placeholder { aspect-ratio: 4 / 3; diff --git a/packages/block-library/src/image/test/edit.native.js b/packages/block-library/src/image/test/edit.native.js index 5cf653321b2be..16497b7bbcb54 100644 --- a/packages/block-library/src/image/test/edit.native.js +++ b/packages/block-library/src/image/test/edit.native.js @@ -62,7 +62,7 @@ Clipboard.getString.mockImplementation( () => clipboardPromise ); beforeAll( () => { registerCoreBlocks(); - // Mock Image.getSize to avoid failed attempt to size non-existant image + // Mock Image.getSize to avoid failed attempt to size non-existent image const getSizeSpy = jest.spyOn( Image, 'getSize' ); getSizeSpy.mockImplementation( ( _url, callback ) => callback( 300, 200 ) ); } ); diff --git a/packages/block-library/src/image/test/transforms.native.js b/packages/block-library/src/image/test/transforms.native.js index f5b7bcdab9758..4b0f2153f67f4 100644 --- a/packages/block-library/src/image/test/transforms.native.js +++ b/packages/block-library/src/image/test/transforms.native.js @@ -15,12 +15,12 @@ const initialHtml = `
Mountain
`; -const tranformsWithInnerBlocks = [ 'Gallery', 'Columns', 'Group' ]; +const transformsWithInnerBlocks = [ 'Gallery', 'Columns', 'Group' ]; const nonMediaTransforms = [ 'File' ]; const blockTransforms = [ 'Cover', 'Media & Text', - ...tranformsWithInnerBlocks, + ...transformsWithInnerBlocks, ...nonMediaTransforms, ]; @@ -31,7 +31,7 @@ describe( `${ block } block transformations`, () => { const screen = await initializeEditor( { initialHtml } ); const newBlock = await transformBlock( screen, block, blockTransform, { isMediaBlock: ! nonMediaTransforms.includes( blockTransform ), - hasInnerBlocks: tranformsWithInnerBlocks.includes( blockTransform ), + hasInnerBlocks: transformsWithInnerBlocks.includes( blockTransform ), } ); expect( newBlock ).toBeVisible(); expect( getEditorHtml() ).toMatchSnapshot(); diff --git a/packages/block-library/src/list-item/edit.native.js b/packages/block-library/src/list-item/edit.native.js index 2367529242ded..d1eb1a9441a0c 100644 --- a/packages/block-library/src/list-item/edit.native.js +++ b/packages/block-library/src/list-item/edit.native.js @@ -54,7 +54,7 @@ export default function ListItemEdit( { getBlockParentsByBlockName, getBlockRootClientId, } = select( blockEditorStore ); - const currentIdentationLevel = getBlockParentsByBlockName( + const currentIndentationLevel = getBlockParentsByBlockName( clientId, 'core/list-item', true @@ -73,7 +73,7 @@ export default function ListItemEdit( { return { blockIndex: currentBlockIndex, hasInnerBlocks: blockWithInnerBlocks, - indentationLevel: currentIdentationLevel, + indentationLevel: currentIndentationLevel, numberOfListItems: totalListItems, ordered: isOrdered, reversed: isReversed, diff --git a/packages/block-library/src/list/test/edit.native.js b/packages/block-library/src/list/test/edit.native.js index 2393f2820cfc2..35678aabe4a69 100644 --- a/packages/block-library/src/list/test/edit.native.js +++ b/packages/block-library/src/list/test/edit.native.js @@ -157,7 +157,7 @@ describe( 'List block', () => { fireEvent.press( listBlock ); await triggerBlockListLayout( listBlock ); - // Select Secont List Item block + // Select Second List Item block const [ listItemBlock ] = screen.getAllByLabelText( /List item Block\. Row 2/ ); diff --git a/packages/block-library/src/media-text/edit.native.js b/packages/block-library/src/media-text/edit.native.js index a5ccb007bdf5c..d2798fce52ce1 100644 --- a/packages/block-library/src/media-text/edit.native.js +++ b/packages/block-library/src/media-text/edit.native.js @@ -218,7 +218,7 @@ class MediaTextEdit extends Component { ? ( containerWidth * mediaWidth ) / 100 - styles.mediaAreaPadding.width : containerWidth; - const aligmentStyles = + const alignmentStyles = styles[ `is-vertically-aligned-${ verticalAlignment || 'center' }` ]; @@ -244,7 +244,7 @@ class MediaTextEdit extends Component { imageFill, focalPoint, isSelected, - aligmentStyles, + alignmentStyles, shouldStack, } } /> diff --git a/packages/block-library/src/media-text/media-container.native.js b/packages/block-library/src/media-text/media-container.native.js index 3bf4fbf25d8f2..f37d9af3ed8be 100644 --- a/packages/block-library/src/media-text/media-container.native.js +++ b/packages/block-library/src/media-text/media-container.native.js @@ -171,7 +171,7 @@ class MediaContainer extends Component { renderImage( params, openMediaOptions ) { const { isUploadInProgress } = this.state; const { - aligmentStyles, + alignmentStyles, focalPoint, imageFill, isMediaSelected, @@ -205,7 +205,7 @@ class MediaContainer extends Component { style={ [ imageFill && styles.imageCropped, styles.mediaImageContainer, - ! isUploadInProgress && aligmentStyles, + ! isUploadInProgress && alignmentStyles, ] } > - + `; -const tranformsWithInnerBlocks = [ 'Columns', 'Group' ]; +const transformsWithInnerBlocks = [ 'Columns', 'Group' ]; const blockTransformsWithImage = [ 'Image', 'Cover', - ...tranformsWithInnerBlocks, + ...transformsWithInnerBlocks, ]; const blockTransformsWithVideo = [ 'Video', 'Cover', - ...tranformsWithInnerBlocks, + ...transformsWithInnerBlocks, ]; setupCoreBlocks(); @@ -52,7 +52,7 @@ describe( `${ block } block transformations`, () => { { isMediaBlock: true, hasInnerBlocks: - tranformsWithInnerBlocks.includes( blockTransform ), + transformsWithInnerBlocks.includes( blockTransform ), } ); expect( newBlock ).toBeVisible(); @@ -88,7 +88,7 @@ describe( `${ block } block transformations`, () => { { isMediaBlock: true, hasInnerBlocks: - tranformsWithInnerBlocks.includes( blockTransform ), + transformsWithInnerBlocks.includes( blockTransform ), } ); expect( newBlock ).toBeVisible(); diff --git a/packages/block-library/src/navigation-link/edit.js b/packages/block-library/src/navigation-link/edit.js index 9e2e171975570..2ac6069325773 100644 --- a/packages/block-library/src/navigation-link/edit.js +++ b/packages/block-library/src/navigation-link/edit.js @@ -156,7 +156,7 @@ function getMissingText( type ) { /* * Warning, this duplicated in * packages/block-library/src/navigation-submenu/edit.js - * Consider reuseing this components for both blocks. + * Consider reusing this components for both blocks. */ function Controls( { attributes, setAttributes, setIsLabelFieldFocused } ) { const { label, url, description, title, rel } = attributes; diff --git a/packages/block-library/src/navigation-link/link-ui.js b/packages/block-library/src/navigation-link/link-ui.js index ee238c71ed28e..feee2fe4b01ce 100644 --- a/packages/block-library/src/navigation-link/link-ui.js +++ b/packages/block-library/src/navigation-link/link-ui.js @@ -96,7 +96,7 @@ function LinkUIBlockInserter( { clientId, onBack, onSelectBlock } ) { LinkControl, `link-ui-block-inserter__title` ); - const dialogDescritionId = useInstanceId( + const dialogDescriptionId = useInstanceId( LinkControl, `link-ui-block-inserter__description` ); @@ -110,13 +110,13 @@ function LinkUIBlockInserter( { clientId, onBack, onSelectBlock } ) { className="link-ui-block-inserter" role="dialog" aria-labelledby={ dialogTitleId } - aria-describedby={ dialogDescritionId } + aria-describedby={ dialogDescriptionId } ref={ focusOnMountRef } >

{ __( 'Add block' ) }

-

+

{ __( 'Choose a block to add to your Navigation.' ) }

@@ -198,7 +198,7 @@ function UnforwardedLinkUI( props, ref ) { LinkUI, `link-ui-link-control__title` ); - const dialogDescritionId = useInstanceId( + const dialogDescriptionId = useInstanceId( LinkUI, `link-ui-link-control__description` ); @@ -219,12 +219,12 @@ function UnforwardedLinkUI( props, ref ) {

{ __( 'Add link' ) }

-

+

{ __( 'Search for and add a link to your Navigation.' ) } diff --git a/packages/block-library/src/navigation-submenu/edit.js b/packages/block-library/src/navigation-submenu/edit.js index acc9510d0d3d3..353f6a7780c4b 100644 --- a/packages/block-library/src/navigation-submenu/edit.js +++ b/packages/block-library/src/navigation-submenu/edit.js @@ -273,7 +273,7 @@ export default function NavigationSubmenuEdit( { // as it shares the CMD+K shortcut. // See https://github.com/WordPress/gutenberg/pull/59845. event.preventDefault(); - // If we don't stop propogation, this event bubbles up to the parent submenu item + // If we don't stop propagation, this event bubbles up to the parent submenu item event.stopPropagation(); setIsLinkOpen( true ); setOpenedBy( ref.current ); diff --git a/packages/block-library/src/paragraph/style.scss b/packages/block-library/src/paragraph/style.scss index 7bd8c77e85de8..59c73fffd9877 100644 --- a/packages/block-library/src/paragraph/style.scss +++ b/packages/block-library/src/paragraph/style.scss @@ -44,7 +44,7 @@ p.has-drop-cap.has-background { } // Use :where to contain the specificity of this rule -// so it's easily overrideable by any theme that targets +// so it's easily overridable by any theme that targets // links using the a element. // For example, this is what global styles does. :where(p.has-text-color:not(.has-link-color)) a { diff --git a/packages/block-library/src/query/edit/inspector-controls/author-control.js b/packages/block-library/src/query/edit/inspector-controls/author-control.js index b27322837e4b9..36f216287b8a3 100644 --- a/packages/block-library/src/query/edit/inspector-controls/author-control.js +++ b/packages/block-library/src/query/edit/inspector-controls/author-control.js @@ -30,7 +30,7 @@ function AuthorControl( { value, onChange } ) { const authorsInfo = getEntitiesInfo( authorsList ); /** * We need to normalize the value because the block operates on a - * comma(`,`) separated string value and `FormTokenFiels` needs an + * comma(`,`) separated string value and `FormTokenFields` needs an * array. */ const normalizedValue = ! value ? [] : value.toString().split( ',' ); diff --git a/packages/block-library/src/query/utils.js b/packages/block-library/src/query/utils.js index e12fdc8d8a7e8..9aabf05bae37c 100644 --- a/packages/block-library/src/query/utils.js +++ b/packages/block-library/src/query/utils.js @@ -81,7 +81,7 @@ export const getValueFromObjectPath = ( object, path ) => { * * @param {Object[]} entities The array of entities. * @param {string} path The path to map a `name` property from the entity. - * @return {IHasNameAndId[]} An array of enitities that now implement the `IHasNameAndId` interface. + * @return {IHasNameAndId[]} An array of entities that now implement the `IHasNameAndId` interface. */ export const mapToIHasNameAndId = ( entities, path ) => { return ( entities || [] ).map( ( entity ) => ( { diff --git a/packages/block-library/src/quote/transforms.js b/packages/block-library/src/quote/transforms.js index c960759691bf1..7ddead03d6b2b 100644 --- a/packages/block-library/src/quote/transforms.js +++ b/packages/block-library/src/quote/transforms.js @@ -67,7 +67,7 @@ const transforms = { isMultiBlock: true, blocks: [ '*' ], isMatch: ( {}, blocks ) => { - // When a single block is selected make the tranformation + // When a single block is selected make the transformation // available only to specific blocks that make sense. if ( blocks.length === 1 ) { return [ diff --git a/packages/block-library/src/separator/deprecated.scss b/packages/block-library/src/separator/deprecated.scss index b133ad1243704..4977122f5a503 100644 --- a/packages/block-library/src/separator/deprecated.scss +++ b/packages/block-library/src/separator/deprecated.scss @@ -1,5 +1,5 @@ .wp-block-separator { - // V1 version of the block expects a default opactiy of 0.4 to be set. + // V1 version of the block expects a default opacity of 0.4 to be set. &.has-css-opacity { opacity: 0.4; } diff --git a/packages/block-library/src/video/edit.native.js b/packages/block-library/src/video/edit.native.js index f6960f0888617..a323d516ff553 100644 --- a/packages/block-library/src/video/edit.native.js +++ b/packages/block-library/src/video/edit.native.js @@ -72,7 +72,7 @@ class VideoEdit extends Component { this.finishMediaUploadWithFailure.bind( this ); this.updateMediaProgress = this.updateMediaProgress.bind( this ); this.onVideoPressed = this.onVideoPressed.bind( this ); - this.onVideoContanerLayout = this.onVideoContanerLayout.bind( this ); + this.onVideoContainerLayout = this.onVideoContainerLayout.bind( this ); this.onFocusCaption = this.onFocusCaption.bind( this ); } @@ -179,7 +179,7 @@ class VideoEdit extends Component { } } - onVideoContanerLayout( event ) { + onVideoContainerLayout( event ) { const { width } = event.nativeEvent.layout; const height = width / VIDEO_ASPECT_RATIO; if ( height !== this.state.videoContainerHeight ) { @@ -321,7 +321,7 @@ class VideoEdit extends Component { return ( { showVideo && ( diff --git a/packages/block-library/src/video/test/transforms.native.js b/packages/block-library/src/video/test/transforms.native.js index 1655c04e2eb21..d873be67a75ec 100644 --- a/packages/block-library/src/video/test/transforms.native.js +++ b/packages/block-library/src/video/test/transforms.native.js @@ -15,12 +15,12 @@ const initialHtml = `

Cloudup video
`; -const tranformsWithInnerBlocks = [ 'Columns', 'Group' ]; +const transformsWithInnerBlocks = [ 'Columns', 'Group' ]; const nonMediaTransforms = [ 'File' ]; const blockTransforms = [ 'Cover', 'Media & Text', - ...tranformsWithInnerBlocks, + ...transformsWithInnerBlocks, ...nonMediaTransforms, ]; @@ -31,7 +31,7 @@ describe( `${ block } block transforms`, () => { const screen = await initializeEditor( { initialHtml } ); const newBlock = await transformBlock( screen, block, blockTransform, { isMediaBlock: ! nonMediaTransforms.includes( blockTransform ), - hasInnerBlocks: tranformsWithInnerBlocks.includes( blockTransform ), + hasInnerBlocks: transformsWithInnerBlocks.includes( blockTransform ), } ); expect( newBlock ).toBeVisible(); expect( getEditorHtml() ).toMatchSnapshot(); diff --git a/packages/blocks/src/api/index.js b/packages/blocks/src/api/index.js index 3ace68be87393..2e2e382e61db3 100644 --- a/packages/blocks/src/api/index.js +++ b/packages/blocks/src/api/index.js @@ -23,7 +23,7 @@ export { // // This has multiple practical implications: when parsing, we can safely dispose // of any block boundary found within a block from the innerHTML property when -// transfering to state. Not doing so would have a compounding effect on memory +// transferring to state. Not doing so would have a compounding effect on memory // and uncertainty over the source of truth. This can be illustrated in how, // given a tree of `n` nested blocks, the entry node would have to contain the // actual content of each block while each subsequent block node in the state @@ -42,7 +42,7 @@ export { // While block transformations account for a specific surface of the API, there // are also raw transformations which handle arbitrary sources not made out of -// blocks but producing block basaed on various heursitics. This includes +// blocks but producing block basaed on various heuristics. This includes // pasting rich text or HTML data. export { pasteHandler, diff --git a/packages/blocks/src/api/parser/index.js b/packages/blocks/src/api/parser/index.js index 14a88f602987a..7230932f0a5fb 100644 --- a/packages/blocks/src/api/parser/index.js +++ b/packages/blocks/src/api/parser/index.js @@ -204,7 +204,7 @@ export function parseRawBlock( rawBlock, options ) { // Try finding the type for known block name. let blockType = getBlockType( normalizedBlock.blockName ); - // If not blockType is found for the specified name, fallback to the "unregistedBlockType". + // If not blockType is found for the specified name, fallback to the "unregisteredBlockType". if ( ! blockType ) { normalizedBlock = createMissingBlockType( normalizedBlock ); blockType = getBlockType( normalizedBlock.blockName ); diff --git a/packages/blocks/src/api/parser/test/apply-block-deprecated-versions.js b/packages/blocks/src/api/parser/test/apply-block-deprecated-versions.js index bea5a4ea30bfd..0d451c142e956 100644 --- a/packages/blocks/src/api/parser/test/apply-block-deprecated-versions.js +++ b/packages/blocks/src/api/parser/test/apply-block-deprecated-versions.js @@ -275,7 +275,7 @@ describe( 'applyBlockDeprecatedVersions', () => { }; // When the block was created, it was given the new default value for the fruit attribute of 'Oranges'. - // This is because unchanged default values are not saved to the comment delimeter attributes. + // This is because unchanged default values are not saved to the comment delimiter attributes. // Validation failed because this block was saved when the old default was 'Bananas' as reflected by the originalContent. const block = deepFreeze( { name: 'core/test-block', diff --git a/packages/blocks/src/api/raw-handling/html-formatting-remover.js b/packages/blocks/src/api/raw-handling/html-formatting-remover.js index 73a8eb5c2e8f6..0e76c8833e8ee 100644 --- a/packages/blocks/src/api/raw-handling/html-formatting-remover.js +++ b/packages/blocks/src/api/raw-handling/html-formatting-remover.js @@ -61,7 +61,7 @@ export default function htmlFormattingRemover( node ) { } // Remove the trailing space if the text element is at the end of a block, - // is succeded by a line break element, or has a space in the next text + // is succeeded by a line break element, or has a space in the next text // node. if ( newData[ newData.length - 1 ] === ' ' ) { const nextSibling = getSibling( node, 'next' ); diff --git a/packages/blocks/src/api/raw-handling/test/html-formatting-remover.js b/packages/blocks/src/api/raw-handling/test/html-formatting-remover.js index 64df51a4f781b..d8619f5e60143 100644 --- a/packages/blocks/src/api/raw-handling/test/html-formatting-remover.js +++ b/packages/blocks/src/api/raw-handling/test/html-formatting-remover.js @@ -120,7 +120,7 @@ describe( 'HTMLFormattingRemover', () => { expect( doc.body.innerHTML ).toEqual( input ); } ); - it( 'should not remove white space if next elemnt has none', () => { + it( 'should not remove white space if next element has none', () => { const input = `
a b
`; const output = '
a b
'; expect( deepFilterHTML( input, [ filter ] ) ).toEqual( output ); diff --git a/packages/blocks/src/api/raw-handling/utils.js b/packages/blocks/src/api/raw-handling/utils.js index 3f4fe32a1af24..abf586532b937 100644 --- a/packages/blocks/src/api/raw-handling/utils.js +++ b/packages/blocks/src/api/raw-handling/utils.js @@ -100,7 +100,7 @@ export function getBlockContentSchemaFromTransforms( transforms, context ) { /** * Gets the block content schema, which is extracted and merged from all - * registered blocks with raw transfroms. + * registered blocks with raw transforms. * * @param {string} context Set to "paste" when in paste context, where the * schema is more strict. diff --git a/packages/blocks/src/api/registration.js b/packages/blocks/src/api/registration.js index 2f4bab2b5f258..2886632e2ab0e 100644 --- a/packages/blocks/src/api/registration.js +++ b/packages/blocks/src/api/registration.js @@ -866,7 +866,7 @@ export const registerBlockBindingsSource = ( source ) => { } if ( label && existingSource?.label && label !== existingSource?.label ) { - warning( 'Block bindings "' + name + '" source label was overriden.' ); + warning( 'Block bindings "' + name + '" source label was overridden.' ); } // Check the `usesContext` property is correct. diff --git a/packages/blocks/src/api/test/registration.js b/packages/blocks/src/api/test/registration.js index 5941415e61fe5..3826f58c2e94b 100644 --- a/packages/blocks/src/api/test/registration.js +++ b/packages/blocks/src/api/test/registration.js @@ -1568,7 +1568,7 @@ describe( 'blocks', () => { label: 'Client label', } ); expect( console ).toHaveWarnedWith( - 'Block bindings "core/testing" source label was overriden.' + 'Block bindings "core/testing" source label was overridden.' ); const source = getBlockBindingsSource( 'core/testing' ); unregisterBlockBindingsSource( 'core/testing' ); diff --git a/packages/blocks/src/api/test/serializer.js b/packages/blocks/src/api/test/serializer.js index 3c1cbd6d1e74f..854e035b27d43 100644 --- a/packages/blocks/src/api/test/serializer.js +++ b/packages/blocks/src/api/test/serializer.js @@ -149,7 +149,7 @@ describe( 'block serializer', () => { expect( attributes ).toEqual( { fruit: 'bananas' } ); } ); - it( 'should ingore local attributes', () => { + it( 'should ignore local attributes', () => { const attributes = getCommentAttributes( { attributes: { diff --git a/packages/blocks/src/api/validation/index.js b/packages/blocks/src/api/validation/index.js index 29b8a08771833..d5ac569e15ff0 100644 --- a/packages/blocks/src/api/validation/index.js +++ b/packages/blocks/src/api/validation/index.js @@ -163,7 +163,7 @@ const TEXT_NORMALIZATIONS = [ identity, getTextWithCollapsedWhitespace ]; * "The ampersand must be followed by one of the names given in the named * character references section, using the same case." * - * Tested aginst "12.5 Named character references": + * Tested against "12.5 Named character references": * * ``` * const references = Array.from( document.querySelectorAll( @@ -222,7 +222,7 @@ export function isValidCharacterReference( text ) { } /** - * Subsitute EntityParser class for `simple-html-tokenizer` which uses the + * Substitute EntityParser class for `simple-html-tokenizer` which uses the * implementation of `decodeEntities` from `html-entities`, in order to avoid * bundling a massive named character reference. * diff --git a/packages/blocks/src/store/private-actions.js b/packages/blocks/src/store/private-actions.js index bfefe56773d77..33f29a93c3483 100644 --- a/packages/blocks/src/store/private-actions.js +++ b/packages/blocks/src/store/private-actions.js @@ -7,7 +7,7 @@ import { processBlockType } from './process-block-type'; /** * Add bootstrapped block type metadata to the store. These metadata usually come from - * the `block.json` file and are either statically boostrapped from the server, or + * the `block.json` file and are either statically bootstrapped from the server, or * passed as the `metadata` parameter to the `registerBlockType` function. * * @param {string} name Block name. diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 23e791645a20c..d6e15f7f6065f 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -88,7 +88,7 @@ - `Tabs`: remove internal custom logic ([#66097](https://github.com/WordPress/gutenberg/pull/66097)). - `Tabs`: add props to control active tab item ([#66223](https://github.com/WordPress/gutenberg/pull/66223)). -- `Tabs`: restore vertical alignent for tabs content ([#66215](https://github.com/WordPress/gutenberg/pull/66215)). +- `Tabs`: restore vertical alignment for tabs content ([#66215](https://github.com/WordPress/gutenberg/pull/66215)). - `Tabs`: fix indicator animation ([#66198](https://github.com/WordPress/gutenberg/pull/66198)). - `Tabs`: update indicator more reactively ([#66207](https://github.com/WordPress/gutenberg/pull/66207)). - `Tabs` and `TabPanel`: Fix arrow key navigation in RTL ([#66201](https://github.com/WordPress/gutenberg/pull/66201)). @@ -424,7 +424,7 @@ - `Tabs`: Vertical Tabs should be 40px min height. ([#63446](https://github.com/WordPress/gutenberg/pull/63446)). - `ColorPicker`: Use `minimal` variant for `SelectControl` ([#63676](https://github.com/WordPress/gutenberg/pull/63676)). - `Tabs`: keep full opacity of focus ring and remove hover styles on disabled tabs ([#63754](https://github.com/WordPress/gutenberg/pull/63754)). -- `Placeholder`: Remove unnecssary `placeholder-style` Sass mixin ([#63885](https://github.com/WordPress/gutenberg/pull/63885)). +- `Placeholder`: Remove unnecessary `placeholder-style` Sass mixin ([#63885](https://github.com/WordPress/gutenberg/pull/63885)). ### Documentation @@ -1491,7 +1491,7 @@ - `TabPanel`: support manual tab activation ([#46004](https://github.com/WordPress/gutenberg/pull/46004)). - `TabPanel`: support disabled prop for tab buttons ([#46471](https://github.com/WordPress/gutenberg/pull/46471)). -- `BaseControl`: Add `useBaseControlProps` hook to help generate id-releated props ([#46170](https://github.com/WordPress/gutenberg/pull/46170)). +- `BaseControl`: Add `useBaseControlProps` hook to help generate id-related props ([#46170](https://github.com/WordPress/gutenberg/pull/46170)). ### Bug Fixes @@ -1514,8 +1514,8 @@ - `Popover`: Prevent unnecessary paint caused by using outline ([#46201](https://github.com/WordPress/gutenberg/pull/46201)). - `PaletteEdit`: Global styles: add onChange actions to color palette items [#45681](https://github.com/WordPress/gutenberg/pull/45681). - Lighten the border color on control components ([#46252](https://github.com/WordPress/gutenberg/pull/46252)). -- `Popover`: Prevent unnecessary paint when scrolling by using transform instead of top/left positionning ([#46187](https://github.com/WordPress/gutenberg/pull/46187)). -- `CircularOptionPicker`: Prevent unecessary paint on hover ([#46197](https://github.com/WordPress/gutenberg/pull/46197)). +- `Popover`: Prevent unnecessary paint when scrolling by using transform instead of top/left positioning ([#46187](https://github.com/WordPress/gutenberg/pull/46187)). +- `CircularOptionPicker`: Prevent unnecessary paint on hover ([#46197](https://github.com/WordPress/gutenberg/pull/46197)). ### Experimental @@ -2361,7 +2361,7 @@ ### Bug Fixes -- Improve accessibility and visibility in `ColorPallete` ([#36925](https://github.com/WordPress/gutenberg/pull/36925)) +- Improve accessibility and visibility in `ColorPalette` ([#36925](https://github.com/WordPress/gutenberg/pull/36925)) ## 19.1.3 (2021-12-06) diff --git a/packages/components/CONTRIBUTING.md b/packages/components/CONTRIBUTING.md index 8af8bbf801edf..d6d56d765f325 100644 --- a/packages/components/CONTRIBUTING.md +++ b/packages/components/CONTRIBUTING.md @@ -411,7 +411,7 @@ export default MyComponent; On the component's main named export, add a JSDoc comment that includes the main description and the example code snippet from the README ([example](https://github.com/WordPress/gutenberg/blob/43d9c82922619c1d1ff6b454f86f75c3157d3de6/packages/components/src/date-time/date-time/index.tsx#L193-L217)). _At the time of writing, the `@example` JSDoc keyword is not recognized by StoryBook's docgen, so please avoid using it_. - ## Styling @@ -550,7 +550,7 @@ export function useCardBody( props ) { // Read any derived registered prop from the Context System in the `CardBody` namespace. // If a `CardBody` component is rendered as a child of a `Card` component, the value of // the `size` prop will be the one set by the parent `Card` component via the Context - // System (unless the prop gets explicitely set on the `CardBody` component). + // System (unless the prop gets explicitly set on the `CardBody` component). const { size = 'medium', ...otherDerivedProps } = useContextSystem( props, 'CardBody' @@ -759,13 +759,13 @@ function NewComponentImplementation( props ) { In case that is not possible (eg. too difficult to reconciliate new and legacy implementations, or impossible to preserve backward compatibility), then the legacy implementation can stay as-is. -In any case, extra attention should be payed to legacy component families made of two or more subcomponents. It is possible, in fact, that the a legacy subcomponent is used as a parent / child of a subcomponent from the new version (this can happen, for example, when Gutenberg allows third party developers to inject React components via Slot/Fill). To avoid incompatibility issues and unexpected behavior, there should be some code in the components warning when the above scenario happens — or even better, aliasing to the correct version of the component. +In any case, extra attention should be paid to legacy component families made of two or more subcomponents. It is possible, in fact, that the a legacy subcomponent is used as a parent / child of a subcomponent from the new version (this can happen, for example, when Gutenberg allows third party developers to inject React components via Slot/Fill). To avoid incompatibility issues and unexpected behavior, there should be some code in the components warning when the above scenario happens — or even better, aliasing to the correct version of the component. ##### Naming When it comes to naming the newly added component, there are two options. -If there is a good reason for it, pick a new name for the component. For example, some legacy components have names that don't correspond to the corrent name of UI widget that they implement (for example, `TabPanel` should be called `Tabs`, and `Modal` should be called `Dialog`). +If there is a good reason for it, pick a new name for the component. For example, some legacy components have names that don't correspond to the current name of UI widget that they implement (for example, `TabPanel` should be called `Tabs`, and `Modal` should be called `Dialog`). Alternatively, version the component name. For example, the new version of `Component` could be called `ComponentV2`. This also applies for namespaced subcomponents (ie. `ComponentV2.SubComponent`). diff --git a/packages/components/README.md b/packages/components/README.md index df92e8db57be4..7fdba5511338f 100644 --- a/packages/components/README.md +++ b/packages/components/README.md @@ -33,7 +33,7 @@ In non-WordPress projects, link to the `build-style/style.css` file directly, it By default, the `Popover` component will render within an extra element appended to the body of the document. -If you want to precisely contol where the popovers render, you will need to use the `Popover.Slot` component. +If you want to precisely control where the popovers render, you will need to use the `Popover.Slot` component. The following example illustrates how you can wrap a component using a `Popover` and have those popovers render to a single location in the DOM. diff --git a/packages/components/src/button/style.scss b/packages/components/src/button/style.scss index 61455a54e26f6..dd0fb425dfa71 100644 --- a/packages/components/src/button/style.scss +++ b/packages/components/src/button/style.scss @@ -377,7 +377,7 @@ fill: currentColor; outline: none; - // 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; diff --git a/packages/components/src/combobox-control/test/index.tsx b/packages/components/src/combobox-control/test/index.tsx index 8f569ed381a84..c9276f495d7b1 100644 --- a/packages/components/src/combobox-control/test/index.tsx +++ b/packages/components/src/combobox-control/test/index.tsx @@ -348,7 +348,7 @@ describe.each( [ expect( option ).toHaveTextContent( matches[ optionIndex ].label ); } ); - // Confirm that the corrent option is selected + // Confirm that the current option is selected await user.keyboard( '{Enter}' ); expect( onChangeSpy ).toHaveBeenCalledTimes( 1 ); diff --git a/packages/components/src/font-size-picker/index.native.js b/packages/components/src/font-size-picker/index.native.js index 5c22cb86175db..90af5d33e2570 100644 --- a/packages/components/src/font-size-picker/index.native.js +++ b/packages/components/src/font-size-picker/index.native.js @@ -126,7 +126,7 @@ function FontSizePicker( { { fontSizes.map( ( item, index ) => { - // Only display a choice that we can currenly select. + // Only display a choice that we can currently select. if ( ! parseFloat( item.sizePx ) ) { return null; } diff --git a/packages/components/src/higher-order/navigate-regions/style.scss b/packages/components/src/higher-order/navigate-regions/style.scss index 5fc1e210dea87..1196acf5b9327 100644 --- a/packages/components/src/higher-order/navigate-regions/style.scss +++ b/packages/components/src/higher-order/navigate-regions/style.scss @@ -8,7 +8,7 @@ $regionOutlineRatio: 2; [role="region"] { position: relative; - // Handles the focus when we programatically send focus to this region + // Handles the focus when we programmatically send focus to this region &.interface-interface-skeleton__content:focus-visible::after { @include region-selection-focus; } @@ -26,7 +26,7 @@ $regionOutlineRatio: 2; // the navigable regions should always have a computed size. For now, we can // fix some edge cases but these CSS rules should be later removed in favor of // a more abstracted approach to make the navigable regions focus style work - // regardles of the CSS used on other components. + // regardless of the CSS used on other components. // Header top bar when Distraction free mode is on. &.is-distraction-free .interface-interface-skeleton__header .edit-post-header, diff --git a/packages/components/src/higher-order/with-focus-return/index.tsx b/packages/components/src/higher-order/with-focus-return/index.tsx index 196226def624c..cfd795188794c 100644 --- a/packages/components/src/higher-order/with-focus-return/index.tsx +++ b/packages/components/src/higher-order/with-focus-return/index.tsx @@ -32,7 +32,7 @@ type Props = { * describing the component and the * focus return characteristics. * - * @return Higher Order Component with the focus restauration behaviour. + * @return Higher Order Component with the focus restoration behaviour. */ export default createHigherOrderComponent( // @ts-expect-error TODO: Reconcile with intended `createHigherOrderComponent` types diff --git a/packages/components/src/menu-group/stories/index.story.tsx b/packages/components/src/menu-group/stories/index.story.tsx index f53cbbf5b7b0a..fd810da82b2c7 100644 --- a/packages/components/src/menu-group/stories/index.story.tsx +++ b/packages/components/src/menu-group/stories/index.story.tsx @@ -76,8 +76,8 @@ const MultiGroupsTemplate: StoryFn< typeof MenuGroup > = ( args ) => { * When other menu items exist above or below a MenuGroup, the group * should have a divider line between it and the adjacent item. */ -export const WithSeperator = MultiGroupsTemplate.bind( {} ); -WithSeperator.args = { +export const WithSeparator = MultiGroupsTemplate.bind( {} ); +WithSeparator.args = { ...Default.args, hideSeparator: false, label: 'Editor', diff --git a/packages/components/src/mobile/bottom-sheet/nav-bar/action-button.native.js b/packages/components/src/mobile/bottom-sheet/nav-bar/action-button.native.js index 6a13bca18e9ef..e8a4a1de07b9f 100644 --- a/packages/components/src/mobile/bottom-sheet/nav-bar/action-button.native.js +++ b/packages/components/src/mobile/bottom-sheet/nav-bar/action-button.native.js @@ -8,7 +8,7 @@ import { View, TouchableWithoutFeedback } from 'react-native'; */ import styles from './styles.scss'; -// Action button component is used by both Back and Apply Button componenets. +// Action button component is used by both Back and Apply Button components. function ActionButton( { onPress, accessibilityLabel, diff --git a/packages/components/src/mobile/utils/get-px-from-css-unit.native.js b/packages/components/src/mobile/utils/get-px-from-css-unit.native.js index 8689de9869609..13812a5e7a6f6 100644 --- a/packages/components/src/mobile/utils/get-px-from-css-unit.native.js +++ b/packages/components/src/mobile/utils/get-px-from-css-unit.native.js @@ -71,7 +71,7 @@ function getFunctionUnitValue( functionUnitValue, options ) { * Take a css function such as min, max, calc, clamp and returns parsedUnit * * How this works for the nested function is that it first replaces the inner function call. - * Then it tackles the outer onces. + * Then it tackles the outer ones. * So for example: min( max(25px, 35px), 40px ) * in the first pass we would replace max(25px, 35px) with 35px. * then we would try to evaluate min( 35px, 40px ) @@ -101,7 +101,7 @@ function parseUnitFunction( cssUnit ) { /** * Return true if we think this is a math expression. * - * @param {string} cssUnit the cssUnit value being evaluted. + * @param {string} cssUnit the cssUnit value being evaluated. * @return {boolean} Whether the cssUnit is a math expression. */ function isMathExpression( cssUnit ) { @@ -115,7 +115,7 @@ function isMathExpression( cssUnit ) { /** * Evaluates the math expression and return a px value. * - * @param {string} cssUnit the cssUnit value being evaluted. + * @param {string} cssUnit the cssUnit value being evaluated. * @return {string} return a converfted value to px. */ function evalMathExpression( cssUnit ) { diff --git a/packages/components/src/modal/test/index.tsx b/packages/components/src/modal/test/index.tsx index a0d0ee2653edb..f1445f7b7642b 100644 --- a/packages/components/src/modal/test/index.tsx +++ b/packages/components/src/modal/test/index.tsx @@ -397,7 +397,7 @@ describe( 'Modal', () => { const [ isAShown, setIsAShown ] = useState( false ); const [ isA1Shown, setIsA1Shown ] = useState( false ); const [ isBShown, setIsBShown ] = useState( false ); - const [ isClassOverriden, setIsClassOverriden ] = useState( false ); + const [ isClassOverridden, setIsClassOverridden ] = useState( false ); useEffect( () => { const toggles: ( e: KeyboardEvent ) => void = ( { key, @@ -413,7 +413,7 @@ describe( 'Modal', () => { return setIsBShown( ( v ) => ! v ); } if ( key === 'c' ) { - return setIsClassOverriden( ( v ) => ! v ); + return setIsClassOverridden( ( v ) => ! v ); } }; document.addEventListener( 'keydown', toggles ); @@ -425,7 +425,7 @@ describe( 'Modal', () => { { isAShown && ( setIsAShown( false ) } > @@ -445,7 +445,7 @@ describe( 'Modal', () => { { isBShown && ( setIsBShown( false ) } > diff --git a/packages/components/src/notice/README.md b/packages/components/src/notice/README.md index 2efb8276cb758..d2249d0aef76c 100644 --- a/packages/components/src/notice/README.md +++ b/packages/components/src/notice/README.md @@ -134,9 +134,9 @@ Whether the notice should be dismissible or not #### `onDismiss` : `() => void` -A deprecated alternative to `onRemove`. This prop is kept for compatibilty reasons but should be avoided. +A deprecated alternative to `onRemove`. This prop is kept for compatibility reasons but should be avoided. -- Requiered: No +- Required: No - Default: `noop` #### `actions`: `Array`. @@ -154,4 +154,4 @@ The default appearance of an action button is inferred based on whether `url` or ## Related components - To create a more prominent message that requires action, use a Modal. -- For low priority, non-interruptive messsages, use Snackbar. +- For low priority, non-interruptive messages, use Snackbar. diff --git a/packages/components/src/notice/types.ts b/packages/components/src/notice/types.ts index 2af7bc22c7ea5..8671f630643a6 100644 --- a/packages/components/src/notice/types.ts +++ b/packages/components/src/notice/types.ts @@ -83,7 +83,7 @@ export type NoticeProps = { isDismissible?: boolean; /** * A deprecated alternative to `onRemove`. This prop is kept for - * compatibilty reasons but should be avoided. + * compatibility reasons but should be avoided. * * @default noop */ diff --git a/packages/components/src/placeholder/style.scss b/packages/components/src/placeholder/style.scss index a38d7d3e3ace8..ab8202c61563d 100644 --- a/packages/components/src/placeholder/style.scss +++ b/packages/components/src/placeholder/style.scss @@ -48,7 +48,7 @@ .block-editor-block-icon { margin-right: $grid-unit-05; 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; diff --git a/packages/components/src/progress-bar/stories/index.story.tsx b/packages/components/src/progress-bar/stories/index.story.tsx index 2f6bb4dbe000f..110dab79124c6 100644 --- a/packages/components/src/progress-bar/stories/index.story.tsx +++ b/packages/components/src/progress-bar/stories/index.story.tsx @@ -43,7 +43,7 @@ const withCustomWidthCustomCSS = ` * You can override the default `width` by passing a custom CSS class via the * `className` prop. * - * This example shows a progress bar with an overriden `width` of `100%` which + * This example shows a progress bar with an overridden `width` of `100%` which * makes it fit all available horizontal space of the parent element. The CSS * class looks like this: * diff --git a/packages/components/src/search-control/index.tsx b/packages/components/src/search-control/index.tsx index 0a1b821a0a079..54ef5f3eb9ca5 100644 --- a/packages/components/src/search-control/index.tsx +++ b/packages/components/src/search-control/index.tsx @@ -86,7 +86,7 @@ function UnforwardedSearchControl( () => ( { BaseControl: { // Overrides the underlying BaseControl `__nextHasNoMarginBottom` via the context system - // to provide backwards compatibile margin for SearchControl. + // to provide backwards compatible margin for SearchControl. // (In a standard InputControl, the BaseControl `__nextHasNoMarginBottom` is always set to true.) _overrides: { __nextHasNoMarginBottom }, __associatedWPComponentName: 'SearchControl', diff --git a/packages/components/src/text-highlight/test/index.tsx b/packages/components/src/text-highlight/test/index.tsx index 2d71f3e98b135..bb2b08a169fbe 100644 --- a/packages/components/src/text-highlight/test/index.tsx +++ b/packages/components/src/text-highlight/test/index.tsx @@ -20,7 +20,7 @@ const defaultText = describe( 'TextHighlight', () => { describe( 'Basic rendering', () => { it.each( [ [ 'Gutenberg' ], [ 'media' ] ] )( - 'should highlight the singular occurance of the text "%s" in the text if it exists', + 'should highlight the singular occurrence of the text "%s" in the text if it exists', ( highlight ) => { const { container } = render( { } ); - it( 'should highlight multiple occurances of the string every time it exists in the text', () => { + it( 'should highlight multiple occurrences of the string every time it exists in the text', () => { const highlight = 'edit'; const { container } = render( @@ -55,7 +55,7 @@ describe( 'TextHighlight', () => { } ); } ); - it( 'should highlight occurances of a string regardless of capitalisation', () => { + it( 'should highlight occurrences of a string regardless of capitalisation', () => { // Note that `The` occurs twice in the default text, once in // lowercase and once capitalized. const highlight = 'The'; diff --git a/packages/components/src/text/README.md b/packages/components/src/text/README.md index 46bd6a5f10de7..ef06f63e950f0 100644 --- a/packages/components/src/text/README.md +++ b/packages/components/src/text/README.md @@ -156,7 +156,7 @@ Adjusts all text line-height based on the typography system. **Type**: `number` -Clamps the text content to the specifiec `numberOfLines`, adding the `ellipsis` at the end. +Clamps the text content to the specific `numberOfLines`, adding the `ellipsis` at the end. ### optimizeReadabilityFor diff --git a/packages/components/src/text/stories/index.story.tsx b/packages/components/src/text/stories/index.story.tsx index 92a2c7eb9be3e..18e2c21946085 100644 --- a/packages/components/src/text/stories/index.story.tsx +++ b/packages/components/src/text/stories/index.story.tsx @@ -49,7 +49,7 @@ Truncate.args = { facilisis dictum tortor, eu tincidunt justo scelerisque tincidunt. Duis semper dui id augue malesuada, ut feugiat nisi aliquam. Vestibulum venenatis diam sem, finibus dictum massa semper in. Nulla -facilisi. Nunc vulputate faucibus diam, in lobortis arcu ornare vel. +facilities. Nunc vulputate faucibus diam, in lobortis arcu ornare vel. In dignissim nunc sed facilisis finibus. Etiam imperdiet mattis arcu, sed rutrum sapien blandit gravida. Aenean sollicitudin neque eget enim blandit, sit amet rutrum leo vehicula. Nunc malesuada @@ -68,7 +68,7 @@ Highlight.args = { facilisis dictum tortor, eu tincidunt justo scelerisque tincidunt. Duis semper dui id augue malesuada, ut feugiat nisi aliquam. Vestibulum venenatis diam sem, finibus dictum massa semper in. Nulla -facilisi. Nunc vulputate faucibus diam, in lobortis arcu ornare vel. +facilities. Nunc vulputate faucibus diam, in lobortis arcu ornare vel. In dignissim nunc sed facilisis finibus. Etiam imperdiet mattis arcu, sed rutrum sapien blandit gravida. Aenean sollicitudin neque eget enim blandit, sit amet rutrum leo vehicula. Nunc malesuada diff --git a/packages/components/src/text/utils.ts b/packages/components/src/text/utils.ts index bcf7bff9c36ab..1c081ce85869d 100644 --- a/packages/components/src/text/utils.ts +++ b/packages/components/src/text/utils.ts @@ -27,7 +27,7 @@ import { createElement } from '@wordpress/element'; * @property {string | Record} [highlightClassName=''] Classname to apply to highlighted text or a Record of classnames to apply to given text (which should be the key). * @property {import('react').AllHTMLAttributes['style']} [highlightStyle={}] Styles to apply to highlighted text. * @property {keyof JSX.IntrinsicElements} [highlightTag='mark'] Tag to use for the highlighted text. - * @property {import('highlight-words-core').FindAllArgs['sanitize']} [sanitize] Custom `santize` function to pass to `highlight-words-core`. + * @property {import('highlight-words-core').FindAllArgs['sanitize']} [sanitize] Custom `sanitize` function to pass to `highlight-words-core`. * @property {string[]} [searchWords=[]] Words to search for and highlight. * @property {string} [unhighlightClassName=''] Classname to apply to unhighlighted text. * @property {import('react').AllHTMLAttributes['style']} [unhighlightStyle] Style to apply to unhighlighted text. diff --git a/packages/compose/src/hooks/use-async-list/index.ts b/packages/compose/src/hooks/use-async-list/index.ts index ff53bc7b9eb99..bc085dd49b818 100644 --- a/packages/compose/src/hooks/use-async-list/index.ts +++ b/packages/compose/src/hooks/use-async-list/index.ts @@ -13,7 +13,7 @@ type AsyncListConfig = { * * @param list New array. * @param state Current state. - * @return First items present iin state. + * @return First items present in state. */ function getFirstItemsPresentInState< T >( list: T[], state: T[] ): T[] { const firstItems = []; diff --git a/packages/compose/src/hooks/use-merge-refs/test/index.js b/packages/compose/src/hooks/use-merge-refs/test/index.js index 4c883ff97c608..3744dbf9f6b16 100644 --- a/packages/compose/src/hooks/use-merge-refs/test/index.js +++ b/packages/compose/src/hooks/use-merge-refs/test/index.js @@ -152,7 +152,7 @@ describe( 'useMergeRefs', () => { rerender( ); - // After a second render with a dependency change, expect the inital + // After a second render with a dependency change, expect the initial // callback function to be called with null and the new callback // function to be called with the original node. Note that for callback // one no dependencies have changed. @@ -235,7 +235,7 @@ describe( 'useMergeRefs', () => { rerender( ); - // After a third render with a dependency change, expect the inital + // After a third render with a dependency change, expect the initial // callback function to be called with null and the new callback // function to be called with the new element. Note that for callback // one no dependencies have changed. diff --git a/packages/compose/src/hooks/use-warn-on-change/index.js b/packages/compose/src/hooks/use-warn-on-change/index.js index 2da51db01d7b6..e8a865902d70b 100644 --- a/packages/compose/src/hooks/use-warn-on-change/index.js +++ b/packages/compose/src/hooks/use-warn-on-change/index.js @@ -3,7 +3,7 @@ */ import usePrevious from '../use-previous'; -// Disable reason: Object and object are distinctly different types in TypeScript and we mean the lowercase object in thise case +// Disable reason: Object and object are distinctly different types in TypeScript and we mean the lowercase object in this case // but eslint wants to force us to use `Object`. See https://stackoverflow.com/questions/49464634/difference-between-object-and-object-in-typescript /* eslint-disable jsdoc/check-types */ /** diff --git a/packages/core-data/README.md b/packages/core-data/README.md index eb6980cdd4eea..2b518360cd7ce 100644 --- a/packages/core-data/README.md +++ b/packages/core-data/README.md @@ -288,7 +288,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 diff --git a/packages/core-data/src/actions.js b/packages/core-data/src/actions.js index 13cbba39e1176..275cfccdb7823 100644 --- a/packages/core-data/src/actions.js +++ b/packages/core-data/src/actions.js @@ -450,7 +450,7 @@ export const undo = }; /** - * Action triggered to redo the last undoed + * Action triggered to redo the last undone * edit to an entity record, if any. */ export const redo = diff --git a/packages/core-data/src/batch/create-batch.js b/packages/core-data/src/batch/create-batch.js index dd2c3b74188c1..73e07b140b652 100644 --- a/packages/core-data/src/batch/create-batch.js +++ b/packages/core-data/src/batch/create-batch.js @@ -48,7 +48,7 @@ export default function createBatch( processor = defaultProcessor ) { * rejected when the input is processed by `batch.run()`. * * You may also pass a thunk which allows inputs to be added - * asychronously. + * asynchronously. * * ``` * // Both are allowed: diff --git a/packages/core-data/src/hooks/use-entity-block-editor.js b/packages/core-data/src/hooks/use-entity-block-editor.js index df213898659e7..99171c6e15c69 100644 --- a/packages/core-data/src/hooks/use-entity-block-editor.js +++ b/packages/core-data/src/hooks/use-entity-block-editor.js @@ -69,7 +69,7 @@ export default function useEntityBlockEditor( kind, name, { id: _id } = {} ) { } // If there's an edit, cache the parsed blocks by the edit. - // If not, cache by the original enity record. + // If not, cache by the original entity record. const edits = getEntityRecordEdits( kind, name, id ); const isUnedited = ! edits || ! Object.keys( edits ).length; const cackeKey = isUnedited ? getEntityRecord( kind, name, id ) : edits; diff --git a/packages/core-data/src/resolvers.js b/packages/core-data/src/resolvers.js index a35403c049346..8b382459413c6 100644 --- a/packages/core-data/src/resolvers.js +++ b/packages/core-data/src/resolvers.js @@ -105,7 +105,7 @@ export const getEntityRecord = } ); - // Boostraps the edited document as well (and load from peers). + // Bootstraps the edited document as well (and load from peers). await getSyncProvider().bootstrap( entityConfig.syncObjectType + '--edit', objectId, diff --git a/packages/create-block/CHANGELOG.md b/packages/create-block/CHANGELOG.md index 075386562f384..89cdab01bd942 100644 --- a/packages/create-block/CHANGELOG.md +++ b/packages/create-block/CHANGELOG.md @@ -460,7 +460,7 @@ ### Internal -- Relocated npm packge from `create-wordpress-block` to `@wordpress/create-block` ([#19773](https://github.com/WordPress/gutenberg/pull/19773)). +- Relocated npm package from `create-wordpress-block` to `@wordpress/create-block` ([#19773](https://github.com/WordPress/gutenberg/pull/19773)). ## 0.5.0 (2020-01-08) diff --git a/packages/data/src/components/with-dispatch/test/index.js b/packages/data/src/components/with-dispatch/test/index.js index 6bcda99ba9c0f..a58b4af3c5588 100644 --- a/packages/data/src/components/with-dispatch/test/index.js +++ b/packages/data/src/components/with-dispatch/test/index.js @@ -77,7 +77,7 @@ describe( 'withDispatch', () => { ); // Function value reference should not have changed in props update. - // The spy method is only called during inital render. + // The spy method is only called during initial render. expect( ButtonSpy ).toHaveBeenCalledTimes( 1 ); await user.click( screen.getByRole( 'button' ) ); diff --git a/packages/data/src/redux-store/index.js b/packages/data/src/redux-store/index.js index 979c3127b9ed5..6c20c8cb2bb3e 100644 --- a/packages/data/src/redux-store/index.js +++ b/packages/data/src/redux-store/index.js @@ -250,7 +250,7 @@ export default function createReduxStore( key, options ) { }; // Expose normalization method on the bound selector - // in order that it can be called when fullfilling + // in order that it can be called when fulfilling // the resolver. boundSelector.__unstableNormalizeArgs = selector.__unstableNormalizeArgs; diff --git a/packages/data/src/redux-store/test/index.js b/packages/data/src/redux-store/test/index.js index 1251051c4c9d9..1365ceab0d5a8 100644 --- a/packages/data/src/redux-store/test/index.js +++ b/packages/data/src/redux-store/test/index.js @@ -311,7 +311,7 @@ describe( 'normalizing args', () => { // Needs to be called twice: // 1. When the selector is called. - // 2. When the resolver is fullfilled. + // 2. When the resolver is fulfilled. expect( normalizingFunction ).toHaveBeenCalledTimes( 2 ); } ); diff --git a/packages/dataviews/README.md b/packages/dataviews/README.md index 92426bf1e1f83..73b053fa43bb3 100644 --- a/packages/dataviews/README.md +++ b/packages/dataviews/README.md @@ -1,6 +1,6 @@ # The `@wordpress/dataviews` package -The DataViews package offers two React components and a few utilites to work with a list of data: +The DataViews package offers two React components and a few utilities to work with a list of data: - `DataViews`: to render the dataset using different types of layouts (table, grid, list) and interaction capabilities (search, filters, sorting, etc.). - `DataForm`: to edit the items of the dataset. @@ -66,7 +66,7 @@ const data = [ ]; ``` -The data can come from anywhere, from a static JSON file to a dynamic source like a HTTP Request. It's the consumer's responsiblity to query the data source appropiately and update the dataset based on the user's choices for sorting, filtering, etc. +The data can come from anywhere, from a static JSON file to a dynamic source like a HTTP Request. It's the consumer's responsibility to query the data source appropriately and update the dataset based on the user's choices for sorting, filtering, etc. Each record should have an `id` that identifies them uniquely. If they don't, the consumer should provide the `getItemId` property to `DataViews`: a function that returns an unique identifier for the record. @@ -710,7 +710,7 @@ Example: Field type. One of `text`, `integer`, `datetime`. -If a field declares a `type`, it gets default implementations for the `sort`, `isValid`, and `Edit` functions. They will overriden if the field provides its own. +If a field declares a `type`, it gets default implementations for the `sort`, `isValid`, and `Edit` functions. They will overridden if the field provides its own. - Type: `string`. - Optional. diff --git a/packages/dataviews/src/dataviews-layouts/table/index.tsx b/packages/dataviews/src/dataviews-layouts/table/index.tsx index 7f93a4c14a7dd..2f315e49bad08 100644 --- a/packages/dataviews/src/dataviews-layouts/table/index.tsx +++ b/packages/dataviews/src/dataviews-layouts/table/index.tsx @@ -235,7 +235,7 @@ function TableRow< Item >( { ) } { columns.map( ( column: string ) => { - // Explicits picks the supported styles. + // Explicit picks the supported styles. const { width, maxWidth, minWidth } = view.layout?.styles?.[ column ] ?? {}; @@ -362,7 +362,7 @@ function ViewTable< Item >( { ) } { columns.map( ( column, index ) => { - // Explicits picks the supported styles. + // Explicit picks the supported styles. const { width, maxWidth, minWidth } = view.layout?.styles?.[ column ] ?? {}; return ( diff --git a/packages/dataviews/src/field-types/integer.tsx b/packages/dataviews/src/field-types/integer.tsx index f57c8e382db81..2b2163ef6020e 100644 --- a/packages/dataviews/src/field-types/integer.tsx +++ b/packages/dataviews/src/field-types/integer.tsx @@ -8,7 +8,7 @@ function sort( a: any, b: any, direction: SortDirection ) { } function isValid( value: any, context?: ValidationContext ) { - // TODO: this implicitely means the value is required. + // TODO: this implicitly means the value is required. if ( value === '' ) { return false; } diff --git a/packages/date/src/test/index.js b/packages/date/src/test/index.js index 3c52aae1fbd0d..082679bbb8747 100644 --- a/packages/date/src/test/index.js +++ b/packages/date/src/test/index.js @@ -608,7 +608,7 @@ describe( 'Moment.js Localization', () => { }, } ); - // Get the freshly changed setings. + // Get the freshly changed settings. const newSettings = getSettings(); // Test the unchanged values. diff --git a/packages/docgen/README.md b/packages/docgen/README.md index 4f60d0a3c7a26..6226eea9b7329 100644 --- a/packages/docgen/README.md +++ b/packages/docgen/README.md @@ -6,7 +6,7 @@ Some characteristics: - If the export statement doesn't contain any JSDoc, it'll look up for JSDoc up to the declaration. - It can resolve relative dependencies, either files or directories. For example, `import default from './dependency'` will find `dependency.js` or `dependency/index.js` -- For TypeScript support, all types must be explicity annotated as the TypeScript Babel plugin is unable to consume inferred types (it does not run the TS compiler, after all—it merely parses TypeScript). For example, all function return types must be explicitly annotated if they are to be documented by `docgen`. +- For TypeScript support, all types must be explicitly annotated as the TypeScript Babel plugin is unable to consume inferred types (it does not run the TS compiler, after all—it merely parses TypeScript). For example, all function return types must be explicitly annotated if they are to be documented by `docgen`. ## Installation @@ -169,12 +169,12 @@ with `./count/index.js` contents being: ````js /** - * Substracts two numbers. + * Subtracts two numbers. * * @example * * ```js - * const result = substraction( 5, 2 ); + * const result = subtraction( 5, 2 ); * console.log( result ); // Will log 3 * ``` * @@ -182,7 +182,7 @@ with `./count/index.js` contents being: * @param {number} term2 Second number. * @return {number} The result of subtracting the two numbers. */ -export function substraction( term1, term2 ) { +export function subtraction( term1, term2 ) { return term1 - term2; } @@ -233,16 +233,16 @@ console.log( result ); // Will log 7 `number` The result of adding the two numbers. -## substraction +## subtraction [example-module.js#L1-L1](example-module.js#L1-L1) -Substracts two numbers. +Subtracts two numbers. **Usage** ```js -const result = substraction( 5, 2 ); +const result = subtraction( 5, 2 ); console.log( result ); // Will log 3 ``` diff --git a/packages/docgen/lib/get-type-annotation.js b/packages/docgen/lib/get-type-annotation.js index 5e72724952f29..1dc9eee02dc62 100644 --- a/packages/docgen/lib/get-type-annotation.js +++ b/packages/docgen/lib/get-type-annotation.js @@ -394,7 +394,7 @@ function getTypeAnnotation( typeAnnotation ) { * with their descriptions in the JSDoc comments. * * If we find more wrapper functions on selectors we should add them below following the - * example of `createSelector` and `createRegsitrySelector`. + * example of `createSelector` and `createRegistrySelector`. * * @param {ASTNode} token Contains either a function or a call to a function-wrapper. * diff --git a/packages/docgen/lib/index.js b/packages/docgen/lib/index.js index 86c230f1e901a..4edeeb16c9887 100644 --- a/packages/docgen/lib/index.js +++ b/packages/docgen/lib/index.js @@ -133,7 +133,7 @@ module.exports = ( sourceFile, options ) => { return true; } ); - // Ouput. + // Output. if ( result === undefined ) { process.stdout.write( '\nFile was processed, but contained no ES6 module exports:' diff --git a/packages/e2e-test-utils/CHANGELOG.md b/packages/e2e-test-utils/CHANGELOG.md index 1974f72e3fb21..8c5aa4d1b5589 100644 --- a/packages/e2e-test-utils/CHANGELOG.md +++ b/packages/e2e-test-utils/CHANGELOG.md @@ -205,7 +205,7 @@ ### Enhancements -- `visitAdminPage` will now throw an error (emit a test failure) when there are unexpected errors on hte page. +- `visitAdminPage` will now throw an error (emit a test failure) when there are unexpected errors on the page. ### New Features diff --git a/packages/e2e-test-utils/README.md b/packages/e2e-test-utils/README.md index 196768b0e2487..4ec4a0d405972 100644 --- a/packages/e2e-test-utils/README.md +++ b/packages/e2e-test-utils/README.md @@ -414,7 +414,7 @@ _Parameters_ _Returns_ -- `Promise`: all the blocks anchor nodes matching the lable in the ListView. +- `Promise`: all the blocks anchor nodes matching the label in the ListView. ### getOption @@ -921,7 +921,7 @@ _Related_ _Parameters_ - _store_ `string`: Store to query e.g: core/editor, core/blocks... -- _selector_ `string`: Selector to exectute e.g: getBlocks. +- _selector_ `string`: Selector to execute e.g: getBlocks. - _parameters_ `...Object`: Parameters to pass to the selector. _Returns_ diff --git a/packages/e2e-test-utils/src/get-list-view-blocks.js b/packages/e2e-test-utils/src/get-list-view-blocks.js index 8b52953b58290..aed9501296a4f 100644 --- a/packages/e2e-test-utils/src/get-list-view-blocks.js +++ b/packages/e2e-test-utils/src/get-list-view-blocks.js @@ -2,7 +2,7 @@ * Gets all block anchor nodes in the list view that match a given block name label. * * @param {string} blockLabel the label of the block as displayed in the ListView. - * @return {Promise} all the blocks anchor nodes matching the lable in the ListView. + * @return {Promise} all the blocks anchor nodes matching the label in the ListView. */ export async function getListViewBlocks( blockLabel ) { return page.$x( diff --git a/packages/e2e-test-utils/src/wp-data-select.js b/packages/e2e-test-utils/src/wp-data-select.js index 65e382730292c..9313115c20d2e 100644 --- a/packages/e2e-test-utils/src/wp-data-select.js +++ b/packages/e2e-test-utils/src/wp-data-select.js @@ -13,7 +13,7 @@ * @see https://github.com/WordPress/gutenberg/pull/31199 * * @param {string} store Store to query e.g: core/editor, core/blocks... - * @param {string} selector Selector to exectute e.g: getBlocks. + * @param {string} selector Selector to execute e.g: getBlocks. * @param {...Object} parameters Parameters to pass to the selector. * * @return {Promise} Result of querying. diff --git a/packages/e2e-tests/README.md b/packages/e2e-tests/README.md index 75283a3d9ecc8..2f0aa79434a55 100644 --- a/packages/e2e-tests/README.md +++ b/packages/e2e-tests/README.md @@ -78,7 +78,7 @@ Debugging in a Chrome browser can be replaced with `vscode`'s debugger by adding } ``` -This will run jest, targetting the spec file currently open in the editor. `vscode`'s debugger can now be used to add breakpoints and inspect tests as you would in Chrome DevTools. +This will run jest, targeting the spec file currently open in the editor. `vscode`'s debugger can now be used to add breakpoints and inspect tests as you would in Chrome DevTools. **Note**: This package requires Node.js version with long-term support status (check [Active LTS or Maintenance LTS releases](https://nodejs.org/en/about/previous-releases)). It is not compatible with older versions. diff --git a/packages/e2e-tests/plugins/cpt-locking.php b/packages/e2e-tests/plugins/cpt-locking.php index 5ac97c9cfae52..310c1df91580e 100644 --- a/packages/e2e-tests/plugins/cpt-locking.php +++ b/packages/e2e-tests/plugins/cpt-locking.php @@ -8,7 +8,7 @@ */ /** - * Registers CPT's with 3 diffferent types of locking. + * Registers CPT's with 3 different types of locking. */ function gutenberg_test_cpt_locking() { $template = array( diff --git a/packages/e2e-tests/plugins/delete-installed-fonts.php b/packages/e2e-tests/plugins/delete-installed-fonts.php index 871d19f82e635..3ef01406f854b 100644 --- a/packages/e2e-tests/plugins/delete-installed-fonts.php +++ b/packages/e2e-tests/plugins/delete-installed-fonts.php @@ -32,7 +32,7 @@ function gutenberg_filter_e2e_font_dir( $font_dir ) { /** * Deletes all user installed fonts, associated font files, the fonts directory, and user global styles typography - * setings for the current theme so that we can test uploading/installing fonts in a clean environment. + * settings for the current theme so that we can test uploading/installing fonts in a clean environment. */ function gutenberg_delete_installed_fonts() { $font_family_ids = new WP_Query( diff --git a/packages/edit-post/src/components/layout/index.js b/packages/edit-post/src/components/layout/index.js index 5dcbfa2c82cea..34c28b920bf2d 100644 --- a/packages/edit-post/src/components/layout/index.js +++ b/packages/edit-post/src/components/layout/index.js @@ -171,7 +171,7 @@ function MetaBoxesMain( { isLegacy } ) { const [ { min, max }, setHeightConstraints ] = useState( () => ( {} ) ); // Keeps the resizable area’s size constraints updated taking into account // editor notices. The constraints are also used to derive the value for the - // aria-valuenow attribute on the seperator. + // aria-valuenow attribute on the separator. const effectSizeConstraints = useRefEffect( ( node ) => { const container = node.closest( '.interface-interface-skeleton__content' diff --git a/packages/edit-site/src/components/add-new-template/utils.js b/packages/edit-site/src/components/add-new-template/utils.js index e3e2faf945792..bc825f8b1a56e 100644 --- a/packages/edit-site/src/components/add-new-template/utils.js +++ b/packages/edit-site/src/components/add-new-template/utils.js @@ -37,7 +37,7 @@ const getValueFromObjectPath = ( object, path ) => { * * @param {Object[]} entities The array of entities. * @param {string} path The path to map a `name` property from the entity. - * @return {IHasNameAndId[]} An array of enitities that now implement the `IHasNameAndId` interface. + * @return {IHasNameAndId[]} An array of entities that now implement the `IHasNameAndId` interface. */ export const mapToIHasNameAndId = ( entities, path ) => { return ( entities || [] ).map( ( entity ) => ( { diff --git a/packages/edit-site/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js b/packages/edit-site/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js index 7e98b77964f7f..a2dc7e63d14a9 100644 --- a/packages/edit-site/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js +++ b/packages/edit-site/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js @@ -201,7 +201,7 @@ describe( 'formatFontFaceName', () => { ); } ); - it( 'should ouput the font face name with quotes on Firefox', () => { + it( 'should output the font face name with quotes on Firefox', () => { const mockUserAgent = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0'; diff --git a/packages/edit-site/src/components/global-styles/screen-root.js b/packages/edit-site/src/components/global-styles/screen-root.js index ffa85b046ead7..ce9e4d08daf0a 100644 --- a/packages/edit-site/src/components/global-styles/screen-root.js +++ b/packages/edit-site/src/components/global-styles/screen-root.js @@ -93,7 +93,7 @@ function ScreenRoot() { paddingTop={ 2 } /* * 13px matches the text inset of the NavigationButton (12px padding, plus the width of the button's border). - * This is an ad hoc override for this instance and the Addtional CSS option below. Other options for matching the + * This is an ad hoc override for this instance and the Additional CSS option below. Other options for matching the * the nav button inset should be looked at before reusing further. */ paddingX="13px" diff --git a/packages/edit-site/src/components/resizable-frame/index.js b/packages/edit-site/src/components/resizable-frame/index.js index 95ccfe4fdd966..d0132be57aae0 100644 --- a/packages/edit-site/src/components/resizable-frame/index.js +++ b/packages/edit-site/src/components/resizable-frame/index.js @@ -83,7 +83,7 @@ function ResizableFrame( { setIsOversized, isReady, children, - /** The default (unresized) width/height of the frame, based on the space availalbe in the viewport. */ + /** The default (unresized) width/height of the frame, based on the space available in the viewport. */ defaultSize, innerContentStyle, } ) { diff --git a/packages/editor/src/bindings/pattern-overrides.js b/packages/editor/src/bindings/pattern-overrides.js index baa1f72f47694..57f6714e8b9f4 100644 --- a/packages/editor/src/bindings/pattern-overrides.js +++ b/packages/editor/src/bindings/pattern-overrides.js @@ -19,7 +19,7 @@ export default { currentBlockAttributes?.metadata?.name ]?.[ attributeName ]; - // If it has not been overriden, return the original value. + // If it has not been overridden, return the original value. // Check undefined because empty string is a valid value. if ( overridableValue === undefined ) { overridesValues[ attributeName ] = diff --git a/packages/editor/src/components/autocompleters/style.scss b/packages/editor/src/components/autocompleters/style.scss index ca3159ee4ac82..295d63b8e57c7 100644 --- a/packages/editor/src/components/autocompleters/style.scss +++ b/packages/editor/src/components/autocompleters/style.scss @@ -11,7 +11,7 @@ flex-grow: 0; flex-shrink: 0; max-width: none; // we must override the gutenberg default of 100% - width: 24px; // avoid jarring resize by seting the size upfront + width: 24px; // avoid jarring resize by setting the size upfront height: 24px; } .editor-autocompleters__user-name { diff --git a/packages/editor/src/components/header/index.js b/packages/editor/src/components/header/index.js index 2a5629b080caf..5078661a7da2c 100644 --- a/packages/editor/src/components/header/index.js +++ b/packages/editor/src/components/header/index.js @@ -101,7 +101,7 @@ function Header( { ! isTooNarrowForDocumentBar; const hasBackButton = useHasBackButton(); /* - * The edit-post-header classname is only kept for backward compatability + * The edit-post-header classname is only kept for backward compatibility * as some plugins might be relying on its presence. */ return ( diff --git a/packages/editor/src/components/post-excerpt/index.js b/packages/editor/src/components/post-excerpt/index.js index 2555922f4e45a..1a64bd53bab9b 100644 --- a/packages/editor/src/components/post-excerpt/index.js +++ b/packages/editor/src/components/post-excerpt/index.js @@ -32,7 +32,7 @@ export default function PostExcerpt( { select( editorStore ); const postType = getCurrentPostType(); // This special case is unfortunate, but the REST API of wp_template and wp_template_part - // support the excerpt field throught the "description" field rather than "excerpt". + // support the excerpt field through the "description" field rather than "excerpt". const _usedAttribute = [ 'wp_template', 'wp_template_part', diff --git a/packages/editor/src/components/post-publish-button/index.js b/packages/editor/src/components/post-publish-button/index.js index 71e18a4d6a9c8..a01571c519ebf 100644 --- a/packages/editor/src/components/post-publish-button/index.js +++ b/packages/editor/src/components/post-publish-button/index.js @@ -114,10 +114,10 @@ export class PostPublishButton extends Component { ( ! isPublishable && ! forceIsDirty ) ) && ( ! hasNonPostEntityChanges || isSavingNonPostEntityChanges ); - // If the new status has not changed explicitely, we derive it from + // If the new status has not changed explicitly, we derive it from // other factors, like having a publish action, etc.. We need to preserve // this because it affects when to show the pre and post publish panels. - // If it has changed though explicitely, we need to respect that. + // If it has changed though explicitly, we need to respect that. let publishStatus = 'publish'; if ( postStatusHasChanged ) { publishStatus = postStatus; diff --git a/packages/editor/src/components/post-publish-button/post-publish-button-or-toggle.js b/packages/editor/src/components/post-publish-button/post-publish-button-or-toggle.js index bf742bef1429b..794cfb2a7e085 100644 --- a/packages/editor/src/components/post-publish-button/post-publish-button-or-toggle.js +++ b/packages/editor/src/components/post-publish-button/post-publish-button-or-toggle.js @@ -36,7 +36,7 @@ export function PostPublishButtonOrToggle( { * for a particular role (see https://wordpress.org/documentation/article/post-status/): * * - is published - * - post status has changed explicitely to something different than 'future' or 'publish' + * - post status has changed explicitly to something different than 'future' or 'publish' * - is scheduled to be published * - is pending and can't be published (but only for viewports >= medium). * Originally, we considered showing a button for pending posts that couldn't be published diff --git a/packages/editor/src/components/post-schedule/index.js b/packages/editor/src/components/post-schedule/index.js index c9b017bcfa80d..e324e40896d37 100644 --- a/packages/editor/src/components/post-schedule/index.js +++ b/packages/editor/src/components/post-schedule/index.js @@ -59,7 +59,7 @@ export function PrivatePostSchedule( { startOfMonth( new Date( postDate ) ) ); - // Pick up published and schduled site posts. + // Pick up published and scheduled site posts. const eventsByPostType = useSelect( ( select ) => select( coreStore ).getEntityRecords( 'postType', postType, { diff --git a/packages/editor/src/components/sidebar/post-summary.js b/packages/editor/src/components/sidebar/post-summary.js index 3539f7ba964ec..58e9e3e6ee61b 100644 --- a/packages/editor/src/components/sidebar/post-summary.js +++ b/packages/editor/src/components/sidebar/post-summary.js @@ -38,7 +38,7 @@ const PANEL_NAME = 'post-status'; export default function PostSummary( { onActionPerformed } ) { const { isRemovedPostStatusPanel, postType, postId } = useSelect( ( select ) => { - // We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do + // We use isEditorPanelRemoved to hide the panel if it was programmatically removed. We do // not use isEditorPanelEnabled since this panel should not be disabled through the UI. const { isEditorPanelRemoved, diff --git a/packages/editor/src/components/visual-editor/edit-template-blocks-notification.js b/packages/editor/src/components/visual-editor/edit-template-blocks-notification.js index bacf1beb1abec..b3f1f0dfc4bbf 100644 --- a/packages/editor/src/components/visual-editor/edit-template-blocks-notification.js +++ b/packages/editor/src/components/visual-editor/edit-template-blocks-notification.js @@ -19,7 +19,7 @@ import { store as editorStore } from '../../store'; * user is focusing on editing page content and clicks on a disabled template * block. * - Displays a 'Edit your template to edit this block' dialog when the user - * is focusing on editing page conetnt and double clicks on a disabled + * is focusing on editing page content and double clicks on a disabled * template block. * * @param {Object} props diff --git a/packages/editor/src/components/visual-editor/index.js b/packages/editor/src/components/visual-editor/index.js index 795a4f983f153..4d9c14644d91d 100644 --- a/packages/editor/src/components/visual-editor/index.js +++ b/packages/editor/src/components/visual-editor/index.js @@ -337,7 +337,7 @@ function VisualEditor( { ! isPreview && // Disable resizing in mobile viewport. ! isMobileViewport && - // Dsiable resizing in zoomed-out mode. + // Disable resizing in zoomed-out mode. ! isZoomedOut; const iframeStyles = useMemo( () => { @@ -433,7 +433,7 @@ function VisualEditor( {
status === 'fulfilled' ) ) { let successMessage; diff --git a/packages/element/CHANGELOG.md b/packages/element/CHANGELOG.md index 00eccb7e5ec53..0a5d2f9075764 100644 --- a/packages/element/CHANGELOG.md +++ b/packages/element/CHANGELOG.md @@ -243,7 +243,7 @@ ### New Features -- Added `lazy` feautre (see: https://reactjs.org/docs/react-api.html#reactlazy). +- Added `lazy` feature (see: https://reactjs.org/docs/react-api.html#reactlazy). - Added `Suspense` component (see: https://reactjs.org/docs/react-api.html#reactsuspense). ## 2.3.0 (2019-03-06) diff --git a/packages/element/README.md b/packages/element/README.md index 86f3a6214df0e..eeed217ab6e90 100755 --- a/packages/element/README.md +++ b/packages/element/README.md @@ -241,7 +241,7 @@ _Related_ ### Platform -Component used to detect the current Platform being used. Use Platform.OS === 'web' to detect if running on web enviroment. +Component used to detect the current Platform being used. Use Platform.OS === 'web' to detect if running on web environment. This is the same concept as the React Native implementation. diff --git a/packages/element/src/platform.js b/packages/element/src/platform.js index 841cd06e4cabb..37960103b7546 100644 --- a/packages/element/src/platform.js +++ b/packages/element/src/platform.js @@ -13,7 +13,7 @@ const Platform = { }; /** * Component used to detect the current Platform being used. - * Use Platform.OS === 'web' to detect if running on web enviroment. + * Use Platform.OS === 'web' to detect if running on web environment. * * This is the same concept as the React Native implementation. * diff --git a/packages/env/CHANGELOG.md b/packages/env/CHANGELOG.md index 181adb034b6b1..31e16a1389556 100644 --- a/packages/env/CHANGELOG.md +++ b/packages/env/CHANGELOG.md @@ -300,7 +300,7 @@ ### Breaking Changes -- `wp-env start` is now the only command which writes to the docker configuration files. Previously, running any command would also parse the config and then write it to the correct location. Now, other commands still parse the config, but they will not overwrite the confugiration which was set by wp-env start. This allows parameters to be passed to wp-env start which can affect the configuration. +- `wp-env start` is now the only command which writes to the docker configuration files. Previously, running any command would also parse the config and then write it to the correct location. Now, other commands still parse the config, but they will not overwrite the configuration which was set by wp-env start. This allows parameters to be passed to wp-env start which can affect the configuration. ### Enhancements diff --git a/packages/env/lib/config/parse-config.js b/packages/env/lib/config/parse-config.js index 1fc7e94925149..e94b7a628d755 100644 --- a/packages/env/lib/config/parse-config.js +++ b/packages/env/lib/config/parse-config.js @@ -140,7 +140,7 @@ async function parseConfig( configDirectoryPath, cacheDirectoryPath ) { } ); // Users can provide overrides in environment - // variables that supercede all other options. + // variables that supersede all other options. const environmentVarOverrides = getEnvironmentVarOverrides( cacheDirectoryPath ); diff --git a/packages/env/lib/config/post-process-config.js b/packages/env/lib/config/post-process-config.js index d09843893ea69..15fd2cbd8c072 100644 --- a/packages/env/lib/config/post-process-config.js +++ b/packages/env/lib/config/post-process-config.js @@ -129,7 +129,7 @@ function appendPortToWPConfigs( config ) { */ function validatePortUniqueness( config ) { // We're going to build a map of the environments and their port - // so we can accomodate root-level config options more easily. + // so we can accommodate root-level config options more easily. const environmentPorts = {}; // Add all of the environments to the map. This will @@ -179,7 +179,7 @@ function validate( config ) { * @return {WPRootConfig} A deep copy of the root config object. */ function deepCopyRootOptions( config ) { - // Create a shallow clone of the object first so we can operate on it safetly. + // Create a shallow clone of the object first so we can operate on it safely. const rootConfig = Object.assign( {}, config ); // Since we're only dealing with the root options we don't want the environments. diff --git a/packages/env/lib/config/test/validate-config.js b/packages/env/lib/config/test/validate-config.js index bb1decfd53dfb..a4c16e579e5e6 100644 --- a/packages/env/lib/config/test/validate-config.js +++ b/packages/env/lib/config/test/validate-config.js @@ -306,7 +306,7 @@ describe( 'validate-config', () => { } ); describe( 'checkValidURL', () => { - it( 'throws for invaid URLs', () => { + it( 'throws for invalid URLs', () => { expect( () => checkValidURL( 'test.json', 'test', 'localhost' ) ).toThrow( diff --git a/packages/env/lib/config/validate-config.js b/packages/env/lib/config/validate-config.js index 4aa62cb457155..36c454ac5a6c0 100644 --- a/packages/env/lib/config/validate-config.js +++ b/packages/env/lib/config/validate-config.js @@ -5,7 +5,7 @@ */ /** - * Error subtype which indicates that an expected validation erorr occurred + * Error subtype which indicates that an expected validation error occurred * while reading wp-env configuration. */ class ValidationError extends Error {} diff --git a/packages/eslint-plugin/rules/no-wp-process-env.js b/packages/eslint-plugin/rules/no-wp-process-env.js index 55aca44b92ba7..be7c37e76d204 100644 --- a/packages/eslint-plugin/rules/no-wp-process-env.js +++ b/packages/eslint-plugin/rules/no-wp-process-env.js @@ -17,7 +17,7 @@ module.exports = { useGlobalThis: '`{{ name }}` should not be accessed from process.env. Use `globalThis.{{name}}`.', noGutenbergPhase: - 'The GUTENBERG_PHASE environement variable is no longer available. Use IS_GUTENBERG_PLUGIN (boolean).', + 'The GUTENBERG_PHASE environment variable is no longer available. Use IS_GUTENBERG_PLUGIN (boolean).', }, }, create( context ) { diff --git a/packages/eslint-plugin/rules/wp-global-usage.js b/packages/eslint-plugin/rules/wp-global-usage.js index c6c75d9933123..b2c395e29b98c 100644 --- a/packages/eslint-plugin/rules/wp-global-usage.js +++ b/packages/eslint-plugin/rules/wp-global-usage.js @@ -25,7 +25,7 @@ function isUsedInConditional( node ) { /** @type {import('estree').Node|undefined} */ let current = node; - // Simple negation is the only expresion allowed in the conditional: + // Simple negation is the only expression allowed in the conditional: // if ( ! globalThis.SCRIPT_DEBUG ) {} // const D = ! globalThis.SCRIPT_DEBUG ? 'yes' : 'no'; if ( diff --git a/packages/eslint-plugin/utils/constants.js b/packages/eslint-plugin/utils/constants.js index a19add74964c0..3d64b3f83441b 100644 --- a/packages/eslint-plugin/utils/constants.js +++ b/packages/eslint-plugin/utils/constants.js @@ -28,7 +28,7 @@ const TRANSLATION_FUNCTIONS = new Set( [ '__', '_x', '_n', '_nx' ] ); * made more accurate using the `u` flag: * * ``` - * /^[$_\p{L}\p{Nl}][$_\p{L}\p{Nl}\u200C\u200D\p{Mn}\p{Mc}\p{Nd}\p{Pc}]*$/u; + * /^[$_\p{L}\p{Nl}][$_\p{L}\p{Nl}\u200C\u200D\p{Mn}\p{Mc}\p{And}\p{Pc}]*$/u; * ``` * * @see http://www.pixelbeat.org/programming/gcc/format_specs.html diff --git a/packages/fields/src/actions/duplicate-post.tsx b/packages/fields/src/actions/duplicate-post.tsx index fd7e0ae9de4ad..d81a081d454b2 100644 --- a/packages/fields/src/actions/duplicate-post.tsx +++ b/packages/fields/src/actions/duplicate-post.tsx @@ -55,7 +55,7 @@ const duplicatePost: Action< BasePost > = { return; } - const newItemOject = { + const newItemObject = { status: 'draft', title: item.title, slug: item.title || __( 'No title' ), @@ -90,7 +90,7 @@ const duplicatePost: Action< BasePost > = { assignableProperties.forEach( ( property ) => { if ( item.hasOwnProperty( property ) ) { // @ts-ignore - newItemOject[ property ] = item[ property ]; + newItemObject[ property ] = item[ property ]; } } ); setIsCreatingPage( true ); @@ -98,7 +98,7 @@ const duplicatePost: Action< BasePost > = { const newItem = await saveEntityRecord( 'postType', item.type, - newItemOject, + newItemObject, { throwOnError: true } ); diff --git a/packages/format-library/src/link/inline.js b/packages/format-library/src/link/inline.js index 3d2ee57567dc1..e40bb329d2860 100644 --- a/packages/format-library/src/link/inline.js +++ b/packages/format-library/src/link/inline.js @@ -181,7 +181,7 @@ function InlineLinkUI( { // As "replace" will operate on the first match only, it is // run only against the second half of the value which was // split at the active format's boundary. This avoids a bug - // with incorrectly targetted replacements. + // with incorrectly targeted replacements. // See: https://github.com/WordPress/gutenberg/issues/41771. // Note original formats will be lost when applying this change. // That is expected behaviour. diff --git a/packages/format-library/src/link/utils.js b/packages/format-library/src/link/utils.js index 314c8118713a4..4cf611f7c51fb 100644 --- a/packages/format-library/src/link/utils.js +++ b/packages/format-library/src/link/utils.js @@ -202,7 +202,7 @@ export function getFormatBoundary( // Safe guard: start index cannot be less than 0. startIndex = startIndex < 0 ? 0 : startIndex; - // // Return the indicies of the "edges" as the boundaries. + // // Return the indices of the "edges" as the boundaries. return { start: startIndex, end: endIndex, diff --git a/packages/hooks/CHANGELOG.md b/packages/hooks/CHANGELOG.md index be3f8c7cf6b41..d4482c3c21fcf 100644 --- a/packages/hooks/CHANGELOG.md +++ b/packages/hooks/CHANGELOG.md @@ -179,7 +179,7 @@ ### New Features -- Enable an optional namespace parameter for `hasAction` & `hasFilter`. When checking if an action or filter exists, `hasAction` and `hasFilter` now accept an optional paramter to limit matches by namespace. +- Enable an optional namespace parameter for `hasAction` & `hasFilter`. When checking if an action or filter exists, `hasAction` and `hasFilter` now accept an optional parameter to limit matches by namespace. ## 2.4.0 (2019-06-12) diff --git a/packages/hooks/src/test/index.test.js b/packages/hooks/src/test/index.test.js index 5fdaf5fc7207a..343b148c334fb 100644 --- a/packages/hooks/src/test/index.test.js +++ b/packages/hooks/src/test/index.test.js @@ -67,7 +67,7 @@ function actionC() { beforeEach( () => { window.actionValue = ''; // Reset state in between tests (clear all callbacks, `didAction` counts, - // etc.) Just reseting actions and filters is not enough + // etc.) Just resetting actions and filters is not enough // because the internal functions have references to the original objects. [ actions, filters ].forEach( ( hooks ) => { for ( const k in hooks ) { diff --git a/packages/i18n/src/test/create-i18n.js b/packages/i18n/src/test/create-i18n.js index 51e280a358b34..d588f5e37a30e 100644 --- a/packages/i18n/src/test/create-i18n.js +++ b/packages/i18n/src/test/create-i18n.js @@ -359,7 +359,7 @@ describe( 'createI18n', () => { 'translated_plural_2' ); - // Reset the locale data and fallback to the defualt plural forms function. + // Reset the locale data and fallback to the default plural forms function. locale.resetLocaleData( { singular: [ diff --git a/packages/icons/src/icon/index.js b/packages/icons/src/icon/index.js index c83a5179a41b8..221970bd21b93 100644 --- a/packages/icons/src/icon/index.js +++ b/packages/icons/src/icon/index.js @@ -9,7 +9,7 @@ import { cloneElement, forwardRef } from '@wordpress/element'; * Return an SVG icon. * * @param {IconProps} props icon is the SVG component to render - * size is a number specifiying the icon size in pixels + * size is a number specifying the icon size in pixels * Other props will be passed to wrapped SVG component * @param {import('react').ForwardedRef} ref The forwarded ref to the SVG element. * diff --git a/packages/interactivity-router/src/index.ts b/packages/interactivity-router/src/index.ts index 8a46d4ce35011..b26fc79be4fb6 100644 --- a/packages/interactivity-router/src/index.ts +++ b/packages/interactivity-router/src/index.ts @@ -245,7 +245,7 @@ export const { state, actions } = store< Store >( 'core/router', { /** * Navigates to the specified page. * - * This function normalizes the passed href, fetchs the page HTML if + * This function normalizes the passed href, fetches the page HTML if * needed, and updates any interactive regions whose contents have * changed. It also creates a new entry in the browser session history. * @@ -348,7 +348,7 @@ export const { state, actions } = store< Store >( 'core/router', { }, /** - * Prefetchs the page with the passed URL. + * Prefetches the page with the passed URL. * * The function normalizes the URL and stores internally the fetch * promise, to avoid triggering a second fetch for an ongoing request. diff --git a/packages/interactivity/src/proxies/state.ts b/packages/interactivity/src/proxies/state.ts index f9af257bada2e..e86ec05c48461 100644 --- a/packages/interactivity/src/proxies/state.ts +++ b/packages/interactivity/src/proxies/state.ts @@ -36,7 +36,7 @@ const proxyToProps: WeakMap< > = new WeakMap(); /** - * Checks wether a {@link PropSignal | `PropSignal`} instance exists for the + * Checks whether a {@link PropSignal | `PropSignal`} instance exists for the * given property in the passed proxy. * * @param proxy Proxy of a state object or array. diff --git a/packages/interactivity/src/scopes.ts b/packages/interactivity/src/scopes.ts index 722305f6bee11..96e23c86ade73 100644 --- a/packages/interactivity/src/scopes.ts +++ b/packages/interactivity/src/scopes.ts @@ -77,7 +77,7 @@ export const getContext = < T extends object >( namespace?: string ): T => { /** * Retrieves a representation of the element where a function from the store - * is being evalutated. Such representation is read-only, and contains a + * is being evaluated. Such representation is read-only, and contains a * reference to the DOM element, its props and a local reactive state. * * @return Element representation. diff --git a/packages/interactivity/src/store.ts b/packages/interactivity/src/store.ts index b147e0f61163b..0b37e043733bb 100644 --- a/packages/interactivity/src/store.ts +++ b/packages/interactivity/src/store.ts @@ -28,7 +28,7 @@ export const getConfig = ( namespace?: string ) => * * The object returned is read-only, and includes the state defined in PHP with * `wp_interactivity_state()`. When using `actions.navigate()`, this object is - * updated to reflect the changes in its properites, without affecting the state + * updated to reflect the changes in its properties, without affecting the state * returned by `store()`. Directives can subscribe to those changes to update * the state if needed. * diff --git a/packages/interactivity/src/utils.ts b/packages/interactivity/src/utils.ts index ab6b0074727ee..d894d37a7b84b 100644 --- a/packages/interactivity/src/utils.ts +++ b/packages/interactivity/src/utils.ts @@ -119,7 +119,7 @@ export function useSignalEffect( callback: () => unknown ) { * accessible whenever the function runs. This is primarily to make the scope * available inside hook callbacks. * - * Asyncronous functions should use generators that yield promises instead of awaiting them. + * Asynchronous functions should use generators that yield promises instead of awaiting them. * See the documentation for details: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/packages-interactivity-api-reference/#the-store * * @param func The passed function. @@ -200,7 +200,7 @@ export function useWatch( callback: () => unknown ) { /** * Accepts a function that contains imperative code which runs only after the - * element's first render, mainly useful for intialization logic. + * element's first render, mainly useful for initialization logic. * * This hook makes the element's scope available so functions like * `getElement()` and `getContext()` can be used inside the passed callback. diff --git a/packages/interactivity/src/vdom.ts b/packages/interactivity/src/vdom.ts index 9a1ec7ec5d76f..e61a5a9b52895 100644 --- a/packages/interactivity/src/vdom.ts +++ b/packages/interactivity/src/vdom.ts @@ -24,7 +24,7 @@ const directiveParser = new RegExp( // segments. It excludes underscore intentionally to prevent confusion. // E.g., "custom-directive". '([a-z0-9]+(?:-[a-z0-9]+)*)' + - // (Optional) Match '--' followed by any alphanumeric charachters. It + // (Optional) Match '--' followed by any alphanumeric characters. It // excludes underscore intentionally to prevent confusion, but it can // contain multiple hyphens. E.g., "--custom-prefix--with-more-info". '(?:--([a-z0-9_-]+))?$', diff --git a/packages/lazy-import/README.md b/packages/lazy-import/README.md index cd3dcb16eb6ab..f08f494c410ce 100644 --- a/packages/lazy-import/README.md +++ b/packages/lazy-import/README.md @@ -58,7 +58,7 @@ lazyImport( 'fbjs@^1.0.0', { } ).then( /* ... */ ); ``` -Note that `lazyImport` can throw an error when offline and unable to install the dependency using NPM. You may want to anticipate this and provide remediation steps for a failed install, such as logging a warning messsage: +Note that `lazyImport` can throw an error when offline and unable to install the dependency using NPM. You may want to anticipate this and provide remediation steps for a failed install, such as logging a warning message: ```js try { diff --git a/packages/nux/README.md b/packages/nux/README.md index c0941ddd0c5f2..31508d38f5995 100644 --- a/packages/nux/README.md +++ b/packages/nux/README.md @@ -59,7 +59,7 @@ console.log( isVisible ); // true or false ## Disabling and enabling tips -Tips can be programatically disabled or enabled using the `disableTips` and `enableTips` dispatch methods. You can query the current setting by using the `areTipsEnabled` select method. +Tips can be programmatically disabled or enabled using the `disableTips` and `enableTips` dispatch methods. You can query the current setting by using the `areTipsEnabled` select method. Calling `enableTips` will also un-dismiss all previously dismissed tips. diff --git a/packages/patterns/README.md b/packages/patterns/README.md index 1123805836f2a..1fa11a1eefe46 100644 --- a/packages/patterns/README.md +++ b/packages/patterns/README.md @@ -15,7 +15,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If ## Components -This package doesn't currently have any publically exported components. +This package doesn't currently have any publicly exported components. ## Contributing to this package diff --git a/packages/patterns/src/components/reset-overrides-control.js b/packages/patterns/src/components/reset-overrides-control.js index 697a595dc4216..9d5d68d58fe23 100644 --- a/packages/patterns/src/components/reset-overrides-control.js +++ b/packages/patterns/src/components/reset-overrides-control.js @@ -14,7 +14,7 @@ const CONTENT = 'content'; export default function ResetOverridesControl( props ) { const name = props.attributes.metadata?.name; const registry = useRegistry(); - const isOverriden = useSelect( + const isOverridden = useSelect( ( select ) => { if ( ! name ) { return; @@ -81,7 +81,7 @@ export default function ResetOverridesControl( props ) { return ( - + { __( 'Reset' ) } diff --git a/packages/patterns/src/store/actions.js b/packages/patterns/src/store/actions.js index 5eef01b2bb8f8..80b3f9bff4588 100644 --- a/packages/patterns/src/store/actions.js +++ b/packages/patterns/src/store/actions.js @@ -104,7 +104,7 @@ export const convertSyncedPatternToStatic = delete metadata.bindings; // Use overridden values of the pattern block if they exist. if ( existingOverrides?.[ metadata.name ] ) { - // Iterate over each overriden attribute. + // Iterate over each overridden attribute. for ( const [ attributeName, value ] of Object.entries( existingOverrides[ metadata.name ] ) ) { diff --git a/packages/preferences-persistence/src/create/test/index.js b/packages/preferences-persistence/src/create/test/index.js index acf28a9c51ff0..1d3c8ab7f09da 100644 --- a/packages/preferences-persistence/src/create/test/index.js +++ b/packages/preferences-persistence/src/create/test/index.js @@ -33,8 +33,8 @@ describe( 'create', () => { // The second param of the call to `setItem` has been JSON.stringified. // Parse it to check it contains the data. - const setItemDataParm = spy.mock.calls[ 0 ][ 1 ]; - expect( JSON.parse( setItemDataParm ) ).toEqual( + const setItemDataParam = spy.mock.calls[ 0 ][ 1 ]; + expect( JSON.parse( setItemDataParam ) ).toEqual( expect.objectContaining( data ) ); } ); diff --git a/packages/private-apis/src/test/index.js b/packages/private-apis/src/test/index.js index 51d1b6a3afba0..36e57ee58165d 100644 --- a/packages/private-apis/src/test/index.js +++ b/packages/private-apis/src/test/index.js @@ -236,7 +236,7 @@ describe( 'Specific use-cases of sharing private APIs', () => { * * ```js * import { logData } from 'package1'; - * const experimenalLogData = unlock( logData ); + * const experimentalLogData = unlock( logData ); * ``` */ expect( unlock( logData ) ).toBe( __privateLogData ); diff --git a/packages/react-native-aztec/android/settings.gradle b/packages/react-native-aztec/android/settings.gradle index 5c91464a04245..9dc9e0805956b 100644 --- a/packages/react-native-aztec/android/settings.gradle +++ b/packages/react-native-aztec/android/settings.gradle @@ -6,14 +6,14 @@ pluginManagement { plugins { id "com.android.library" version gradle.ext.agpVersion id "org.jetbrains.kotlin.android" version gradle.ext.kotlinVersion - id "com.automattic.android.publish-to-s3" version gradle.ext.automatticPublishToS3Version + id "com.automatic.android.publish-to-s3" version gradle.ext.automatticPublishToS3Version } repositories { maven { url 'https://a8c-libs.s3.amazonaws.com/android' content { - includeGroup "com.automattic.android" - includeGroup "com.automattic.android.publish-to-s3" + includeGroup "com.automatic.android" + includeGroup "com.automatic.android.publish-to-s3" } } gradlePluginPortal() diff --git a/packages/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift b/packages/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift index 03362c3a371fb..bc3426a41680f 100644 --- a/packages/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift +++ b/packages/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift @@ -72,18 +72,18 @@ class RCTAztecView: Aztec.TextView { return label }() - // RCTScrollViews are flipped horizontally on RTL. This messes up competelly horizontal layout contraints + // RCTScrollViews are flipped horizontally on RTL. This messes up competelly horizontal layout constraints // on views inserted after the transformation. - var placeholderPreferedHorizontalAnchor: NSLayoutXAxisAnchor { + var placeholderPreferredHorizontalAnchor: NSLayoutXAxisAnchor { return hasRTLLayout ? placeholderLabel.rightAnchor : placeholderLabel.leftAnchor } - // This constraint is created from the prefered horizontal anchor (analog to "leading") + // This constraint is created from the preferred horizontal anchor (analog to "leading") // but appending it always to left of its super view (Aztec). // This partially fixes the position issue originated from fliping the scroll view. // fixLabelPositionForRTLLayout() fixes the rest. private lazy var placeholderHorizontalConstraint: NSLayoutConstraint = { - return placeholderPreferedHorizontalAnchor.constraint( + return placeholderPreferredHorizontalAnchor.constraint( equalTo: leftAnchor, constant: leftTextInset ) @@ -169,7 +169,7 @@ class RCTAztecView: Aztec.TextView { /** This handles a bug introduced by iOS 13.0 (tested up to 13.2) where link interactions don't respect what the documentation says. - The documenatation for textView(_:shouldInteractWith:in:interaction:) says: + The documentation for textView(_:shouldInteractWith:in:interaction:) says: > Links in text views are interactive only if the text view is selectable but noneditable. @@ -413,7 +413,7 @@ class RCTAztecView: Aztec.TextView { return text.isStartOfParagraph(at: currentLocation) && !(text.endIndex == currentLocation) } override var keyCommands: [UIKeyCommand]? { - // Remove defautls Tab and Shift+Tab commands, leaving just Shift+Enter command. + // Remove defaults Tab and Shift+Tab commands, leaving just Shift+Enter command. return [carriageReturnKeyCommand] } @@ -673,7 +673,7 @@ class RCTAztecView: Aztec.TextView { } } - /// This method refreshes the font for the palceholder field and typing attributes. + /// This method refreshes the font for the placeholder field and typing attributes. /// This method should not be called directly. Call `refreshFont()` instead. /// private func refreshTypingAttributesAndPlaceholderFont() { diff --git a/packages/react-native-aztec/ios/RNTAztecView/RCTAztecViewManager.swift b/packages/react-native-aztec/ios/RNTAztecView/RCTAztecViewManager.swift index 5422d2feb864a..23aeb04ea8e40 100644 --- a/packages/react-native-aztec/ios/RNTAztecView/RCTAztecViewManager.swift +++ b/packages/react-native-aztec/ios/RNTAztecView/RCTAztecViewManager.swift @@ -18,7 +18,7 @@ public class RCTAztecViewManager: RCTViewManager { public override func view() -> UIView { let view = RCTAztecView( defaultFont: defaultFont, - defaultParagraphStyle: defaultParagrahStyle, + defaultParagraphStyle: defaultParagraphStyle, defaultMissingImage: UIImage()) view.isScrollEnabled = false @@ -71,7 +71,7 @@ public class RCTAztecViewManager: RCTViewManager { return defaultFont } - private var defaultParagrahStyle: ParagraphStyle { + private var defaultParagraphStyle: ParagraphStyle { let defaultStyle = ParagraphStyle.default defaultStyle.textListParagraphSpacing = 5 defaultStyle.textListParagraphSpacingBefore = 5 diff --git a/packages/react-native-bridge/android/build.gradle b/packages/react-native-bridge/android/build.gradle index 2e7c3c822c42f..6dd9121136318 100644 --- a/packages/react-native-bridge/android/build.gradle +++ b/packages/react-native-bridge/android/build.gradle @@ -7,7 +7,7 @@ buildscript { plugins { id "com.android.library" apply false id "org.jetbrains.kotlin.android" apply false - id "com.automattic.android.publish-to-s3" apply false + id "com.automatic.android.publish-to-s3" apply false } allprojects { diff --git a/packages/react-native-bridge/android/react-native-bridge/build.gradle b/packages/react-native-bridge/android/react-native-bridge/build.gradle index d8249b9d1b640..8f2820693fe32 100644 --- a/packages/react-native-bridge/android/react-native-bridge/build.gradle +++ b/packages/react-native-bridge/android/react-native-bridge/build.gradle @@ -18,7 +18,7 @@ plugins { id "com.android.library" id "org.jetbrains.kotlin.android" id "maven-publish" - id "com.automattic.android.publish-to-s3" + id "com.automatic.android.publish-to-s3" } // import the `readReactNativeVersion()` function diff --git a/packages/react-native-bridge/android/settings.gradle b/packages/react-native-bridge/android/settings.gradle index 2863d3bb06512..33246a6d1bcde 100644 --- a/packages/react-native-bridge/android/settings.gradle +++ b/packages/react-native-bridge/android/settings.gradle @@ -6,14 +6,14 @@ pluginManagement { plugins { id "com.android.library" version gradle.ext.agpVersion id "org.jetbrains.kotlin.android" version gradle.ext.kotlinVersion - id "com.automattic.android.publish-to-s3" version gradle.ext.automatticPublishToS3Version + id "com.automatic.android.publish-to-s3" version gradle.ext.automatticPublishToS3Version } repositories { maven { url 'https://a8c-libs.s3.amazonaws.com/android' content { - includeGroup "com.automattic.android" - includeGroup "com.automattic.android.publish-to-s3" + includeGroup "com.automatic.android" + includeGroup "com.automatic.android.publish-to-s3" } } gradlePluginPortal() diff --git a/packages/react-native-bridge/common/gutenberg-web-single-block/editor-behavior-overrides.js b/packages/react-native-bridge/common/gutenberg-web-single-block/editor-behavior-overrides.js index 1a4f4422a47ba..f0dec3339b9da 100644 --- a/packages/react-native-bridge/common/gutenberg-web-single-block/editor-behavior-overrides.js +++ b/packages/react-native-bridge/common/gutenberg-web-single-block/editor-behavior-overrides.js @@ -16,7 +16,7 @@ function isAndroid() { * @return {void} * @see https://github.com/WordPress/gutenberg/pull/34668 */ -function manageTextSelectonContextMenu() { +function manageTextSelectionContextMenu() { // Listeners for native context menu visibility changes. let isContextMenuVisible = false; const hideContextMenuListeners = []; @@ -74,7 +74,7 @@ function manageTextSelectonContextMenu() { } if ( isAndroid() ) { - manageTextSelectonContextMenu(); + manageTextSelectionContextMenu(); } function _toggleBlockSelectedClass( isBlockSelected ) { diff --git a/packages/react-native-bridge/index.js b/packages/react-native-bridge/index.js index da16f75e161da..12dbfc2bb6fea 100644 --- a/packages/react-native-bridge/index.js +++ b/packages/react-native-bridge/index.js @@ -494,7 +494,7 @@ export function logException( if ( ! wasSent ) { // eslint-disable-next-line no-console console.error( - 'An error ocurred when logging the exception', + 'An error occurred when logging the exception', parsedException ); } diff --git a/packages/react-native-bridge/ios/Gutenberg.swift b/packages/react-native-bridge/ios/Gutenberg.swift index adb24baa77851..09ea9f4d99772 100644 --- a/packages/react-native-bridge/ios/Gutenberg.swift +++ b/packages/react-native-bridge/ios/Gutenberg.swift @@ -85,7 +85,7 @@ public class Gutenberg: UIResponder { let editorSettings = dataSource.gutenbergEditorSettings() let settingsUpdates = properties(from: editorSettings) - initialProps.merge(settingsUpdates) { (intialProp, settingsUpdates) -> Any in + initialProps.merge(settingsUpdates) { (initialProp, settingsUpdates) -> Any in settingsUpdates } @@ -136,8 +136,8 @@ public class Gutenberg: UIResponder { } public func updateCapabilities() { - let capabilites = dataSource.gutenbergCapabilities() - sendEvent(.updateCapabilities, body: capabilites.toJSPayload()) + let capabilities = dataSource.gutenbergCapabilities() + sendEvent(.updateCapabilities, body: capabilities.toJSPayload()) } private func sendEvent(_ event: RNReactNativeGutenbergBridge.EventName, body: [String: Any]? = nil) { diff --git a/packages/react-native-bridge/ios/GutenbergBridgeDelegate.swift b/packages/react-native-bridge/ios/GutenbergBridgeDelegate.swift index 8ff78b8fa1415..077ef8bc0fb6c 100644 --- a/packages/react-native-bridge/ios/GutenbergBridgeDelegate.swift +++ b/packages/react-native-bridge/ios/GutenbergBridgeDelegate.swift @@ -89,7 +89,7 @@ public typealias MediaPickerDidPickMediaCallback = (_ media: [MediaInfo]?) -> Vo public typealias MediaImportCallback = (_ media: MediaInfo?) -> Void /// Declare internal Media Sources. -/// Label and Type are not relevant since they are delcared on the JS side. +/// Label and Type are not relevant since they are declared on the JS side. /// Hopefully soon, this will need to be declared on the client side. extension Gutenberg.MediaSource { public static let mediaLibrary = Gutenberg.MediaSource(id: "SITE_MEDIA_LIBRARY", label: "", types: [.image, .video]) diff --git a/packages/react-native-bridge/ios/GutenbergWebFallback/FallbackJavascriptInjection.swift b/packages/react-native-bridge/ios/GutenbergWebFallback/FallbackJavascriptInjection.swift index ee75dc0968a58..e3fe710eadcfe 100644 --- a/packages/react-native-bridge/ios/GutenbergWebFallback/FallbackJavascriptInjection.swift +++ b/packages/react-native-bridge/ios/GutenbergWebFallback/FallbackJavascriptInjection.swift @@ -22,7 +22,7 @@ public struct FallbackJavascriptInjection { public let editorBehaviorScript: WKUserScript /// Init an instance of GutenbergWebJavascriptInjection or throws if any of the required sources doesn't exist. - /// This helps to cach early any possible error due to missing source files. + /// This helps to cache early any possible error due to missing source files. /// - Parameter blockHTML: The block HTML code to be injected. /// - Parameter userId: The id of the logged user. /// - Throws: Throws an error if any required source doesn't exist. diff --git a/packages/react-native-bridge/lib/test/parseException.test.js b/packages/react-native-bridge/lib/test/parseException.test.js index 64d16356adba2..37738a1bbf2f6 100644 --- a/packages/react-native-bridge/lib/test/parseException.test.js +++ b/packages/react-native-bridge/lib/test/parseException.test.js @@ -66,7 +66,7 @@ describe( 'Parse exception', () => { expect( exception.message ).toBe( 'No error message' ); } ); - it( 'sets unkown error type', () => { + it( 'sets unknown error type', () => { const exception = parseException( { message: { error: { message: '' } }, } ); diff --git a/packages/react-native-editor/CHANGELOG.md b/packages/react-native-editor/CHANGELOG.md index 6031e402100c9..304f305173eb4 100644 --- a/packages/react-native-editor/CHANGELOG.md +++ b/packages/react-native-editor/CHANGELOG.md @@ -270,7 +270,7 @@ For each user feature we should also add a importance categorization label to i ## 1.95.0 - [*] Fix crash when trying to convert to regular blocks an undefined/deleted reusable block [#50475] -- [**] Tapping on nested text blocks gets focus directly instead of having to tap multiple times depeding on the nesting levels. [#50108] +- [**] Tapping on nested text blocks gets focus directly instead of having to tap multiple times depending on the nesting levels. [#50108] - [*] Use host app namespace in reusable block message [#50478] - [**] Configuring a link to open in a new tab no longer results in a partial loss of edit history (undo and redo) [#50460] @@ -344,11 +344,11 @@ For each user feature we should also add a importance categorization label to i ## 1.86.0 - [**] Upgrade React Native to 0.69.4 [#43485] -- [**] Prevent error message from unneccesarily firing when uploading to Gallery block [#46175] +- [**] Prevent error message from unnecessarily firing when uploading to Gallery block [#46175] ## 1.85.1 -- [**] Prevent error message from unneccesarily firing when uploading to Gallery block [#46175] +- [**] Prevent error message from unnecessarily firing when uploading to Gallery block [#46175] ## 1.85.0 @@ -967,7 +967,7 @@ For each user feature we should also add a importance categorization label to i - New block: Latest Posts - Fix Quote block's left border not being visible in Dark Mode - Added Starter Page Templates: when you create a new page, we now show you a few templates to get started more quickly. -- Fix crash when pasting HTML content with embeded images on paragraphs +- Fix crash when pasting HTML content with embedded images on paragraphs ## 1.23.0 @@ -977,7 +977,7 @@ For each user feature we should also add a importance categorization label to i - New block: Button - Add scroll support inside block picker and block settings - [Android] Fix issue preventing correct placeholder image from displaying during image upload -- [iOS] Fix diplay of large numbers on ordered lists +- [iOS] Fix display of large numbers on ordered lists - Fix issue where adding emojis to the post title add strong HTML elements to the title of the post - [iOS] Fix issue where alignment of paragraph blocks was not always being respected when splitting the paragraph or reading the post's html content. - We’ve introduced a new toolbar that floats above the block you’re editing, which makes navigating your blocks easier — especially complex ones. diff --git a/packages/react-native-editor/README.md b/packages/react-native-editor/README.md index 5fe50c1972fbe..37f3a16513841 100644 --- a/packages/react-native-editor/README.md +++ b/packages/react-native-editor/README.md @@ -1,6 +1,6 @@ # React Native Editor -This package provides a demo application to simplify the environment setup required for the development of Gutenberg for native Android and iOS. The demo application allows running the mobile versions of Gutenberg blocks while avoiding the additional setup steps required by the [WordPress Android](https://github.com/wordpress-mobile/WordPress-Android) and [Wordpress iOS](https://github.com/wordpress-mobile/WordPress-iOS) apps. +This package provides a demo application to simplify the environment setup required for the development of Gutenberg for native Android and iOS. The demo application allows running the mobile versions of Gutenberg blocks while avoiding the additional setup steps required by the [WordPress Android](https://github.com/wordpress-mobile/WordPress-Android) and [WordPress iOS](https://github.com/wordpress-mobile/WordPress-iOS) apps. ## Getting Started diff --git a/packages/react-native-editor/ios/GutenbergDemo/GutenbergViewController.swift b/packages/react-native-editor/ios/GutenbergDemo/GutenbergViewController.swift index c9c1bca191c22..9575dac96d488 100644 --- a/packages/react-native-editor/ios/GutenbergDemo/GutenbergViewController.swift +++ b/packages/react-native-editor/ios/GutenbergDemo/GutenbergViewController.swift @@ -219,7 +219,7 @@ extension GutenbergViewController: GutenbergBridgeDelegate { } alertController.addAction(dismissAction) - if progress.fractionCompleted < 1 && mediaUploadCoordinator.successfullUpload { + if progress.fractionCompleted < 1 && mediaUploadCoordinator.successfulUpload { let cancelUploadAction = UIAlertAction(title: "Cancel upload", style: .destructive) { (action) in self.mediaUploadCoordinator.cancelUpload(with: mediaID) } @@ -317,7 +317,7 @@ extension GutenbergViewController: GutenbergBridgeDelegate { } func gutenbergDidRequestSendEventToHost(_ eventName: String, properties: [AnyHashable: Any]) -> Void { - print("Gutenberg requested sending '\(eventName)' event to host with propreties: \(properties).") + print("Gutenberg requested sending '\(eventName)' event to host with properties: \(properties).") } func gutenbergDidRequestToggleUndoButton(_ isDisabled: Bool) -> Void { diff --git a/packages/react-native-editor/ios/GutenbergDemo/MediaUploadCoordinator.swift b/packages/react-native-editor/ios/GutenbergDemo/MediaUploadCoordinator.swift index e9183d33c70d0..a21df84b6eafa 100644 --- a/packages/react-native-editor/ios/GutenbergDemo/MediaUploadCoordinator.swift +++ b/packages/react-native-editor/ios/GutenbergDemo/MediaUploadCoordinator.swift @@ -10,7 +10,7 @@ class MediaUploadCoordinator: NSObject { private let gutenberg: Gutenberg private var activeUploads: [Int32: Progress] = [:] - private(set) var successfullUpload = true + private(set) var successfulUpload = true init(gutenberg: Gutenberg) { self.gutenberg = gutenberg @@ -20,7 +20,7 @@ class MediaUploadCoordinator: NSObject { func upload(url: URL) -> Int32? { //Make sure the media is not larger than a 32 bits to number to avoid problems when bridging to JS - successfullUpload = true + successfulUpload = true let mediaID = Int32(truncatingIfNeeded:UUID().uuidString.hash) let progress = Progress(parent: nil, userInfo: [ProgressUserInfoKey.mediaID: mediaID, ProgressUserInfoKey.mediaURL: url]) progress.totalUnitCount = 100 @@ -42,7 +42,7 @@ class MediaUploadCoordinator: NSObject { return } progress.completedUnitCount = 0 - successfullUpload = true + successfulUpload = true Timer.scheduledTimer(timeInterval: 0.1, target: self, selector: #selector(timerFireMethod(_:)), userInfo: progress, repeats: true) } @@ -54,7 +54,7 @@ class MediaUploadCoordinator: NSObject { } @objc func failUpload() { - successfullUpload = false + successfulUpload = false } @objc func timerFireMethod(_ timer: Timer) { @@ -67,11 +67,11 @@ class MediaUploadCoordinator: NSObject { } progress.completedUnitCount += 1 - if !successfullUpload { + if !successfulUpload { timer.invalidate() progress.setUserInfoObject("Network upload failed", forKey: .mediaError) gutenberg.mediaUploadUpdate(id: mediaID, state: .failed, progress: 1, url: nil, serverID: nil, metadata: ["demoApp" : true, "failReason" : "Network upload failed"]) - successfullUpload = true + successfulUpload = true return } diff --git a/packages/react-native-editor/sass-transformer.js b/packages/react-native-editor/sass-transformer.js index 3b561eca6d88b..8cf49ca293c64 100644 --- a/packages/react-native-editor/sass-transformer.js +++ b/packages/react-native-editor/sass-transformer.js @@ -70,14 +70,14 @@ function findVariant( name, extensions, includePaths, projectRoot ) { } // Try to find the file iterating through the extensions, in order. - const foundExtention = extensions.find( ( extension ) => { + const foundExtension = extensions.find( ( extension ) => { const fname = includePath + '/' + name + extension; const partialfname = includePath + '/_' + name + extension; return fs.existsSync( fname ) || fs.existsSync( partialfname ); } ); - if ( foundExtention ) { - return includePath + '/' + name + foundExtention; + if ( foundExtension ) { + return includePath + '/' + name + foundExtension; } } diff --git a/packages/react-native-editor/src/jsdom-patches.js b/packages/react-native-editor/src/jsdom-patches.js index 680bdcf1eb12e..284bd9359931a 100644 --- a/packages/react-native-editor/src/jsdom-patches.js +++ b/packages/react-native-editor/src/jsdom-patches.js @@ -54,7 +54,7 @@ Node.prototype.contains = function ( node ) { * Copy of insertBefore function from jsdom-jscore, WRONG_DOCUMENT_ERR exception * disabled. * - * @param {Object} newChild The node to be insterted. + * @param {Object} newChild The node to be inserted. * @param {Object} refChild The node before which newChild is inserted. * @return {Object} the newly inserted child node * diff --git a/packages/redux-routine/README.md b/packages/redux-routine/README.md index b455d52db8b81..a79196fb2dc90 100644 --- a/packages/redux-routine/README.md +++ b/packages/redux-routine/README.md @@ -53,7 +53,7 @@ store.dispatch( retrieveTemperature() ); ``` In this example, when we dispatch `retrieveTemperature`, it will trigger the control handler to take effect, issuing the network request and assigning the result into the `result` variable. Only once the -request has completed does the action creator procede to return the `SET_TEMPERATURE` action type. +request has completed does the action creator proceed to return the `SET_TEMPERATURE` action type. ## API diff --git a/packages/rich-text/src/component/index.js b/packages/rich-text/src/component/index.js index 600fc0faff520..e17a4704d8a37 100644 --- a/packages/rich-text/src/component/index.js +++ b/packages/rich-text/src/component/index.js @@ -157,7 +157,7 @@ export function useRichText( { const didMountRef = useRef( false ); - // Value updates must happen synchonously to avoid overwriting newer values. + // Value updates must happen synchronously to avoid overwriting newer values. useLayoutEffect( () => { if ( didMountRef.current && value !== _valueRef.current ) { applyFromProps(); @@ -165,7 +165,7 @@ export function useRichText( { } }, [ value ] ); - // Value updates must happen synchonously to avoid overwriting newer values. + // Value updates must happen synchronously to avoid overwriting newer values. useLayoutEffect( () => { if ( ! hadSelectionUpdateRef.current ) { return; diff --git a/packages/rich-text/src/component/use-anchor.js b/packages/rich-text/src/component/use-anchor.js index 412c31bf5b707..320ef3dbdca2d 100644 --- a/packages/rich-text/src/component/use-anchor.js +++ b/packages/rich-text/src/component/use-anchor.js @@ -21,7 +21,7 @@ import { useState, useLayoutEffect } from '@wordpress/element'; function getFormatElement( range, editableContentElement, tagName, className ) { let element = range.startContainer; - // Even if the active format is defined, the actualy DOM range's start + // Even if the active format is defined, the actually DOM range's start // container may be outside of the format's DOM element: // `a‸b` (DOM) while visually it's `a‸b`. // So at a given selection index, start with the deepest format DOM element. diff --git a/packages/rich-text/src/join.js b/packages/rich-text/src/join.js index 805d2528f0c68..6d91fbec1e7a3 100644 --- a/packages/rich-text/src/join.js +++ b/packages/rich-text/src/join.js @@ -23,13 +23,13 @@ export function join( values, separator = '' ) { } return normaliseFormats( - values.reduce( ( accumlator, { formats, replacements, text } ) => ( { - formats: accumlator.formats.concat( separator.formats, formats ), - replacements: accumlator.replacements.concat( + values.reduce( ( accumulator, { formats, replacements, text } ) => ( { + formats: accumulator.formats.concat( separator.formats, formats ), + replacements: accumulator.replacements.concat( separator.replacements, replacements ), - text: accumlator.text + separator.text + text, + text: accumulator.text + separator.text + text, } ) ) ); } diff --git a/packages/rich-text/src/test/remove-format.js b/packages/rich-text/src/test/remove-format.js index bf3dd19179f70..5bc3061b41349 100644 --- a/packages/rich-text/src/test/remove-format.js +++ b/packages/rich-text/src/test/remove-format.js @@ -45,7 +45,7 @@ describe( 'removeFormat', () => { expect( getSparseArrayLength( result.formats ) ).toBe( 3 ); } ); - it( 'should remove format for collased selection', () => { + it( 'should remove format for collapsed selection', () => { const record = { formats: [ , diff --git a/packages/scripts/CHANGELOG.md b/packages/scripts/CHANGELOG.md index 0decdaca528b2..c0406b796e468 100644 --- a/packages/scripts/CHANGELOG.md +++ b/packages/scripts/CHANGELOG.md @@ -325,7 +325,7 @@ ### Breaking Changes -- Remove `lint-md-js` script that was broken for some time and it's extemely hard to make it work correctly with the recommended ESLint config in Markdown files ([#40511](https://github.com/WordPress/gutenberg/pull/40511)). +- Remove `lint-md-js` script that was broken for some time and it's extremely hard to make it work correctly with the recommended ESLint config in Markdown files ([#40511](https://github.com/WordPress/gutenberg/pull/40511)). - Remove the previously deprecated and undocumented `format-js` command ([#40512](https://github.com/WordPress/gutenberg/pull/40512)). You should use the `format` command instead. ### New Features diff --git a/packages/stylelint-config/CHANGELOG.md b/packages/stylelint-config/CHANGELOG.md index 402ca7cf9de59..9e2d80eb4bf9a 100644 --- a/packages/stylelint-config/CHANGELOG.md +++ b/packages/stylelint-config/CHANGELOG.md @@ -307,7 +307,7 @@ - Added: `no-extra-semicolons` rule. - Added: `selector-attribute-operator-space-after` rule. - Added: `selector-attribute-operator-space-before` rule. -- Added: `selector-max-empty-liness` rule. +- Added: `selector-max-empty-lines` rule. ## 5.0.0 (2016-04-24) diff --git a/packages/sync/src/provider.js b/packages/sync/src/provider.js index 15d972dbcd4f0..0be1dedab5d30 100644 --- a/packages/sync/src/provider.js +++ b/packages/sync/src/provider.js @@ -35,7 +35,7 @@ export const createSyncProvider = ( connectLocal, connectRemote ) => { const docs = {}; /** - * Registeres an object type. + * Registers an object type. * * @param {ObjectType} objectType Object type to register. * @param {ObjectConfig} objectConfig Object config. diff --git a/packages/token-list/src/test/index.ts b/packages/token-list/src/test/index.ts index fda0de0c53e48..7897a3a62de31 100644 --- a/packages/token-list/src/test/index.ts +++ b/packages/token-list/src/test/index.ts @@ -26,7 +26,7 @@ describe( 'token-list', () => { expect( list ).toHaveLength( 1 ); } ); - describe( 'array method inheritence', () => { + describe( 'array method inheritance', () => { it( 'entries', () => { const list = new TokenList( 'abc ' ); diff --git a/packages/url/CHANGELOG.md b/packages/url/CHANGELOG.md index 94fc29e83f98d..035cc15d071fc 100644 --- a/packages/url/CHANGELOG.md +++ b/packages/url/CHANGELOG.md @@ -218,7 +218,7 @@ ### Bug Fixes -- The `isValidProtocol` function now correctly considers the protocol of the URL as only incoporating characters up to and including the colon (':'). +- The `isValidProtocol` function now correctly considers the protocol of the URL as only incorporating characters up to and including the colon (':'). - `getFragment` is now greedier and matches fragments from the first occurrence of the '#' symbol instead of the last. ## 2.3.0 (2018-11-12) diff --git a/packages/url/src/is-phone-number.js b/packages/url/src/is-phone-number.js index 857b468bc5239..ed7aad1a3540e 100644 --- a/packages/url/src/is-phone-number.js +++ b/packages/url/src/is-phone-number.js @@ -13,7 +13,7 @@ const PHONE_REGEXP = /^(tel:)?(\+)?\d{6,15}$/; * @return {boolean} Whether or not it looks like a phone number. */ export function isPhoneNumber( phoneNumber ) { - // Remove any seperator from phone number. + // Remove any separator from phone number. phoneNumber = phoneNumber.replace( /[-.() ]/g, '' ); return PHONE_REGEXP.test( phoneNumber ); } diff --git a/packages/url/src/normalize-path.js b/packages/url/src/normalize-path.js index 57c9d1a5ab679..eb1cafed08365 100644 --- a/packages/url/src/normalize-path.js +++ b/packages/url/src/normalize-path.js @@ -8,9 +8,9 @@ * @return {string} Normalized path. */ export function normalizePath( path ) { - const splitted = path.split( '?' ); - const query = splitted[ 1 ]; - const base = splitted[ 0 ]; + const split = path.split( '?' ); + const query = split[ 1 ]; + const base = split[ 0 ]; if ( ! query ) { return base; } diff --git a/packages/url/src/test/index.js b/packages/url/src/test/index.js index 4fc3d5e2970d6..3d622ad2d8db7 100644 --- a/packages/url/src/test/index.js +++ b/packages/url/src/test/index.js @@ -796,7 +796,7 @@ describe( 'getQueryArg', () => { expect( getQueryArg( url, 'baz' ) ).toBeUndefined(); } ); - it( 'should get the value of an arry query arg', () => { + it( 'should get the value of an array query arg', () => { const url = 'https://andalouses.example/beach?foo[]=bar&foo[]=baz'; expect( getQueryArg( url, 'foo' ) ).toEqual( [ 'bar', 'baz' ] ); @@ -823,7 +823,7 @@ describe( 'hasQueryArg', () => { expect( hasQueryArg( url, 'baz' ) ).toBeFalsy(); } ); - it( 'should return true for an arry query arg', () => { + it( 'should return true for an array query arg', () => { const url = 'https://andalouses.example/beach?foo[]=bar&foo[]=baz'; expect( hasQueryArg( url, 'foo' ) ).toBeTruthy(); diff --git a/packages/widgets/src/blocks/legacy-widget/edit/control.js b/packages/widgets/src/blocks/legacy-widget/edit/control.js index 250fb7f2078f0..e1f512aa07c30 100644 --- a/packages/widgets/src/blocks/legacy-widget/edit/control.js +++ b/packages/widgets/src/blocks/legacy-widget/edit/control.js @@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n'; /** * An API for creating and loading a widget control (a
* element) that is compatible with most third party widget scripts. By not - * using React for this, we ensure that we have complete contorl over the DOM + * using React for this, we ensure that we have complete control over the DOM * and do not accidentally remove any elements that a third party widget script * has attached an event listener to. * @@ -60,7 +60,7 @@ export default class Control { } /** - * Clean up the control so that it can be garabge collected. + * Clean up the control so that it can be garbage collected. * * @access public */ diff --git a/phpunit/block-supports/typography-test.php b/phpunit/block-supports/typography-test.php index 1804659c11af3..5e6ca84f31d72 100644 --- a/phpunit/block-supports/typography-test.php +++ b/phpunit/block-supports/typography-test.php @@ -1064,7 +1064,7 @@ public function data_generate_should_override_theme_settings_fixtures() { * @param string $theme_slug A theme slug corresponding to an available test theme. * @param string $expected_output Expected value of style property from gutenberg_apply_typography_support(). */ - public function test_should_covert_font_sizes_to_fluid_values( $font_size_value, $theme_slug, $expected_output ) { + public function test_should_convert_font_sizes_to_fluid_values( $font_size_value, $theme_slug, $expected_output ) { switch_theme( $theme_slug ); $this->test_block_name = 'test/font-size-fluid-value'; @@ -1101,7 +1101,7 @@ public function test_should_covert_font_sizes_to_fluid_values( $font_size_value, } /** - * Data provider for test_should_covert_font_sizes_to_fluid_values. + * Data provider for test_should_convert_font_sizes_to_fluid_values. * * @return array */ diff --git a/phpunit/blocks/renderBlockCorePostExcerpt.php b/phpunit/blocks/renderBlockCorePostExcerpt.php index 38c27bfde9b30..c37599b150590 100644 --- a/phpunit/blocks/renderBlockCorePostExcerpt.php +++ b/phpunit/blocks/renderBlockCorePostExcerpt.php @@ -79,7 +79,7 @@ public function test_should_render_empty_string_when_excerpt_is_empty() { /** * Test gutenberg_render_block_core_post_excerpt() method. */ - public function test_should_render_correct_exceprt() { + public function test_should_render_correct_excerpt() { $block = new stdClass(); $GLOBALS['post'] = self::$post; diff --git a/phpunit/class-wp-theme-json-test.php b/phpunit/class-wp-theme-json-test.php index e47a36f73f418..9f9ae7a26f299 100644 --- a/phpunit/class-wp-theme-json-test.php +++ b/phpunit/class-wp-theme-json-test.php @@ -4995,7 +4995,7 @@ public function data_set_spacing_sizes_when_invalid() { } /** - * Tests the core separator block outbut based on various provided settings. + * Tests the core separator block output based on various provided settings. * * @dataProvider data_update_separator_declarations * diff --git a/test/e2e/specs/editor/blocks/classic.spec.js b/test/e2e/specs/editor/blocks/classic.spec.js index 95d39906b0d8b..bd7ccb2280d09 100644 --- a/test/e2e/specs/editor/blocks/classic.spec.js +++ b/test/e2e/specs/editor/blocks/classic.spec.js @@ -106,7 +106,7 @@ test.describe( 'Classic', () => { page, pageUtils, } ) => { - // Based on docs routing diables caching. + // Based on docs routing disables caching. // See: https://playwright.dev/docs/api/class-page#page-route await page.route( '**', async ( route ) => { await route.continue(); diff --git a/test/e2e/specs/editor/blocks/cover.spec.js b/test/e2e/specs/editor/blocks/cover.spec.js index a9a93caa4f434..cc686892a1075 100644 --- a/test/e2e/specs/editor/blocks/cover.spec.js +++ b/test/e2e/specs/editor/blocks/cover.spec.js @@ -177,7 +177,7 @@ test.describe( 'Cover', () => { expect( coverBlockBox.height ).toBeTruthy(); expect( coverBlockResizeHandleBox.height ).toBeTruthy(); - // Increse the Cover block height by 100px. + // Increase the Cover block height by 100px. await coverBlockResizeHandle.hover(); await page.mouse.down(); diff --git a/test/e2e/specs/editor/blocks/list.spec.js b/test/e2e/specs/editor/blocks/list.spec.js index 16126cf9cd29f..ec7b12293aa82 100644 --- a/test/e2e/specs/editor/blocks/list.spec.js +++ b/test/e2e/specs/editor/blocks/list.spec.js @@ -680,7 +680,7 @@ test.describe( 'List (@firefox)', () => { ); } ); - test( 'should be immeadiately saved on indentation', async ( { + test( 'should be immediately saved on indentation', async ( { editor, page, } ) => { diff --git a/test/e2e/specs/editor/blocks/navigation-frontend-interactivity.spec.js b/test/e2e/specs/editor/blocks/navigation-frontend-interactivity.spec.js index b31533d0d17c2..75ba370072e34 100644 --- a/test/e2e/specs/editor/blocks/navigation-frontend-interactivity.spec.js +++ b/test/e2e/specs/editor/blocks/navigation-frontend-interactivity.spec.js @@ -86,7 +86,7 @@ test.describe( 'Navigation block - Frontend interactivity', () => { /** * These are already tested within the Overlay Interactions test above, but Safari is flakey on the Tab * keypresses (passes 50 - 70% of the time). Tab keypresses are testing fine manually in Safari, but not - * in the test. nce we figure out why the Tab keypresses are flakey in the test, we can + * in the test. Once we figure out why the Tab keypresses are flakey in the test, we can * remove this test and only rely on the Overlay Interactions test above and add a (@firefox, @webkit) * directive to the describe() statement. https://github.com/WordPress/gutenberg/pull/55198 */ diff --git a/test/e2e/specs/editor/various/block-bindings/custom-sources.spec.js b/test/e2e/specs/editor/various/block-bindings/custom-sources.spec.js index d6563ce9cb5f5..b4184f2e07cb7 100644 --- a/test/e2e/specs/editor/various/block-bindings/custom-sources.spec.js +++ b/test/e2e/specs/editor/various/block-bindings/custom-sources.spec.js @@ -261,7 +261,7 @@ test.describe( 'Registered sources', () => { } ); test.describe( 'should lock editing', () => { - // Logic reused accross all the tests that check paragraph editing is locked. + // Logic reused across all the tests that check paragraph editing is locked. async function testParagraphControlsAreLocked( { source, editor, diff --git a/test/e2e/specs/editor/various/datepicker.spec.js b/test/e2e/specs/editor/various/datepicker.spec.js index 00030efa1fe27..e50f08b9b2b1e 100644 --- a/test/e2e/specs/editor/various/datepicker.spec.js +++ b/test/e2e/specs/editor/various/datepicker.spec.js @@ -14,9 +14,9 @@ const TIMEZONES = [ 'Pacific/Honolulu', 'UTC', 'Australia/Sydney' ]; TIMEZONES.forEach( ( timezone ) => { test.describe( `Datepicker: ${ timezone }`, () => { - let orignalTimezone; + let originalTimezone; test.beforeAll( async ( { requestUtils } ) => { - orignalTimezone = ( await requestUtils.getSiteSettings() ).timezone; + originalTimezone = ( await requestUtils.getSiteSettings() ).timezone; await requestUtils.updateSiteSettings( { timezone } ); } ); @@ -27,7 +27,7 @@ TIMEZONES.forEach( ( timezone ) => { test.afterAll( async ( { requestUtils } ) => { await requestUtils.updateSiteSettings( { - timezone: orignalTimezone, + timezone: originalTimezone, } ); } ); diff --git a/test/e2e/specs/editor/various/embedding.spec.js b/test/e2e/specs/editor/various/embedding.spec.js index fe488f9130174..8f64ab16fce40 100644 --- a/test/e2e/specs/editor/various/embedding.spec.js +++ b/test/e2e/specs/editor/various/embedding.spec.js @@ -98,13 +98,13 @@ test.describe( 'Embedding content', () => { MOCK_EMBED_PHOTO_SUCCESS_RESPONSE, } ); - const currenEmbedBlock = editor.canvas + const currentEmbedBlock = editor.canvas .getByRole( 'document', { name: 'Block' } ) .last(); await embedUtils.insertEmbed( 'https://twitter.com/notnownikki' ); await expect( - currenEmbedBlock.locator( 'iframe' ), + currentEmbedBlock.locator( 'iframe' ), 'Valid embed. Should render valid element.' ).toHaveAttribute( 'title', 'Embedded content from twitter.com' ); @@ -112,7 +112,7 @@ test.describe( 'Embedding content', () => { 'https://twitter.com/wooyaygutenberg123454312' ); await expect( - currenEmbedBlock.getByRole( 'textbox', { name: 'Embed URL' } ), + currentEmbedBlock.getByRole( 'textbox', { name: 'Embed URL' } ), 'Valid provider; invalid content. Should render failed, edit state.' ).toHaveValue( 'https://twitter.com/wooyaygutenberg123454312' ); @@ -120,13 +120,13 @@ test.describe( 'Embedding content', () => { 'https://wordpress.org/gutenberg/handbook/' ); await expect( - currenEmbedBlock.getByRole( 'textbox', { name: 'Embed URL' } ), + currentEmbedBlock.getByRole( 'textbox', { name: 'Embed URL' } ), 'WordPress invalid content. Should render failed, edit state.' ).toHaveValue( 'https://wordpress.org/gutenberg/handbook' ); await embedUtils.insertEmbed( 'https://twitter.com/thatbunty' ); await expect( - currenEmbedBlock.getByRole( 'textbox', { name: 'Embed URL' } ), + currentEmbedBlock.getByRole( 'textbox', { name: 'Embed URL' } ), 'Provider whose oembed API has gone wrong. Should render failed, edit state.' ).toHaveValue( 'https://twitter.com/thatbunty' ); @@ -134,7 +134,7 @@ test.describe( 'Embedding content', () => { 'https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/' ); await expect( - currenEmbedBlock, + currentEmbedBlock, 'WordPress valid content. Should render valid figure element.' ).toHaveClass( /wp-block-embed/ ); @@ -142,13 +142,13 @@ test.describe( 'Embedding content', () => { 'https://www.youtube.com/watch?v=lXMskKTw3Bc' ); await expect( - currenEmbedBlock, + currentEmbedBlock, 'Video content. Should render valid figure element, and include the aspect ratio class.' ).toHaveClass( /wp-embed-aspect-16-9/ ); await embedUtils.insertEmbed( 'https://cloudup.com/cQFlxqtY4ob' ); await expect( - currenEmbedBlock.locator( 'iframe' ), + currentEmbedBlock.locator( 'iframe' ), 'Photo content. Should render valid iframe element.' ).toHaveAttribute( 'title', 'Embedded content from cloudup.com' ); } ); diff --git a/test/e2e/specs/editor/various/pattern-overrides.spec.js b/test/e2e/specs/editor/various/pattern-overrides.spec.js index 6f4a592930052..fdc474be02ca5 100644 --- a/test/e2e/specs/editor/various/pattern-overrides.spec.js +++ b/test/e2e/specs/editor/various/pattern-overrides.spec.js @@ -1018,10 +1018,10 @@ test.describe( 'Pattern Overrides', () => { } ) .last(); - await firstParagraph.fill( 'overriden content' ); - await expect( headingBlock ).toHaveText( 'overriden content' ); - await expect( firstParagraph ).toHaveText( 'overriden content' ); - await expect( secondParagraph ).toHaveText( 'overriden content' ); + await firstParagraph.fill( 'overridden content' ); + await expect( headingBlock ).toHaveText( 'overridden content' ); + await expect( firstParagraph ).toHaveText( 'overridden content' ); + await expect( secondParagraph ).toHaveText( 'overridden content' ); } ); } ); diff --git a/test/e2e/specs/editor/various/patterns.spec.js b/test/e2e/specs/editor/various/patterns.spec.js index 00a68a9f08ea5..a3af79289f270 100644 --- a/test/e2e/specs/editor/various/patterns.spec.js +++ b/test/e2e/specs/editor/various/patterns.spec.js @@ -517,7 +517,7 @@ test.describe( 'Synced pattern', () => { test( 'should show a proper message when the reusable block is missing', async ( { editor, } ) => { - // Insert a non-existant reusable block. + // Insert a non-existent reusable block. await editor.insertBlock( { name: 'core/block', attributes: { ref: 123456 }, diff --git a/test/e2e/specs/editor/various/post-title.spec.js b/test/e2e/specs/editor/various/post-title.spec.js index 1abf94f821574..5181efae598aa 100644 --- a/test/e2e/specs/editor/various/post-title.spec.js +++ b/test/e2e/specs/editor/various/post-title.spec.js @@ -22,7 +22,7 @@ test.describe( 'Post title', () => { editor.canvas.getByRole( 'document', { name: 'Empty block', } ), - 'sould move focus to an empty paragraph block when the Enter key is pressed' + 'should move focus to an empty paragraph block when the Enter key is pressed' ).toBeFocused(); } ); diff --git a/test/e2e/specs/editor/various/rich-text.spec.js b/test/e2e/specs/editor/various/rich-text.spec.js index 29b4fb3d58901..b38fae9dafaf7 100644 --- a/test/e2e/specs/editor/various/rich-text.spec.js +++ b/test/e2e/specs/editor/various/rich-text.spec.js @@ -758,7 +758,7 @@ test.describe( 'RichText (@firefox, @webkit)', () => { ); } ); - test( 'should navigate arround emoji', async ( { page, editor } ) => { + test( 'should navigate around emoji', async ( { page, editor } ) => { await editor.canvas .locator( 'role=button[name="Add default block"i]' ) .click(); diff --git a/test/e2e/specs/editor/various/scheduling.spec.js b/test/e2e/specs/editor/various/scheduling.spec.js index 2ea05589d0274..8d46f0d64ab55 100644 --- a/test/e2e/specs/editor/various/scheduling.spec.js +++ b/test/e2e/specs/editor/various/scheduling.spec.js @@ -10,9 +10,9 @@ const TIMEZONES = [ 'Pacific/Honolulu', 'UTC', 'Australia/Sydney' ]; test.describe( 'Scheduling', () => { TIMEZONES.forEach( ( timezone ) => { test.describe( `Timezone ${ timezone }`, () => { - let orignalTimezone; + let originalTimezone; test.beforeAll( async ( { requestUtils } ) => { - orignalTimezone = ( await requestUtils.getSiteSettings() ) + originalTimezone = ( await requestUtils.getSiteSettings() ) .timezone; await requestUtils.updateSiteSettings( { timezone } ); @@ -20,7 +20,7 @@ test.describe( 'Scheduling', () => { test.afterAll( async ( { requestUtils } ) => { await requestUtils.updateSiteSettings( { - timezone: orignalTimezone, + timezone: originalTimezone, } ); } ); diff --git a/test/e2e/specs/editor/various/splitting-merging.spec.js b/test/e2e/specs/editor/various/splitting-merging.spec.js index 146039a7c7d1b..e094b5d60468c 100644 --- a/test/e2e/specs/editor/various/splitting-merging.spec.js +++ b/test/e2e/specs/editor/various/splitting-merging.spec.js @@ -539,7 +539,7 @@ test.describe( 'splitting and merging blocks (@firefox, @webkit)', () => { expect( await editor.getBlocks() ).toMatchObject( snap1 ); await page.keyboard.press( 'Delete' ); - // Carret should be in the first block and at the proper position. + // Caret should be in the first block and at the proper position. await page.keyboard.type( '-' ); // Check the content. @@ -560,7 +560,7 @@ test.describe( 'splitting and merging blocks (@firefox, @webkit)', () => { expect( await editor.getBlocks() ).toMatchObject( snap1 ); await page.keyboard.press( 'Backspace' ); - // Carret should be in the first block and at the proper position. + // Caret should be in the first block and at the proper position. await page.keyboard.type( '-' ); // Check the content. diff --git a/test/e2e/specs/editor/various/typewriter.spec.js b/test/e2e/specs/editor/various/typewriter.spec.js index abf24cbfc298e..7597b8ea71e13 100644 --- a/test/e2e/specs/editor/various/typewriter.spec.js +++ b/test/e2e/specs/editor/various/typewriter.spec.js @@ -231,14 +231,14 @@ test.describe( 'Typewriter', () => { activeElement.offsetHeight + 10; } ); - const bottomPostition = await typewriterUtils.getCaretPosition(); + const bottomPosition = await typewriterUtils.getCaretPosition(); // Should scroll the caret back into view (preserve browser behaviour). await page.keyboard.type( 'a' ); const newBottomPosition = await typewriterUtils.getCaretPosition(); - expect( newBottomPosition ).toBeLessThanOrEqual( bottomPostition ); + expect( newBottomPosition ).toBeLessThanOrEqual( bottomPosition ); // Should maintain new caret position. await page.keyboard.press( 'Enter' ); @@ -263,14 +263,14 @@ test.describe( 'Typewriter', () => { activeElement.offsetHeight + 10; } ); - const topPostition = await typewriterUtils.getCaretPosition(); + const topPosition = await typewriterUtils.getCaretPosition(); // Should scroll the caret back into view (preserve browser behaviour). await page.keyboard.type( 'a' ); const newTopPosition = await typewriterUtils.getCaretPosition(); - expect( newTopPosition ).toBeGreaterThan( topPostition ); + expect( newTopPosition ).toBeGreaterThan( topPosition ); // Should maintain new caret position. await page.keyboard.press( 'Enter' ); diff --git a/test/e2e/specs/interactivity/directive-bind.spec.ts b/test/e2e/specs/interactivity/directive-bind.spec.ts index 11902018e0753..8c637875b1634 100644 --- a/test/e2e/specs/interactivity/directive-bind.spec.ts +++ b/test/e2e/specs/interactivity/directive-bind.spec.ts @@ -231,7 +231,7 @@ test.describe( 'data-wp-bind', () => { ] ); // Only check the rendered value if the new value is not - // `undefined` and the attibute is neither `value` nor + // `undefined` and the attribute is neither `value` nor // `disabled` because Preact doesn't update the attribute // for those cases. // See https://github.com/preactjs/preact/blob/099c38c6ef92055428afbc116d18a6b9e0c2ea2c/src/diff/index.js#L471-L494 diff --git a/test/e2e/specs/interactivity/directive-each.spec.ts b/test/e2e/specs/interactivity/directive-each.spec.ts index 511b38e7ddbb8..dd27e95f16ec6 100644 --- a/test/e2e/specs/interactivity/directive-each.spec.ts +++ b/test/e2e/specs/interactivity/directive-each.spec.ts @@ -18,7 +18,7 @@ test.describe( 'data-wp-each', () => { await utils.deleteAllPosts(); } ); - test( 'should use `item` as the defaul item name in the context', async ( { + test( 'should use `item` as the default item name in the context', async ( { page, } ) => { const elements = page.getByTestId( 'letters' ).getByTestId( 'item' ); diff --git a/test/e2e/specs/interactivity/router-navigate.spec.ts b/test/e2e/specs/interactivity/router-navigate.spec.ts index d1ac30783ee2b..324800aed6047 100644 --- a/test/e2e/specs/interactivity/router-navigate.spec.ts +++ b/test/e2e/specs/interactivity/router-navigate.spec.ts @@ -264,7 +264,7 @@ test.describe( 'Router navigate', () => { const count = page.getByTestId( 'router navigations count' ); const title = page.getByTestId( 'title' ); - // Check the cound to ensure the page has hydrated. + // Check the count to ensure the page has hydrated. await expect( count ).toHaveText( '0' ); // Navigate to a page without clientNavigationDisabled. diff --git a/test/integration/helpers/integration-test-editor.js b/test/integration/helpers/integration-test-editor.js index bc2e6f71a954f..693c4f246fede 100644 --- a/test/integration/helpers/integration-test-editor.js +++ b/test/integration/helpers/integration-test-editor.js @@ -36,7 +36,7 @@ const { ExperimentalBlockCanvas: BlockCanvas } = unlock( blockEditorPrivateApis ); -// Polyfill for String.prototype.replaceAll until CI is runnig Node 15 or higher. +// Polyfill for String.prototype.replaceAll until CI is running Node 15 or higher. if ( ! String.prototype.replaceAll ) { String.prototype.replaceAll = function ( str, newStr ) { // If a regex pattern diff --git a/test/native/integration/editor-history.native.js b/test/native/integration/editor-history.native.js index 9b2c212d17ee7..e111b4fcd4098 100644 --- a/test/native/integration/editor-history.native.js +++ b/test/native/integration/editor-history.native.js @@ -110,7 +110,7 @@ describe( 'Editor History', () => { const paragraphTextInput = within( paragraphBlock ).getByPlaceholderText( 'Start writing…' ); typeInRichText( paragraphTextInput, 'A quick brown fox' ); - // Artifical delay to create two history entries for typing + // Artificial delay to create two history entries for typing await new Promise( ( resolve ) => setTimeout( resolve, 1000 ) ); typeInRichText( paragraphTextInput, ' jumps over the lazy dog.' ); @@ -177,7 +177,7 @@ describe( 'Editor History', () => { 'A quick brown fox jumps over the lazy dog.', { finalSelectionStart: 2, finalSelectionEnd: 7 } ); - // Artifical delay to create two history entries for typing and formatting. + // Artificial delay to create two history entries for typing and formatting. await new Promise( ( resolve ) => setTimeout( resolve, 1000 ) ); fireEvent.press( screen.getByLabelText( 'Bold' ) ); fireEvent.press( screen.getByLabelText( 'Italic' ) );