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
5 changes: 1 addition & 4 deletions bin/api-docs/update-api-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ const PACKAGES_DIR = resolve( ROOT_DIR, 'packages' );
*
* @type {string}
*/
const DATA_DOCS_DIR = resolve(
ROOT_DIR,
'docs/designers-developers/developers/data'
);
const DATA_DOCS_DIR = resolve( ROOT_DIR, 'docs/reference-guides/data' );

/**
* Pattern matching start token of a README file.
Expand Down
9 changes: 5 additions & 4 deletions docs/reference-guides/data/data-core-annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ Namespace: `core/annotations`.

## Selectors

<!-- START TOKEN(Autogenerated selectors|../../../../packages/annotations/src/store/selectors.js) -->
<!-- START TOKEN(Autogenerated selectors|../../../packages/annotations/src/store/selectors.js) -->

Nothing to document.

<!-- END TOKEN(Autogenerated selectors|../../../../packages/annotations/src/store/selectors.js) -->
<!-- END TOKEN(Autogenerated selectors|../../../packages/annotations/src/store/selectors.js) -->

## Actions

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

Nothing to document.

<!-- END TOKEN(Autogenerated actions|../../../../packages/annotations/src/store/actions.js) -->

<!-- END TOKEN(Autogenerated actions|../../../packages/annotations/src/store/actions.js) -->
41 changes: 29 additions & 12 deletions docs/reference-guides/data/data-core-block-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Namespace: `core/block-editor`.

## Selectors

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

<a name="areInnerBlocksControlled" href="#areInnerBlocksControlled">#</a> **areInnerBlocksControlled**

Expand Down Expand Up @@ -705,11 +705,11 @@ Returns the defined block template

_Parameters_

- _state_ `boolean`:
- _state_ `boolean`:

_Returns_

- `?Array`: Block Template
- `?Array`: Block Template.

<a name="getTemplateLock" href="#getTemplateLock">#</a> **getTemplateLock**

Expand Down Expand Up @@ -1027,17 +1027,31 @@ Returns whether the blocks matches the template or not.

_Parameters_

- _state_ `boolean`:
- _state_ `boolean`:

_Returns_

- `?boolean`: Whether the template is valid or not.

<!-- END TOKEN(Autogenerated selectors|../../../../packages/block-editor/src/store/selectors.js) -->
<a name="wasBlockJustInserted" href="#wasBlockJustInserted">#</a> **wasBlockJustInserted**

Tells if the block with the passed clientId was just inserted.

_Parameters_

- _state_ `Object`: Global application state.
- _clientId_ `Object`: Client Id of the block.
- _source_ `?string`: Optional insertion source of the block.

_Returns_

- `boolean`: True if the block matches the last block inserted from the specified source.

<!-- END TOKEN(Autogenerated selectors|../../../packages/block-editor/src/store/selectors.js) -->

## Actions

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

<a name="clearSelectedBlock" href="#clearSelectedBlock">#</a> **clearSelectedBlock**

Expand All @@ -1053,8 +1067,8 @@ Generator that triggers an action used to duplicate a list of blocks.

_Parameters_

- _clientIds_ `string[]`:
- _updateSelection_ `boolean`:
- _clientIds_ `string[]`:
- _updateSelection_ `boolean`:

<a name="enterFormattedText" href="#enterFormattedText">#</a> **enterFormattedText**

Expand Down Expand Up @@ -1095,15 +1109,15 @@ Generator used to insert an empty block before a given block.

_Parameters_

- _clientId_ `string`:
- _clientId_ `string`:

<a name="insertBeforeBlock" href="#insertBeforeBlock">#</a> **insertBeforeBlock**

Generator used to insert an empty block after a given block.

_Parameters_

- _clientId_ `string`:
- _clientId_ `string`:

<a name="insertBlock" href="#insertBlock">#</a> **insertBlock**

Expand All @@ -1116,6 +1130,7 @@ _Parameters_
- _index_ `?number`: Index at which block should be inserted.
- _rootClientId_ `?string`: Optional root client ID of block list on which to insert.
- _updateSelection_ `?boolean`: If true block selection will be updated. If false, block selection will not change. Defaults to true.
- _meta_ `?Object`: Optional Meta values to be passed to the action object.

_Returns_

Expand All @@ -1131,7 +1146,7 @@ _Parameters_
- _blocks_ `Object[]`: Block objects to insert.
- _index_ `?number`: Index at which block should be inserted.
- _rootClientId_ `?string`: Optional root client ID of block list on which to insert.
- _updateSelection_ `?boolean`: If true block selection will be updated. If false, block selection will not change. Defaults to true.
- _updateSelection_ `?boolean`: If true block selection will be updated. If false, block selection will not change. Defaults to true.
- _initialPosition_ `0|-1|null`: Initial focus position. Setting it to null prevent focusing the inserted block.
- _meta_ `?Object`: Optional Meta values to be passed to the action object.

Expand Down Expand Up @@ -1406,6 +1421,7 @@ _Parameters_

- _rootClientId_ `?string`: Optional root client ID of block list on which to insert.
- _index_ `?number`: Index at which block should be inserted.
- _\_\_unstableOptions_ `Object`: Wether or not to show an inserter button.

_Returns_

Expand Down Expand Up @@ -1570,4 +1586,5 @@ _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.js) -->
35 changes: 30 additions & 5 deletions docs/reference-guides/data/data-core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,31 @@ Namespace: `core/blocks`.

## Selectors

<!-- START TOKEN(Autogenerated selectors|../../../../packages/blocks/src/store/selectors.js) -->
<!-- START TOKEN(Autogenerated selectors|../../../packages/blocks/src/store/selectors.js) -->

<a name="getActiveBlockVariation" href="#getActiveBlockVariation">#</a> **getActiveBlockVariation**

Returns the active block variation for a given block based on its attributes.
Variations are determined by their `isActive` property.
Which is either an array of block attribute keys or a function.

In case of an array of block attribute keys, the `attributes` are compared
to the variation's attributes using strict equality check.

In case of function type, the function should accept a block's attributes
and the variation's attributes and determines if a variation is active.
A function that accepts a block's attributes and the variation's attributes and determines if a variation is active.

_Parameters_

- _state_ `Object`: Data state.
- _blockName_ `string`: Name of block (example: “core/columns”).
- _attributes_ `Object`: Block attributes used to determine active variation.
- _scope_ `[WPBlockVariationScope]`: Block variation scope name.

_Returns_

- `(WPBlockVariation|undefined)`: Active block variation.

<a name="getBlockStyles" href="#getBlockStyles">#</a> **getBlockStyles**

Expand All @@ -27,7 +51,7 @@ _Parameters_

- _state_ `Object`: Data state.
- _nameOrType_ `(string|Object)`: Block name or type object
- _feature_ `string`: Feature to retrieve
- _feature_ `Array|string`: Feature to retrieve
- _defaultSupports_ `*`: Default value to return if not explicitly defined

_Returns_
Expand Down Expand Up @@ -231,11 +255,11 @@ _Returns_

- `Object[]`: Whether block type matches search term.

<!-- END TOKEN(Autogenerated selectors|../../../../packages/blocks/src/store/selectors.js) -->
<!-- END TOKEN(Autogenerated selectors|../../../packages/blocks/src/store/selectors.js) -->

## Actions

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

<a name="addBlockCollection" href="#addBlockCollection">#</a> **addBlockCollection**

Expand Down Expand Up @@ -416,4 +440,5 @@ _Returns_

- `Object`: Action object.

<!-- END TOKEN(Autogenerated actions|../../../../packages/blocks/src/store/actions.js) -->

<!-- END TOKEN(Autogenerated actions|../../../packages/blocks/src/store/actions.js) -->
57 changes: 50 additions & 7 deletions docs/reference-guides/data/data-core-edit-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Namespace: `core/edit-post`.

## Selectors

<!-- START TOKEN(Autogenerated selectors|../../../../packages/edit-post/src/store/selectors.js) -->
<!-- START TOKEN(Autogenerated selectors|../../../packages/edit-post/src/store/selectors.js) -->

<a name="getActiveGeneralSidebarName" href="#getActiveGeneralSidebarName">#</a> **getActiveGeneralSidebarName**

Expand Down Expand Up @@ -49,6 +49,14 @@ _Returns_

- `Array`: List of meta boxes.

<a name="getEditedPostTemplate" href="#getEditedPostTemplate">#</a> **getEditedPostTemplate**

Retrieves the template of the currently edited post.

_Returns_

- `Object?`: Post Template.

<a name="getEditorMode" href="#getEditorMode">#</a> **getEditorMode**

Returns the current editing mode.
Expand Down Expand Up @@ -201,6 +209,18 @@ _Returns_

- `boolean`: Whether the inserter is opened.

<a name="isListViewOpened" href="#isListViewOpened">#</a> **isListViewOpened**

Returns true if the list view is opened.

_Parameters_

- _state_ `Object`: Global application state.

_Returns_

- `boolean`: Whether the list view is opened.

<a name="isMetaBoxLocationActive" href="#isMetaBoxLocationActive">#</a> **isMetaBoxLocationActive**

Returns true if there is an active meta box in the given location, or false
Expand Down Expand Up @@ -261,7 +281,7 @@ Returns true if the plugin sidebar is opened.

_Parameters_

- _state_ `Object`: Global application state
- _state_ `Object`: Global application state.

_Returns_

Expand Down Expand Up @@ -291,11 +311,11 @@ _Returns_

- `boolean`: Whether the metaboxes are being saved.

<!-- END TOKEN(Autogenerated selectors|../../../../packages/edit-post/src/store/selectors.js) -->
<!-- END TOKEN(Autogenerated selectors|../../../packages/edit-post/src/store/selectors.js) -->

## Actions

<!-- START TOKEN(Autogenerated actions|../../../../packages/edit-post/src/store/actions.js) -->
<!-- START TOKEN(Autogenerated actions|../../../packages/edit-post/src/store/actions.js) -->

<a name="closeGeneralSidebar" href="#closeGeneralSidebar">#</a> **closeGeneralSidebar**

Expand Down Expand Up @@ -331,9 +351,17 @@ _Returns_

- `Object`: Action object.

<a name="metaBoxUpdatesFailure" href="#metaBoxUpdatesFailure">#</a> **metaBoxUpdatesFailure**

Returns an action object used to signal a failed meta box update.

_Returns_

- `Object`: Action object.

<a name="metaBoxUpdatesSuccess" href="#metaBoxUpdatesSuccess">#</a> **metaBoxUpdatesSuccess**

Returns an action object used signal a successful meta box update.
Returns an action object used to signal a successful meta box update.

_Returns_

Expand Down Expand Up @@ -411,7 +439,21 @@ Returns an action object used to open/close the inserter.

_Parameters_

- _value_ `boolean`: A boolean representing whether the inserter should be opened or closed.
- _value_ `boolean|Object`: Whether the inserter should be opened (true) or closed (false). To specify an insertion point, use an object.
- _value.rootClientId_ `string`: The root client ID to insert at.
- _value.insertionIndex_ `number`: The index to insert at.

_Returns_

- `Object`: Action object.

<a name="setIsListViewOpened" href="#setIsListViewOpened">#</a> **setIsListViewOpened**

Returns an action object used to open/close the list view.

_Parameters_

- _isOpen_ `boolean`: A boolean representing whether the list view should be opened or closed.

_Returns_

Expand Down Expand Up @@ -503,4 +545,5 @@ _Returns_

- `Object`: Action object.

<!-- END TOKEN(Autogenerated actions|../../../../packages/edit-post/src/store/actions.js) -->

<!-- END TOKEN(Autogenerated actions|../../../packages/edit-post/src/store/actions.js) -->
Loading