: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const canEdit = canEditBlock(clientId);
const canMove = canMoveBlock(clientId);
const canRemove = canRemoveBlock(clientId);
canLock: canLockBlockType(getBlockName(clientId)),
isContentLocked: getTemplateLock(clientId) === 'contentOnly',
isLocked: !canEdit || !canMove || !canRemove
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/unlock.js
const unlock_unlock = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"
/* harmony default export */ const library_unlock = (unlock_unlock);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/lock-outline.js
const lockOutline = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zM9.8 7c0-1.2 1-2.2 2.2-2.2 1.2 0 2.2 1 2.2 2.2v3H9.8V7zm6.7 11.5h-9v-7h9v7z"
/* harmony default export */ const lock_outline = (lockOutline);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/lock.js
const lock_lock = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"
/* harmony default export */ const library_lock = (lock_lock);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-lock/modal.js
// Entity based blocks which allow edit locking
const ALLOWS_EDIT_LOCKING = ['core/block', 'core/navigation'];
function getTemplateLockValue(lock) {
// Prevents all operations.
if (lock.remove && lock.move) {
// Prevents inserting or removing blocks, but allows moving existing blocks.
if (lock.remove && !lock.move) {
function BlockLockModal({
const [lock, setLock] = (0,external_wp_element_namespaceObject.useState)({
} = useBlockLock(clientId);
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const blockName = getBlockName(clientId);
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName);
allowsEditLocking: ALLOWS_EDIT_LOCKING.includes(blockName),
templateLock: getBlockAttributes(clientId)?.templateLock,
hasTemplateLock: !!blockType?.attributes?.templateLock
const [applyTemplateLock, setApplyTemplateLock] = (0,external_wp_element_namespaceObject.useState)(!!templateLock);
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
const blockInformation = useBlockDisplayInformation(clientId);
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockLockModal, 'block-editor-block-lock-modal__options-title');
(0,external_wp_element_namespaceObject.useEffect)(() => {
...(allowsEditLocking ? {
}, [canEdit, canMove, canRemove, allowsEditLocking]);
const isAllChecked = Object.values(lock).every(Boolean);
const isMixed = Object.values(lock).some(Boolean) && !isAllChecked;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, {
title: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Name of the block. */
(0,external_wp_i18n_namespaceObject.__)('Lock %s'), blockInformation.title),
overlayClassName: "block-editor-block-lock-modal",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
children: (0,external_wp_i18n_namespaceObject.__)('Choose specific attributes to restrict or lock all available options.')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", {
updateBlockAttributes([clientId], {
templateLock: applyTemplateLock ? getTemplateLockValue(lock) : undefined
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
"aria-labelledby": instanceId,
className: "block-editor-block-lock-modal__options",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, {
__nextHasNoMarginBottom: true,
className: "block-editor-block-lock-modal__options-title",
label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
children: (0,external_wp_i18n_namespaceObject.__)('Lock all')
onChange: newValue => setLock({
...(allowsEditLocking ? {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("ul", {
className: "block-editor-block-lock-modal__checklist",
children: [allowsEditLocking && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", {
className: "block-editor-block-lock-modal__checklist-item",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Restrict editing'),
onChange: edit => setLock(prevLock => ({
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
className: "block-editor-block-lock-modal__lock-icon",
icon: lock.edit ? library_lock : library_unlock
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", {
className: "block-editor-block-lock-modal__checklist-item",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Disable movement'),
onChange: move => setLock(prevLock => ({
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
className: "block-editor-block-lock-modal__lock-icon",
icon: lock.move ? library_lock : library_unlock
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", {
className: "block-editor-block-lock-modal__checklist-item",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Prevent removal'),
onChange: remove => setLock(prevLock => ({
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
className: "block-editor-block-lock-modal__lock-icon",
icon: lock.remove ? library_lock : library_unlock
}), hasTemplateLock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
className: "block-editor-block-lock-modal__template-lock",
label: (0,external_wp_i18n_namespaceObject.__)('Apply to all blocks inside'),
checked: applyTemplateLock,
disabled: lock.move && !lock.remove,
onChange: () => setApplyTemplateLock(!applyTemplateLock)
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, {
className: "block-editor-block-lock-modal__actions",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
children: (0,external_wp_i18n_namespaceObject.__)('Apply')
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-lock/menu-item.js
function BlockLockMenuItem({
} = useBlockLock(clientId);
const [isModalOpen, toggleModal] = (0,external_wp_element_namespaceObject.useReducer)(isActive => !isActive, false);
const label = isLocked ? (0,external_wp_i18n_namespaceObject.__)('Unlock') : (0,external_wp_i18n_namespaceObject.__)('Lock');
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
icon: isLocked ? library_unlock : lock_outline,
"aria-expanded": isModalOpen,
"aria-haspopup": "dialog",
}), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockLockModal, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-mode-toggle.js
const block_mode_toggle_noop = () => {};
function BlockModeToggle({
isCodeEditingEnabled = true
if (!blockType || !(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'html', true) || !isCodeEditingEnabled) {
const label = mode === 'visual' ? (0,external_wp_i18n_namespaceObject.__)('Edit as HTML') : (0,external_wp_i18n_namespaceObject.__)('Edit visually');
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
children: !small && label
/* harmony default export */ const block_mode_toggle = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)((select, {
const block = getBlock(clientId);
const isCodeEditingEnabled = getSettings().codeEditingEnabled;
mode: getBlockMode(clientId),
blockType: block ? (0,external_wp_blocks_namespaceObject.getBlockType)(block.name) : null,
}), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, {
onToggle = block_mode_toggle_noop,
dispatch(store).toggleBlockMode(clientId);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-rename/use-block-rename.js
function useBlockRename(name) {
canRename: (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, 'renaming', true)
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-rename/is-empty-string.js
function isEmptyString(testString) {
return testString?.trim()?.length === 0;
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-rename/modal.js
function BlockRenameModal({
// Pattern Overrides is a WordPress-only feature but it also uses the Block Binding API.
// Ideally this should not be inside the block editor package, but we keep it here for simplicity.
const [editedBlockName, setEditedBlockName] = (0,external_wp_element_namespaceObject.useState)(blockName);
const descriptionId = (0,external_wp_element_namespaceObject.useId)();
const nameHasChanged = editedBlockName !== blockName;
const nameIsOriginal = editedBlockName === originalBlockName;
const nameIsEmpty = isEmptyString(editedBlockName);
const isNameValid = nameHasChanged || nameIsOriginal;
const autoSelectInputText = event => event.target.select();
const handleSubmit = () => {
const message = nameIsOriginal || nameIsEmpty ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: new name/label for the block */
(0,external_wp_i18n_namespaceObject.__)('Block name reset to: "%s".'), editedBlockName) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: new name/label for the block */
(0,external_wp_i18n_namespaceObject.__)('Block name changed to: "%s".'), editedBlockName);
// Must be assertive to immediately announce change.
(0,external_wp_a11y_namespaceObject.speak)(message, 'assertive');
// Immediate close avoids ability to hit save multiple times.
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
title: (0,external_wp_i18n_namespaceObject.__)('Rename'),
overlayClassName: "block-editor-block-rename-modal",
focusOnMount: "firstContentElement",
describedby: descriptionId
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
children: (0,external_wp_i18n_namespaceObject.__)('Enter a custom name for this block.')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)('Block name'),
hideLabelFromVision: true,
help: hasOverridesWarning ? (0,external_wp_i18n_namespaceObject.__)('This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern.') : undefined,
placeholder: originalBlockName,
onChange: setEditedBlockName,
onFocus: autoSelectInputText
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
"aria-disabled": !isNameValid,
children: (0,external_wp_i18n_namespaceObject.__)('Save')
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-rename/rename-control.js
function BlockRenameControl({
const [renamingBlock, setRenamingBlock] = (0,external_wp_element_namespaceObject.useState)(false);
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const _metadata = getBlockAttributes(clientId)?.metadata;