Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/contributors/code/coding-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ export function MyComponent() {

WordPress extenders cannot update the private block settings on their own. The `updateSettings()` actions of the `@wordpress/block-editor` store will filter out all the settings that are **not** a part of the public API. The only way to actually store them is via the private action `__experimentalUpdateSettings()`.

To privatize a block editor setting, add it to the `privateSettings` list in [/packages/block-editor/src/store/private-actions.js](/packages/block-editor/src/store/private-actions.js):
To privatize a block editor setting, add it to the `privateSettings` list in [/packages/block-editor/src/store/private-actions.ts](/packages/block-editor/src/store/private-actions.ts):

```js
const privateSettings = [
Expand Down
8 changes: 4 additions & 4 deletions docs/reference-guides/data/data-core-block-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ _Returns_

## Actions

<!-- START TOKEN(Autogenerated actions|../../../packages/block-editor/src/store/actions.js) -->
<!-- START TOKEN(Autogenerated actions|../../../packages/block-editor/src/store/actions.ts) -->

### clearSelectedBlock

Expand Down Expand Up @@ -1668,7 +1668,7 @@ Action that changes the position of the user caret.

_Parameters_

- _clientId_ `string|WPSelection`: The selected block client ID.
- _clientId_ `string|Selection`: The selected block client ID.
- _attributeKey_ `string`: The selected block attribute key.
- _startOffset_ `number`: The start offset.
- _endOffset_ `number`: The end offset.
Expand Down Expand Up @@ -1767,7 +1767,7 @@ _Returns_
_Properties_

- _\_\_unstableWithInserter_ `boolean`: Whether or not to show an inserter button.
- _operation_ `WPDropOperation`: The operation to perform when applied, either 'insert' or 'replace' for now.
- _operation_ `'insert'|'replace'`: The operation to perform when applied, either 'insert' or 'replace' for now.

### startDraggingBlocks

Expand Down Expand Up @@ -1939,4 +1939,4 @@ _Parameters_

- _blocks_ `Array`: Array of blocks.

<!-- END TOKEN(Autogenerated actions|../../../packages/block-editor/src/store/actions.js) -->
<!-- END TOKEN(Autogenerated actions|../../../packages/block-editor/src/store/actions.ts) -->
1 change: 1 addition & 0 deletions packages/block-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
- Convert the store reducer to TypeScript and add the store `State` and `Action` types ([#84624](https://github.com/WordPress/gutenberg/pull/84624)).
- Convert the store selectors and `store/utils` to TypeScript ([#84631](https://github.com/WordPress/gutenberg/pull/84631)).
- Convert the store private selectors to TypeScript and type the editor settings the store reads ([#84662](https://github.com/WordPress/gutenberg/pull/84662)).
- Convert the store actions and private actions to TypeScript and add the store thunk arguments type ([#84672](https://github.com/WordPress/gutenberg/pull/84672)).

## 18.1.0 (2026-10-07)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { useSelect } from '@wordpress/data';
import { store as blockEditorStore } from '../../../store';
import { unlock } from '../../../lock-unlock';

/** @typedef {import('../../../store/actions').InserterMediaRequest} InserterMediaRequest */
/** @typedef {import('../../../store/actions').InserterMediaItem} InserterMediaItem */
/** @typedef {import('../../../store/actions').InserterMediaCategory} InserterMediaCategory */
/** @typedef {import('../../../store/actions').InserterMediaResponse} InserterMediaResponse */
/** @typedef {import('../../../store/types').InserterMediaRequest} InserterMediaRequest */
/** @typedef {import('../../../store/types').InserterMediaItem} InserterMediaItem */
/** @typedef {import('../../../store/types').InserterMediaCategory} InserterMediaCategory */
/** @typedef {import('../../../store/types').InserterMediaResponse} InserterMediaResponse */

/**
* Normalizes the result of a media category's `fetch`, which may be either a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type InserterMediaCategory =
import( '../../../store/actions' ).InserterMediaCategory;
import( '../../../store/types' ).InserterMediaCategory;

/**
* Taken from the registration interface so the two cannot drift.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import DetachConfirmation from './detach-confirmation';
import type { MediaItem } from './types';

type InserterMediaCategory =
import( '../../../store/actions' ).InserterMediaCategory;
import( '../../../store/types' ).InserterMediaCategory;
type InserterMediaItem = import( '../../../store/types' ).InserterMediaItem;

/**
* A core media category: the public interface plus the private capabilities
Expand Down Expand Up @@ -180,7 +181,13 @@ export function useAttachmentActions( {
callback: ( [ media ]: MediaItem[] ) => {
// `open` returns null when a popup blocker steps in.
window
.open( category.getReportUrl?.( media ), '_blank' )
.open(
// Only external sources report items, and their titles are strings.
category.getReportUrl?.(
media as InserterMediaItem
),
'_blank'
)
?.focus();
},
} );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,7 @@ function Fields( {
return;
}
const [ clientId ] = clientIds;
const block = registry
.select( blockEditorStore )
.getBlock( clientId ) as { attributes: Record< string, unknown > };
const block = registry.select( blockEditorStore ).getBlock( clientId )!;
registry.batch( () => {
selectionChange( clientId, keys[ 0 ], start, end );
replaceBlocks(
Expand Down
Loading
Loading