: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Returns an action object used in signalling that a block removal prompt must
* Contrast with `setBlockRemovalRules`.
* @param {string|string[]} clientIds Client IDs of blocks to remove.
* @param {boolean} selectPrevious True if the previous block or the
* immediate parent (if no previous
* block exists) should be selected
* when a block is removed.
* @param {string} message Message to display in the prompt.
* @return {Object} Action object.
function displayBlockRemovalPrompt(clientIds, selectPrevious, message) {
type: 'DISPLAY_BLOCK_REMOVAL_PROMPT',
* Returns an action object used in signalling that a block removal prompt must
* be cleared, either be cause the user has confirmed or canceled the request
* @return {Object} Action object.
function clearBlockRemovalPrompt() {
type: 'CLEAR_BLOCK_REMOVAL_PROMPT'
* Returns an action object used to set up any rules that a block editor may
* provide in order to prevent a user from accidentally removing certain
* blocks. These rules are then used to display a confirmation prompt to the
* user. For instance, in the Site Editor, the Query Loop block is important
* enough to warrant such confirmation.
* IMPORTANT: Registering rules implicitly signals to the `privateRemoveBlocks`
* action that the editor will be responsible for displaying block removal
* prompts and confirming deletions. This action is meant to be used by
* component `BlockRemovalWarningModal` only.
* The data is a record whose keys are block types (e.g. 'core/query') and
* whose values are the explanation to be shown to users (e.g. 'Query Loop
* displays a list of posts or pages.').
* Contrast with `displayBlockRemovalPrompt`.
* @param {Record<string,string>|false} rules Block removal rules.
* @return {Object} Action object.
function setBlockRemovalRules(rules = false) {
type: 'SET_BLOCK_REMOVAL_RULES',
* Sets the client ID of the block settings menu that is currently open.
* @param {?string} clientId The block client ID.
* @return {Object} Action object.
function setOpenedBlockSettingsMenu(clientId) {
type: 'SET_OPENED_BLOCK_SETTINGS_MENU',
function setStyleOverride(id, style) {
type: 'SET_STYLE_OVERRIDE',
function deleteStyleOverride(id) {
type: 'DELETE_STYLE_OVERRIDE',
* A higher-order action that mark every change inside a callback as "non-persistent"
* and ignore pushing to the undo history stack. It's primarily used for synchronized
* derived updates from the block editor without affecting the undo history.
* @param {() => void} callback The synchronous callback to derive updates.
function syncDerivedUpdates(callback) {
// Mark every change in the `callback` as non-persistent.
type: 'SET_EXPLICIT_PERSISTENT',
isPersistentChange: false
type: 'SET_EXPLICIT_PERSISTENT',
isPersistentChange: undefined
// Ignore pushing undo stack for the updated blocks.
const updatedBlocks = select.getBlocks();
undoIgnoreBlocks.add(updatedBlocks);
* Action that sets the element that had focus when focus leaves the editor canvas.
* @param {Object} lastFocus The last focused element.
* @return {Object} Action object.
function setLastFocus(lastFocus = null) {
* Action that stops temporarily editing as blocks.
* @param {string} clientId The block's clientId.
function stopEditingAsBlocks(clientId) {
const focusModeToRevert = unlock(registry.select(store)).getTemporarilyEditingFocusModeToRevert();
dispatch.__unstableMarkNextChangeAsNotPersistent();
dispatch.updateBlockAttributes(clientId, {
templateLock: 'contentOnly'
dispatch.updateBlockListSettings(clientId, {
...select.getBlockListSettings(clientId),
templateLock: 'contentOnly'
dispatch.updateSettings({
focusMode: focusModeToRevert
dispatch.__unstableSetTemporarilyEditingAsBlocks();
* Returns an action object used in signalling that the user has begun to drag.
* @return {Object} Action object.
function startDragging() {
* Returns an action object used in signalling that the user has stopped dragging.
* @return {Object} Action object.
function stopDragging() {
* @param {string|null} clientId The block's clientId, or `null` to clear.
* @return {Object} Action object.
function expandBlock(clientId) {
type: 'SET_BLOCK_EXPANDED_IN_LIST_VIEW',
* Temporarily modify/unlock the content-only block for editions.
* @param {string} clientId The client id of the block.
const modifyContentLockBlock = clientId => ({
dispatch.__unstableMarkNextChangeAsNotPersistent();
dispatch.updateBlockAttributes(clientId, {
dispatch.updateBlockListSettings(clientId, {
...select.getBlockListSettings(clientId),
const focusModeToRevert = select.getSettings().focusMode;
dispatch.updateSettings({
dispatch.__unstableSetTemporarilyEditingAsBlocks(clientId, focusModeToRevert);
;// CONCATENATED MODULE: external ["wp","a11y"]
const external_wp_a11y_namespaceObject = window["wp"]["a11y"];
;// CONCATENATED MODULE: external ["wp","notices"]
const external_wp_notices_namespaceObject = window["wp"]["notices"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/selection.js
* A robust way to retain selection position through various
* transforms is to insert a special character at the position and
const START_OF_SELECTED_AREA = '\u0086';
* Retrieve the block attribute that contains the selection position.
* @param {Object} blockAttributes Block attributes.
* @return {string|void} The name of the block attribute that was previously selected.
function retrieveSelectedAttribute(blockAttributes) {
return Object.keys(blockAttributes).find(name => {
const value = blockAttributes[name];
return (typeof value === 'string' || value instanceof external_wp_richText_namespaceObject.RichTextData) &&
// To do: refactor this to use rich text's selection instead, so we
// no longer have to use on this hack inserting a special character.
value.toString().indexOf(START_OF_SELECTED_AREA) !== -1;
function findRichTextAttributeKey(blockType) {
for (const [key, value] of Object.entries(blockType.attributes)) {
if (value.source === 'rich-text' || value.source === 'html') {
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/actions.js
/* eslint no-console: [ 'error', { allow: [ 'error', 'warn' ] } ] */
/** @typedef {import('../components/use-on-block-drop/types').WPDropOperation} WPDropOperation */
const actions_castArray = maybeArray => Array.isArray(maybeArray) ? maybeArray : [maybeArray];
* Action that resets blocks state to the specified array of blocks, taking precedence
* over any other content reflected as an edit in state.
* @param {Array} blocks Array of blocks.
const resetBlocks = blocks => ({
dispatch(validateBlocksToTemplate(blocks));
* 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.
* @param {Array} blocks Array of blocks.
const validateBlocksToTemplate = blocks => ({
const template = select.getTemplate();
const templateLock = select.getTemplateLock();
// Unlocked templates are considered always valid because they act
// as default values only.
const isBlocksValidToTemplate = !template || templateLock !== 'all' || (0,external_wp_blocks_namespaceObject.doBlocksMatchTemplate)(blocks, template);
// Update if validity has changed.
const isValidTemplate = select.isValidTemplate();
if (isBlocksValidToTemplate !== isValidTemplate) {
dispatch.setTemplateValidity(isBlocksValidToTemplate);
return isBlocksValidToTemplate;
* A block selection object.
* @typedef {Object} WPBlockSelection
* @property {string} clientId A block client ID.
* @property {string} attributeKey A block attribute key.
* @property {number} offset An attribute value offset, based on the rich
* text value. See `wp.richText.create`.
* @typedef {Object} WPSelection
* @property {WPBlockSelection} start The selection start.
* @property {WPBlockSelection} end The selection end.
/* eslint-disable jsdoc/valid-types */
* Returns an action object used in signalling that selection state should be
* reset to the specified selection.
* @param {WPBlockSelection} selectionStart The selection start.
* @param {WPBlockSelection} selectionEnd The selection end.
* @param {0|-1|null} initialPosition Initial block position.
* @return {Object} Action object.
function resetSelection(selectionStart, selectionEnd, initialPosition) {
/* eslint-enable jsdoc/valid-types */
* Returns an action object used in signalling that blocks have been received.
* Unlike resetBlocks, these should be appended to the existing known set, not
* @param {Object[]} blocks Array of block objects.
* @return {Object} Action object.
function receiveBlocks(blocks) {
external_wp_deprecated_default()('wp.data.dispatch( "core/block-editor" ).receiveBlocks', {
alternative: 'resetBlocks or insertBlocks'
* Action that updates attributes of multiple blocks with the specified client IDs.
* @param {string|string[]} clientIds Block client IDs.
* @param {Object} attributes Block attributes to be merged. Should be keyed by clientIds if
* @param {boolean} uniqueByBlock true if each block in clientIds array has a unique set of attributes
* @return {Object} Action object.
function updateBlockAttributes(clientIds, attributes, uniqueByBlock = false) {
type: 'UPDATE_BLOCK_ATTRIBUTES',
clientIds: actions_castArray(clientIds),
* Action that updates the block with the specified client ID.
* @param {string} clientId Block client ID.
* @param {Object} updates Block attributes to be merged.
* @return {Object} Action object.
function updateBlock(clientId, updates) {
/* eslint-disable jsdoc/valid-types */
* 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.
* @param {string} clientId Block client ID.
* @param {0|-1|null} initialPosition Optional initial position. Pass as -1 to
* reflect reverse selection.
* @return {Object} Action object.
function selectBlock(clientId, initialPosition = 0) {
/* eslint-enable jsdoc/valid-types */
* Yields action objects used in signalling that the block preceding the given
* clientId (or optionally, its first parent from bottom to top)
* @param {string} clientId Block client ID.
* @param {boolean} fallbackToParent If true, select the first parent if there is no previous block.
const selectPreviousBlock = (clientId, fallbackToParent = false) => ({
const previousBlockClientId = select.getPreviousBlockClientId(clientId);
if (previousBlockClientId) {
dispatch.selectBlock(previousBlockClientId, -1);
} else if (fallbackToParent) {
const firstParentClientId = select.getBlockRootClientId(clientId);
if (firstParentClientId) {
dispatch.selectBlock(firstParentClientId, -1);
* Yields action objects used in signalling that the block following the given
* clientId should be selected.
* @param {string} clientId Block client ID.
const selectNextBlock = clientId => ({
const nextBlockClientId = select.getNextBlockClientId(clientId);
dispatch.selectBlock(nextBlockClientId);
* Action that starts block multi-selection.
* @return {Object} Action object.
function startMultiSelect() {