: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
getSelectedBlockClientId,
} = unlock(select(store));
const _selectedBlockClientId = getSelectedBlockClientId();
const _selectedBlockName = _selectedBlockClientId && getBlockName(_selectedBlockClientId);
const _blockType = _selectedBlockName && (0,external_wp_blocks_namespaceObject.getBlockType)(_selectedBlockName);
count: getSelectedBlockCount(),
selectedBlockClientId: _selectedBlockClientId,
selectedBlockName: _selectedBlockName,
topLevelLockedBlock: getContentLockingParent(_selectedBlockClientId) || (getTemplateLock(_selectedBlockClientId) === 'contentOnly' || _selectedBlockName === 'core/block' ? _selectedBlockClientId : undefined)
const availableTabs = useInspectorControlsTabs(blockType?.name);
const showTabs = availableTabs?.length > 1;
// The block inspector animation settings will be completely
// removed in the future to create an API which allows the block
// inspector to transition between what it
// displays based on the relationship between the selected block
// and its parent, and only enable it if the parent is controlling
const blockInspectorAnimationSettings = useBlockInspectorAnimationSettings(blockType);
const borderPanelLabel = useBorderPanelLabel({
blockName: selectedBlockName
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "block-editor-block-inspector",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(multi_selection_inspector, {}), showTabs ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorControlsTabs, {
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, {
label: (0,external_wp_i18n_namespaceObject.__)('Color'),
className: "color-block-support-panel__inner-wrapper"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, {
label: (0,external_wp_i18n_namespaceObject.__)('Typography')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, {
label: (0,external_wp_i18n_namespaceObject.__)('Dimensions')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, {
const isSelectedBlockUnregistered = selectedBlockName === (0,external_wp_blocks_namespaceObject.getUnregisteredTypeHandlerName)();
* If the selected block is of an unregistered type, avoid showing it as an actual selection
* because we want the user to focus on the unregistered block warning, not block settings.
if (!blockType || !selectedBlockClientId || isSelectedBlockUnregistered) {
if (showNoBlockSelectedMessage) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "block-editor-block-inspector__no-blocks",
children: (0,external_wp_i18n_namespaceObject.__)('No block selected.')
if (topLevelLockedBlock) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockInspectorLockedBlocks, {
topLevelLockedBlock: topLevelLockedBlock
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockInspectorSingleBlockWrapper, {
animate: blockInspectorAnimationSettings,
wrapper: children => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AnimatedContainer, {
blockInspectorAnimationSettings: blockInspectorAnimationSettings,
selectedBlockClientId: selectedBlockClientId,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockInspectorSingleBlock, {
clientId: selectedBlockClientId,
blockName: blockType.name
const BlockInspectorSingleBlockWrapper = ({
return animate ? wrapper(children) : children;
const AnimatedContainer = ({
blockInspectorAnimationSettings,
const animationOrigin = blockInspectorAnimationSettings && blockInspectorAnimationSettings.enterDirection === 'leftToRight' ? -50 : 50;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, {
}, selectedBlockClientId);
const BlockInspectorSingleBlock = ({
const availableTabs = useInspectorControlsTabs(blockName);
const showTabs = availableTabs?.length > 1;
const hasBlockStyles = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_blocks_namespaceObject.store);
const blockStyles = getBlockStyles(blockName);
return blockStyles && blockStyles.length > 0;
const blockInformation = useBlockDisplayInformation(clientId);
const borderPanelLabel = useBorderPanelLabel({
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "block-editor-block-inspector",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_card, {
className: blockInformation.isSynced && 'is-synced'
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_variation_transforms, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_info_slot_fill.Slot, {}), showTabs && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorControlsTabs, {
hasBlockStyles: hasBlockStyles,
}), !showTabs && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [hasBlockStyles && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
title: (0,external_wp_i18n_namespaceObject.__)('Styles'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_styles, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, {
label: (0,external_wp_i18n_namespaceObject.__)('Color'),
className: "color-block-support-panel__inner-wrapper"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, {
label: (0,external_wp_i18n_namespaceObject.__)('Typography')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, {
label: (0,external_wp_i18n_namespaceObject.__)('Dimensions')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, {
label: (0,external_wp_i18n_namespaceObject.__)('Background image')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(position_controls_panel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(advanced_controls_panel, {})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SkipToSelectedBlock, {}, "back")]
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-inspector/README.md
/* harmony default export */ const block_inspector = (BlockInspector);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/copy-handler/index.js
const __unstableUseClipboardHandler = () => {
external_wp_deprecated_default()('__unstableUseClipboardHandler', {
alternative: 'BlockCanvas or WritingFlow',
return useClipboardHandler();
function CopyHandler(props) {
external_wp_deprecated_default()('CopyHandler', {
alternative: 'BlockCanvas or WritingFlow',
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
ref: useClipboardHandler()
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/library.js
const library_noop = () => {};
function InserterLibrary({
showMostUsedBlocks = false,
__experimentalInsertionIndex,
__experimentalInitialTab,
__experimentalInitialCategory,
__experimentalFilterValue,
onPatternCategorySelection,
shouldFocusBlock = false,
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const _rootClientId = rootClientId || getBlockRootClientId(clientId) || undefined;
destinationRootClientId: _rootClientId
}, [clientId, rootClientId]);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateInserterMenu, {
rootClientId: destinationRootClientId,
showInserterHelpPanel: showInserterHelpPanel,
showMostUsedBlocks: showMostUsedBlocks,
__experimentalInsertionIndex: __experimentalInsertionIndex,
__experimentalFilterValue: __experimentalFilterValue,
onPatternCategorySelection: onPatternCategorySelection,
__experimentalInitialTab: __experimentalInitialTab,
__experimentalInitialCategory: __experimentalInitialCategory,
shouldFocusBlock: shouldFocusBlock,
const PrivateInserterLibrary = (0,external_wp_element_namespaceObject.forwardRef)(InserterLibrary);
function PublicInserterLibrary(props, ref) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateInserterLibrary, {
onPatternCategorySelection: undefined,
/* harmony default export */ const library = ((0,external_wp_element_namespaceObject.forwardRef)(PublicInserterLibrary));
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/selection-scroll-into-view/index.js
* Scrolls the multi block selection end into view if not in view already. This
* is important to do after selection by keyboard.
function MultiSelectScrollIntoView() {
external_wp_deprecated_default()('wp.blockEditor.MultiSelectScrollIntoView', {
hint: 'This behaviour is now built-in.',
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/typewriter/index.js
const isIE = window.navigator.userAgent.indexOf('Trident') !== -1;
const arrowKeyCodes = new Set([external_wp_keycodes_namespaceObject.UP, external_wp_keycodes_namespaceObject.DOWN, external_wp_keycodes_namespaceObject.LEFT, external_wp_keycodes_namespaceObject.RIGHT]);
const initialTriggerPercentage = 0.75;
function useTypewriter() {
const hasSelectedBlock = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).hasSelectedBlock(), []);
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
function onScrollResize() {
scrollResizeRafId = defaultView.requestAnimationFrame(() => {
scrollResizeRafId = null;
function onKeyDown(event) {
// Ensure the any remaining request is cancelled.
defaultView.cancelAnimationFrame(onKeyDownRafId);
// Use an animation frame for a smooth result.
onKeyDownRafId = defaultView.requestAnimationFrame(() => {
maintainCaretPosition(event);
* Maintains the scroll position after a selection change caused by a
* @param {KeyboardEvent} event Keyboard event.
function maintainCaretPosition({
if (!isSelectionEligibleForScroll()) {
const currentCaretRect = (0,external_wp_dom_namespaceObject.computeCaretRect)(defaultView);
// If for some reason there is no position set to be scrolled to, let
// this be the position to be scrolled to in the future.
caretRect = currentCaretRect;
// Even though enabling the typewriter effect for arrow keys results in
// a pleasant experience, it may not be the case for everyone, so, for
// now, let's disable it.
if (arrowKeyCodes.has(keyCode)) {
// Reset the caret position to maintain.
caretRect = currentCaretRect;
const diff = currentCaretRect.top - caretRect.top;
const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(node);
// The page must be scrollable.
const windowScroll = scrollContainer === ownerDocument.body || scrollContainer === ownerDocument.documentElement;
const scrollY = windowScroll ? defaultView.scrollY : scrollContainer.scrollTop;
const scrollContainerY = windowScroll ? 0 : scrollContainer.getBoundingClientRect().top;
const relativeScrollPosition = windowScroll ? caretRect.top / defaultView.innerHeight : (caretRect.top - scrollContainerY) / (defaultView.innerHeight - scrollContainerY);
// If the scroll position is at the start, the active editable element
// is the last one, and the caret is positioned within the initial
// trigger percentage of the page, do not scroll the page.
// The typewriter effect should not kick in until an empty page has been
// filled with the initial trigger percentage or the user scrolls
if (scrollY === 0 && relativeScrollPosition < initialTriggerPercentage && isLastEditableNode()) {
// Reset the caret position to maintain.
caretRect = currentCaretRect;
const scrollContainerHeight = windowScroll ? defaultView.innerHeight : scrollContainer.clientHeight;
// Abort if the target scroll position would scroll the caret out of
// The caret is under the lower fold.
caretRect.top + caretRect.height > scrollContainerY + scrollContainerHeight ||
// The caret is above the upper fold.
caretRect.top < scrollContainerY) {
// Reset the caret position to maintain.
caretRect = currentCaretRect;
defaultView.scrollBy(0, diff);
scrollContainer.scrollTop += diff;
* Adds a `selectionchange` listener to reset the scroll position to be
function addSelectionChangeListener() {
ownerDocument.addEventListener('selectionchange', computeCaretRectOnSelectionChange);
* Resets the scroll position to be maintained during a `selectionchange`
* event. Also removes the listener, so it acts as a one-time listener.
function computeCaretRectOnSelectionChange() {
ownerDocument.removeEventListener('selectionchange', computeCaretRectOnSelectionChange);
* Resets the scroll position to be maintained.
function computeCaretRectangle() {
if (isSelectionEligibleForScroll()) {
caretRect = (0,external_wp_dom_namespaceObject.computeCaretRect)(defaultView);
* Checks if the current situation is elegible for scroll:
* - There should be one and only one block selected.
* - The component must contain the selection.
* - The active element must be contenteditable.
function isSelectionEligibleForScroll() {
return node.contains(ownerDocument.activeElement) && ownerDocument.activeElement.isContentEditable;
function isLastEditableNode() {
const editableNodes = node.querySelectorAll('[contenteditable="true"]');
const lastEditableNode = editableNodes[editableNodes.length - 1];
return lastEditableNode === ownerDocument.activeElement;
// When the user scrolls or resizes, the scroll position should be
defaultView.addEventListener('scroll', onScrollResize, true);
defaultView.addEventListener('resize', onScrollResize, true);
node.addEventListener('keydown', onKeyDown);
node.addEventListener('keyup', maintainCaretPosition);
node.addEventListener('mousedown', addSelectionChangeListener);
node.addEventListener('touchstart', addSelectionChangeListener);
defaultView.removeEventListener('scroll', onScrollResize, true);