Returns the cache for a given dependants array. When possible, a WeakMap
will be used to create a unique cache for each set of dependants. This
is feasible due to the nature of WeakMap in allowing garbage collection
to occur on entries where the key object is no longer referenced. Since
WeakMap requires the key to be an object, this is only possible when the
dependant is object-like. The root cache is created as a hierarchy where
each top-level key is the first entry in a dependants set, the value a
WeakMap where each key is the next dependant, and so on. This continues
so long as the dependants are object-like. If no dependants are object-
like, then the cache is shared across all invocations.

Higher-order reducer intended to augment the blocks reducer, assigning an
`isPersistentChange` property value corresponding to whether a change in
state can be considered as persistent. All changes are considered persistent
except when updating the same block attribute as in the previous action.

Higher-order reducer intended to augment the blocks reducer, assigning an
`isIgnoredChange` property value corresponding to whether a change in state
can be considered as ignored. A change is considered ignored when the result
of an action not incurred by direct user interaction.

Generator which will yield a default block insert action if there
are no other blocks at the root of the editor. This generator should be used
in actions which may result in no blocks remaining in the editor (removal,
replacement, etc).

Returns an action object used in signalling that the block with the
specified client ID has been selected, optionally accepting a position
value reflecting its selection directionality. An initialPosition of -1
reflects a reverse selection.

Returns the client ID of the block adjacent one at the given reference
startClientId and modifier directionality. Defaults start startClientId to
the selected block, and direction as next block. Returns null if there is no
adjacent block.

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
the order should be returned, defaulting to the top-level block order.

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"
refers to the block sequence in the document, _not_ the sequence of
multi-selection, which is why `state.blockSelection.end` isn't used.

return: {boolean} Whether block is selected and not the last in theparam: {Object} state Editor state.param: {string} clientId Block client ID.

Returns information about how recently and frequently a block has been inserted.

return: {?{ time: number, count: number }} An object containing `time` which is when the lastparam: {Object} state Global application state.param: {string} id A string which identifies the insert, e.g. 'core/block/12'

Returns true if the most recent block change is be considered persistent, or
false otherwise. A persistent change is one committed by BlockEditorProvider
via its `onChange` callback, in addition to `onInput`.

Block validity is a function of blocks state (at the point of a
reset) and the template setting. As a compromise to its placement
across distinct parts of state, it is implemented here as a side-
effect of the block reset action.

Returns a class based on the context a color is being used and its slug.

return: {string} String with the class corresponding to the color in the provided context.param: {string} colorContextName Context/place where color is being used e.g: background, text etc...param: {string} colorSlug Slug of the color.

Given an array of color objects and a color value returns the color value of the most readable color in the array.

return: {string} String with the color value of the most readable color.param: {Array} colors Array of color objects as set by the theme or by the editor defaults.param: {?string} colorValue A string containing the color value.

Helper function used with `createHigherOrderComponent` to create
higher order components for managing color logic.

return: {Component} The component that can be used as a HOC.param: {Array} colorTypes An array of color types (e.g. 'backgroundColor, borderColor).param: {Function} withColorPalette A HOC for injecting the 'colors' prop into the WrappedComponent.

Return a label for the block movement controls depending on block position.

return: {string} Label for the block movement controls.param: {number} selectedCount Number of blocks selected.param: {string} type Block type - in the case of a single block, shouldparam: {number} firstIndex The index (position - 1) of the first block selected.param: {boolean} isFirst This is the first block.param: {boolean} isLast This is the last block.param: {number} dir Direction of movement (> 0 is considered to be going

Return a label for the block movement controls depending on block position.

return: {string} Label for the block movement controls.param: {number} selectedCount Number of blocks selected.param: {number} firstIndex The index (position - 1) of the first block selected.param: {boolean} isFirst This is the first block.param: {boolean} isLast This is the last block.param: {number} dir Direction of movement (> 0 is considered to be going

Given a block client ID, returns the corresponding DOM node for the block,
if exists. As much as possible, this helper should be avoided, and used only
in cases where isolated behaviors need remote access to a block node.

Given a block client ID, returns the corresponding DOM node for the block
focusable wrapper, if exists. As much as possible, this helper should be
avoided, and used only in cases where isolated behaviors need remote access
to a block node.

It would be better dispatch an `input` event after each deleting
`keydown` because the DOM is updated after each, but it is challenging
to determine the right time to dispatch `input` since propagation of
`keydown` can be stopped at any point.

It's easier to listen for `keyup` in the capture phase and dispatch
`input` before `keyup` propagates further. It's not perfect, but should
be good enough.

Returns the valid alignments.
Takes into consideration the aligns supported by a block, if the block supports wide controls or not and if theme supports wide controls or not.
Exported just for testing purposes, not exported outside the module.

Given a parsed set of block attributes, if the block supports custom class
names and an unknown class (per the block's serialization behavior) is
found, the unknown classes are treated as custom classes. This prevents the
block from being considered as invalid.