: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
// This only fires when the sidebar is open because of the conditional rendering.
// It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/toggle-list-view', handleToggleListViewShortcut);
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "editor-list-view-sidebar",
onKeyDown: closeOnEscape,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs, {
onSelect: tabName => setTab(tabName),
// The initial tab value is set explicitly to avoid an initial
// render where no tab is selected. This ensures that the
// tabpanel height is correct so the relevant scroll container
// can be rendered internally.
defaultTabId: "list-view",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "editor-list-view-sidebar__header",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
className: "editor-list-view-sidebar__close-button",
label: (0,external_wp_i18n_namespaceObject.__)('Close'),
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs.TabList, {
className: "editor-list-view-sidebar__tabs-tablist",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, {
className: "editor-list-view-sidebar__tabs-tab",
children: (0,external_wp_i18n_namespaceObject._x)('List View', 'Post overview')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, {
className: "editor-list-view-sidebar__tabs-tab",
children: (0,external_wp_i18n_namespaceObject._x)('Outline', 'Post overview')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabPanel, {
ref: listViewContainerRef,
className: "editor-list-view-sidebar__tabs-tabpanel",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "editor-list-view-sidebar__list-view-container",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "editor-list-view-sidebar__list-view-panel-content",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalListView, {
dropZoneElement: dropZoneElement
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabPanel, {
className: "editor-list-view-sidebar__tabs-tabpanel",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "editor-list-view-sidebar__list-view-container",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewOutline, {})
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/save-publish-panels/index.js
Fill: save_publish_panels_Fill,
Slot: save_publish_panels_Slot
} = (0,external_wp_components_namespaceObject.createSlotFill)('ActionsPanel');
const ActionsPanelFill = (/* unused pure expression or super */ null && (save_publish_panels_Fill));
function SavePublishPanels({
setEntitiesSavedStatesCallback,
closeEntitiesSavedStates,
isEntitiesSavedStatesOpen,
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const _hasOtherEntitiesChanges = hasNonPostEntityChanges();
publishSidebarOpened: isPublishSidebarOpened(),
isPublishable: !isCurrentPostPublished() && isEditedPostPublishable(),
isDirty: _hasOtherEntitiesChanges || isEditedPostDirty(),
hasOtherEntitiesChanges: _hasOtherEntitiesChanges
const openEntitiesSavedStates = (0,external_wp_element_namespaceObject.useCallback)(() => setEntitiesSavedStatesCallback(true), []);
// It is ok for these components to be unmounted when not in visual use.
// We don't want more than one present at a time, decide which to render.
if (publishSidebarOpened) {
unmountableContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_publish_panel, {
onClose: closePublishSidebar,
forceIsDirty: forceIsDirtyPublishPanel,
PrePublishExtension: plugin_pre_publish_panel.Slot,
PostPublishExtension: plugin_post_publish_panel.Slot
} else if (isPublishable && !hasOtherEntitiesChanges) {
unmountableContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "editor-layout__toggle-publish-panel",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
className: "editor-layout__toggle-publish-panel-button",
onClick: togglePublishSidebar,
children: (0,external_wp_i18n_namespaceObject.__)('Open publish panel')
unmountableContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "editor-layout__toggle-entities-saved-states-panel",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
className: "editor-layout__toggle-entities-saved-states-panel-button",
onClick: openEntitiesSavedStates,
__experimentalIsFocusable: true,
children: (0,external_wp_i18n_namespaceObject.__)('Open save panel')
// Since EntitiesSavedStates controls its own panel, we can keep it
// always mounted to retain its own component state (such as checkboxes).
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [isEntitiesSavedStatesOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EntitiesSavedStates, {
close: closeEntitiesSavedStates
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(save_publish_panels_Slot, {
}), !isEntitiesSavedStatesOpen && unmountableContent]
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/text-editor/index.js
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
getShortcutRepresentation
} = select(external_wp_keyboardShortcuts_namespaceObject.store);
shortcut: getShortcutRepresentation('core/editor/toggle-mode'),
isRichEditingEnabled: getEditorSettings().richEditingEnabled
const titleRef = (0,external_wp_element_namespaceObject.useRef)();
(0,external_wp_element_namespaceObject.useEffect)(() => {
titleRef?.current?.focus();
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "editor-text-editor",
children: [isRichEditingEnabled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "editor-text-editor__toolbar",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", {
children: (0,external_wp_i18n_namespaceObject.__)('Editing code')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
onClick: () => switchEditorMode('visual'),
children: (0,external_wp_i18n_namespaceObject.__)('Exit code editor')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "editor-text-editor__body",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_title_raw, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTextEditor, {})]
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/visual-editor/edit-template-blocks-notification.js
* - Displays a 'Edit your template to edit this block' notification when the
* user is focusing on editing page content and clicks on a disabled template
* - Displays a 'Edit your template to edit this block' dialog when the user
* is focusing on editing page conetnt and double clicks on a disabled
* @param {import('react').RefObject<HTMLElement>} props.contentRef Ref to the block
function EditTemplateBlocksNotification({
onNavigateToEntityRecord,
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
onNavigateToEntityRecord: getEditorSettings().onNavigateToEntityRecord,
templateId: getCurrentTemplateId()
const canEditTemplate = (0,external_wp_data_namespaceObject.useSelect)(select => {
return (_select$canUser = select(external_wp_coreData_namespaceObject.store).canUser('create', 'templates')) !== null && _select$canUser !== void 0 ? _select$canUser : false;
const [isDialogOpen, setIsDialogOpen] = (0,external_wp_element_namespaceObject.useState)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const handleDblClick = event => {
if (!event.target.classList.contains('is-root-container')) {
const canvas = contentRef.current;
canvas?.addEventListener('dblclick', handleDblClick);
canvas?.removeEventListener('dblclick', handleDblClick);
}, [contentRef, canEditTemplate]);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, {
confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Edit template'),
onNavigateToEntityRecord({
onCancel: () => setIsDialogOpen(false),
children: (0,external_wp_i18n_namespaceObject.__)('You’ve tried to select a block that is part of a template, which may be used on other posts and pages. Would you like to edit the template?')
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/resizable-editor/resize-handle.js
const DELTA_DISTANCE = 20; // The distance to resize per keydown in pixels.
function handleKeyDown(event) {
if (direction === 'left' && keyCode === external_wp_keycodes_namespaceObject.LEFT || direction === 'right' && keyCode === external_wp_keycodes_namespaceObject.RIGHT) {
resizeWidthBy(DELTA_DISTANCE);
} else if (direction === 'left' && keyCode === external_wp_keycodes_namespaceObject.RIGHT || direction === 'right' && keyCode === external_wp_keycodes_namespaceObject.LEFT) {
resizeWidthBy(-DELTA_DISTANCE);
const resizeHandleVariants = {
const resizableHandleHelpId = `resizable-editor__resize-help-${direction}`;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, {
text: (0,external_wp_i18n_namespaceObject.__)('Drag to resize'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.button, {
className: `editor-resizable-editor__resize-handle is-${direction}`,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Drag to resize'),
"aria-describedby": resizableHandleHelpId,
onKeyDown: handleKeyDown,
variants: resizeHandleVariants,
"aria-orientation": "vertical"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
id: resizableHandleHelpId,
children: (0,external_wp_i18n_namespaceObject.__)('Use left and right arrow keys to resize the canvas.')
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/resizable-editor/index.js
// Removes the inline styles in the drag handles.
const HANDLE_STYLES_OVERRIDE = {
function ResizableEditor({
const [width, setWidth] = (0,external_wp_element_namespaceObject.useState)('100%');
const resizableRef = (0,external_wp_element_namespaceObject.useRef)();
const resizeWidthBy = (0,external_wp_element_namespaceObject.useCallback)(deltaPixels => {
if (resizableRef.current) {
setWidth(resizableRef.current.offsetWidth + deltaPixels);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, {
className: dist_clsx('editor-resizable-editor', className, {
'is-resizable': enableResizing
resizableRef.current = api?.resizable;
width: enableResizing ? width : '100%',
height: enableResizing && height ? height : '100%'
onResizeStop: (event, direction, element) => {
setWidth(element.style.width);
showHandle: enableResizing
// The editor is centered horizontally, resizing it only
// moves half the distance. Hence double the ratio to correctly
// align the cursor to the resizer handle.
left: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizeHandle, {
resizeWidthBy: resizeWidthBy
right: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizeHandle, {
resizeWidthBy: resizeWidthBy
handleClasses: undefined,
left: HANDLE_STYLES_OVERRIDE,
right: HANDLE_STYLES_OVERRIDE
/* harmony default export */ const resizable_editor = (ResizableEditor);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/hooks/use-select-nearest-editable-block.js
const DISTANCE_THRESHOLD = 500;
function clamp(value, min, max) {
return Math.min(Math.max(value, min), max);
function distanceFromRect(x, y, rect) {
const dx = x - clamp(x, rect.left, rect.right);
const dy = y - clamp(y, rect.top, rect.bottom);
return Math.sqrt(dx * dx + dy * dy);
function useSelectNearestEditableBlock({
} = unlock((0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store));