diff --git a/docs/reference-guides/data/data-core-block-editor.md b/docs/reference-guides/data/data-core-block-editor.md index fc01e5cd49f65..c7c71e86845ff 100644 --- a/docs/reference-guides/data/data-core-block-editor.md +++ b/docs/reference-guides/data/data-core-block-editor.md @@ -6,7 +6,7 @@ Namespace: `core/block-editor`. -# **areInnerBlocksControlled** +### areInnerBlocksControlled Checks if a given block has controlled inner blocks. @@ -19,7 +19,7 @@ _Returns_ - `boolean`: True if the block has controlled inner blocks. -# **canInsertBlocks** +### canInsertBlocks Determines if the given blocks are allowed to be inserted into the block list. @@ -34,7 +34,7 @@ _Returns_ - `boolean`: Whether the given blocks are allowed to be inserted. -# **canInsertBlockType** +### canInsertBlockType Determines if the given block type is allowed to be inserted into the block list. @@ -48,7 +48,7 @@ _Returns_ - `boolean`: Whether the given block type is allowed to be inserted. -# **didAutomaticChange** +### didAutomaticChange Returns true if the last change was an automatic change, false otherwise. @@ -60,7 +60,7 @@ _Returns_ - `boolean`: Whether the last change was automatic. -# **getAdjacentBlockClientId** +### getAdjacentBlockClientId Returns the client ID of the block adjacent one at the given reference startClientId and modifier directionality. Defaults start startClientId to @@ -77,7 +77,7 @@ _Returns_ - `?string`: Return the client ID of the block, or null if none exists. -# **getBlock** +### getBlock Returns a block given its client ID. This is a parsed copy of the block, containing its `blockName`, `clientId`, and current `attributes` state. This @@ -103,7 +103,7 @@ _Returns_ - `Object`: Parsed block object. -# **getBlockAttributes** +### getBlockAttributes Returns a block's attributes given its client ID, or null if no block exists with the client ID. @@ -117,7 +117,7 @@ _Returns_ - `Object?`: Block attributes. -# **getBlockCount** +### getBlockCount Returns the number of blocks currently present in the post. @@ -130,7 +130,7 @@ _Returns_ - `number`: Number of blocks in the post. -# **getBlockHierarchyRootClientId** +### getBlockHierarchyRootClientId Given a block client ID, returns the root of the hierarchy from which the block is nested, return the block itself for root level blocks. @@ -143,7 +143,7 @@ _Returns_ - `string`: Root client ID -# **getBlockIndex** +### getBlockIndex Returns the index at which the block corresponding to the specified client ID occurs within the block order, or `-1` if the block does not exist. @@ -158,7 +158,7 @@ _Returns_ - `number`: Index at which block exists in order. -# **getBlockInsertionPoint** +### getBlockInsertionPoint Returns the insertion point, the index at which the new inserted block would be placed. Defaults to the last index. @@ -171,7 +171,7 @@ _Returns_ - `Object`: Insertion point object with `rootClientId`, `index`. -# **getBlockListSettings** +### getBlockListSettings Returns the Block List settings of a block, if any exist. @@ -184,7 +184,7 @@ _Returns_ - `?Object`: Block settings of the block if set. -# **getBlockMode** +### getBlockMode Returns the block's editing mode, defaulting to "visual" if not explicitly assigned. @@ -198,7 +198,7 @@ _Returns_ - `Object`: Block editing mode. -# **getBlockName** +### getBlockName Returns a block's name given its client ID, or null if no block exists with the client ID. @@ -212,7 +212,7 @@ _Returns_ - `string`: Block name. -# **getBlockOrder** +### getBlockOrder Returns an array containing all block client IDs in the editor in the order they appear. Optionally accepts a root client ID of the block list for which @@ -227,7 +227,7 @@ _Returns_ - `Array`: Ordered client IDs of editor blocks. -# **getBlockParents** +### getBlockParents Given a block client ID, returns the list of all its parents from top to bottom. @@ -241,7 +241,7 @@ _Returns_ - `Array`: ClientIDs of the parent blocks. -# **getBlockParentsByBlockName** +### getBlockParentsByBlockName Given a block client ID and a block name, returns the list of all its parents from top to bottom, filtered by the given name(s). For example, if passed @@ -260,7 +260,7 @@ _Returns_ - `Array`: ClientIDs of the parent blocks. -# **getBlockRootClientId** +### getBlockRootClientId Given a block client ID, returns the root block from which the block is nested, an empty string for top-level blocks, or null if the block does not @@ -275,7 +275,7 @@ _Returns_ - `?string`: Root client ID, if exists -# **getBlocks** +### getBlocks Returns all block objects for the current post being edited as an array in the order they appear in the post. Note that this will exclude child blocks @@ -296,7 +296,7 @@ _Returns_ - `Object[]`: Post blocks. -# **getBlocksByClientId** +### getBlocksByClientId Given an array of block client IDs, returns the corresponding array of block objects. @@ -310,7 +310,7 @@ _Returns_ - `WPBlock[]`: Block objects. -# **getBlockSelectionEnd** +### getBlockSelectionEnd Returns the current block selection end. This value may be null, and it may represent either a singular block selection or multi-selection end. @@ -324,7 +324,7 @@ _Returns_ - `?string`: Client ID of block selection end. -# **getBlockSelectionStart** +### getBlockSelectionStart Returns the current block selection start. This value may be null, and it may represent either a singular block selection or multi-selection start. @@ -338,7 +338,7 @@ _Returns_ - `?string`: Client ID of block selection start. -# **getBlockTransformItems** +### getBlockTransformItems Determines the items that appear in the available block transforms list. @@ -372,7 +372,7 @@ _Properties_ - _isDisabled_ `boolean`: Whether or not the user should be prevented from inserting this item. - _frecency_ `number`: Heuristic that combines frequency and recency. -# **getClientIdsOfDescendants** +### getClientIdsOfDescendants Returns an array containing the clientIds of all descendants of the blocks given. @@ -386,7 +386,7 @@ _Returns_ - `Array`: ids of descendants. -# **getClientIdsWithDescendants** +### getClientIdsWithDescendants Returns an array containing the clientIds of the top-level blocks and their descendants of any depth (for nested blocks). @@ -399,7 +399,7 @@ _Returns_ - `Array`: ids of top-level and descendant blocks. -# **getDraggedBlockClientIds** +### getDraggedBlockClientIds Returns the client ids of any blocks being directly dragged. @@ -413,7 +413,7 @@ _Returns_ - `string[]`: Array of dragged block client ids. -# **getFirstMultiSelectedBlockClientId** +### getFirstMultiSelectedBlockClientId Returns the client ID of the first block in the multi-selection set, or null if there is no multi-selection. @@ -426,7 +426,7 @@ _Returns_ - `?string`: First block client ID in the multi-selection set. -# **getGlobalBlockCount** +### getGlobalBlockCount Returns the total number of blocks, or the total number of blocks with a specific name in a post. The number returned includes nested blocks. @@ -440,7 +440,7 @@ _Returns_ - `number`: Number of blocks in the post, or number of blocks with name equal to blockName. -# **getInserterItems** +### getInserterItems Determines the items that appear in the inserter. Includes both static items (e.g. a regular block type) and dynamic items (e.g. a reusable block). @@ -478,7 +478,7 @@ _Properties_ - _isDisabled_ `boolean`: Whether or not the user should be prevented from inserting this item. - _frecency_ `number`: Heuristic that combines frequency and recency. -# **getLastMultiSelectedBlockClientId** +### getLastMultiSelectedBlockClientId Returns the client ID of the last block in the multi-selection set, or null if there is no multi-selection. @@ -491,7 +491,7 @@ _Returns_ - `?string`: Last block client ID in the multi-selection set. -# **getLowestCommonAncestorWithSelectedBlock** +### getLowestCommonAncestorWithSelectedBlock Given a block client ID, returns the lowest common ancestor with selected client ID. @@ -504,7 +504,7 @@ _Returns_ - `string`: Common ancestor client ID or undefined -# **getMultiSelectedBlockClientIds** +### getMultiSelectedBlockClientIds Returns the current multi-selection set of block client IDs, or an empty array if there is no multi-selection. @@ -517,7 +517,7 @@ _Returns_ - `Array`: Multi-selected block client IDs. -# **getMultiSelectedBlocks** +### getMultiSelectedBlocks Returns the current multi-selection set of blocks, or an empty array if there is no multi-selection. @@ -530,7 +530,7 @@ _Returns_ - `Array`: Multi-selected block objects. -# **getMultiSelectedBlocksEndClientId** +### getMultiSelectedBlocksEndClientId Returns the client ID of the block which ends the multi-selection set, or null if there is no multi-selection. @@ -549,7 +549,7 @@ _Returns_ - `?string`: Client ID of block ending multi-selection. -# **getMultiSelectedBlocksStartClientId** +### getMultiSelectedBlocksStartClientId Returns the client ID of the block which begins the multi-selection set, or null if there is no multi-selection. @@ -568,7 +568,7 @@ _Returns_ - `?string`: Client ID of block beginning multi-selection. -# **getNextBlockClientId** +### getNextBlockClientId Returns the next block's client ID from the given reference start ID. Defaults start to the selected block. Returns null if there is no next @@ -583,7 +583,7 @@ _Returns_ - `?string`: Adjacent block's client ID, or null if none exists. -# **getPreviousBlockClientId** +### getPreviousBlockClientId Returns the previous block's client ID from the given reference start ID. Defaults start to the selected block. Returns null if there is no previous @@ -598,7 +598,7 @@ _Returns_ - `?string`: Adjacent block's client ID, or null if none exists. -# **getSelectedBlock** +### getSelectedBlock Returns the currently selected block, or null if there is no selected block. @@ -610,7 +610,7 @@ _Returns_ - `?Object`: Selected block. -# **getSelectedBlockClientId** +### getSelectedBlockClientId Returns the currently selected block client ID, or null if there is no selected block. @@ -623,7 +623,7 @@ _Returns_ - `?string`: Selected block client ID. -# **getSelectedBlockClientIds** +### getSelectedBlockClientIds Returns the current selection set of block client IDs (multiselection or single selection). @@ -635,7 +635,7 @@ _Returns_ - `Array`: Multi-selected block client IDs. -# **getSelectedBlockCount** +### getSelectedBlockCount Returns the number of blocks currently selected in the post. @@ -647,7 +647,7 @@ _Returns_ - `number`: Number of blocks selected in the post. -# **getSelectedBlocksInitialCaretPosition** +### getSelectedBlocksInitialCaretPosition Returns the initial caret position for the selected block. This position is to used to position the caret properly when the selected block changes. @@ -661,7 +661,7 @@ _Returns_ - `0|-1|null`: Initial position. -# **getSelectionEnd** +### getSelectionEnd Returns the current selection end block client ID, attribute key and text offset. @@ -674,7 +674,7 @@ _Returns_ - `WPBlockSelection`: Selection end information. -# **getSelectionStart** +### getSelectionStart Returns the current selection start block client ID, attribute key and text offset. @@ -687,7 +687,7 @@ _Returns_ - `WPBlockSelection`: Selection start information. -# **getSettings** +### getSettings Returns the editor settings. @@ -699,7 +699,7 @@ _Returns_ - `Object`: The editor settings object. -# **getTemplate** +### getTemplate Returns the defined block template @@ -711,7 +711,7 @@ _Returns_ - `?Array`: Block Template. -# **getTemplateLock** +### getTemplateLock Returns the defined block template lock. Optionally accepts a root block client ID as context, otherwise defaulting to the global context. @@ -725,7 +725,7 @@ _Returns_ - `?string`: Block Template Lock -# **hasBlockMovingClientId** +### hasBlockMovingClientId Returns whether block moving mode is enabled. @@ -737,7 +737,7 @@ _Returns_ - `string`: Client Id of moving block. -# **hasInserterItems** +### hasInserterItems Determines whether there are items to show in the inserter. @@ -750,7 +750,7 @@ _Returns_ - `boolean`: Items that appear in inserter. -# **hasMultiSelection** +### hasMultiSelection Returns true if a multi-selection has been made, or false otherwise. @@ -762,7 +762,7 @@ _Returns_ - `boolean`: Whether multi-selection has been made. -# **hasSelectedBlock** +### hasSelectedBlock Returns true if there is a single selected block, or false otherwise. @@ -774,7 +774,7 @@ _Returns_ - `boolean`: Whether a single block is selected. -# **hasSelectedInnerBlock** +### hasSelectedInnerBlock Returns true if one of the block's inner blocks is selected. @@ -788,7 +788,7 @@ _Returns_ - `boolean`: Whether the block as an inner block selected -# **isAncestorBeingDragged** +### isAncestorBeingDragged Returns whether a parent/ancestor of the block is being dragged. @@ -801,7 +801,7 @@ _Returns_ - `boolean`: Whether the block's ancestor is being dragged. -# **isAncestorMultiSelected** +### isAncestorMultiSelected Returns true if an ancestor of the block is multi-selected, or false otherwise. @@ -815,7 +815,7 @@ _Returns_ - `boolean`: Whether an ancestor of the block is in multi-selection set. -# **isBlockBeingDragged** +### isBlockBeingDragged Returns whether the block is being dragged. @@ -832,7 +832,7 @@ _Returns_ - `boolean`: Whether the block is being dragged. -# **isBlockHighlighted** +### isBlockHighlighted Returns true if the current highlighted block matches the block clientId. @@ -845,7 +845,7 @@ _Returns_ - `boolean`: Whether the block is currently highlighted. -# **isBlockInsertionPointVisible** +### isBlockInsertionPointVisible Returns true if we should show the block insertion point. @@ -857,7 +857,7 @@ _Returns_ - `?boolean`: Whether the insertion point is visible or not. -# **isBlockMultiSelected** +### isBlockMultiSelected Returns true if the client ID occurs within the block multi-selection, or false otherwise. @@ -871,7 +871,7 @@ _Returns_ - `boolean`: Whether block is in multi-selection set. -# **isBlockSelected** +### isBlockSelected Returns true if the block corresponding to the specified client ID is currently selected and no multi-selection exists, or false otherwise. @@ -885,7 +885,7 @@ _Returns_ - `boolean`: Whether block is selected and multi-selection exists. -# **isBlockValid** +### isBlockValid Returns whether a block is valid or not. @@ -898,7 +898,7 @@ _Returns_ - `boolean`: Is Valid. -# **isBlockWithinSelection** +### isBlockWithinSelection Returns true if the block corresponding to the specified client ID is currently selected but isn't the last of the selected blocks. Here "last" @@ -914,7 +914,7 @@ _Returns_ - `boolean`: Whether block is selected and not the last in the selection. -# **isCaretWithinFormattedText** +### isCaretWithinFormattedText Returns true if the caret is within formatted text, or false otherwise. @@ -926,7 +926,7 @@ _Returns_ - `boolean`: Whether the caret is within formatted text. -# **isDraggingBlocks** +### isDraggingBlocks Returns true if the user is dragging blocks, or false otherwise. @@ -938,7 +938,7 @@ _Returns_ - `boolean`: Whether user is dragging blocks. -# **isFirstMultiSelectedBlock** +### isFirstMultiSelectedBlock Returns true if a multi-selection exists, and the block corresponding to the specified client ID is the first block of the multi-selection set, or false @@ -953,7 +953,7 @@ _Returns_ - `boolean`: Whether block is first in multi-selection. -# **isLastBlockChangePersistent** +### isLastBlockChangePersistent Returns true if the most recent block change is be considered persistent, or false otherwise. A persistent change is one committed by BlockEditorProvider @@ -967,7 +967,7 @@ _Returns_ - `boolean`: Whether the most recent block change was persistent. -# **isMultiSelecting** +### isMultiSelecting Whether in the process of multi-selecting or not. This flag is only true while the multi-selection is being selected (by mouse move), and is false @@ -985,7 +985,7 @@ _Returns_ - `boolean`: True if multi-selecting, false if not. -# **isNavigationMode** +### isNavigationMode Returns whether the navigation mode is enabled. @@ -997,7 +997,7 @@ _Returns_ - `boolean`: Is navigation mode enabled. -# **isSelectionEnabled** +### isSelectionEnabled Selector that returns if multi-selection is enabled or not. @@ -1009,7 +1009,7 @@ _Returns_ - `boolean`: True if it should be possible to multi-select blocks, false if multi-selection is disabled. -# **isTyping** +### isTyping Returns true if the user is typing, or false otherwise. @@ -1021,7 +1021,7 @@ _Returns_ - `boolean`: Whether user is typing. -# **isValidTemplate** +### isValidTemplate Returns whether the blocks matches the template or not. @@ -1033,7 +1033,7 @@ _Returns_ - `?boolean`: Whether the template is valid or not. -# **wasBlockJustInserted** +### wasBlockJustInserted Tells if the block with the passed clientId was just inserted. @@ -1053,7 +1053,7 @@ _Returns_ -# **clearSelectedBlock** +### clearSelectedBlock Returns an action object used in signalling that the block selection is cleared. @@ -1061,7 +1061,7 @@ _Returns_ - `Object`: Action object. -# **duplicateBlocks** +### duplicateBlocks Generator that triggers an action used to duplicate a list of blocks. @@ -1070,7 +1070,7 @@ _Parameters_ - _clientIds_ `string[]`: - _updateSelection_ `boolean`: -# **enterFormattedText** +### enterFormattedText Returns an action object used in signalling that the caret has entered formatted text. @@ -1078,7 +1078,7 @@ _Returns_ - `Object`: Action object. -# **exitFormattedText** +### exitFormattedText Returns an action object used in signalling that the user caret has exited formatted text. @@ -1086,7 +1086,7 @@ _Returns_ - `Object`: Action object. -# **flashBlock** +### flashBlock Yields action objects used in signalling that the block corresponding to the given clientId should appear to "flash" by rhythmically highlighting it. @@ -1095,7 +1095,7 @@ _Parameters_ - _clientId_ `string`: Target block client ID. -# **hideInsertionPoint** +### hideInsertionPoint Returns an action object hiding the insertion point. @@ -1103,7 +1103,7 @@ _Returns_ - `Object`: Action object. -# **insertAfterBlock** +### insertAfterBlock Generator used to insert an empty block before a given block. @@ -1111,7 +1111,7 @@ _Parameters_ - _clientId_ `string`: -# **insertBeforeBlock** +### insertBeforeBlock Generator used to insert an empty block after a given block. @@ -1119,7 +1119,7 @@ _Parameters_ - _clientId_ `string`: -# **insertBlock** +### insertBlock Returns an action object used in signalling that a single block should be inserted, optionally at a specific index respective a root block list. @@ -1136,7 +1136,7 @@ _Returns_ - `Object`: Action object. -# **insertBlocks** +### insertBlocks Returns an action object used in signalling that an array of blocks should be inserted, optionally at a specific index respective a root block list. @@ -1154,7 +1154,7 @@ _Returns_ - `Object`: Action object. -# **insertDefaultBlock** +### insertDefaultBlock Returns an action object used in signalling that a new block of the default type should be added to the block list. @@ -1169,7 +1169,7 @@ _Returns_ - `Object`: Action object -# **mergeBlocks** +### mergeBlocks Returns an action object used in signalling that two blocks should be merged @@ -1178,11 +1178,11 @@ _Parameters_ - _firstBlockClientId_ `string`: Client ID of the first block to merge. - _secondBlockClientId_ `string`: Client ID of the second block to merge. -# **moveBlocksDown** +### moveBlocksDown Undocumented declaration. -# **moveBlocksToPosition** +### moveBlocksToPosition Returns an action object signalling that the given blocks should be moved to a new position. @@ -1194,11 +1194,11 @@ _Parameters_ - _toRootClientId_ `?string`: Root client ID destination. - _index_ `number`: The index to move the blocks to. -# **moveBlocksUp** +### moveBlocksUp Undocumented declaration. -# **moveBlockToPosition** +### moveBlockToPosition Returns an action object signalling that the given block should be moved to a new position. @@ -1210,7 +1210,7 @@ _Parameters_ - _toRootClientId_ `?string`: Root client ID destination. - _index_ `number`: The index to move the block to. -# **multiSelect** +### multiSelect Returns an action object used in signalling that block multi-selection changed. @@ -1219,7 +1219,7 @@ _Parameters_ - _start_ `string`: First block of the multi selection. - _end_ `string`: Last block of the multiselection. -# **receiveBlocks** +### receiveBlocks Returns an action object used in signalling that blocks have been received. Unlike resetBlocks, these should be appended to the existing known set, not @@ -1233,7 +1233,7 @@ _Returns_ - `Object`: Action object. -# **removeBlock** +### removeBlock Returns an action object used in signalling that the block with the specified client ID is to be removed. @@ -1247,7 +1247,7 @@ _Returns_ - `Object`: Action object. -# **removeBlocks** +### removeBlocks Yields action objects used in signalling that the blocks corresponding to the set of specified client IDs are to be removed. @@ -1257,7 +1257,7 @@ _Parameters_ - _clientIds_ `string|string[]`: Client IDs of blocks to remove. - _selectPrevious_ `boolean`: True if the previous block should be selected when a block is removed. -# **replaceBlock** +### replaceBlock Returns an action object signalling that a single block should be replaced with one or more replacement blocks. @@ -1271,7 +1271,7 @@ _Returns_ - `Object`: Action object. -# **replaceBlocks** +### replaceBlocks Returns an action object signalling that a blocks should be replaced with one or more replacement blocks. @@ -1284,7 +1284,7 @@ _Parameters_ - _initialPosition_ `0|-1|null`: Index of caret after in the selected block after the operation. - _meta_ `?Object`: Optional Meta values to be passed to the action object. -# **replaceInnerBlocks** +### replaceInnerBlocks Returns an action object used in signalling that the inner blocks with the specified client ID should be replaced. @@ -1300,7 +1300,7 @@ _Returns_ - `Object`: Action object. -# **resetBlocks** +### resetBlocks Returns an action object used in signalling that blocks state should be reset to the specified array of blocks, taking precedence over any other @@ -1310,7 +1310,7 @@ _Parameters_ - _blocks_ `Array`: Array of blocks. -# **resetSelection** +### resetSelection Returns an action object used in signalling that selection state should be reset to the specified selection. @@ -1325,7 +1325,7 @@ _Returns_ - `Object`: Action object. -# **selectBlock** +### selectBlock Returns an action object used in signalling that the block with the specified client ID has been selected, optionally accepting a position @@ -1341,7 +1341,7 @@ _Returns_ - `Object`: Action object. -# **selectionChange** +### selectionChange Returns an action object used in signalling that the user caret has changed position. @@ -1357,7 +1357,7 @@ _Returns_ - `Object`: Action object. -# **selectNextBlock** +### selectNextBlock Yields action objects used in signalling that the block following the given clientId should be selected. @@ -1366,7 +1366,7 @@ _Parameters_ - _clientId_ `string`: Block client ID. -# **selectPreviousBlock** +### selectPreviousBlock Yields action objects used in signalling that the block preceding the given clientId should be selected. @@ -1375,7 +1375,7 @@ _Parameters_ - _clientId_ `string`: Block client ID. -# **setBlockMovingClientId** +### setBlockMovingClientId Generator that triggers an action used to enable or disable the block moving mode. @@ -1383,7 +1383,7 @@ _Parameters_ - _hasBlockMovingClientId_ `string|null`: Enable/Disable block moving mode. -# **setHasControlledInnerBlocks** +### setHasControlledInnerBlocks Returns an action object that sets whether the block has controlled innerblocks. @@ -1392,7 +1392,7 @@ _Parameters_ - _clientId_ `string`: The block's clientId. - _hasControlledInnerBlocks_ `boolean`: True if the block's inner blocks are controlled. -# **setNavigationMode** +### setNavigationMode Generators that triggers an action used to enable or disable the navigation mode. @@ -1400,7 +1400,7 @@ _Parameters_ - _isNavigationMode_ `string`: Enable/Disable navigation mode. -# **setTemplateValidity** +### setTemplateValidity Returns an action object resetting the template validity. @@ -1412,7 +1412,7 @@ _Returns_ - `Object`: Action object. -# **showInsertionPoint** +### showInsertionPoint Returns an action object used in signalling that the insertion point should be shown. @@ -1427,7 +1427,7 @@ _Returns_ - `Object`: Action object. -# **startDraggingBlocks** +### startDraggingBlocks Returns an action object used in signalling that the user has begun to drag blocks. @@ -1439,7 +1439,7 @@ _Returns_ - `Object`: Action object. -# **startMultiSelect** +### startMultiSelect Returns an action object used in signalling that a block multi-selection has started. @@ -1447,7 +1447,7 @@ _Returns_ - `Object`: Action object. -# **startTyping** +### startTyping Returns an action object used in signalling that the user has begun to type. @@ -1455,7 +1455,7 @@ _Returns_ - `Object`: Action object. -# **stopDraggingBlocks** +### stopDraggingBlocks Returns an action object used in signalling that the user has stopped dragging blocks. @@ -1463,7 +1463,7 @@ _Returns_ - `Object`: Action object. -# **stopMultiSelect** +### stopMultiSelect Returns an action object used in signalling that block multi-selection stopped. @@ -1471,7 +1471,7 @@ _Returns_ - `Object`: Action object. -# **stopTyping** +### stopTyping Returns an action object used in signalling that the user has stopped typing. @@ -1479,7 +1479,7 @@ _Returns_ - `Object`: Action object. -# **synchronizeTemplate** +### synchronizeTemplate Returns an action object synchronize the template with the list of blocks @@ -1487,7 +1487,7 @@ _Returns_ - `Object`: Action object. -# **toggleBlockHighlight** +### toggleBlockHighlight Returns an action object that toggles the highlighted block state. @@ -1496,7 +1496,7 @@ _Parameters_ - _clientId_ `string`: The block's clientId. - _isHighlighted_ `boolean`: The highlight state. -# **toggleBlockMode** +### toggleBlockMode Returns an action object used to toggle the block editing mode between visual and HTML modes. @@ -1509,7 +1509,7 @@ _Returns_ - `Object`: Action object. -# **toggleSelection** +### toggleSelection Returns an action object that enables or disables block selection. @@ -1521,7 +1521,7 @@ _Returns_ - `Object`: Action object. -# **updateBlock** +### updateBlock Returns an action object used in signalling that the block with the specified client ID has been updated. @@ -1535,7 +1535,7 @@ _Returns_ - `Object`: Action object. -# **updateBlockAttributes** +### updateBlockAttributes Returns an action object used in signalling that the multiple blocks' attributes with the specified client IDs have been updated. @@ -1550,7 +1550,7 @@ _Returns_ - `Object`: Action object. -# **updateBlockListSettings** +### updateBlockListSettings Returns an action object that changes the nested settings of a given block. @@ -1563,7 +1563,7 @@ _Returns_ - `Object`: Action object -# **updateSettings** +### updateSettings Returns an action object used in signalling that the block editor settings have been updated. @@ -1575,7 +1575,7 @@ _Returns_ - `Object`: Action object -# **validateBlocksToTemplate** +### validateBlocksToTemplate Block validity is a function of blocks state (at the point of a reset) and the template setting. As a compromise to its placement diff --git a/docs/reference-guides/data/data-core-blocks.md b/docs/reference-guides/data/data-core-blocks.md index 4aa8f73009e90..4d78203d38465 100644 --- a/docs/reference-guides/data/data-core-blocks.md +++ b/docs/reference-guides/data/data-core-blocks.md @@ -6,7 +6,7 @@ Namespace: `core/blocks`. -# **getActiveBlockVariation** +### getActiveBlockVariation Returns the active block variation for a given block based on its attributes. Variations are determined by their `isActive` property. @@ -30,7 +30,7 @@ _Returns_ - `(WPBlockVariation|undefined)`: Active block variation. -# **getBlockStyles** +### getBlockStyles Returns block styles by block name. @@ -43,7 +43,7 @@ _Returns_ - `Array?`: Block Styles. -# **getBlockSupport** +### getBlockSupport Returns the block support value for a feature, if defined. @@ -58,7 +58,7 @@ _Returns_ - `?*`: Block support value -# **getBlockType** +### getBlockType Returns a block type by name. @@ -71,7 +71,7 @@ _Returns_ - `Object?`: Block Type. -# **getBlockTypes** +### getBlockTypes Returns all the available block types. @@ -83,7 +83,7 @@ _Returns_ - `Array`: Block Types. -# **getBlockVariations** +### getBlockVariations Returns block variations by block name. @@ -97,7 +97,7 @@ _Returns_ - `(WPBlockVariation[]|void)`: Block variations. -# **getCategories** +### getCategories Returns all the available categories. @@ -109,7 +109,7 @@ _Returns_ - `WPBlockCategory[]`: Categories list. -# **getChildBlockNames** +### getChildBlockNames Returns an array with the child blocks of a given block. @@ -122,7 +122,7 @@ _Returns_ - `Array`: Array of child block names. -# **getCollections** +### getCollections Returns all the available collections. @@ -134,7 +134,7 @@ _Returns_ - `Object`: Collections list. -# **getDefaultBlockName** +### getDefaultBlockName Returns the name of the default block name. @@ -146,7 +146,7 @@ _Returns_ - `string?`: Default block name. -# **getDefaultBlockVariation** +### getDefaultBlockVariation Returns the default block variation for the given block type. When there are multiple variations annotated as the default one, @@ -163,7 +163,7 @@ _Returns_ - `?WPBlockVariation`: The default block variation. -# **getFreeformFallbackBlockName** +### getFreeformFallbackBlockName Returns the name of the block for handling non-block content. @@ -175,7 +175,7 @@ _Returns_ - `string?`: Name of the block for handling non-block content. -# **getGroupingBlockName** +### getGroupingBlockName Returns the name of the block for handling unregistered blocks. @@ -187,7 +187,7 @@ _Returns_ - `string?`: Name of the block for handling unregistered blocks. -# **getUnregisteredFallbackBlockName** +### getUnregisteredFallbackBlockName Returns the name of the block for handling unregistered blocks. @@ -199,7 +199,7 @@ _Returns_ - `string?`: Name of the block for handling unregistered blocks. -# **hasBlockSupport** +### hasBlockSupport Returns true if the block defines support for a feature, or false otherwise. @@ -214,7 +214,7 @@ _Returns_ - `boolean`: Whether block supports feature. -# **hasChildBlocks** +### hasChildBlocks Returns a boolean indicating if a block has child blocks or not. @@ -227,7 +227,7 @@ _Returns_ - `boolean`: True if a block contains child blocks and false otherwise. -# **hasChildBlocksWithInserterSupport** +### hasChildBlocksWithInserterSupport Returns a boolean indicating if a block has at least one child block with inserter support. @@ -240,7 +240,7 @@ _Returns_ - `boolean`: True if a block contains at least one child blocks with inserter support and false otherwise. -# **isMatchingSearchTerm** +### isMatchingSearchTerm Returns true if the block type by the given name or object value matches a search term, or false otherwise. @@ -261,7 +261,7 @@ _Returns_ -# **addBlockCollection** +### addBlockCollection Returns an action object used to add block collections @@ -275,7 +275,7 @@ _Returns_ - `Object`: Action object. -# **addBlockStyles** +### addBlockStyles Returns an action object used in signalling that new block styles have been added. @@ -288,7 +288,7 @@ _Returns_ - `Object`: Action object. -# **addBlockTypes** +### addBlockTypes Returns an action object used in signalling that block types have been added. @@ -300,7 +300,7 @@ _Returns_ - `Object`: Action object. -# **addBlockVariations** +### addBlockVariations Returns an action object used in signalling that new block variations have been added. @@ -313,7 +313,7 @@ _Returns_ - `Object`: Action object. -# **removeBlockCollection** +### removeBlockCollection Returns an action object used to remove block collections @@ -325,7 +325,7 @@ _Returns_ - `Object`: Action object. -# **removeBlockStyles** +### removeBlockStyles Returns an action object used in signalling that block styles have been removed. @@ -338,7 +338,7 @@ _Returns_ - `Object`: Action object. -# **removeBlockTypes** +### removeBlockTypes Returns an action object used to remove a registered block type. @@ -350,7 +350,7 @@ _Returns_ - `Object`: Action object. -# **removeBlockVariations** +### removeBlockVariations Returns an action object used in signalling that block variations have been removed. @@ -363,7 +363,7 @@ _Returns_ - `Object`: Action object. -# **setCategories** +### setCategories Returns an action object used to set block categories. @@ -375,7 +375,7 @@ _Returns_ - `Object`: Action object. -# **setDefaultBlockName** +### setDefaultBlockName Returns an action object used to set the default block name. @@ -387,7 +387,7 @@ _Returns_ - `Object`: Action object. -# **setFreeformFallbackBlockName** +### setFreeformFallbackBlockName Returns an action object used to set the name of the block used as a fallback for non-block content. @@ -400,7 +400,7 @@ _Returns_ - `Object`: Action object. -# **setGroupingBlockName** +### setGroupingBlockName Returns an action object used to set the name of the block used when grouping other blocks @@ -414,7 +414,7 @@ _Returns_ - `Object`: Action object. -# **setUnregisteredFallbackBlockName** +### setUnregisteredFallbackBlockName Returns an action object used to set the name of the block used as a fallback for unregistered blocks. @@ -427,7 +427,7 @@ _Returns_ - `Object`: Action object. -# **updateCategory** +### updateCategory Returns an action object used to update a category. diff --git a/docs/reference-guides/data/data-core-edit-post.md b/docs/reference-guides/data/data-core-edit-post.md index 7ef45b337962b..8f150ff19b668 100644 --- a/docs/reference-guides/data/data-core-edit-post.md +++ b/docs/reference-guides/data/data-core-edit-post.md @@ -6,7 +6,7 @@ Namespace: `core/edit-post`. -# **getActiveGeneralSidebarName** +### getActiveGeneralSidebarName Returns the current active general sidebar name, or null if there is no general sidebar active. The active general sidebar is a unique name to @@ -25,7 +25,7 @@ _Returns_ - `?string`: Active general sidebar name. -# **getActiveMetaBoxLocations** +### getActiveMetaBoxLocations Returns an array of active meta box locations. @@ -37,7 +37,7 @@ _Returns_ - `string[]`: Active meta box locations. -# **getAllMetaBoxes** +### getAllMetaBoxes Returns the list of all the available meta boxes. @@ -49,7 +49,7 @@ _Returns_ - `Array`: List of meta boxes. -# **getEditedPostTemplate** +### getEditedPostTemplate Retrieves the template of the currently edited post. @@ -57,7 +57,7 @@ _Returns_ - `Object?`: Post Template. -# **getEditorMode** +### getEditorMode Returns the current editing mode. @@ -69,7 +69,7 @@ _Returns_ - `string`: Editing mode. -# **getMetaBoxesPerLocation** +### getMetaBoxesPerLocation Returns the list of all the available meta boxes for a given location. @@ -82,7 +82,7 @@ _Returns_ - `?Array`: List of meta boxes. -# **getPreference** +### getPreference _Parameters_ @@ -94,7 +94,7 @@ _Returns_ - `*`: Preference Value. -# **getPreferences** +### getPreferences Returns the preferences (these preferences are persisted locally). @@ -106,7 +106,7 @@ _Returns_ - `Object`: Preferences Object. -# **hasMetaBoxes** +### hasMetaBoxes Returns true if the post is using Meta Boxes @@ -118,7 +118,7 @@ _Returns_ - `boolean`: Whether there are metaboxes or not. -# **isEditingTemplate** +### isEditingTemplate Returns true if the template editing mode is enabled. @@ -130,7 +130,7 @@ _Returns_ - `boolean`: Whether we're editing the template. -# **isEditorPanelEnabled** +### isEditorPanelEnabled Returns true if the given panel is enabled, or false otherwise. Panels are enabled by default. @@ -144,7 +144,7 @@ _Returns_ - `boolean`: Whether or not the panel is enabled. -# **isEditorPanelOpened** +### isEditorPanelOpened Returns true if the given panel is open, or false otherwise. Panels are closed by default. @@ -158,7 +158,7 @@ _Returns_ - `boolean`: Whether or not the panel is open. -# **isEditorPanelRemoved** +### isEditorPanelRemoved Returns true if the given panel was programmatically removed, or false otherwise. All panels are not removed by default. @@ -172,7 +172,7 @@ _Returns_ - `boolean`: Whether or not the panel is removed. -# **isEditorSidebarOpened** +### isEditorSidebarOpened Returns true if the editor sidebar is opened. @@ -184,7 +184,7 @@ _Returns_ - `boolean`: Whether the editor sidebar is opened. -# **isFeatureActive** +### isFeatureActive Returns whether the given feature is enabled or not. @@ -197,7 +197,7 @@ _Returns_ - `boolean`: Is active. -# **isInserterOpened** +### isInserterOpened Returns true if the inserter is opened. @@ -209,7 +209,7 @@ _Returns_ - `boolean`: Whether the inserter is opened. -# **isListViewOpened** +### isListViewOpened Returns true if the list view is opened. @@ -221,7 +221,7 @@ _Returns_ - `boolean`: Whether the list view is opened. -# **isMetaBoxLocationActive** +### isMetaBoxLocationActive Returns true if there is an active meta box in the given location, or false otherwise. @@ -235,7 +235,7 @@ _Returns_ - `boolean`: Whether the meta box location is active. -# **isMetaBoxLocationVisible** +### isMetaBoxLocationVisible Returns true if a metabox location is active and visible @@ -248,7 +248,7 @@ _Returns_ - `boolean`: Whether the meta box location is active and visible. -# **isModalActive** +### isModalActive Returns true if a modal is active, or false otherwise. @@ -261,7 +261,7 @@ _Returns_ - `boolean`: Whether the modal is active. -# **isPluginItemPinned** +### isPluginItemPinned Returns true if the plugin item is pinned to the header. When the value is not set it defaults to true. @@ -275,7 +275,7 @@ _Returns_ - `boolean`: Whether the plugin item is pinned. -# **isPluginSidebarOpened** +### isPluginSidebarOpened Returns true if the plugin sidebar is opened. @@ -287,7 +287,7 @@ _Returns_ - `boolean`: Whether the plugin sidebar is opened. -# **isPublishSidebarOpened** +### isPublishSidebarOpened Returns true if the publish sidebar is opened. @@ -299,7 +299,7 @@ _Returns_ - `boolean`: Whether the publish sidebar is open. -# **isSavingMetaBoxes** +### isSavingMetaBoxes Returns true if the Meta Boxes are being saved. @@ -317,11 +317,11 @@ _Returns_ -# **closeGeneralSidebar** +### closeGeneralSidebar Returns an action object signalling that the user closed the sidebar. -# **closeModal** +### closeModal Returns an action object signalling that the user closed a modal. @@ -329,7 +329,7 @@ _Returns_ - `Object`: Action object. -# **closePublishSidebar** +### closePublishSidebar Returns an action object used in signalling that the user closed the publish sidebar. @@ -338,7 +338,7 @@ _Returns_ - `Object`: Action object. -# **hideBlockTypes** +### hideBlockTypes Returns an action object used in signalling that block types by the given name(s) should be hidden. @@ -351,7 +351,7 @@ _Returns_ - `Object`: Action object. -# **metaBoxUpdatesFailure** +### metaBoxUpdatesFailure Returns an action object used to signal a failed meta box update. @@ -359,7 +359,7 @@ _Returns_ - `Object`: Action object. -# **metaBoxUpdatesSuccess** +### metaBoxUpdatesSuccess Returns an action object used to signal a successful meta box update. @@ -367,7 +367,7 @@ _Returns_ - `Object`: Action object. -# **openGeneralSidebar** +### openGeneralSidebar Returns an action object used in signalling that the user opened an editor sidebar. @@ -375,7 +375,7 @@ _Parameters_ - _name_ `?string`: Sidebar name to be opened. -# **openModal** +### openModal Returns an action object used in signalling that the user opened a modal. @@ -387,7 +387,7 @@ _Returns_ - `Object`: Action object. -# **openPublishSidebar** +### openPublishSidebar Returns an action object used in signalling that the user opened the publish sidebar. @@ -396,7 +396,7 @@ _Returns_ - `Object`: Action object -# **removeEditorPanel** +### removeEditorPanel Returns an action object used to remove a panel from the editor. @@ -408,11 +408,11 @@ _Returns_ - `Object`: Action object. -# **requestMetaBoxUpdates** +### requestMetaBoxUpdates Returns an action object used to request meta box update. -# **setAvailableMetaBoxesPerLocation** +### setAvailableMetaBoxesPerLocation Returns an action object used in signaling what Meta boxes are available in which location. @@ -421,7 +421,7 @@ _Parameters_ - _metaBoxesPerLocation_ `Object`: Meta boxes per location. -# **setIsEditingTemplate** +### setIsEditingTemplate Returns an action object used to switch to template editing. @@ -433,7 +433,7 @@ _Returns_ - `Object`: Action object. -# **setIsInserterOpened** +### setIsInserterOpened Returns an action object used to open/close the inserter. @@ -447,7 +447,7 @@ _Returns_ - `Object`: Action object. -# **setIsListViewOpened** +### setIsListViewOpened Returns an action object used to open/close the list view. @@ -459,7 +459,7 @@ _Returns_ - `Object`: Action object. -# **showBlockTypes** +### showBlockTypes Returns an action object used in signalling that block types by the given name(s) should be shown. @@ -472,11 +472,11 @@ _Returns_ - `Object`: Action object. -# **switchEditorMode** +### switchEditorMode Undocumented declaration. -# **toggleEditorPanelEnabled** +### toggleEditorPanelEnabled Returns an action object used to enable or disable a panel in the editor. @@ -488,7 +488,7 @@ _Returns_ - `Object`: Action object. -# **toggleEditorPanelOpened** +### toggleEditorPanelOpened Returns an action object used to open or close a panel in the editor. @@ -500,7 +500,7 @@ _Returns_ - `Object`: Action object. -# **toggleFeature** +### toggleFeature Returns an action object used to toggle a feature flag. @@ -512,7 +512,7 @@ _Returns_ - `Object`: Action object. -# **togglePinnedPluginItem** +### togglePinnedPluginItem Returns an action object used to toggle a plugin name flag. @@ -524,7 +524,7 @@ _Returns_ - `Object`: Action object. -# **togglePublishSidebar** +### togglePublishSidebar Returns an action object used in signalling that the user toggles the publish sidebar. @@ -532,7 +532,7 @@ _Returns_ - `Object`: Action object -# **updatePreferredStyleVariations** +### updatePreferredStyleVariations Returns an action object used in signaling that a style should be auto-applied when a block is created. diff --git a/docs/reference-guides/data/data-core-editor.md b/docs/reference-guides/data/data-core-editor.md index a3decea1e286c..027dcb4441f36 100644 --- a/docs/reference-guides/data/data-core-editor.md +++ b/docs/reference-guides/data/data-core-editor.md @@ -6,13 +6,13 @@ Namespace: `core/editor`. -# **canInsertBlockType** +### canInsertBlockType _Related_ - canInsertBlockType in core/block-editor store. -# **canUserUseUnfilteredHTML** +### canUserUseUnfilteredHTML Returns whether or not the user has the unfiltered_html capability. @@ -24,7 +24,7 @@ _Returns_ - `boolean`: Whether the user can or can't post unfiltered HTML. -# **didPostSaveRequestFail** +### didPostSaveRequestFail Returns true if a previous post save was attempted but failed, or false otherwise. @@ -37,7 +37,7 @@ _Returns_ - `boolean`: Whether the post save failed. -# **didPostSaveRequestSucceed** +### didPostSaveRequestSucceed Returns true if a previous post save was attempted successfully, or false otherwise. @@ -50,7 +50,7 @@ _Returns_ - `boolean`: Whether the post was saved successfully. -# **getActivePostLock** +### getActivePostLock Returns the active post lock. @@ -62,13 +62,13 @@ _Returns_ - `Object`: The lock object. -# **getAdjacentBlockClientId** +### getAdjacentBlockClientId _Related_ - getAdjacentBlockClientId in core/block-editor store. -# **getAutosave** +### getAutosave > **Deprecated** since 5.6. Callers should use the `getAutosave( postType, postId, userId )` selector from the '@wordpress/core-data' package. @@ -84,7 +84,7 @@ _Returns_ - `?Object`: Current autosave, if exists. -# **getAutosaveAttribute** +### getAutosaveAttribute > **Deprecated** since 5.6. Callers should use the `getAutosave( postType, postId, userId )` selector from the '@wordpress/core-data' package and access properties on the returned autosave object using getPostRawValue. @@ -100,97 +100,97 @@ _Returns_ - `*`: Autosave attribute value. -# **getBlock** +### getBlock _Related_ - getBlock in core/block-editor store. -# **getBlockAttributes** +### getBlockAttributes _Related_ - getBlockAttributes in core/block-editor store. -# **getBlockCount** +### getBlockCount _Related_ - getBlockCount in core/block-editor store. -# **getBlockHierarchyRootClientId** +### getBlockHierarchyRootClientId _Related_ - getBlockHierarchyRootClientId in core/block-editor store. -# **getBlockIndex** +### getBlockIndex _Related_ - getBlockIndex in core/block-editor store. -# **getBlockInsertionPoint** +### getBlockInsertionPoint _Related_ - getBlockInsertionPoint in core/block-editor store. -# **getBlockListSettings** +### getBlockListSettings _Related_ - getBlockListSettings in core/block-editor store. -# **getBlockMode** +### getBlockMode _Related_ - getBlockMode in core/block-editor store. -# **getBlockName** +### getBlockName _Related_ - getBlockName in core/block-editor store. -# **getBlockOrder** +### getBlockOrder _Related_ - getBlockOrder in core/block-editor store. -# **getBlockRootClientId** +### getBlockRootClientId _Related_ - getBlockRootClientId in core/block-editor store. -# **getBlocks** +### getBlocks _Related_ - getBlocks in core/block-editor store. -# **getBlocksByClientId** +### getBlocksByClientId _Related_ - getBlocksByClientId in core/block-editor store. -# **getBlockSelectionEnd** +### getBlockSelectionEnd _Related_ - getBlockSelectionEnd in core/block-editor store. -# **getBlockSelectionStart** +### getBlockSelectionStart _Related_ - getBlockSelectionStart in core/block-editor store. -# **getBlocksForSerialization** +### getBlocksForSerialization > **Deprecated** since Gutenberg 6.2.0. @@ -205,19 +205,19 @@ _Returns_ - `WPBlock[]`: Filtered set of blocks for save. -# **getClientIdsOfDescendants** +### getClientIdsOfDescendants _Related_ - getClientIdsOfDescendants in core/block-editor store. -# **getClientIdsWithDescendants** +### getClientIdsWithDescendants _Related_ - getClientIdsWithDescendants in core/block-editor store. -# **getCurrentPost** +### getCurrentPost Returns the post currently being edited in its last known saved state, not including unsaved edits. Returns an object containing relevant default post @@ -231,7 +231,7 @@ _Returns_ - `Object`: Post object. -# **getCurrentPostAttribute** +### getCurrentPostAttribute Returns an attribute value of the saved post. @@ -244,7 +244,7 @@ _Returns_ - `*`: Post attribute value. -# **getCurrentPostId** +### getCurrentPostId Returns the ID of the post currently being edited, or null if the post has not yet been saved. @@ -257,7 +257,7 @@ _Returns_ - `?number`: ID of current post. -# **getCurrentPostLastRevisionId** +### getCurrentPostLastRevisionId Returns the last revision ID of the post currently being edited, or null if the post has no revisions. @@ -270,7 +270,7 @@ _Returns_ - `?number`: ID of the last revision. -# **getCurrentPostRevisionsCount** +### getCurrentPostRevisionsCount Returns the number of revisions of the post currently being edited. @@ -282,7 +282,7 @@ _Returns_ - `number`: Number of revisions. -# **getCurrentPostType** +### getCurrentPostType Returns the post type of the post currently being edited. @@ -294,7 +294,7 @@ _Returns_ - `string`: Post type. -# **getEditedPostAttribute** +### getEditedPostAttribute Returns a single attribute of the post being edited, preferring the unsaved edit if one exists, but falling back to the attribute for the last known @@ -309,7 +309,7 @@ _Returns_ - `*`: Post attribute value. -# **getEditedPostContent** +### getEditedPostContent Returns the content of the post being edited. @@ -321,7 +321,7 @@ _Returns_ - `string`: Post content. -# **getEditedPostPreviewLink** +### getEditedPostPreviewLink Returns the post preview link @@ -333,7 +333,7 @@ _Returns_ - `string?`: Preview Link. -# **getEditedPostSlug** +### getEditedPostSlug Returns the slug for the post being edited, preferring a manually edited value if one exists, then a sanitized version of the current post title, and @@ -347,7 +347,7 @@ _Returns_ - `string`: The current slug to be displayed in the editor -# **getEditedPostVisibility** +### getEditedPostVisibility Returns the current visibility of the post being edited, preferring the unsaved value if different than the saved post. The return value is one of @@ -361,7 +361,7 @@ _Returns_ - `string`: Post visibility. -# **getEditorBlocks** +### getEditorBlocks Return the current block list. @@ -373,7 +373,7 @@ _Returns_ - `Array`: Block list. -# **getEditorSelection** +### getEditorSelection Returns the current selection. @@ -385,7 +385,7 @@ _Returns_ - `WPBlockSelection`: The selection end. -# **getEditorSelectionEnd** +### getEditorSelectionEnd > **Deprecated** since Gutenberg 10.0.0. @@ -399,7 +399,7 @@ _Returns_ - `WPBlockSelection`: The selection end. -# **getEditorSelectionStart** +### getEditorSelectionStart > **Deprecated** since Gutenberg 10.0.0. @@ -413,7 +413,7 @@ _Returns_ - `WPBlockSelection`: The selection start. -# **getEditorSettings** +### getEditorSettings Returns the post editor settings. @@ -425,61 +425,61 @@ _Returns_ - `Object`: The editor settings object. -# **getFirstMultiSelectedBlockClientId** +### getFirstMultiSelectedBlockClientId _Related_ - getFirstMultiSelectedBlockClientId in core/block-editor store. -# **getGlobalBlockCount** +### getGlobalBlockCount _Related_ - getGlobalBlockCount in core/block-editor store. -# **getInserterItems** +### getInserterItems _Related_ - getInserterItems in core/block-editor store. -# **getLastMultiSelectedBlockClientId** +### getLastMultiSelectedBlockClientId _Related_ - getLastMultiSelectedBlockClientId in core/block-editor store. -# **getMultiSelectedBlockClientIds** +### getMultiSelectedBlockClientIds _Related_ - getMultiSelectedBlockClientIds in core/block-editor store. -# **getMultiSelectedBlocks** +### getMultiSelectedBlocks _Related_ - getMultiSelectedBlocks in core/block-editor store. -# **getMultiSelectedBlocksEndClientId** +### getMultiSelectedBlocksEndClientId _Related_ - getMultiSelectedBlocksEndClientId in core/block-editor store. -# **getMultiSelectedBlocksStartClientId** +### getMultiSelectedBlocksStartClientId _Related_ - getMultiSelectedBlocksStartClientId in core/block-editor store. -# **getNextBlockClientId** +### getNextBlockClientId _Related_ - getNextBlockClientId in core/block-editor store. -# **getPermalink** +### getPermalink Returns the permalink for the post. @@ -491,7 +491,7 @@ _Returns_ - `?string`: The permalink, or null if the post is not viewable. -# **getPermalinkParts** +### getPermalinkParts Returns the permalink for a post, split into it's three parts: the prefix, the postName, and the suffix. @@ -504,7 +504,7 @@ _Returns_ - `Object`: An object containing the prefix, postName, and suffix for the permalink, or null if the post is not viewable. -# **getPostEdits** +### getPostEdits Returns any post values which have been changed in the editor but not yet been saved. @@ -517,7 +517,7 @@ _Returns_ - `Object`: Object of key value pairs comprising unsaved edits. -# **getPostLockUser** +### getPostLockUser Returns details about the post lock user. @@ -529,7 +529,7 @@ _Returns_ - `Object`: A user object. -# **getPostTypeLabel** +### getPostTypeLabel Returns a post type label depending on the current post. @@ -541,13 +541,13 @@ _Returns_ - `string|undefined`: The post type label if available, otherwise undefined. -# **getPreviousBlockClientId** +### getPreviousBlockClientId _Related_ - getPreviousBlockClientId in core/block-editor store. -# **getReferenceByDistinctEdits** +### getReferenceByDistinctEdits > **Deprecated** since Gutenberg 6.5.0. @@ -570,38 +570,38 @@ _Returns_ - `*`: A value whose reference will change only when an edit occurs. -# **getSelectedBlock** +### getSelectedBlock _Related_ - getSelectedBlock in core/block-editor store. -# **getSelectedBlockClientId** +### getSelectedBlockClientId _Related_ - getSelectedBlockClientId in core/block-editor store. -# **getSelectedBlockCount** +### getSelectedBlockCount _Related_ - getSelectedBlockCount in core/block-editor store. -# **getSelectedBlocksInitialCaretPosition** +### getSelectedBlocksInitialCaretPosition _Related_ - getSelectedBlocksInitialCaretPosition in core/block-editor store. -# **getStateBeforeOptimisticTransaction** +### getStateBeforeOptimisticTransaction > **Deprecated** since Gutenberg 9.7.0. Returns state object prior to a specified optimist transaction ID, or `null` if the transaction corresponding to the given ID cannot be found. -# **getSuggestedPostFormat** +### getSuggestedPostFormat Returns a suggested post format for the current post, inferred only if there is a single block within the post and it is of a type known to match a @@ -615,19 +615,19 @@ _Returns_ - `?string`: Suggested post format. -# **getTemplate** +### getTemplate _Related_ - getTemplate in core/block-editor store. -# **getTemplateLock** +### getTemplateLock _Related_ - getTemplateLock in core/block-editor store. -# **hasAutosave** +### hasAutosave > **Deprecated** since 5.6. Callers should use the `getAutosave( postType, postId, userId )` selector from the '@wordpress/core-data' package and check for a truthy value. @@ -641,7 +641,7 @@ _Returns_ - `boolean`: Whether there is an existing autosave. -# **hasChangedContent** +### hasChangedContent Returns true if content includes unsaved changes, or false otherwise. @@ -653,7 +653,7 @@ _Returns_ - `boolean`: Whether content includes unsaved changes. -# **hasEditorRedo** +### hasEditorRedo Returns true if any future editor history snapshots exist, or false otherwise. @@ -666,7 +666,7 @@ _Returns_ - `boolean`: Whether redo history exists. -# **hasEditorUndo** +### hasEditorUndo Returns true if any past editor history snapshots exist, or false otherwise. @@ -678,19 +678,19 @@ _Returns_ - `boolean`: Whether undo history exists. -# **hasInserterItems** +### hasInserterItems _Related_ - hasInserterItems in core/block-editor store. -# **hasMultiSelection** +### hasMultiSelection _Related_ - hasMultiSelection in core/block-editor store. -# **hasNonPostEntityChanges** +### hasNonPostEntityChanges Returns true if there are unsaved edits for entities other than the editor's post, and false otherwise. @@ -703,32 +703,32 @@ _Returns_ - `boolean`: Whether there are edits or not. -# **hasSelectedBlock** +### hasSelectedBlock _Related_ - hasSelectedBlock in core/block-editor store. -# **hasSelectedInnerBlock** +### hasSelectedInnerBlock _Related_ - hasSelectedInnerBlock in core/block-editor store. -# **inSomeHistory** +### inSomeHistory > **Deprecated** since Gutenberg 9.7.0. Returns true if an optimistic transaction is pending commit, for which the before state satisfies the given predicate function. -# **isAncestorMultiSelected** +### isAncestorMultiSelected _Related_ - isAncestorMultiSelected in core/block-editor store. -# **isAutosavingPost** +### isAutosavingPost Returns true if the post is autosaving, or false otherwise. @@ -740,43 +740,43 @@ _Returns_ - `boolean`: Whether the post is autosaving. -# **isBlockInsertionPointVisible** +### isBlockInsertionPointVisible _Related_ - isBlockInsertionPointVisible in core/block-editor store. -# **isBlockMultiSelected** +### isBlockMultiSelected _Related_ - isBlockMultiSelected in core/block-editor store. -# **isBlockSelected** +### isBlockSelected _Related_ - isBlockSelected in core/block-editor store. -# **isBlockValid** +### isBlockValid _Related_ - isBlockValid in core/block-editor store. -# **isBlockWithinSelection** +### isBlockWithinSelection _Related_ - isBlockWithinSelection in core/block-editor store. -# **isCaretWithinFormattedText** +### isCaretWithinFormattedText _Related_ - isCaretWithinFormattedText in core/block-editor store. -# **isCleanNewPost** +### isCleanNewPost Returns true if there are no unsaved values for the current edit session and if the currently edited post is new (has never been saved before). @@ -789,7 +789,7 @@ _Returns_ - `boolean`: Whether new post and unsaved values exist. -# **isCurrentPostPending** +### isCurrentPostPending Returns true if post is pending review. @@ -801,7 +801,7 @@ _Returns_ - `boolean`: Whether current post is pending review. -# **isCurrentPostPublished** +### isCurrentPostPublished Return true if the current post has already been published. @@ -814,7 +814,7 @@ _Returns_ - `boolean`: Whether the post has been published. -# **isCurrentPostScheduled** +### isCurrentPostScheduled Returns true if post is already scheduled. @@ -826,7 +826,7 @@ _Returns_ - `boolean`: Whether current post is scheduled to be posted. -# **isEditedPostAutosaveable** +### isEditedPostAutosaveable Returns true if the post can be autosaved, or false otherwise. @@ -839,7 +839,7 @@ _Returns_ - `boolean`: Whether the post can be autosaved. -# **isEditedPostBeingScheduled** +### isEditedPostBeingScheduled Return true if the post being edited is being scheduled. Preferring the unsaved status values. @@ -852,7 +852,7 @@ _Returns_ - `boolean`: Whether the post has been published. -# **isEditedPostDateFloating** +### isEditedPostDateFloating Returns whether the current post should be considered to have a "floating" date (i.e. that it would publish "Immediately" rather than at a set time). @@ -870,7 +870,7 @@ _Returns_ - `boolean`: Whether the edited post has a floating date value. -# **isEditedPostDirty** +### isEditedPostDirty Returns true if there are unsaved values for the current edit session, or false if the editing state matches the saved or new post. @@ -883,7 +883,7 @@ _Returns_ - `boolean`: Whether unsaved values exist. -# **isEditedPostEmpty** +### isEditedPostEmpty Returns true if the edited post has content. A post has content if it has at least one saveable block or otherwise has a non-empty content property @@ -897,7 +897,7 @@ _Returns_ - `boolean`: Whether post has content. -# **isEditedPostNew** +### isEditedPostNew Returns true if the currently edited post is yet to be saved, or false if the post has been saved. @@ -910,7 +910,7 @@ _Returns_ - `boolean`: Whether the post is new. -# **isEditedPostPublishable** +### isEditedPostPublishable Return true if the post being edited can be published. @@ -922,7 +922,7 @@ _Returns_ - `boolean`: Whether the post can been published. -# **isEditedPostSaveable** +### isEditedPostSaveable Returns true if the post can be saved, or false otherwise. A post must contain a title, an excerpt, or non-empty content to be valid for save. @@ -935,19 +935,19 @@ _Returns_ - `boolean`: Whether the post can be saved. -# **isFirstMultiSelectedBlock** +### isFirstMultiSelectedBlock _Related_ - isFirstMultiSelectedBlock in core/block-editor store. -# **isMultiSelecting** +### isMultiSelecting _Related_ - isMultiSelecting in core/block-editor store. -# **isPermalinkEditable** +### isPermalinkEditable Returns whether the permalink is editable or not. @@ -959,7 +959,7 @@ _Returns_ - `boolean`: Whether or not the permalink is editable. -# **isPostAutosavingLocked** +### isPostAutosavingLocked Returns whether post autosaving is locked. @@ -971,7 +971,7 @@ _Returns_ - `boolean`: Is locked. -# **isPostLocked** +### isPostLocked Returns whether the post is locked. @@ -983,7 +983,7 @@ _Returns_ - `boolean`: Is locked. -# **isPostLockTakeover** +### isPostLockTakeover Returns whether the edition of the post has been taken over. @@ -995,7 +995,7 @@ _Returns_ - `boolean`: Is post lock takeover. -# **isPostSavingLocked** +### isPostSavingLocked Returns whether post saving is locked. @@ -1007,7 +1007,7 @@ _Returns_ - `boolean`: Is locked. -# **isPreviewingPost** +### isPreviewingPost Returns true if the post is being previewed, or false otherwise. @@ -1019,7 +1019,7 @@ _Returns_ - `boolean`: Whether the post is being previewed. -# **isPublishingPost** +### isPublishingPost Returns true if the post is being published, or false otherwise. @@ -1031,7 +1031,7 @@ _Returns_ - `boolean`: Whether post is being published. -# **isPublishSidebarEnabled** +### isPublishSidebarEnabled Returns whether the pre-publish panel should be shown or skipped when the user clicks the "publish" button. @@ -1044,7 +1044,7 @@ _Returns_ - `boolean`: Whether the pre-publish panel should be shown or not. -# **isSavingNonPostEntityChanges** +### isSavingNonPostEntityChanges Returns true if non-post entities are currently being saved, or false otherwise. @@ -1056,7 +1056,7 @@ _Returns_ - `boolean`: Whether non-post entities are being saved. -# **isSavingPost** +### isSavingPost Returns true if the post is currently being saved, or false otherwise. @@ -1068,19 +1068,19 @@ _Returns_ - `boolean`: Whether post is being saved. -# **isSelectionEnabled** +### isSelectionEnabled _Related_ - isSelectionEnabled in core/block-editor store. -# **isTyping** +### isTyping _Related_ - isTyping in core/block-editor store. -# **isValidTemplate** +### isValidTemplate _Related_ @@ -1092,7 +1092,7 @@ _Related_ -# **autosave** +### autosave Action generator used in signalling that the post should autosave. This includes server-side autosaving (default) and client-side (a.k.a. local) @@ -1103,13 +1103,13 @@ _Parameters_ - _options_ `Object?`: Extra flags to identify the autosave. -# **clearSelectedBlock** +### clearSelectedBlock _Related_ - clearSelectedBlock in core/block-editor store. -# **createUndoLevel** +### createUndoLevel Returns an action object used in signalling that undo history record should be created. @@ -1118,7 +1118,7 @@ _Returns_ - `Object`: Action object. -# **disablePublishSidebar** +### disablePublishSidebar Returns an action object used in signalling that the user has disabled the publish sidebar. @@ -1127,7 +1127,7 @@ _Returns_ - `Object`: Action object -# **editPost** +### editPost Returns an action object used in signalling that attributes of the post have been edited. @@ -1137,7 +1137,7 @@ _Parameters_ - _edits_ `Object`: Post attributes to edit. - _options_ `Object`: Options for the edit. -# **enablePublishSidebar** +### enablePublishSidebar Returns an action object used in signalling that the user has enabled the publish sidebar. @@ -1146,43 +1146,43 @@ _Returns_ - `Object`: Action object -# **enterFormattedText** +### enterFormattedText _Related_ - enterFormattedText in core/block-editor store. -# **exitFormattedText** +### exitFormattedText _Related_ - exitFormattedText in core/block-editor store. -# **hideInsertionPoint** +### hideInsertionPoint _Related_ - hideInsertionPoint in core/block-editor store. -# **insertBlock** +### insertBlock _Related_ - insertBlock in core/block-editor store. -# **insertBlocks** +### insertBlocks _Related_ - insertBlocks in core/block-editor store. -# **insertDefaultBlock** +### insertDefaultBlock _Related_ - insertDefaultBlock in core/block-editor store. -# **lockPostAutosaving** +### lockPostAutosaving Returns an action object used to signal that post autosaving is locked. @@ -1199,7 +1199,7 @@ _Returns_ - `Object`: Action object -# **lockPostSaving** +### lockPostSaving Returns an action object used to signal that post saving is locked. @@ -1246,76 +1246,76 @@ _Returns_ - `Object`: Action object -# **mergeBlocks** +### mergeBlocks _Related_ - mergeBlocks in core/block-editor store. -# **moveBlocksDown** +### moveBlocksDown _Related_ - moveBlocksDown in core/block-editor store. -# **moveBlocksUp** +### moveBlocksUp _Related_ - moveBlocksUp in core/block-editor store. -# **moveBlockToPosition** +### moveBlockToPosition _Related_ - moveBlockToPosition in core/block-editor store. -# **multiSelect** +### multiSelect _Related_ - multiSelect in core/block-editor store. -# **receiveBlocks** +### receiveBlocks _Related_ - receiveBlocks in core/block-editor store. -# **redo** +### redo Returns an action object used in signalling that undo history should restore last popped state. -# **refreshPost** +### refreshPost Action generator for handling refreshing the current post. -# **removeBlock** +### removeBlock _Related_ - removeBlock in core/block-editor store. -# **removeBlocks** +### removeBlocks _Related_ - removeBlocks in core/block-editor store. -# **replaceBlock** +### replaceBlock _Related_ - replaceBlock in core/block-editor store. -# **replaceBlocks** +### replaceBlocks _Related_ - replaceBlocks in core/block-editor store. -# **resetAutosave** +### resetAutosave > **Deprecated** since 5.6. Callers should use the `receiveAutosaves( postId, autosave )` selector from the '@wordpress/core-data' package. @@ -1330,13 +1330,13 @@ _Returns_ - `Object`: Action object. -# **resetBlocks** +### resetBlocks _Related_ - resetBlocks in core/block-editor store. -# **resetEditorBlocks** +### resetEditorBlocks Returns an action object used to signal that the blocks have been updated. @@ -1345,7 +1345,7 @@ _Parameters_ - _blocks_ `Array`: Block Array. - _options_ `?Object`: Optional options. -# **resetPost** +### resetPost Returns an action object used in signalling that the latest version of the post has been received, either by initialization or save. @@ -1358,7 +1358,7 @@ _Returns_ - `Object`: Action object. -# **savePost** +### savePost Action generator for saving the current post in the editor. @@ -1366,19 +1366,19 @@ _Parameters_ - _options_ `Object`: -# **selectBlock** +### selectBlock _Related_ - selectBlock in core/block-editor store. -# **setTemplateValidity** +### setTemplateValidity _Related_ - setTemplateValidity in core/block-editor store. -# **setupEditor** +### setupEditor Returns an action generator used in signalling that editor has initialized with the specified post object and editor settings. @@ -1389,7 +1389,7 @@ _Parameters_ - _edits_ `Object`: Initial edited attributes object. - _template_ `Array?`: Block Template. -# **setupEditorState** +### setupEditorState Returns an action object used to setup the editor state when first opening an editor. @@ -1402,63 +1402,63 @@ _Returns_ - `Object`: Action object. -# **showInsertionPoint** +### showInsertionPoint _Related_ - showInsertionPoint in core/block-editor store. -# **startMultiSelect** +### startMultiSelect _Related_ - startMultiSelect in core/block-editor store. -# **startTyping** +### startTyping _Related_ - startTyping in core/block-editor store. -# **stopMultiSelect** +### stopMultiSelect _Related_ - stopMultiSelect in core/block-editor store. -# **stopTyping** +### stopTyping _Related_ - stopTyping in core/block-editor store. -# **synchronizeTemplate** +### synchronizeTemplate _Related_ - synchronizeTemplate in core/block-editor store. -# **toggleBlockMode** +### toggleBlockMode _Related_ - toggleBlockMode in core/block-editor store. -# **toggleSelection** +### toggleSelection _Related_ - toggleSelection in core/block-editor store. -# **trashPost** +### trashPost Action generator for trashing the current post in the editor. -# **undo** +### undo Returns an action object used in signalling that undo history should pop. -# **unlockPostAutosaving** +### unlockPostAutosaving Returns an action object used to signal that post autosaving is unlocked. @@ -1475,7 +1475,7 @@ _Returns_ - `Object`: Action object -# **unlockPostSaving** +### unlockPostSaving Returns an action object used to signal that post saving is unlocked. @@ -1492,29 +1492,29 @@ _Returns_ - `Object`: Action object -# **updateBlock** +### updateBlock _Related_ - updateBlock in core/block-editor store. -# **updateBlockAttributes** +### updateBlockAttributes _Related_ - updateBlockAttributes in core/block-editor store. -# **updateBlockListSettings** +### updateBlockListSettings _Related_ - updateBlockListSettings in core/block-editor store. -# **updateEditorSettings** +### updateEditorSettings Undocumented declaration. -# **updatePost** +### updatePost > **Deprecated** since Gutenberg 9.7.0. @@ -1525,7 +1525,7 @@ _Returns_ - `Object`: Action object. -# **updatePostLock** +### updatePostLock Returns an action object used to lock the editor. diff --git a/docs/reference-guides/data/data-core-keyboard-shortcuts.md b/docs/reference-guides/data/data-core-keyboard-shortcuts.md index d19af87e9f71b..fe8a0c9b1e4bb 100644 --- a/docs/reference-guides/data/data-core-keyboard-shortcuts.md +++ b/docs/reference-guides/data/data-core-keyboard-shortcuts.md @@ -6,11 +6,11 @@ Namespace: `core/keyboard-shortcuts`. -# **getAllShortcutKeyCombinations** +### getAllShortcutKeyCombinations Undocumented declaration. -# **getAllShortcutRawKeyCombinations** +### getAllShortcutRawKeyCombinations Returns the raw representation of all the keyboard combinations of a given shortcut name. @@ -23,7 +23,7 @@ _Returns_ - `string[]`: Shortcuts. -# **getCategoryShortcuts** +### getCategoryShortcuts Returns the shortcut names list for a given category name. @@ -36,7 +36,7 @@ _Returns_ - `string[]`: Shortcut names. -# **getShortcutAliases** +### getShortcutAliases Returns the aliases for a given shortcut name. @@ -49,7 +49,7 @@ _Returns_ - `WPShortcutKeyCombination[]`: Key combinations. -# **getShortcutDescription** +### getShortcutDescription Returns the shortcut description given its name. @@ -62,7 +62,7 @@ _Returns_ - `string?`: Shortcut description. -# **getShortcutKeyCombination** +### getShortcutKeyCombination Returns the main key combination for a given shortcut name. @@ -75,7 +75,7 @@ _Returns_ - `WPShortcutKeyCombination?`: Key combination. -# **getShortcutRepresentation** +### getShortcutRepresentation Returns a string representing the main key combination for a given shortcut name. @@ -95,7 +95,7 @@ _Returns_ -# **registerShortcut** +### registerShortcut Returns an action object used to register a new keyboard shortcut. @@ -107,7 +107,7 @@ _Returns_ - `Object`: action. -# **unregisterShortcut** +### unregisterShortcut Returns an action object used to unregister a keyboard shortcut. diff --git a/docs/reference-guides/data/data-core-notices.md b/docs/reference-guides/data/data-core-notices.md index 9f45e4d4c6153..cf24beadd251d 100644 --- a/docs/reference-guides/data/data-core-notices.md +++ b/docs/reference-guides/data/data-core-notices.md @@ -6,7 +6,7 @@ Namespace: `core/notices`. -# **getNotices** +### getNotices Returns all notices as an array, optionally for a given context. Defaults to the global context. @@ -26,7 +26,7 @@ _Returns_ -# **createErrorNotice** +### createErrorNotice Returns an action object used in signalling that an error notice is to be created. Refer to `createNotice` for options documentation. @@ -44,7 +44,7 @@ _Returns_ - `Object`: Action object. -# **createInfoNotice** +### createInfoNotice Returns an action object used in signalling that an info notice is to be created. Refer to `createNotice` for options documentation. @@ -62,7 +62,7 @@ _Returns_ - `Object`: Action object. -# **createNotice** +### createNotice Returns an action object used in signalling that a notice is to be created. @@ -85,7 +85,7 @@ _Returns_ - `Object`: Action object. -# **createSuccessNotice** +### createSuccessNotice Returns an action object used in signalling that a success notice is to be created. Refer to `createNotice` for options documentation. @@ -103,7 +103,7 @@ _Returns_ - `Object`: Action object. -# **createWarningNotice** +### createWarningNotice Returns an action object used in signalling that a warning notice is to be created. Refer to `createNotice` for options documentation. @@ -121,7 +121,7 @@ _Returns_ - `Object`: Action object. -# **removeNotice** +### removeNotice Returns an action object used in signalling that a notice is to be removed. diff --git a/docs/reference-guides/data/data-core-nux.md b/docs/reference-guides/data/data-core-nux.md index 79a5bba662b4f..fb92f8840c959 100644 --- a/docs/reference-guides/data/data-core-nux.md +++ b/docs/reference-guides/data/data-core-nux.md @@ -6,7 +6,7 @@ Namespace: `core/nux`. -# **areTipsEnabled** +### areTipsEnabled Returns whether or not tips are globally enabled. @@ -18,7 +18,7 @@ _Returns_ - `boolean`: Whether tips are globally enabled. -# **getAssociatedGuide** +### getAssociatedGuide Returns an object describing the guide, if any, that the given tip is a part of. @@ -32,7 +32,7 @@ _Returns_ - `?NUXGuideInfo`: Information about the associated guide. -# **isTipVisible** +### isTipVisible Determines whether or not the given tip is showing. Tips are hidden if they are disabled, have been dismissed, or are not the current tip in any @@ -53,7 +53,7 @@ _Returns_ -# **disableTips** +### disableTips Returns an action object that, when dispatched, prevents all tips from showing again. @@ -62,7 +62,7 @@ _Returns_ - `Object`: Action object. -# **dismissTip** +### dismissTip Returns an action object that, when dispatched, dismisses the given tip. A dismissed tip will not show again. @@ -75,7 +75,7 @@ _Returns_ - `Object`: Action object. -# **enableTips** +### enableTips Returns an action object that, when dispatched, makes all tips show again. @@ -83,7 +83,7 @@ _Returns_ - `Object`: Action object. -# **triggerGuide** +### triggerGuide Returns an action object that, when dispatched, presents a guide that takes the user through a series of tips step by step. diff --git a/docs/reference-guides/data/data-core-viewport.md b/docs/reference-guides/data/data-core-viewport.md index c2d77bae1ad05..045c2f85c9555 100644 --- a/docs/reference-guides/data/data-core-viewport.md +++ b/docs/reference-guides/data/data-core-viewport.md @@ -6,7 +6,7 @@ Namespace: `core/viewport`. -# **isViewportMatch** +### isViewportMatch Returns true if the viewport matches the given query, or false otherwise. @@ -32,7 +32,7 @@ _Returns_ -# **setIsMatching** +### setIsMatching Returns an action object used in signalling that viewport queries have been updated. Values are specified as an object of breakpoint query keys where diff --git a/docs/reference-guides/data/data-core.md b/docs/reference-guides/data/data-core.md index acccf7e3ce954..49bc8c8adecf2 100644 --- a/docs/reference-guides/data/data-core.md +++ b/docs/reference-guides/data/data-core.md @@ -6,7 +6,7 @@ Namespace: `core`. -# **canUser** +### canUser Returns whether the current user can perform the given action on the given REST resource. @@ -27,7 +27,7 @@ _Returns_ - `boolean|undefined`: Whether or not the user can perform the action, or `undefined` if the OPTIONS request is still being made. -# **canUserEditEntityRecord** +### canUserEditEntityRecord Returns whether the current user can edit the given entity. @@ -47,7 +47,7 @@ _Returns_ - `boolean|undefined`: Whether or not the user can edit, or `undefined` if the OPTIONS request is still being made. -# **getAuthors** +### getAuthors Returns all available authors. @@ -60,7 +60,7 @@ _Returns_ - `Array`: Authors list. -# **getAutosave** +### getAutosave Returns the autosave for the post and author. @@ -75,7 +75,7 @@ _Returns_ - `?Object`: The autosave for the post and author. -# **getAutosaves** +### getAutosaves Returns the latest autosaves for the post. @@ -92,7 +92,7 @@ _Returns_ - `?Array`: An array of autosaves for the post, or undefined if there is none. -# **getCurrentTheme** +### getCurrentTheme Return the current theme. @@ -104,7 +104,7 @@ _Returns_ - `Object`: The current theme. -# **getCurrentUser** +### getCurrentUser Returns the current user. @@ -116,7 +116,7 @@ _Returns_ - `Object`: Current user object. -# **getEditedEntityRecord** +### getEditedEntityRecord Returns the specified entity record, merged with its edits. @@ -131,7 +131,7 @@ _Returns_ - `Object?`: The entity record, merged with its edits. -# **getEmbedPreview** +### getEmbedPreview Returns the embed preview for the given URL. @@ -144,7 +144,7 @@ _Returns_ - `*`: Undefined if the preview has not been fetched, otherwise, the preview fetched from the embed preview API. -# **getEntitiesByKind** +### getEntitiesByKind Returns whether the entities for the give kind are loaded. @@ -157,7 +157,7 @@ _Returns_ - `Array`: Array of entities with config matching kind. -# **getEntity** +### getEntity Returns the entity object given its kind and name. @@ -171,7 +171,7 @@ _Returns_ - `Object`: Entity -# **getEntityRecord** +### getEntityRecord Returns the Entity's record object by key. Returns `null` if the value is not yet received, undefined if the value entity is known to not exist, or the @@ -189,7 +189,7 @@ _Returns_ - `Object?`: Record. -# **getEntityRecordEdits** +### getEntityRecordEdits Returns the specified entity record's edits. @@ -204,7 +204,7 @@ _Returns_ - `Object?`: The entity record's edits. -# **getEntityRecordNonTransientEdits** +### getEntityRecordNonTransientEdits Returns the specified entity record's non transient edits. @@ -223,7 +223,7 @@ _Returns_ - `Object?`: The entity record's non transient edits. -# **getEntityRecords** +### getEntityRecords Returns the Entity's records. @@ -238,7 +238,7 @@ _Returns_ - `?Array`: Records. -# **getLastEntityDeleteError** +### getLastEntityDeleteError Returns the specified entity record's last delete error. @@ -253,7 +253,7 @@ _Returns_ - `Object?`: The entity record's save error. -# **getLastEntitySaveError** +### getLastEntitySaveError Returns the specified entity record's last save error. @@ -268,7 +268,7 @@ _Returns_ - `Object?`: The entity record's save error. -# **getRawEntityRecord** +### getRawEntityRecord Returns the entity's record object by key, with its attributes mapped to their raw values. @@ -284,7 +284,7 @@ _Returns_ - `Object?`: Object with the entity's raw attributes. -# **getRedoEdit** +### getRedoEdit Returns the next edit from the current undo offset for the entity records edits history, if any. @@ -297,7 +297,7 @@ _Returns_ - `Object?`: The edit. -# **getReferenceByDistinctEdits** +### getReferenceByDistinctEdits Returns a new reference when edited values have changed. This is useful in inferring where an edit has been made between states by comparison of the @@ -318,7 +318,7 @@ _Returns_ - `*`: A value whose reference will change only when an edit occurs. -# **getThemeSupports** +### getThemeSupports Return theme supports data in the index. @@ -330,7 +330,7 @@ _Returns_ - `*`: Index data. -# **getUndoEdit** +### getUndoEdit Returns the previous edit from the current undo offset for the entity records edits history, if any. @@ -343,7 +343,7 @@ _Returns_ - `Object?`: The edit. -# **getUserQueryResults** +### getUserQueryResults Returns all the users returned by a query ID. @@ -356,7 +356,7 @@ _Returns_ - `Array`: Users list. -# **hasEditsForEntityRecord** +### hasEditsForEntityRecord Returns true if the specified entity record has edits, and false otherwise. @@ -372,7 +372,7 @@ _Returns_ - `boolean`: Whether the entity record has edits or not. -# **hasEntityRecords** +### hasEntityRecords Returns true if records have been received for the given set of parameters, or false otherwise. @@ -388,7 +388,7 @@ _Returns_ - `boolean`: Whether entity records have been received. -# **hasFetchedAutosaves** +### hasFetchedAutosaves Returns true if the REST request for autosaves has completed. @@ -402,7 +402,7 @@ _Returns_ - `boolean`: True if the REST request was completed. False otherwise. -# **hasRedo** +### hasRedo Returns true if there is a next edit from the current undo offset for the entity records edits history, and false otherwise. @@ -415,7 +415,7 @@ _Returns_ - `boolean`: Whether there is a next edit or not. -# **hasUndo** +### hasUndo Returns true if there is a previous edit from the current undo offset for the entity records edits history, and false otherwise. @@ -428,7 +428,7 @@ _Returns_ - `boolean`: Whether there is a previous edit or not. -# **isAutosavingEntityRecord** +### isAutosavingEntityRecord Returns true if the specified entity record is autosaving, and false otherwise. @@ -443,7 +443,7 @@ _Returns_ - `boolean`: Whether the entity record is autosaving or not. -# **isDeletingEntityRecord** +### isDeletingEntityRecord Returns true if the specified entity record is deleting, and false otherwise. @@ -458,7 +458,7 @@ _Returns_ - `boolean`: Whether the entity record is deleting or not. -# **isPreviewEmbedFallback** +### isPreviewEmbedFallback Determines if the returned preview is an oEmbed link fallback. @@ -475,7 +475,7 @@ _Returns_ - `boolean`: Is the preview for the URL an oEmbed link fallback. -# **isRequestingEmbedPreview** +### isRequestingEmbedPreview Returns true if a request is in progress for embed preview data, or false otherwise. @@ -489,7 +489,7 @@ _Returns_ - `boolean`: Whether a request is in progress for an embed preview. -# **isSavingEntityRecord** +### isSavingEntityRecord Returns true if the specified entity record is saving, and false otherwise. @@ -510,7 +510,7 @@ _Returns_ -# **addEntities** +### addEntities Returns an action object used in adding new entities. @@ -522,7 +522,7 @@ _Returns_ - `Object`: Action object. -# **deleteEntityRecord** +### deleteEntityRecord Action triggered to delete an entity record. @@ -535,7 +535,7 @@ _Parameters_ - _options_ `[Object]`: Delete options. - _options.\_\_unstableFetch_ `[Function]`: Internal use only. Function to call instead of `apiFetch()`. Must return a control descriptor. -# **editEntityRecord** +### editEntityRecord Returns an action object that triggers an edit to an entity record. @@ -553,7 +553,7 @@ _Returns_ - `Object`: Action object. -# **receiveAutosaves** +### receiveAutosaves Returns an action object used in signalling that the autosaves for a post have been received. @@ -567,7 +567,7 @@ _Returns_ - `Object`: Action object. -# **receiveCurrentTheme** +### receiveCurrentTheme Returns an action object used in signalling that the current theme has been received. @@ -579,7 +579,7 @@ _Returns_ - `Object`: Action object. -# **receiveCurrentUser** +### receiveCurrentUser Returns an action used in signalling that the current user has been received. @@ -591,7 +591,7 @@ _Returns_ - `Object`: Action object. -# **receiveEmbedPreview** +### receiveEmbedPreview Returns an action object used in signalling that the preview data for a given URl has been received. @@ -605,7 +605,7 @@ _Returns_ - `Object`: Action object. -# **receiveEntityRecords** +### receiveEntityRecords Returns an action object used in signalling that entity records have been received. @@ -622,7 +622,7 @@ _Returns_ - `Object`: Action object. -# **receiveThemeSupports** +### receiveThemeSupports Returns an action object used in signalling that the index has been received. @@ -634,7 +634,7 @@ _Returns_ - `Object`: Action object. -# **receiveUploadPermissions** +### receiveUploadPermissions Returns an action object used in signalling that Upload permissions have been received. @@ -646,7 +646,7 @@ _Returns_ - `Object`: Action object. -# **receiveUserPermission** +### receiveUserPermission Returns an action object used in signalling that the current user has permission to perform an action on a REST resource. @@ -660,7 +660,7 @@ _Returns_ - `Object`: Action object. -# **receiveUserQuery** +### receiveUserQuery Returns an action object used in signalling that authors have been received. @@ -673,12 +673,12 @@ _Returns_ - `Object`: Action object. -# **redo** +### redo Action triggered to redo the last undoed edit to an entity record, if any. -# **saveEditedEntityRecord** +### saveEditedEntityRecord Action triggered to save an entity record's edits. @@ -689,7 +689,7 @@ _Parameters_ - _recordId_ `Object`: ID of the record. - _options_ `Object`: Saving options. -# **saveEntityRecord** +### saveEntityRecord Action triggered to save an entity record. @@ -702,7 +702,7 @@ _Parameters_ - _options.isAutosave_ `[boolean]`: Whether this is an autosave. - _options.\_\_unstableFetch_ `[Function]`: Internal use only. Function to call instead of `apiFetch()`. Must return a control descriptor. -# **undo** +### undo Action triggered to undo the last edit to an entity record, if any. diff --git a/packages/a11y/README.md b/packages/a11y/README.md index 5f44a3d22cf39..f233027d56f40 100644 --- a/packages/a11y/README.md +++ b/packages/a11y/README.md @@ -16,11 +16,11 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **setup** +### setup Create the live regions. -# **speak** +### speak Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions. This module is inspired by the `speak` function in `wp-a11y.js`. diff --git a/packages/autop/README.md b/packages/autop/README.md index 43d6a0ca123d1..2968ace936b3a 100644 --- a/packages/autop/README.md +++ b/packages/autop/README.md @@ -16,7 +16,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **autop** +#### autop Replaces double line-breaks with paragraph elements. @@ -40,7 +40,7 @@ _Returns_ - `string`: Text which has been converted into paragraph tags. -# **removep** +#### removep Replaces `

` tags with two line breaks. "Opposite" of autop(). diff --git a/packages/blob/README.md b/packages/blob/README.md index f49f493d17565..c8da2a0f36d2a 100644 --- a/packages/blob/README.md +++ b/packages/blob/README.md @@ -14,7 +14,7 @@ npm install @wordpress/blob --save -# **createBlobURL** +### createBlobURL Create a blob URL from a file. @@ -26,7 +26,7 @@ _Returns_ - `string`: The blob URL. -# **getBlobByURL** +### getBlobByURL Retrieve a file based on a blob URL. The file must have been created by `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return @@ -40,7 +40,7 @@ _Returns_ - `File|undefined`: The file for the blob URL. -# **getBlobTypeByURL** +### getBlobTypeByURL Retrieve a blob type based on URL. The file must have been created by `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return @@ -54,7 +54,7 @@ _Returns_ - `string|undefined`: The blob type. -# **isBlobURL** +### isBlobURL Check whether a url is a blob url. @@ -66,7 +66,7 @@ _Returns_ - `boolean`: Is the url a blob url? -# **revokeBlobURL** +### revokeBlobURL Remove the resource and file cache from memory. diff --git a/packages/block-directory/README.md b/packages/block-directory/README.md index 26d26bb04ed92..95ed65f00ac18 100644 --- a/packages/block-directory/README.md +++ b/packages/block-directory/README.md @@ -28,7 +28,7 @@ The following set of dispatching action creators are available on the object ret -# **addInstalledBlockType** +### addInstalledBlockType Returns an action object used to add a block type to the "newly installed" tracking list. @@ -41,7 +41,7 @@ _Returns_ - `Object`: Action object. -# **clearErrorNotice** +### clearErrorNotice Sets the error notice to empty for specific block. @@ -53,7 +53,7 @@ _Returns_ - `Object`: Action object. -# **fetchDownloadableBlocks** +### fetchDownloadableBlocks Returns an action object used in signalling that the downloadable blocks have been requested and are loading. @@ -66,7 +66,7 @@ _Returns_ - `Object`: Action object. -# **installBlockType** +### installBlockType Action triggered to install a block plugin. @@ -78,7 +78,7 @@ _Returns_ - `boolean`: Whether the block was successfully installed & loaded. -# **receiveDownloadableBlocks** +### receiveDownloadableBlocks Returns an action object used in signalling that the downloadable blocks have been updated. @@ -92,7 +92,7 @@ _Returns_ - `Object`: Action object. -# **removeInstalledBlockType** +### removeInstalledBlockType Returns an action object used to remove a block type from the "newly installed" tracking list. @@ -105,7 +105,7 @@ _Returns_ - `Object`: Action object. -# **setErrorNotice** +### setErrorNotice Sets an error notice to be displayed to the user for a given block. @@ -119,7 +119,7 @@ _Returns_ - `Object`: Action object. -# **setIsInstalling** +### setIsInstalling Returns an action object used to indicate install in progress. @@ -132,7 +132,7 @@ _Returns_ - `Object`: Action object. -# **uninstallBlockType** +### uninstallBlockType Action triggered to uninstall a block plugin. @@ -148,7 +148,7 @@ The following selectors are available on the object returned by `wp.data.select( -# **getDownloadableBlocks** +### getDownloadableBlocks Returns the available uninstalled blocks. @@ -161,7 +161,7 @@ _Returns_ - `Array`: Downloadable blocks. -# **getErrorNoticeForBlock** +### getErrorNoticeForBlock Returns the error notice for a given block. @@ -174,7 +174,7 @@ _Returns_ - `string|boolean`: The error text, or false if no error. -# **getErrorNotices** +### getErrorNotices Returns all block error notices. @@ -186,7 +186,7 @@ _Returns_ - `Object`: Object with error notices. -# **getInstalledBlockTypes** +### getInstalledBlockTypes Returns the block types that have been installed on the server in this session. @@ -199,7 +199,7 @@ _Returns_ - `Array`: Block type items -# **getNewBlockTypes** +### getNewBlockTypes Returns block types that have been installed on the server and used in the current post. @@ -212,7 +212,7 @@ _Returns_ - `Array`: Block type items. -# **getUnusedBlockTypes** +### getUnusedBlockTypes Returns the block types that have been installed on the server but are not used in the current post. @@ -225,7 +225,7 @@ _Returns_ - `Array`: Block type items. -# **isInstalling** +### isInstalling Returns true if a block plugin install is in progress. @@ -238,7 +238,7 @@ _Returns_ - `boolean`: Whether this block is currently being installed. -# **isRequestingDownloadableBlocks** +### isRequestingDownloadableBlocks Returns true if application is requesting for downloadable blocks. diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index fc1f1cb6fddd7..0b5ec868655cf 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -78,29 +78,29 @@ registerCoreBlocks(); -# **AlignmentControl** +### AlignmentControl Undocumented declaration. -# **AlignmentToolbar** +### AlignmentToolbar Undocumented declaration. -# **Autocomplete** +### Autocomplete _Related_ - -# **BlockAlignmentControl** +### BlockAlignmentControl Undocumented declaration. -# **BlockAlignmentToolbar** +### BlockAlignmentToolbar Undocumented declaration. -# **BlockBreadcrumb** +### BlockBreadcrumb Block breadcrumb component, displaying the hierarchy of the current block selection as a breadcrumb. @@ -113,11 +113,11 @@ _Returns_ - `WPElement`: Block Breadcrumb. -# **BlockColorsStyleSelector** +### BlockColorsStyleSelector Undocumented declaration. -# **BlockContextProvider** +### BlockContextProvider Component which merges passed value with current consumed block context. @@ -129,47 +129,47 @@ _Parameters_ - _props_ `BlockContextProviderProps`: -# **BlockControls** +### BlockControls Undocumented declaration. -# **BlockEdit** +### BlockEdit Undocumented declaration. -# **BlockEditorKeyboardShortcuts** +### BlockEditorKeyboardShortcuts Undocumented declaration. -# **BlockEditorProvider** +### BlockEditorProvider Undocumented declaration. -# **BlockFormatControls** +### BlockFormatControls Undocumented declaration. -# **BlockIcon** +### BlockIcon Undocumented declaration. -# **BlockInspector** +### BlockInspector Undocumented declaration. -# **BlockList** +### BlockList Undocumented declaration. -# **BlockMover** +### BlockMover Undocumented declaration. -# **BlockNavigationDropdown** +### BlockNavigationDropdown Undocumented declaration. -# **BlockPreview** +### BlockPreview BlockPreview renders a preview of a block or array of blocks. @@ -187,15 +187,15 @@ _Returns_ - `WPComponent`: The component to be rendered. -# **BlockSelectionClearer** +### BlockSelectionClearer Undocumented declaration. -# **BlockSettingsMenu** +### BlockSettingsMenu Undocumented declaration. -# **BlockSettingsMenuControls** +### BlockSettingsMenuControls _Related_ @@ -209,7 +209,7 @@ _Returns_ - `WPElement`: Element. -# **BlockTitle** +### BlockTitle Renders the block's configured title as a string, or empty if the title cannot be determined. @@ -229,11 +229,11 @@ _Returns_ - `?string`: Block title. -# **BlockToolbar** +### BlockToolbar Undocumented declaration. -# **BlockTools** +### BlockTools Renders block tools (the block toolbar, select/navigation mode toolbar, the insertion point and a slot for the inline rich text toolbar). Must be wrapped @@ -245,43 +245,43 @@ _Parameters_ - _$0.children_ `Object`: The block content and style container. - _$0.\_\_unstableContentRef_ `Object`: Ref holding the content scroll container. -# **BlockVerticalAlignmentControl** +### BlockVerticalAlignmentControl Undocumented declaration. -# **BlockVerticalAlignmentToolbar** +### BlockVerticalAlignmentToolbar Undocumented declaration. -# **ButtonBlockAppender** +### ButtonBlockAppender _Related_ - -# **ButtonBlockerAppender** +### ButtonBlockerAppender > **Deprecated** Use `ButtonBlockAppender` instead. -# **ColorPalette** +### ColorPalette Undocumented declaration. -# **ColorPaletteControl** +### ColorPaletteControl Undocumented declaration. -# **ContrastChecker** +### ContrastChecker Undocumented declaration. -# **CopyHandler** +### CopyHandler Undocumented declaration. -# **createCustomColorsHOC** +### createCustomColorsHOC A higher-order component factory for creating a 'withCustomColors' HOC, which handles color logic for class generation color value, retrieval and color attribute setting. @@ -308,15 +308,15 @@ _Returns_ - `Function`: Higher-order component. -# **DefaultBlockAppender** +### DefaultBlockAppender Undocumented declaration. -# **FontSizePicker** +### FontSizePicker Undocumented declaration. -# **getColorClassName** +### getColorClassName Returns a class based on the context a color is being used and its slug. @@ -329,7 +329,7 @@ _Returns_ - `?string`: String with the class corresponding to the color in the provided context. Returns undefined if either colorContextName or colorSlug are not provided. -# **getColorObjectByAttributeValues** +### getColorObjectByAttributeValues Provided an array of color objects as set by the theme or by the editor defaults, and the values of the defined color or custom color returns a color object describing the color. @@ -344,7 +344,7 @@ _Returns_ - `?Object`: If definedColor is passed and the name is found in colors, the color object exactly as set by the theme or editor defaults is returned. Otherwise, an object that just sets the color is defined. -# **getColorObjectByColorValue** +### getColorObjectByColorValue Provided an array of color objects as set by the theme or by the editor defaults, and a color value returns the color object matching that value or undefined. @@ -357,7 +357,7 @@ _Returns_ - `?Object`: Color object included in the colors array whose color property equals colorValue. Returns undefined if no color object matches this requirement. -# **getFontSize** +### getFontSize Returns the font size object based on an array of named font sizes and the namedFontSize and customFontSize values. If namedFontSize is undefined or not found in fontSizes an object with just the size value based on customFontSize is returned. @@ -372,7 +372,7 @@ _Returns_ - `?Object`: If fontSizeAttribute is set and an equal slug is found in fontSizes it returns the font size object for that slug. Otherwise, an object with just the size value based on customFontSize is returned. -# **getFontSizeClass** +### getFontSizeClass Returns a class based on fontSizeName. @@ -384,7 +384,7 @@ _Returns_ - `string`: String with the class corresponding to the fontSize passed. The class is generated by appending 'has-' followed by fontSizeSlug in kebabCase and ending with '-font-size'. -# **getFontSizeObjectByValue** +### getFontSizeObjectByValue Returns the corresponding font size object for a given value. @@ -397,7 +397,7 @@ _Returns_ - `Object`: Font size object. -# **getGradientSlugByValue** +### getGradientSlugByValue Retrieves the gradient slug per slug. @@ -410,7 +410,7 @@ _Returns_ - `string`: Gradient slug. -# **getGradientValueBySlug** +### getGradientValueBySlug Retrieves the gradient value per slug. @@ -423,108 +423,108 @@ _Returns_ - `string`: Gradient value. -# **InnerBlocks** +### InnerBlocks _Related_ - -# **Inserter** +### Inserter Undocumented declaration. -# **InspectorAdvancedControls** +### InspectorAdvancedControls _Related_ - -# **InspectorControls** +### InspectorControls _Related_ - -# **JustifyContentControl** +### JustifyContentControl Undocumented declaration. -# **JustifyToolbar** +### JustifyToolbar Undocumented declaration. -# **LineHeightControl** +### LineHeightControl Undocumented declaration. -# **MediaPlaceholder** +### MediaPlaceholder _Related_ - -# **MediaReplaceFlow** +### MediaReplaceFlow Undocumented declaration. -# **MediaUpload** +### MediaUpload _Related_ - -# **MediaUploadCheck** +### MediaUploadCheck _Related_ - -# **MultiSelectScrollIntoView** +### MultiSelectScrollIntoView > **Deprecated** Scrolls the multi block selection end into view if not in view already. This is important to do after selection by keyboard. -# **NavigableToolbar** +### NavigableToolbar Undocumented declaration. -# **ObserveTyping** +### ObserveTyping _Related_ - -# **PanelColorSettings** +### PanelColorSettings Undocumented declaration. -# **PlainText** +### PlainText _Related_ - -# **PreserveScrollInReorder** +### PreserveScrollInReorder Undocumented declaration. -# **RichText** +### RichText _Related_ - -# **RichTextShortcut** +### RichTextShortcut Undocumented declaration. -# **RichTextToolbarButton** +### RichTextToolbarButton Undocumented declaration. -# **SETTINGS_DEFAULTS** +### SETTINGS_DEFAULTS The default editor settings @@ -552,11 +552,11 @@ _Properties_ - _\_\_experimentalBlockPatterns_ `Array`: Array of objects representing the block patterns - _\_\_experimentalBlockPatternCategories_ `Array`: Array of objects representing the block pattern categories -# **SkipToSelectedBlock** +### SkipToSelectedBlock Undocumented declaration. -# **store** +### store Store definition for the block editor namespace. @@ -568,7 +568,7 @@ _Type_ - `Object` -# **storeConfig** +### storeConfig Block editor data store configuration. @@ -580,11 +580,11 @@ _Type_ - `Object` -# **ToolSelector** +### ToolSelector Undocumented declaration. -# **transformStyles** +### transformStyles Applies a series of CSS rule transforms to wrap selectors inside a given class and/or rewrite URLs depending on the parameters passed. @@ -597,31 +597,31 @@ _Returns_ - `Array`: converted rules. -# **Typewriter** +### Typewriter Ensures that the text selection keeps the same vertical distance from the viewport during keyboard events within this component. The vertical distance can vary. It is the last clicked or scrolled to position. -# **URLInput** +### URLInput _Related_ - -# **URLInputButton** +### URLInputButton _Related_ - -# **URLPopover** +### URLPopover _Related_ - -# **useBlockDisplayInformation** +### useBlockDisplayInformation Hook used to try to find a matching block variation and return the appropriate information for display reasons. In order to @@ -641,11 +641,11 @@ _Returns_ - `?WPBlockDisplayInformation`: Block's display information, or `null` when the block or its type not found. -# **useBlockEditContext** +### useBlockEditContext Undocumented declaration. -# **useBlockProps** +### useBlockProps This hook is used to lightly mark an element as a block element. The element should be the outermost element of a block. Call this hook and pass the @@ -665,7 +665,7 @@ _Returns_ - `Object`: Props to pass to the element to mark as a block. -# **useSetting** +### useSetting Hook that retrieves the editor setting. It works with nested objects using by finding the value at path. @@ -684,7 +684,7 @@ _Returns_ - `any`: Returns the value defined for the setting. -# **validateThemeColors** +### validateThemeColors Given an array of theme colors checks colors for validity @@ -696,7 +696,7 @@ _Returns_ - `Array`: The array of valid theme colors or the default colors -# **validateThemeGradients** +### validateThemeGradients Given an array of theme gradients checks gradients for validity @@ -708,17 +708,17 @@ _Returns_ - `Array`: The array of valid theme gradients or the default gradients -# **Warning** +### Warning _Related_ - -# **withColorContext** +### withColorContext Undocumented declaration. -# **withColors** +### withColors A higher-order component, which handles color logic for class generation color value, retrieval and color attribute setting. @@ -741,7 +741,7 @@ _Returns_ - `Function`: Higher-order component. -# **withFontSizes** +### withFontSizes Higher-order component, which handles font size logic for class generation, font size value retrieval, and font size change handling. @@ -754,7 +754,7 @@ _Returns_ - `Function`: Higher-order component. -# **WritingFlow** +### WritingFlow Handles selection and navigation across blocks. This component should be wrapped around BlockList. diff --git a/packages/block-library/README.md b/packages/block-library/README.md index 84f86a88a5b74..9106f9b60e9c2 100644 --- a/packages/block-library/README.md +++ b/packages/block-library/README.md @@ -72,7 +72,7 @@ apply_filter( 'render_block', 'render_block_my_block' ); -# **registerCoreBlocks** +### registerCoreBlocks Function to register core blocks provided by the block editor. diff --git a/packages/block-serialization-default-parser/README.md b/packages/block-serialization-default-parser/README.md index 731b5c138b539..491a4de2b6f30 100644 --- a/packages/block-serialization-default-parser/README.md +++ b/packages/block-serialization-default-parser/README.md @@ -16,7 +16,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **parse** +### parse Parser function, that converts input HTML into a block based structure. diff --git a/packages/blocks/README.md b/packages/blocks/README.md index 22c6a6db40cb9..28f94c1078aca 100644 --- a/packages/blocks/README.md +++ b/packages/blocks/README.md @@ -183,7 +183,7 @@ In the random image block above, we've given the `alt` attribute of the image a -# **cloneBlock** +### cloneBlock Given a block object, returns a copy of the block object, optionally merging new attributes and/or replacing its inner blocks. @@ -198,7 +198,7 @@ _Returns_ - `Object`: A cloned block. -# **createBlock** +### createBlock Returns a block object given its type and attributes. @@ -212,7 +212,7 @@ _Returns_ - `Object`: Block object. -# **createBlocksFromInnerBlocksTemplate** +### createBlocksFromInnerBlocksTemplate Given an array of InnerBlocks templates or Block Objects, returns an array of created Blocks from them. @@ -227,7 +227,7 @@ _Returns_ - `Object[]`: Array of Block objects. -# **doBlocksMatchTemplate** +### doBlocksMatchTemplate Checks whether a list of blocks matches a template by comparing the block names. @@ -240,7 +240,7 @@ _Returns_ - `boolean`: Whether the list of blocks matches a templates. -# **findTransform** +### findTransform Given an array of transforms, returns the highest-priority transform where the predicate function returns a truthy value. A higher-priority transform @@ -257,7 +257,7 @@ _Returns_ - `?Object`: Highest-priority transform candidate. -# **getBlockAttributes** +### getBlockAttributes Returns the block attributes of a registered block node given its type. @@ -271,7 +271,7 @@ _Returns_ - `Object`: All block attributes. -# **getBlockContent** +### getBlockContent Given a block object, returns the Block's Inner HTML markup. @@ -283,7 +283,7 @@ _Returns_ - `string`: HTML. -# **getBlockDefaultClassName** +### getBlockDefaultClassName Returns the block's default classname from its name. @@ -295,7 +295,7 @@ _Returns_ - `string`: The block's default class. -# **getBlockFromExample** +### getBlockFromExample Create a block object from the example API. @@ -308,7 +308,7 @@ _Returns_ - `Object`: block. -# **getBlockMenuDefaultClassName** +### getBlockMenuDefaultClassName Returns the block's default menu item classname from its name. @@ -320,7 +320,7 @@ _Returns_ - `string`: The block's default menu item class. -# **getBlockSupport** +### getBlockSupport Returns the block support value for a feature, if defined. @@ -334,7 +334,7 @@ _Returns_ - `?*`: Block support value -# **getBlockTransforms** +### getBlockTransforms Returns normal block transforms for a given transform direction, optionally for a specific block by name, or an empty array if there are no transforms. @@ -350,7 +350,7 @@ _Returns_ - `Array`: Block transforms for direction. -# **getBlockType** +### getBlockType Returns a registered block type. @@ -362,7 +362,7 @@ _Returns_ - `?Object`: Block type. -# **getBlockTypes** +### getBlockTypes Returns all registered blocks. @@ -370,7 +370,7 @@ _Returns_ - `Array`: Block settings. -# **getBlockVariations** +### getBlockVariations Returns an array with the variations of a given block type. @@ -383,7 +383,7 @@ _Returns_ - `(WPBlockVariation[]|void)`: Block variations. -# **getCategories** +### getCategories Returns all the block categories. @@ -391,7 +391,7 @@ _Returns_ - `WPBlockCategory[]`: Block categories. -# **getChildBlockNames** +### getChildBlockNames Returns an array with the child blocks of a given block. @@ -403,7 +403,7 @@ _Returns_ - `Array`: Array of child block names. -# **getDefaultBlockName** +### getDefaultBlockName Retrieves the default block name. @@ -411,7 +411,7 @@ _Returns_ - `?string`: Block name. -# **getFreeformContentHandlerName** +### getFreeformContentHandlerName Retrieves name of block handling non-block content, or undefined if no handler has been defined. @@ -420,7 +420,7 @@ _Returns_ - `?string`: Block name. -# **getGroupingBlockName** +### getGroupingBlockName Retrieves name of block used for handling grouping interactions. @@ -428,11 +428,11 @@ _Returns_ - `?string`: Block name. -# **getPhrasingContentSchema** +### getPhrasingContentSchema Undocumented declaration. -# **getPossibleBlockTransformations** +### getPossibleBlockTransformations Returns an array of block types that the set of blocks received as argument can be transformed into. @@ -445,7 +445,7 @@ _Returns_ - `Array`: Block types that the blocks argument can be transformed to. -# **getSaveContent** +### getSaveContent Given a block type containing a save render implementation and attributes, returns the static markup to be saved. @@ -460,7 +460,7 @@ _Returns_ - `string`: Save content. -# **getSaveElement** +### getSaveElement Given a block type containing a save render implementation and attributes, returns the enhanced element to be saved or string when raw HTML expected. @@ -475,7 +475,7 @@ _Returns_ - `Object|string`: Save element or raw HTML string. -# **getUnregisteredTypeHandlerName** +### getUnregisteredTypeHandlerName Retrieves name of block handling unregistered block types, or undefined if no handler has been defined. @@ -484,7 +484,7 @@ _Returns_ - `?string`: Block name. -# **hasBlockSupport** +### hasBlockSupport Returns true if the block defines support for a feature, or false otherwise. @@ -498,7 +498,7 @@ _Returns_ - `boolean`: Whether block supports feature. -# **hasChildBlocks** +### hasChildBlocks Returns a boolean indicating if a block has child blocks or not. @@ -510,7 +510,7 @@ _Returns_ - `boolean`: True if a block contains child blocks and false otherwise. -# **hasChildBlocksWithInserterSupport** +### hasChildBlocksWithInserterSupport Returns a boolean indicating if a block has at least one child block with inserter support. @@ -522,7 +522,7 @@ _Returns_ - `boolean`: True if a block contains at least one child blocks with inserter support and false otherwise. -# **isReusableBlock** +### isReusableBlock Determines whether or not the given block is a reusable block. This is a special block type that is used to point to a global block stored via the @@ -536,7 +536,7 @@ _Returns_ - `boolean`: Whether the given block is a reusable block. -# **isTemplatePart** +### isTemplatePart Determines whether or not the given block is a template part. This is a special block type that allows composing a page template out of reusable @@ -550,7 +550,7 @@ _Returns_ - `boolean`: Whether the given block is a template part. -# **isUnmodifiedDefaultBlock** +### isUnmodifiedDefaultBlock Determines whether the block is a default block and its attributes are equal to the default attributes @@ -564,7 +564,7 @@ _Returns_ - `boolean`: Whether the block is an unmodified default block -# **isValidBlockContent** +### isValidBlockContent Returns true if the parsed block is valid given the input content. A block is considered valid if, when serialized with assumed attributes, the content @@ -582,7 +582,7 @@ _Returns_ - `boolean`: Whether block is valid. -# **isValidIcon** +### isValidIcon Function that checks if the parameter is a valid icon. @@ -594,7 +594,7 @@ _Returns_ - `boolean`: True if the parameter is a valid icon and false otherwise. -# **normalizeIconObject** +### normalizeIconObject Function that receives an icon as set by the blocks during the registration and returns a new icon object that is normalized so we can rely on just on possible icon structure @@ -608,7 +608,7 @@ _Returns_ - `WPBlockTypeIconDescriptor`: Object describing the icon. -# **parse** +### parse Utilizes an optimized token-driven parser based on the Gutenberg grammar spec defined through a parsing expression grammar to take advantage of the regular @@ -634,7 +634,7 @@ _Returns_ - `Array`: Block list. -# **parseWithAttributeSchema** +### parseWithAttributeSchema Given a block's raw content and an attribute's schema returns the attribute's value depending on its source. @@ -648,7 +648,7 @@ _Returns_ - `*`: Attribute value. -# **pasteHandler** +### pasteHandler Converts an HTML string to known blocks. Strips everything else. @@ -665,7 +665,7 @@ _Returns_ - `Array|string`: A list of blocks or a string, depending on `handlerMode`. -# **rawHandler** +### rawHandler Converts an HTML string to known blocks. @@ -678,7 +678,7 @@ _Returns_ - `Array`: A list of blocks. -# **registerBlockCollection** +### registerBlockCollection Registers a new block collection to group blocks in the same namespace in the inserter. @@ -689,7 +689,7 @@ _Parameters_ - _settings.title_ `string`: The title to display in the block inserter. - _settings.icon_ `[Object]`: The icon to display in the block inserter. -# **registerBlockStyle** +### registerBlockStyle Registers a new block style variation for the given block. @@ -698,7 +698,7 @@ _Parameters_ - _blockName_ `string`: Name of block (example: “core/latest-posts”). - _styleVariation_ `Object`: Object containing `name` which is the class name applied to the block and `label` which identifies the variation to the user. -# **registerBlockType** +### registerBlockType Registers a new block provided a unique name and an object defining its behavior. Once registered, the block is made available as an option to any @@ -713,7 +713,7 @@ _Returns_ - `?WPBlock`: The block, if it has been successfully registered; otherwise `undefined`. -# **registerBlockVariation** +### registerBlockVariation Registers a new block variation for the given block type. @@ -722,7 +722,7 @@ _Parameters_ - _blockName_ `string`: Name of the block (example: “core/columns”). - _variation_ `WPBlockVariation`: Object describing a block variation. -# **serialize** +### serialize Takes a block or set of blocks and returns the serialized post content. @@ -735,7 +735,7 @@ _Returns_ - `string`: The post content. -# **setCategories** +### setCategories Sets the block categories. @@ -743,7 +743,7 @@ _Parameters_ - _categories_ `WPBlockCategory[]`: Block categories. -# **setDefaultBlockName** +### setDefaultBlockName Assigns the default block name. @@ -751,7 +751,7 @@ _Parameters_ - _name_ `string`: Block name. -# **setFreeformContentHandlerName** +### setFreeformContentHandlerName Assigns name of block for handling non-block content. @@ -759,7 +759,7 @@ _Parameters_ - _blockName_ `string`: Block name. -# **setGroupingBlockName** +### setGroupingBlockName Assigns name of block for handling block grouping interactions. @@ -767,7 +767,7 @@ _Parameters_ - _name_ `string`: Block name. -# **setUnregisteredTypeHandlerName** +### setUnregisteredTypeHandlerName Assigns name of block handling unregistered block types. @@ -775,7 +775,7 @@ _Parameters_ - _blockName_ `string`: Block name. -# **store** +### store Store definition for the blocks namespace. @@ -787,7 +787,7 @@ _Type_ - `Object` -# **switchToBlockType** +### switchToBlockType Switch one or more blocks into one or more blocks of the new block type. @@ -800,7 +800,7 @@ _Returns_ - `?Array`: Array of blocks or null. -# **synchronizeBlocksWithTemplate** +### synchronizeBlocksWithTemplate Synchronize a block list with a block template. @@ -818,7 +818,7 @@ _Returns_ - `Array`: Updated Block list. -# **unregisterBlockStyle** +### unregisterBlockStyle Unregisters a block style variation for the given block. @@ -827,7 +827,7 @@ _Parameters_ - _blockName_ `string`: Name of block (example: “core/latest-posts”). - _styleVariationName_ `string`: Name of class applied to the block. -# **unregisterBlockType** +### unregisterBlockType Unregisters a block. @@ -839,7 +839,7 @@ _Returns_ - `?WPBlock`: The previous block value, if it has been successfully unregistered; otherwise `undefined`. -# **unregisterBlockVariation** +### unregisterBlockVariation Unregisters a block variation defined for the given block type. @@ -848,7 +848,7 @@ _Parameters_ - _blockName_ `string`: Name of the block (example: “core/columns”). - _variationName_ `string`: Name of the variation defined for the block. -# **updateCategory** +### updateCategory Updates a category. @@ -857,7 +857,7 @@ _Parameters_ - _slug_ `string`: Block category slug. - _category_ `WPBlockCategory`: Object containing the category properties that should be updated. -# **withBlockContentContext** +### withBlockContentContext A Higher Order Component used to inject BlockContent using context to the wrapped component. diff --git a/packages/compose/README.md b/packages/compose/README.md index 29d6b05e5e3ac..a1cf52195fff4 100644 --- a/packages/compose/README.md +++ b/packages/compose/README.md @@ -61,7 +61,7 @@ For more details, you can refer to each Higher Order Component's README file. [A -# **compose** +### compose Composes multiple higher-order components into a single higher-order component. Performs right-to-left function composition, where each successive invocation is supplied the return value of the previous. @@ -72,7 +72,7 @@ _Related_ - -# **createHigherOrderComponent** +### createHigherOrderComponent Given a function mapping a component to an enhanced component and modifier name, returns the enhanced component augmented with a generated displayName. @@ -86,7 +86,7 @@ _Returns_ - `HigherOrderComponent< TInnerProps, TOuterProps >`: Component class with generated display name assigned. -# **ifCondition** +### ifCondition Higher-order component creator, creating a new component which renders if the given condition is satisfied or with the given optional prop name. @@ -109,7 +109,7 @@ _Returns_ - `HigherOrderComponent< TProps, TProps >`: Higher-order component. -# **pure** +### pure Given a component returns the enhanced component augmented with a component only rerendering when its props/state change @@ -118,7 +118,7 @@ _Type_ - `SimpleHigherOrderComponent` -# **useAsyncList** +### useAsyncList React hook returns an array which items get asynchronously appended from a source array. This behavior is useful if we want to render a list of items asynchronously for performance reasons. @@ -131,7 +131,7 @@ _Returns_ - `T[]`: Async array. -# **useConstrainedTabbing** +### useConstrainedTabbing In Dialogs/modals, the tabbing must be constrained to the content of the wrapper element. This hook adds the behavior to the returned ref. @@ -156,7 +156,7 @@ _Returns_ - `import('react').RefCallback`: Element Ref. -# **useCopyOnClick** +### useCopyOnClick > **Deprecated** @@ -172,7 +172,7 @@ _Returns_ - `boolean`: Whether or not the text has been copied. Resets after the timeout. -# **useCopyToClipboard** +### useCopyToClipboard Copies the given text to the clipboard when the element is clicked. @@ -185,7 +185,7 @@ _Returns_ - `import('react').Ref`: A ref to assign to the target element. -# **useDebounce** +### useDebounce Debounces a function with Lodash's `debounce`. A new debounced function will be returned and any scheduled calls cancelled if any of the arguments change, @@ -206,7 +206,7 @@ _Returns_ - `TFunc & import('lodash').Cancelable`: Debounced function. -# **useFocusOnMount** +### useFocusOnMount Hook used to focus the first tabbable element on mount. @@ -234,7 +234,7 @@ _Returns_ - `import('react').RefCallback`: Ref callback. -# **useFocusReturn** +### useFocusReturn When opening modals/sidebars/dialogs, the focus must move to the opened area and return to the @@ -265,7 +265,7 @@ _Returns_ - `import('react').RefCallback`: Element Ref. -# **useInstanceId** +### useInstanceId Provides a unique instance ID. @@ -279,13 +279,13 @@ _Returns_ - `string | number`: The unique instance id. -# **useIsomorphicLayoutEffect** +### useIsomorphicLayoutEffect Preferred over direct usage of `useLayoutEffect` when supporting server rendered components (SSR) because currently React throws a warning when using useLayoutEffect in that environment. -# **useKeyboardShortcut** +### useKeyboardShortcut Attach a keyboard shortcut handler. @@ -299,7 +299,7 @@ _Parameters_ - _callback_ `(e: import('mousetrap').ExtendedKeyboardEvent, combo: string) => void`: Shortcut callback. - _options_ `WPKeyboardShortcutConfig`: Shortcut options. -# **useMediaQuery** +### useMediaQuery Runs a media query and returns its value when it changes. @@ -311,7 +311,7 @@ _Returns_ - `boolean`: return value of the media query. -# **useMergeRefs** +### useMergeRefs Merges refs into one ref callback. @@ -358,7 +358,7 @@ _Returns_ - `import('react').RefCallback>`: The merged ref callback. -# **usePrevious** +### usePrevious Use something's value from the previous render. Based on . @@ -371,7 +371,7 @@ _Returns_ - `T | undefined`: The value from the previous render. -# **useReducedMotion** +### useReducedMotion Hook returning whether the user has a preference for reduced motion. @@ -379,7 +379,7 @@ _Returns_ - `boolean`: Reduced motion preference value. -# **useRefEffect** +### useRefEffect Effect-like ref callback. Just like with `useEffect`, this allows you to return a cleanup function to be run if the ref changes or one of the @@ -403,7 +403,7 @@ _Returns_ - `RefCallback< TElement | null >`: Ref callback. -# **useResizeObserver** +### useResizeObserver Hook which allows to listen the resize event of any target element when it changes sizes. _Note: `useResizeObserver` will report `null` until after first render_ @@ -430,7 +430,7 @@ const App = () => { }; ``` -# **useThrottle** +### useThrottle Throttles a function with Lodash's `throttle`. A new throttled function will be returned and any scheduled calls cancelled if any of the arguments change, @@ -451,7 +451,7 @@ _Returns_ - `TFunc & import('lodash').Cancelable`: Throttled function. -# **useViewportMatch** +### useViewportMatch Returns true if the viewport matches the given query, or false otherwise. @@ -471,7 +471,7 @@ _Returns_ - `boolean`: Whether viewport matches query. -# **useWarnOnChange** +### useWarnOnChange Hook that performs a shallow comparison between the preview value of an object and the new one, if there's a difference, it prints it to the console. @@ -492,7 +492,7 @@ _Parameters_ - _object_ `object`: Object which changes to compare. - _prefix_ `string`: Just a prefix to show when console logging. -# **withGlobalEvents** +### withGlobalEvents > **Deprecated** @@ -511,7 +511,7 @@ _Returns_ - `any`: Higher-order component. -# **withInstanceId** +### withInstanceId A Higher Order Component used to be provide a unique instance ID by component. @@ -520,7 +520,7 @@ _Type_ - `PropInjectingHigherOrderComponent< { instanceId: string | number; } >` -# **withSafeTimeout** +### withSafeTimeout A higher-order component used to provide and manage delayed function calls that ought to be bound to a component's lifecycle. @@ -529,7 +529,7 @@ _Type_ - `PropInjectingHigherOrderComponent< TimeoutProps >` -# **withState** +### withState > **Deprecated** Use `useState` instead. diff --git a/packages/core-data/README.md b/packages/core-data/README.md index 3c5d3ff07a6b9..4e543905c563f 100644 --- a/packages/core-data/README.md +++ b/packages/core-data/README.md @@ -42,7 +42,7 @@ The following set of dispatching action creators are available on the object ret -# **addEntities** +### addEntities Returns an action object used in adding new entities. @@ -54,7 +54,7 @@ _Returns_ - `Object`: Action object. -# **deleteEntityRecord** +### deleteEntityRecord Action triggered to delete an entity record. @@ -67,7 +67,7 @@ _Parameters_ - _options_ `[Object]`: Delete options. - _options.\_\_unstableFetch_ `[Function]`: Internal use only. Function to call instead of `apiFetch()`. Must return a control descriptor. -# **editEntityRecord** +### editEntityRecord Returns an action object that triggers an edit to an entity record. @@ -85,7 +85,7 @@ _Returns_ - `Object`: Action object. -# **receiveAutosaves** +### receiveAutosaves Returns an action object used in signalling that the autosaves for a post have been received. @@ -99,7 +99,7 @@ _Returns_ - `Object`: Action object. -# **receiveCurrentTheme** +### receiveCurrentTheme Returns an action object used in signalling that the current theme has been received. @@ -111,7 +111,7 @@ _Returns_ - `Object`: Action object. -# **receiveCurrentUser** +### receiveCurrentUser Returns an action used in signalling that the current user has been received. @@ -123,7 +123,7 @@ _Returns_ - `Object`: Action object. -# **receiveEmbedPreview** +### receiveEmbedPreview Returns an action object used in signalling that the preview data for a given URl has been received. @@ -137,7 +137,7 @@ _Returns_ - `Object`: Action object. -# **receiveEntityRecords** +### receiveEntityRecords Returns an action object used in signalling that entity records have been received. @@ -154,7 +154,7 @@ _Returns_ - `Object`: Action object. -# **receiveThemeSupports** +### receiveThemeSupports Returns an action object used in signalling that the index has been received. @@ -166,7 +166,7 @@ _Returns_ - `Object`: Action object. -# **receiveUploadPermissions** +### receiveUploadPermissions Returns an action object used in signalling that Upload permissions have been received. @@ -178,7 +178,7 @@ _Returns_ - `Object`: Action object. -# **receiveUserPermission** +### receiveUserPermission Returns an action object used in signalling that the current user has permission to perform an action on a REST resource. @@ -192,7 +192,7 @@ _Returns_ - `Object`: Action object. -# **receiveUserQuery** +### receiveUserQuery Returns an action object used in signalling that authors have been received. @@ -205,12 +205,12 @@ _Returns_ - `Object`: Action object. -# **redo** +### redo Action triggered to redo the last undoed edit to an entity record, if any. -# **saveEditedEntityRecord** +### saveEditedEntityRecord Action triggered to save an entity record's edits. @@ -221,7 +221,7 @@ _Parameters_ - _recordId_ `Object`: ID of the record. - _options_ `Object`: Saving options. -# **saveEntityRecord** +### saveEntityRecord Action triggered to save an entity record. @@ -234,7 +234,7 @@ _Parameters_ - _options.isAutosave_ `[boolean]`: Whether this is an autosave. - _options.\_\_unstableFetch_ `[Function]`: Internal use only. Function to call instead of `apiFetch()`. Must return a control descriptor. -# **undo** +### undo Action triggered to undo the last edit to an entity record, if any. @@ -247,7 +247,7 @@ The following selectors are available on the object returned by `wp.data.select( -# **canUser** +### canUser Returns whether the current user can perform the given action on the given REST resource. @@ -268,7 +268,7 @@ _Returns_ - `boolean|undefined`: Whether or not the user can perform the action, or `undefined` if the OPTIONS request is still being made. -# **canUserEditEntityRecord** +### canUserEditEntityRecord Returns whether the current user can edit the given entity. @@ -288,7 +288,7 @@ _Returns_ - `boolean|undefined`: Whether or not the user can edit, or `undefined` if the OPTIONS request is still being made. -# **getAuthors** +### getAuthors Returns all available authors. @@ -301,7 +301,7 @@ _Returns_ - `Array`: Authors list. -# **getAutosave** +### getAutosave Returns the autosave for the post and author. @@ -316,7 +316,7 @@ _Returns_ - `?Object`: The autosave for the post and author. -# **getAutosaves** +### getAutosaves Returns the latest autosaves for the post. @@ -333,7 +333,7 @@ _Returns_ - `?Array`: An array of autosaves for the post, or undefined if there is none. -# **getCurrentTheme** +### getCurrentTheme Return the current theme. @@ -345,7 +345,7 @@ _Returns_ - `Object`: The current theme. -# **getCurrentUser** +### getCurrentUser Returns the current user. @@ -357,7 +357,7 @@ _Returns_ - `Object`: Current user object. -# **getEditedEntityRecord** +### getEditedEntityRecord Returns the specified entity record, merged with its edits. @@ -372,7 +372,7 @@ _Returns_ - `Object?`: The entity record, merged with its edits. -# **getEmbedPreview** +### getEmbedPreview Returns the embed preview for the given URL. @@ -385,7 +385,7 @@ _Returns_ - `*`: Undefined if the preview has not been fetched, otherwise, the preview fetched from the embed preview API. -# **getEntitiesByKind** +### getEntitiesByKind Returns whether the entities for the give kind are loaded. @@ -398,7 +398,7 @@ _Returns_ - `Array`: Array of entities with config matching kind. -# **getEntity** +### getEntity Returns the entity object given its kind and name. @@ -412,7 +412,7 @@ _Returns_ - `Object`: Entity -# **getEntityRecord** +### getEntityRecord Returns the Entity's record object by key. Returns `null` if the value is not yet received, undefined if the value entity is known to not exist, or the @@ -430,7 +430,7 @@ _Returns_ - `Object?`: Record. -# **getEntityRecordEdits** +### getEntityRecordEdits Returns the specified entity record's edits. @@ -445,7 +445,7 @@ _Returns_ - `Object?`: The entity record's edits. -# **getEntityRecordNonTransientEdits** +### getEntityRecordNonTransientEdits Returns the specified entity record's non transient edits. @@ -464,7 +464,7 @@ _Returns_ - `Object?`: The entity record's non transient edits. -# **getEntityRecords** +### getEntityRecords Returns the Entity's records. @@ -479,7 +479,7 @@ _Returns_ - `?Array`: Records. -# **getLastEntityDeleteError** +### getLastEntityDeleteError Returns the specified entity record's last delete error. @@ -494,7 +494,7 @@ _Returns_ - `Object?`: The entity record's save error. -# **getLastEntitySaveError** +### getLastEntitySaveError Returns the specified entity record's last save error. @@ -509,7 +509,7 @@ _Returns_ - `Object?`: The entity record's save error. -# **getRawEntityRecord** +### getRawEntityRecord Returns the entity's record object by key, with its attributes mapped to their raw values. @@ -525,7 +525,7 @@ _Returns_ - `Object?`: Object with the entity's raw attributes. -# **getRedoEdit** +### getRedoEdit Returns the next edit from the current undo offset for the entity records edits history, if any. @@ -538,7 +538,7 @@ _Returns_ - `Object?`: The edit. -# **getReferenceByDistinctEdits** +### getReferenceByDistinctEdits Returns a new reference when edited values have changed. This is useful in inferring where an edit has been made between states by comparison of the @@ -559,7 +559,7 @@ _Returns_ - `*`: A value whose reference will change only when an edit occurs. -# **getThemeSupports** +### getThemeSupports Return theme supports data in the index. @@ -571,7 +571,7 @@ _Returns_ - `*`: Index data. -# **getUndoEdit** +### getUndoEdit Returns the previous edit from the current undo offset for the entity records edits history, if any. @@ -584,7 +584,7 @@ _Returns_ - `Object?`: The edit. -# **getUserQueryResults** +### getUserQueryResults Returns all the users returned by a query ID. @@ -597,7 +597,7 @@ _Returns_ - `Array`: Users list. -# **hasEditsForEntityRecord** +### hasEditsForEntityRecord Returns true if the specified entity record has edits, and false otherwise. @@ -613,7 +613,7 @@ _Returns_ - `boolean`: Whether the entity record has edits or not. -# **hasEntityRecords** +### hasEntityRecords Returns true if records have been received for the given set of parameters, or false otherwise. @@ -629,7 +629,7 @@ _Returns_ - `boolean`: Whether entity records have been received. -# **hasFetchedAutosaves** +### hasFetchedAutosaves Returns true if the REST request for autosaves has completed. @@ -643,7 +643,7 @@ _Returns_ - `boolean`: True if the REST request was completed. False otherwise. -# **hasRedo** +### hasRedo Returns true if there is a next edit from the current undo offset for the entity records edits history, and false otherwise. @@ -656,7 +656,7 @@ _Returns_ - `boolean`: Whether there is a next edit or not. -# **hasUndo** +### hasUndo Returns true if there is a previous edit from the current undo offset for the entity records edits history, and false otherwise. @@ -669,7 +669,7 @@ _Returns_ - `boolean`: Whether there is a previous edit or not. -# **isAutosavingEntityRecord** +### isAutosavingEntityRecord Returns true if the specified entity record is autosaving, and false otherwise. @@ -684,7 +684,7 @@ _Returns_ - `boolean`: Whether the entity record is autosaving or not. -# **isDeletingEntityRecord** +### isDeletingEntityRecord Returns true if the specified entity record is deleting, and false otherwise. @@ -699,7 +699,7 @@ _Returns_ - `boolean`: Whether the entity record is deleting or not. -# **isPreviewEmbedFallback** +### isPreviewEmbedFallback Determines if the returned preview is an oEmbed link fallback. @@ -716,7 +716,7 @@ _Returns_ - `boolean`: Is the preview for the URL an oEmbed link fallback. -# **isRequestingEmbedPreview** +### isRequestingEmbedPreview Returns true if a request is in progress for embed preview data, or false otherwise. @@ -730,7 +730,7 @@ _Returns_ - `boolean`: Whether a request is in progress for an embed preview. -# **isSavingEntityRecord** +### isSavingEntityRecord Returns true if the specified entity record is saving, and false otherwise. diff --git a/packages/data-controls/README.md b/packages/data-controls/README.md index 561a621d75597..c5988331f47c2 100644 --- a/packages/data-controls/README.md +++ b/packages/data-controls/README.md @@ -20,7 +20,7 @@ The following controls are available on the object returned by the module: -# **apiFetch** +### apiFetch Dispatches a control action for triggering an api fetch call. @@ -45,7 +45,7 @@ _Returns_ - `Object`: The control descriptor. -# **controls** +### controls The default export is what you use to register the controls with your custom store. @@ -76,7 +76,7 @@ _Returns_ - `Object`: An object for registering the default controls with the store. -# **dispatch** +### dispatch Control for dispatching an action in a registered data store. Alias for the `dispatch` control in the `@wordpress/data` package. @@ -85,7 +85,7 @@ _Parameters_ - _args_ `Array`: Arguments passed without change to the `@wordpress/data` control. -# **select** +### select Control for resolving a selector in a registered data store. Alias for the `resolveSelect` built-in control in the `@wordpress/data` package. @@ -94,7 +94,7 @@ _Parameters_ - _args_ `Array`: Arguments passed without change to the `@wordpress/data` control. -# **syncSelect** +### syncSelect Control for calling a selector in a registered data store. Alias for the `select` built-in control in the `@wordpress/data` package. diff --git a/packages/data/README.md b/packages/data/README.md index 7e2584639cf8d..c4f73bee7d8dd 100644 --- a/packages/data/README.md +++ b/packages/data/README.md @@ -264,7 +264,7 @@ Specific implementation differences from Redux and React Redux: -# **AsyncModeProvider** +### AsyncModeProvider Context Provider Component used to switch the data module component rerendering between Sync and Async modes. @@ -304,7 +304,7 @@ _Returns_ - `WPComponent`: The component to be rendered. -# **combineReducers** +### combineReducers The combineReducers helper function turns an object whose values are different reducing functions into a single reducing function you can pass to registerReducer. @@ -346,11 +346,11 @@ _Returns_ - `Function`: A reducer that invokes every reducer inside the reducers object, and constructs a state object with the same shape. -# **controls** +### controls Undocumented declaration. -# **createReduxStore** +### createReduxStore Creates a data store definition for the provided Redux store options containing properties describing reducer, actions, selectors, controls and resolvers. @@ -377,7 +377,7 @@ _Returns_ - `WPDataStore`: Store Object. -# **createRegistry** +### createRegistry Creates a new store registry, given an optional object of initial store configurations. @@ -391,7 +391,7 @@ _Returns_ - `WPDataRegistry`: Data registry. -# **createRegistryControl** +### createRegistryControl Creates a control function that takes additional curried argument with the `registry` object. While a regular control has signature @@ -420,7 +420,7 @@ _Returns_ - `Function`: Registry control that can be registered with a store. -# **createRegistrySelector** +### createRegistrySelector Creates a selector function that takes additional curried argument with the registry `select` function. While a regular selector has signature @@ -466,7 +466,7 @@ _Returns_ - `Function`: Registry selector that can be registered with a store. -# **dispatch** +### dispatch Given the name of a registered store, returns an object of the store's action creators. Calling an action creator will cause it to be dispatched, updating the state value accordingly. @@ -490,7 +490,7 @@ _Returns_ - `Object`: Object containing the action creators. -# **plugins** +### plugins Object of available plugins to use with a registry. @@ -502,7 +502,7 @@ _Type_ - `Object` -# **register** +### register Registers a standard `@wordpress/data` store definition. @@ -524,7 +524,7 @@ _Parameters_ - _store_ `WPDataStore`: Store definition. -# **registerGenericStore** +### registerGenericStore > **Deprecated** Use `register` instead. @@ -535,7 +535,7 @@ _Parameters_ - _key_ `string`: Store registry key. - _config_ `Object`: Configuration (getSelectors, getActions, subscribe). -# **registerStore** +### registerStore > **Deprecated** Use `register` instead. @@ -550,7 +550,7 @@ _Returns_ - `Object`: Registered store object. -# **RegistryConsumer** +### RegistryConsumer A custom react Context consumer exposing the provided `registry` to children components. Used along with the RegistryProvider. @@ -583,7 +583,7 @@ const App = ( { props } ) => { } ``` -# **RegistryProvider** +### RegistryProvider A custom Context provider for exposing the provided `registry` to children components via a consumer. @@ -591,7 +591,7 @@ components via a consumer. See RegistryConsumer documentation for example. -# **resolveSelect** +### resolveSelect Given the name of a registered store, returns an object containing the store's selectors pre-bound to state so that you only need to supply additional arguments, @@ -614,7 +614,7 @@ _Returns_ - `Object`: Object containing the store's promise-wrapped selectors. -# **select** +### select Given the name or definition of a registered store, returns an object of the store's selectors. The selector functions are been pre-bound to pass the current state automatically. @@ -636,7 +636,7 @@ _Returns_ - `Object`: Object containing the store's selectors. -# **subscribe** +### subscribe Given a listener function, the function will be called any time the state value of one of the registered stores has changed. This function returns a `unsubscribe` @@ -660,7 +660,7 @@ _Parameters_ - _listener_ `Function`: Callback function. -# **use** +### use Extends a registry to inherit functionality provided by a given plugin. A plugin is an object with properties aligning to that of a registry, merged @@ -670,7 +670,7 @@ _Parameters_ - _plugin_ `Object`: Plugin object. -# **useDispatch** +### useDispatch A custom react hook returning the current registry dispatch actions creators. @@ -717,7 +717,7 @@ _Returns_ - `Function`: A custom react hook. -# **useRegistry** +### useRegistry A custom react hook exposing the registry context for use. @@ -760,7 +760,7 @@ _Returns_ - `Function`: A custom react hook exposing the registry context value. -# **useSelect** +### useSelect Custom react hook for retrieving props from registered selectors. @@ -821,7 +821,7 @@ _Returns_ - `Function`: A custom react hook. -# **withDispatch** +### withDispatch Higher-order component used to add dispatch props using registered action creators. @@ -900,7 +900,7 @@ _Returns_ - `WPComponent`: Enhanced component with merged dispatcher props. -# **withRegistry** +### withRegistry Higher-order component which renders the original component with the current registry context passed as its `registry` prop. @@ -913,7 +913,7 @@ _Returns_ - `WPComponent`: Enhanced component. -# **withSelect** +### withSelect Higher-order component used to inject state-derived props using registered selectors. diff --git a/packages/date/README.md b/packages/date/README.md index 7e1488f8c18b3..aecac2617c7de 100644 --- a/packages/date/README.md +++ b/packages/date/README.md @@ -16,7 +16,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **date** +### date Formats a date (like `date()` in PHP). @@ -35,7 +35,7 @@ _Returns_ - `string`: Formatted date in English. -# **dateI18n** +### dateI18n Formats a date (like `wp_date()` in PHP), translating it into site's locale. @@ -57,7 +57,7 @@ _Returns_ - `string`: Formatted date. -# **format** +### format Formats a date. Does not alter the date's timezone. @@ -70,7 +70,7 @@ _Returns_ - `string`: Formatted date. -# **getDate** +### getDate Create and return a JavaScript Date Object from a date string in the WP timezone. @@ -82,7 +82,7 @@ _Returns_ - `Date`: Date -# **gmdate** +### gmdate Formats a date (like `date()` in PHP), in the UTC timezone. @@ -95,7 +95,7 @@ _Returns_ - `string`: Formatted date in English. -# **gmdateI18n** +### gmdateI18n Formats a date (like `wp_date()` in PHP), translating it into site's locale and using the UTC timezone. @@ -109,7 +109,7 @@ _Returns_ - `string`: Formatted date. -# **isInTheFuture** +### isInTheFuture Check whether a date is considered in the future according to the WordPress settings. @@ -121,7 +121,7 @@ _Returns_ - `boolean`: Is in the future. -# **setSettings** +### setSettings Adds a locale to moment, using the format supplied by `wp_localize_script()`. diff --git a/packages/deprecated/README.md b/packages/deprecated/README.md index 2578199dded9d..3a2324fd6f1ba 100644 --- a/packages/deprecated/README.md +++ b/packages/deprecated/README.md @@ -36,7 +36,7 @@ addAction( -# **default** +### default Logs a message to notify developers about a deprecated feature. @@ -67,7 +67,7 @@ _Parameters_ - _options.link_ `[string]`: Link to documentation - _options.hint_ `[string]`: Additional message to help transition away from the deprecated feature. -# **logged** +### logged Object map tracking messages which have been logged, for use in ensuring a message is only logged once. diff --git a/packages/docgen/lib/markdown/formatter.js b/packages/docgen/lib/markdown/formatter.js index 1a3a7894d56f2..a2fcbd081c20a 100644 --- a/packages/docgen/lib/markdown/formatter.js +++ b/packages/docgen/lib/markdown/formatter.js @@ -59,10 +59,6 @@ const getHeading = ( index, text ) => { return '#'.repeat( index ) + ' ' + text; }; -const getSymbolHeading = ( text ) => { - return `# **${ text }**`; -}; - const getTypeOutput = ( tag ) => { if ( tag.optional ) { return `\`[${ tag.type }]\``; @@ -98,7 +94,7 @@ module.exports = ( } ); if ( symbols && symbols.length > 0 ) { symbols.forEach( ( symbol ) => { - docs.push( getSymbolHeading( symbol.name ) ); + docs.push( getHeading( headingIndex, symbol.name ) ); formatDeprecated( getSymbolTagsByName( symbol, 'deprecated' ), docs diff --git a/packages/docgen/test/formatter-markdown.js b/packages/docgen/test/formatter-markdown.js index eedad6bf018cf..b2904d4247e82 100644 --- a/packages/docgen/test/formatter-markdown.js +++ b/packages/docgen/test/formatter-markdown.js @@ -36,7 +36,7 @@ describe( 'Formatter', () => { 'API docs' ); expect( docs ).toBe( - '# API docs\n\n# **myDeclaration**\n\nMy declaration example.\n\n*Parameters*\n\n- *firstParam* `number`: First declaration parameter.\n\n*Returns*\n\n- `number`: The result of the declaration.\n' + '# API docs\n\n## myDeclaration\n\nMy declaration example.\n\n*Parameters*\n\n- *firstParam* `number`: First declaration parameter.\n\n*Returns*\n\n- `number`: The result of the declaration.\n' ); } ); } ); diff --git a/packages/dom-ready/README.md b/packages/dom-ready/README.md index 92c09bc33bbd0..c0dcecec39333 100644 --- a/packages/dom-ready/README.md +++ b/packages/dom-ready/README.md @@ -16,7 +16,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **default** +### default Specify a function to execute when the DOM is fully loaded. diff --git a/packages/dom/README.md b/packages/dom/README.md index 3279aaed867e2..fd78e8447b18d 100644 --- a/packages/dom/README.md +++ b/packages/dom/README.md @@ -14,7 +14,7 @@ npm install @wordpress/dom --save -# **computeCaretRect** +### computeCaretRect Get the rectangle for the selection in a container. @@ -26,7 +26,7 @@ _Returns_ - `DOMRect | null`: The rectangle. -# **documentHasSelection** +### documentHasSelection Check whether the current document has a selection. This checks for both focus in an input field and general text selection. @@ -39,7 +39,7 @@ _Returns_ - `boolean`: True if there is selection, false if not. -# **documentHasTextSelection** +### documentHasTextSelection Check whether the current document has selected text. This applies to ranges of text in the document, and not selection inside and