@wordpress/edit-post 8.45.0 → 8.45.1-next.v.202605131006.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -161,6 +161,8 @@ function MetaBoxesMain({ isLegacy }) {
|
|
|
161
161
|
const separatorRef = (0, import_element.useRef)();
|
|
162
162
|
const separatorHelpId = (0, import_element.useId)();
|
|
163
163
|
const heightRef = (0, import_element.useRef)();
|
|
164
|
+
const getAriaValueNow = (height) => Math.round((height - min) / (max - min) * 100);
|
|
165
|
+
const persistIsOpen = (to = !isOpen) => setPreference("core/edit-post", "metaBoxesMainIsOpen", to);
|
|
164
166
|
const applyHeight = (candidateHeight = "auto", isPersistent) => {
|
|
165
167
|
let styleHeight;
|
|
166
168
|
if (candidateHeight === "auto") {
|
|
@@ -237,9 +239,7 @@ function MetaBoxesMain({ isLegacy }) {
|
|
|
237
239
|
const isAutoHeight = openHeight === void 0;
|
|
238
240
|
const usedOpenHeight = isShort ? "auto" : openHeight;
|
|
239
241
|
const usedHeight = isOpen ? usedOpenHeight : min;
|
|
240
|
-
const getAriaValueNow = (height) => Math.round((height - min) / (max - min) * 100);
|
|
241
242
|
const usedAriaValueNow = max === void 0 || isAutoHeight ? 50 : getAriaValueNow(usedHeight);
|
|
242
|
-
const persistIsOpen = (to = !isOpen) => setPreference("core/edit-post", "metaBoxesMainIsOpen", to);
|
|
243
243
|
const paneLabel = (0, import_i18n.__)("Meta Boxes");
|
|
244
244
|
const toggle = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
245
245
|
"button",
|
|
@@ -376,8 +376,7 @@ function Layout({
|
|
|
376
376
|
...settings,
|
|
377
377
|
styles,
|
|
378
378
|
onNavigateToEntityRecord,
|
|
379
|
-
onNavigateToPreviousEntityRecord
|
|
380
|
-
defaultRenderingMode: "post-only"
|
|
379
|
+
onNavigateToPreviousEntityRecord
|
|
381
380
|
}),
|
|
382
381
|
[
|
|
383
382
|
settings,
|
|
@@ -461,48 +460,40 @@ function Layout({
|
|
|
461
460
|
const backButton = (0, import_compose.useViewportMatch)("medium") && isFullscreenActive ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_back_button.default, { initialPost }) : null;
|
|
462
461
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_editor.ErrorBoundary, { canCopyContent: true, children: [
|
|
463
462
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_welcome_guide.default, { postType: currentPostType }),
|
|
464
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
465
|
-
|
|
463
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...navigateRegionsProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
464
|
+
Editor,
|
|
466
465
|
{
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
currentPostType === "wp_block" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_init_pattern_modal.default, {}),
|
|
497
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugins.PluginArea, { onError: onPluginAreaError }),
|
|
498
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_more_menu.default, {}),
|
|
499
|
-
backButton,
|
|
500
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_notices.SnackbarNotices, { className: "edit-post-layout__snackbar" })
|
|
501
|
-
]
|
|
502
|
-
}
|
|
503
|
-
)
|
|
466
|
+
settings: editorSettings,
|
|
467
|
+
initialEdits,
|
|
468
|
+
postType: currentPostType,
|
|
469
|
+
postId: currentPostId,
|
|
470
|
+
templateId,
|
|
471
|
+
className,
|
|
472
|
+
forceIsDirty: hasActiveMetaboxes,
|
|
473
|
+
disableIframe: !shouldIframe,
|
|
474
|
+
autoFocus: !isWelcomeGuideVisible,
|
|
475
|
+
onActionPerformed,
|
|
476
|
+
extraSidebarPanels: showMetaBoxes && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_meta_boxes.default, { location: "side" }),
|
|
477
|
+
extraContent: !isDistractionFree && showMetaBoxes && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MetaBoxesMain, { isLegacy: isDevicePreview }),
|
|
478
|
+
children: [
|
|
479
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor.PostLockedModal, {}),
|
|
480
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor_initialization.default, {}),
|
|
481
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(FullscreenMode, { isActive: isFullscreenActive }),
|
|
482
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_browser_url.default, {}),
|
|
483
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor.UnsavedChangesWarning, {}),
|
|
484
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor.AutosaveMonitor, {}),
|
|
485
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor.LocalAutosaveMonitor, {}),
|
|
486
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_keyboard_shortcuts.default, {}),
|
|
487
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor.EditorKeyboardShortcutsRegister, {}),
|
|
488
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BlockKeyboardShortcuts, {}),
|
|
489
|
+
currentPostType === "wp_block" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_init_pattern_modal.default, {}),
|
|
490
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugins.PluginArea, { onError: onPluginAreaError }),
|
|
491
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_more_menu.default, {}),
|
|
492
|
+
backButton,
|
|
493
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_notices.SnackbarNotices, { className: "edit-post-layout__snackbar" })
|
|
494
|
+
]
|
|
504
495
|
}
|
|
505
|
-
)
|
|
496
|
+
) })
|
|
506
497
|
] }) });
|
|
507
498
|
}
|
|
508
499
|
var layout_default = Layout;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/layout/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { NavigableRegion } from '@wordpress/admin-ui';\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorKeyboardShortcutsRegister,\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { getLayoutStyles } from '@wordpress/global-styles-engine';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { chevronDown, chevronUp } from '@wordpress/icons';\nimport { SnackbarNotices, store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as commandsPrivateApis } from '@wordpress/commands';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { addQueryArgs } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tIcon,\n\tSlotFillProvider,\n\tTooltip,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport {\n\tuseMediaQuery,\n\tuseMergeRefs,\n\tuseRefEffect,\n\tuseViewportMatch,\n} from '@wordpress/compose';\nimport { VisuallyHidden } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport BackButton from '../back-button';\nimport EditorInitialization from '../editor-initialization';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport InitPatternModal from '../init-pattern-modal';\nimport BrowserURL from '../browser-url';\nimport MetaBoxes from '../meta-boxes';\nimport PostEditorMoreMenu from '../more-menu';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useEditPostCommands from '../../commands/use-commands';\nimport { useShouldIframe } from './use-should-iframe';\nimport useNavigateToEntityRecord from '../../hooks/use-navigate-to-entity-record';\nimport { useMetaBoxInitialization } from '../meta-boxes/use-meta-box-initialization';\n\nconst { useCommandContext } = unlock( commandsPrivateApis );\n/** @type {{} & {useDrag: import('@use-gesture/react').useDrag}} */\nconst { useDrag } = unlock( componentsPrivateApis );\nconst { Editor, FullscreenMode } = unlock( editorPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\nconst DESIGN_POST_TYPES = [\n\t'wp_template',\n\t'wp_template_part',\n\t'wp_block',\n\t'wp_navigation',\n];\n\nfunction useEditorStyles( settings ) {\n\tconst { hasThemeStyleSupport } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t};\n\t}, [] );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\tsettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...( settings?.defaultEditorStyles ?? [] ),\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( settings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! settings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\treturn hasThemeStyles ? settings.styles ?? [] : defaultEditorStyles;\n\t}, [\n\t\tsettings.defaultEditorStyles,\n\t\tsettings.disableLayoutStyles,\n\t\tsettings.styles,\n\t\thasThemeStyleSupport,\n\t] );\n}\n\n/**\n * @param {Object} props\n * @param {boolean} props.isLegacy True for device previews where split view is disabled.\n */\nfunction MetaBoxesMain( { isLegacy } ) {\n\tconst [ isOpen, openHeight, hasAnyVisible ] = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { isMetaBoxLocationVisible } = select( editPostStore );\n\t\treturn [\n\t\t\t!! get( 'core/edit-post', 'metaBoxesMainIsOpen' ),\n\t\t\tget( 'core/edit-post', 'metaBoxesMainOpenHeight' ),\n\t\t\tisMetaBoxLocationVisible( 'normal' ) ||\n\t\t\t\tisMetaBoxLocationVisible( 'advanced' ) ||\n\t\t\t\tisMetaBoxLocationVisible( 'side' ),\n\t\t];\n\t}, [] );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst isShort = useMediaQuery( '(max-height: 549px)' );\n\n\tconst [ { min = 0, max }, setHeightConstraints ] = useState( () => ( {} ) );\n\t// Keeps the resizable area\u2019s size constraints updated taking into account\n\t// editor notices. The constraints are also used to derive the value for the\n\t// aria-valuenow attribute on the separator.\n\tconst effectSizeConstraints = useRefEffect( ( node ) => {\n\t\tconst container = node.closest(\n\t\t\t'.interface-interface-skeleton__content'\n\t\t);\n\t\tif ( ! container ) {\n\t\t\treturn;\n\t\t}\n\t\tconst noticeLists = container.querySelectorAll(\n\t\t\t':scope > .components-notice-list'\n\t\t);\n\t\tconst resizeHandle = container.querySelector(\n\t\t\t'.edit-post-meta-boxes-main__presenter'\n\t\t);\n\t\tconst deriveConstraints = () => {\n\t\t\tconst fullHeight = container.offsetHeight;\n\t\t\tlet nextMax = fullHeight;\n\t\t\tfor ( const element of noticeLists ) {\n\t\t\t\tnextMax -= element.offsetHeight;\n\t\t\t}\n\t\t\tconst nextMin = resizeHandle.offsetHeight;\n\t\t\tsetHeightConstraints( { min: nextMin, max: nextMax } );\n\t\t};\n\t\tconst observer = new window.ResizeObserver( deriveConstraints );\n\t\tobserver.observe( container );\n\t\tfor ( const element of noticeLists ) {\n\t\t\tobserver.observe( element );\n\t\t}\n\t\treturn () => observer.disconnect();\n\t}, [] );\n\tconst metaBoxesMainRef = useRef();\n\tconst setMainRefs = useMergeRefs( [\n\t\tmetaBoxesMainRef,\n\t\teffectSizeConstraints,\n\t] );\n\n\tconst separatorRef = useRef();\n\tconst separatorHelpId = useId();\n\n\tconst heightRef = useRef();\n\n\t/**\n\t * @param {number|'auto'} [candidateHeight] Height in pixels or 'auto'.\n\t * @param {boolean} isPersistent Whether to persist the height in preferences.\n\t */\n\tconst applyHeight = ( candidateHeight = 'auto', isPersistent ) => {\n\t\tlet styleHeight;\n\t\tif ( candidateHeight === 'auto' ) {\n\t\t\tisPersistent = false; // Just in case \u2014 \u201Cauto\u201D should never persist.\n\t\t\tstyleHeight = candidateHeight;\n\t\t} else {\n\t\t\tcandidateHeight = Math.min( max, Math.max( min, candidateHeight ) );\n\t\t\theightRef.current = candidateHeight;\n\t\t\tstyleHeight = `${ candidateHeight }px`;\n\t\t}\n\t\tif ( isPersistent ) {\n\t\t\tsetPreference(\n\t\t\t\t'core/edit-post',\n\t\t\t\t'metaBoxesMainOpenHeight',\n\t\t\t\tcandidateHeight\n\t\t\t);\n\t\t}\n\t\t// Applies imperative DOM updates only when not persisting the value\n\t\t// because otherwise it's done by the subsequent render.\n\t\telse {\n\t\t\tmetaBoxesMainRef.current.style.height = styleHeight;\n\t\t\tif ( ! isShort ) {\n\t\t\t\tseparatorRef.current.ariaValueNow =\n\t\t\t\t\tgetAriaValueNow( candidateHeight );\n\t\t\t}\n\t\t}\n\t};\n\n\t// useDrag includes keyboard support with arrow keys emulating a drag.\n\t// TODO: Support more/all keyboard interactions from the window splitter pattern:\n\t// https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/\n\tconst bindDragGesture = useDrag(\n\t\t( { movement, first, last, memo, tap, args } ) => {\n\t\t\tconst pane = metaBoxesMainRef.current;\n\t\t\tconst [ , yMovement ] = movement;\n\t\t\tif ( first ) {\n\t\t\t\tpane.classList.add( 'is-resizing' );\n\t\t\t\tlet fromHeight = heightRef.current ?? pane.offsetHeight;\n\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t// Starts from max in case shortening the window has imposed it.\n\t\t\t\t\tif ( fromHeight > max ) {\n\t\t\t\t\t\tfromHeight = max;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfromHeight = min;\n\t\t\t\t}\n\t\t\t\tapplyHeight( fromHeight - yMovement );\n\t\t\t\treturn { fromHeight };\n\t\t\t}\n\n\t\t\tif ( ! first && ! last && ! tap ) {\n\t\t\t\tapplyHeight( memo.fromHeight - yMovement );\n\t\t\t\treturn memo;\n\t\t\t}\n\t\t\t// Here, `last === true` \u2013 it\u2019s the final event of the gesture.\n\n\t\t\tpane.classList.remove( 'is-resizing' );\n\t\t\tif ( tap ) {\n\t\t\t\tconst [ onTap ] = args;\n\t\t\t\tonTap?.();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst nextIsOpen = heightRef.current > min;\n\t\t\tpersistIsOpen( nextIsOpen );\n\t\t\t// Persists height only if still open. This is so that when closed by a drag the\n\t\t\t// prior height can be restored by the toggle button instead of having to drag\n\t\t\t// the pane open again.\n\t\t\tapplyHeight( heightRef.current, nextIsOpen );\n\t\t},\n\t\t{ keyboardDisplacement: 20, filterTaps: true }\n\t);\n\n\tif ( ! hasAnyVisible ) {\n\t\treturn;\n\t}\n\n\tconst contents = (\n\t\t<div\n\t\t\t// The class name 'edit-post-layout__metaboxes' is retained because some plugins use it.\n\t\t\tclassName=\"edit-post-layout__metaboxes edit-post-meta-boxes-main__liner\"\n\t\t\thidden={ ! isLegacy && ! isOpen }\n\t\t>\n\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t</div>\n\t);\n\n\tif ( isLegacy ) {\n\t\treturn contents;\n\t}\n\n\tconst isAutoHeight = openHeight === undefined;\n\tconst usedOpenHeight = isShort ? 'auto' : openHeight;\n\tconst usedHeight = isOpen ? usedOpenHeight : min;\n\n\tconst getAriaValueNow = ( height ) =>\n\t\tMath.round( ( ( height - min ) / ( max - min ) ) * 100 );\n\tconst usedAriaValueNow =\n\t\tmax === undefined || isAutoHeight ? 50 : getAriaValueNow( usedHeight );\n\n\tconst persistIsOpen = ( to = ! isOpen ) =>\n\t\tsetPreference( 'core/edit-post', 'metaBoxesMainIsOpen', to );\n\n\tconst paneLabel = __( 'Meta Boxes' );\n\n\t// The toggle button. It also resizes when the viewport is tall to provide\n\t// a larger hit area than the small separator button.\n\tconst toggle = (\n\t\t<button\n\t\t\taria-expanded={ isOpen }\n\t\t\t// Toggles for all clicks when short and only keyboard \u201Cclicks\u201D when\n\t\t\t// resizable because pointer input is handled by the drag gesture.\n\t\t\tonClick={ ( { detail } ) => {\n\t\t\t\tif ( isShort || ! detail ) {\n\t\t\t\t\tpersistIsOpen();\n\t\t\t\t}\n\t\t\t} }\n\t\t\t// Passes a toggle callback that the drag gesture handler calls when\n\t\t\t// it interprets the input as a click/tap.\n\t\t\t{ ...( ! isShort && bindDragGesture( persistIsOpen ) ) }\n\t\t>\n\t\t\t{ paneLabel }\n\t\t\t<Icon icon={ isOpen ? chevronUp : chevronDown } />\n\t\t</button>\n\t);\n\n\t// The separator button that provides a11y for resizing.\n\tconst separator = ! isShort && (\n\t\t<>\n\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t<button\n\t\t\t\t\tref={ separatorRef }\n\t\t\t\t\trole=\"separator\" // eslint-disable-line jsx-a11y/no-interactive-element-to-noninteractive-role\n\t\t\t\t\taria-valuenow={ usedAriaValueNow }\n\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\taria-describedby={ separatorHelpId }\n\t\t\t\t\t{ ...bindDragGesture() }\n\t\t\t\t/>\n\t\t\t</Tooltip>\n\t\t\t<VisuallyHidden id={ separatorHelpId }>\n\t\t\t\t{ __(\n\t\t\t\t\t'Use up and down arrow keys to resize the meta box pane.'\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n\n\treturn (\n\t\t<NavigableRegion\n\t\t\tariaLabel={ paneLabel }\n\t\t\tref={ setMainRefs }\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-post-meta-boxes-main',\n\t\t\t\t! isShort && 'is-resizable'\n\t\t\t) }\n\t\t\tstyle={ { height: usedHeight } }\n\t\t>\n\t\t\t<div className=\"edit-post-meta-boxes-main__presenter\">\n\t\t\t\t{ toggle }\n\t\t\t\t{ separator }\n\t\t\t</div>\n\t\t\t{ contents }\n\t\t</NavigableRegion>\n\t);\n}\n\nfunction Layout( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n} ) {\n\tuseEditPostCommands();\n\tconst shouldIframe = useShouldIframe();\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tcurrentPost: { postId: currentPostId, postType: currentPostType },\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useNavigateToEntityRecord(\n\t\tinitialPostId,\n\t\tinitialPostType,\n\t\t'post-only'\n\t);\n\tconst isEditingTemplate = currentPostType === 'wp_template';\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\thasResolvedMode,\n\t\thasActiveMetaboxes,\n\t\thasBlockSelected,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowMetaBoxes,\n\t\tisWelcomeGuideVisible,\n\t\ttemplateId,\n\t\tisDevicePreview,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isFeatureActive, hasMetaBoxes } = select( editPostStore );\n\t\t\tconst { canUser, getPostType, getTemplateId } = unlock(\n\t\t\t\tselect( coreStore )\n\t\t\t);\n\n\t\t\tconst supportsTemplateMode = settings.supportsTemplateMode;\n\t\t\tconst isViewable =\n\t\t\t\tgetPostType( currentPostType )?.viewable ?? false;\n\t\t\tconst canViewTemplate = canUser( 'read', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\t\t\tconst { getBlockSelectionStart, isZoomOut } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\tconst { getEditorMode, getDefaultRenderingMode, getDeviceType } =\n\t\t\t\tunlock( select( editorStore ) );\n\t\t\tconst isNotDesignPostType =\n\t\t\t\t! DESIGN_POST_TYPES.includes( currentPostType );\n\t\t\tconst isDirectlyEditingPattern =\n\t\t\t\tcurrentPostType === 'wp_block' &&\n\t\t\t\t! onNavigateToPreviousEntityRecord;\n\t\t\tconst _templateId = getTemplateId( currentPostType, currentPostId );\n\t\t\tconst defaultMode = getDefaultRenderingMode( currentPostType );\n\n\t\t\treturn {\n\t\t\t\tmode: getEditorMode(),\n\t\t\t\tisFullscreenActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\thasActiveMetaboxes: hasMetaBoxes(),\n\t\t\t\thasResolvedMode:\n\t\t\t\t\tdefaultMode === 'template-locked'\n\t\t\t\t\t\t? !! _templateId\n\t\t\t\t\t\t: defaultMode !== undefined,\n\t\t\t\thasBlockSelected: !! getBlockSelectionStart(),\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tshowMetaBoxes:\n\t\t\t\t\t( isNotDesignPostType && ! isZoomOut() ) ||\n\t\t\t\t\tisDirectlyEditingPattern,\n\t\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t\t\ttemplateId:\n\t\t\t\t\tsupportsTemplateMode &&\n\t\t\t\t\tisViewable &&\n\t\t\t\t\tcanViewTemplate &&\n\t\t\t\t\t! isEditingTemplate\n\t\t\t\t\t\t? _templateId\n\t\t\t\t\t\t: null,\n\t\t\t\tisDevicePreview: getDeviceType() !== 'Desktop',\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tcurrentPostType,\n\t\t\tcurrentPostId,\n\t\t\tisEditingTemplate,\n\t\t\tsettings.supportsTemplateMode,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t]\n\t);\n\n\tuseMetaBoxInitialization( hasActiveMetaboxes && hasResolvedMode );\n\n\t// Set the right context for the command palette\n\tconst commandContext = hasBlockSelected\n\t\t? 'block-selection-edit'\n\t\t: 'entity-edit';\n\tuseCommandContext( commandContext );\n\tconst styles = useEditorStyles( settings );\n\tconst editorSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tstyles,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t\tdefaultRenderingMode: 'post-only',\n\t\t} ),\n\t\t[\n\t\t\tsettings,\n\t\t\tstyles,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t]\n\t);\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst navigateRegionsProps = useNavigateRegions();\n\n\tconst className = clsx( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t} );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.location.href = addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\ttrashed: 1,\n\t\t\t\t\t\t\tpost_type: items[ 0 ].type,\n\t\t\t\t\t\t\tids: items[ 0 ].id,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post or template, e.g: \"Hello world\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\tdecodeEntities( title ) || __( '(no title)' )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\tconst postId = newItem.id;\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.href =\n\t\t\t\t\t\t\t\t\t\t\t\taddQueryArgs( 'post.php', {\n\t\t\t\t\t\t\t\t\t\t\t\t\tpost: postId,\n\t\t\t\t\t\t\t\t\t\t\t\t\taction: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ createSuccessNotice ]\n\t);\n\n\tconst initialPost = useMemo( () => {\n\t\treturn {\n\t\t\ttype: initialPostType,\n\t\t\tid: initialPostId,\n\t\t};\n\t}, [ initialPostType, initialPostId ] );\n\n\tconst backButton =\n\t\tuseViewportMatch( 'medium' ) && isFullscreenActive ? (\n\t\t\t<BackButton initialPost={ initialPost } />\n\t\t) : null;\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<ErrorBoundary canCopyContent>\n\t\t\t\t<WelcomeGuide postType={ currentPostType } />\n\t\t\t\t<div\n\t\t\t\t\tclassName={ navigateRegionsProps.className }\n\t\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\t>\n\t\t\t\t\t<Editor\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\tpostType={ currentPostType }\n\t\t\t\t\t\tpostId={ currentPostId }\n\t\t\t\t\t\ttemplateId={ templateId }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t\tshowMetaBoxes && <MetaBoxes location=\"side\" />\n\t\t\t\t\t\t}\n\t\t\t\t\t\textraContent={\n\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\tshowMetaBoxes && (\n\t\t\t\t\t\t\t\t<MetaBoxesMain isLegacy={ isDevicePreview } />\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostLockedModal />\n\t\t\t\t\t\t<EditorInitialization />\n\t\t\t\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t\t\t\t<BrowserURL />\n\t\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t\t<AutosaveMonitor />\n\t\t\t\t\t\t<LocalAutosaveMonitor />\n\t\t\t\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t\t<BlockKeyboardShortcuts />\n\t\t\t\t\t\t{ currentPostType === 'wp_block' && (\n\t\t\t\t\t\t\t<InitPatternModal />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t\t<PostEditorMoreMenu />\n\t\t\t\t\t\t{ backButton }\n\t\t\t\t\t\t<SnackbarNotices className=\"edit-post-layout__snackbar\" />\n\t\t\t\t\t</Editor>\n\t\t\t\t</div>\n\t\t\t</ErrorBoundary>\n\t\t</SlotFillProvider>\n\t);\n}\n\nexport default Layout;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,sBAAgC;AAChC,oBASO;AACP,kBAAuC;AACvC,0BAA0C;AAC1C,kCAAgC;AAChC,qBAA2B;AAC3B,kBAA4B;AAC5B,qBAMO;AACP,mBAAuC;AACvC,qBAAuD;AACvD,yBAA0C;AAC1C,sBAAmD;AACnD,2BAAuD;AACvD,iBAA6B;AAC7B,2BAA+B;AAC/B,uBAAmC;AACnC,wBAMO;AACP,qBAKO;AACP,gBAA+B;AAK/B,yBAAuB;AACvB,mCAAiC;AACjC,gCAAsC;AACtC,gCAA6B;AAC7B,yBAAuB;AACvB,wBAAsB;AACtB,uBAA+B;AAC/B,2BAAyB;AACzB,mBAAuC;AACvC,yBAAuB;AACvB,0BAAgC;AAChC,+BAAgC;AAChC,2CAAsC;AACtC,yCAAyC;
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { NavigableRegion } from '@wordpress/admin-ui';\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorKeyboardShortcutsRegister,\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { getLayoutStyles } from '@wordpress/global-styles-engine';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { chevronDown, chevronUp } from '@wordpress/icons';\nimport { SnackbarNotices, store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as commandsPrivateApis } from '@wordpress/commands';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { addQueryArgs } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tIcon,\n\tSlotFillProvider,\n\tTooltip,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport {\n\tuseMediaQuery,\n\tuseMergeRefs,\n\tuseRefEffect,\n\tuseViewportMatch,\n} from '@wordpress/compose';\nimport { VisuallyHidden } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport BackButton from '../back-button';\nimport EditorInitialization from '../editor-initialization';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport InitPatternModal from '../init-pattern-modal';\nimport BrowserURL from '../browser-url';\nimport MetaBoxes from '../meta-boxes';\nimport PostEditorMoreMenu from '../more-menu';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useEditPostCommands from '../../commands/use-commands';\nimport { useShouldIframe } from './use-should-iframe';\nimport useNavigateToEntityRecord from '../../hooks/use-navigate-to-entity-record';\nimport { useMetaBoxInitialization } from '../meta-boxes/use-meta-box-initialization';\n\nconst { useCommandContext } = unlock( commandsPrivateApis );\n/** @type {{} & {useDrag: import('@use-gesture/react').useDrag}} */\nconst { useDrag } = unlock( componentsPrivateApis );\nconst { Editor, FullscreenMode } = unlock( editorPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\nconst DESIGN_POST_TYPES = [\n\t'wp_template',\n\t'wp_template_part',\n\t'wp_block',\n\t'wp_navigation',\n];\n\nfunction useEditorStyles( settings ) {\n\tconst { hasThemeStyleSupport } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t};\n\t}, [] );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\tsettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...( settings?.defaultEditorStyles ?? [] ),\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( settings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! settings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\treturn hasThemeStyles ? settings.styles ?? [] : defaultEditorStyles;\n\t}, [\n\t\tsettings.defaultEditorStyles,\n\t\tsettings.disableLayoutStyles,\n\t\tsettings.styles,\n\t\thasThemeStyleSupport,\n\t] );\n}\n\n/**\n * @param {Object} props\n * @param {boolean} props.isLegacy True for device previews where split view is disabled.\n */\nfunction MetaBoxesMain( { isLegacy } ) {\n\tconst [ isOpen, openHeight, hasAnyVisible ] = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { isMetaBoxLocationVisible } = select( editPostStore );\n\t\treturn [\n\t\t\t!! get( 'core/edit-post', 'metaBoxesMainIsOpen' ),\n\t\t\tget( 'core/edit-post', 'metaBoxesMainOpenHeight' ),\n\t\t\tisMetaBoxLocationVisible( 'normal' ) ||\n\t\t\t\tisMetaBoxLocationVisible( 'advanced' ) ||\n\t\t\t\tisMetaBoxLocationVisible( 'side' ),\n\t\t];\n\t}, [] );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst isShort = useMediaQuery( '(max-height: 549px)' );\n\n\tconst [ { min = 0, max }, setHeightConstraints ] = useState( () => ( {} ) );\n\t// Keeps the resizable area\u2019s size constraints updated taking into account\n\t// editor notices. The constraints are also used to derive the value for the\n\t// aria-valuenow attribute on the separator.\n\tconst effectSizeConstraints = useRefEffect( ( node ) => {\n\t\tconst container = node.closest(\n\t\t\t'.interface-interface-skeleton__content'\n\t\t);\n\t\tif ( ! container ) {\n\t\t\treturn;\n\t\t}\n\t\tconst noticeLists = container.querySelectorAll(\n\t\t\t':scope > .components-notice-list'\n\t\t);\n\t\tconst resizeHandle = container.querySelector(\n\t\t\t'.edit-post-meta-boxes-main__presenter'\n\t\t);\n\t\tconst deriveConstraints = () => {\n\t\t\tconst fullHeight = container.offsetHeight;\n\t\t\tlet nextMax = fullHeight;\n\t\t\tfor ( const element of noticeLists ) {\n\t\t\t\tnextMax -= element.offsetHeight;\n\t\t\t}\n\t\t\tconst nextMin = resizeHandle.offsetHeight;\n\t\t\tsetHeightConstraints( { min: nextMin, max: nextMax } );\n\t\t};\n\t\tconst observer = new window.ResizeObserver( deriveConstraints );\n\t\tobserver.observe( container );\n\t\tfor ( const element of noticeLists ) {\n\t\t\tobserver.observe( element );\n\t\t}\n\t\treturn () => observer.disconnect();\n\t}, [] );\n\tconst metaBoxesMainRef = useRef();\n\tconst setMainRefs = useMergeRefs( [\n\t\tmetaBoxesMainRef,\n\t\teffectSizeConstraints,\n\t] );\n\n\tconst separatorRef = useRef();\n\tconst separatorHelpId = useId();\n\n\tconst heightRef = useRef();\n\n\tconst getAriaValueNow = ( height ) =>\n\t\tMath.round( ( ( height - min ) / ( max - min ) ) * 100 );\n\tconst persistIsOpen = ( to = ! isOpen ) =>\n\t\tsetPreference( 'core/edit-post', 'metaBoxesMainIsOpen', to );\n\n\t/**\n\t * @param {number|'auto'} [candidateHeight] Height in pixels or 'auto'.\n\t * @param {boolean} isPersistent Whether to persist the height in preferences.\n\t */\n\tconst applyHeight = ( candidateHeight = 'auto', isPersistent ) => {\n\t\tlet styleHeight;\n\t\tif ( candidateHeight === 'auto' ) {\n\t\t\tisPersistent = false; // Just in case \u2014 \u201Cauto\u201D should never persist.\n\t\t\tstyleHeight = candidateHeight;\n\t\t} else {\n\t\t\tcandidateHeight = Math.min( max, Math.max( min, candidateHeight ) );\n\t\t\theightRef.current = candidateHeight;\n\t\t\tstyleHeight = `${ candidateHeight }px`;\n\t\t}\n\t\tif ( isPersistent ) {\n\t\t\tsetPreference(\n\t\t\t\t'core/edit-post',\n\t\t\t\t'metaBoxesMainOpenHeight',\n\t\t\t\tcandidateHeight\n\t\t\t);\n\t\t}\n\t\t// Applies imperative DOM updates only when not persisting the value\n\t\t// because otherwise it's done by the subsequent render.\n\t\telse {\n\t\t\tmetaBoxesMainRef.current.style.height = styleHeight;\n\t\t\tif ( ! isShort ) {\n\t\t\t\tseparatorRef.current.ariaValueNow =\n\t\t\t\t\tgetAriaValueNow( candidateHeight );\n\t\t\t}\n\t\t}\n\t};\n\n\t// useDrag includes keyboard support with arrow keys emulating a drag.\n\t// TODO: Support more/all keyboard interactions from the window splitter pattern:\n\t// https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/\n\tconst bindDragGesture = useDrag(\n\t\t( { movement, first, last, memo, tap, args } ) => {\n\t\t\tconst pane = metaBoxesMainRef.current;\n\t\t\tconst [ , yMovement ] = movement;\n\t\t\tif ( first ) {\n\t\t\t\tpane.classList.add( 'is-resizing' );\n\t\t\t\tlet fromHeight = heightRef.current ?? pane.offsetHeight;\n\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t// Starts from max in case shortening the window has imposed it.\n\t\t\t\t\tif ( fromHeight > max ) {\n\t\t\t\t\t\tfromHeight = max;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfromHeight = min;\n\t\t\t\t}\n\t\t\t\tapplyHeight( fromHeight - yMovement );\n\t\t\t\treturn { fromHeight };\n\t\t\t}\n\n\t\t\tif ( ! first && ! last && ! tap ) {\n\t\t\t\tapplyHeight( memo.fromHeight - yMovement );\n\t\t\t\treturn memo;\n\t\t\t}\n\t\t\t// Here, `last === true` \u2013 it\u2019s the final event of the gesture.\n\n\t\t\tpane.classList.remove( 'is-resizing' );\n\t\t\tif ( tap ) {\n\t\t\t\tconst [ onTap ] = args;\n\t\t\t\tonTap?.();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst nextIsOpen = heightRef.current > min;\n\t\t\tpersistIsOpen( nextIsOpen );\n\t\t\t// Persists height only if still open. This is so that when closed by a drag the\n\t\t\t// prior height can be restored by the toggle button instead of having to drag\n\t\t\t// the pane open again.\n\t\t\tapplyHeight( heightRef.current, nextIsOpen );\n\t\t},\n\t\t{ keyboardDisplacement: 20, filterTaps: true }\n\t);\n\n\tif ( ! hasAnyVisible ) {\n\t\treturn;\n\t}\n\n\tconst contents = (\n\t\t<div\n\t\t\t// The class name 'edit-post-layout__metaboxes' is retained because some plugins use it.\n\t\t\tclassName=\"edit-post-layout__metaboxes edit-post-meta-boxes-main__liner\"\n\t\t\thidden={ ! isLegacy && ! isOpen }\n\t\t>\n\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t</div>\n\t);\n\n\tif ( isLegacy ) {\n\t\treturn contents;\n\t}\n\n\tconst isAutoHeight = openHeight === undefined;\n\tconst usedOpenHeight = isShort ? 'auto' : openHeight;\n\tconst usedHeight = isOpen ? usedOpenHeight : min;\n\n\tconst usedAriaValueNow =\n\t\tmax === undefined || isAutoHeight ? 50 : getAriaValueNow( usedHeight );\n\n\tconst paneLabel = __( 'Meta Boxes' );\n\n\t// The toggle button. It also resizes when the viewport is tall to provide\n\t// a larger hit area than the small separator button.\n\tconst toggle = (\n\t\t<button\n\t\t\taria-expanded={ isOpen }\n\t\t\t// Toggles for all clicks when short and only keyboard \u201Cclicks\u201D when\n\t\t\t// resizable because pointer input is handled by the drag gesture.\n\t\t\tonClick={ ( { detail } ) => {\n\t\t\t\tif ( isShort || ! detail ) {\n\t\t\t\t\tpersistIsOpen();\n\t\t\t\t}\n\t\t\t} }\n\t\t\t// Passes a toggle callback that the drag gesture handler calls when\n\t\t\t// it interprets the input as a click/tap.\n\t\t\t{ ...( ! isShort && bindDragGesture( persistIsOpen ) ) }\n\t\t>\n\t\t\t{ paneLabel }\n\t\t\t<Icon icon={ isOpen ? chevronUp : chevronDown } />\n\t\t</button>\n\t);\n\n\t// The separator button that provides a11y for resizing.\n\tconst separator = ! isShort && (\n\t\t<>\n\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t<button\n\t\t\t\t\tref={ separatorRef }\n\t\t\t\t\trole=\"separator\" // eslint-disable-line jsx-a11y/no-interactive-element-to-noninteractive-role\n\t\t\t\t\taria-valuenow={ usedAriaValueNow }\n\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\taria-describedby={ separatorHelpId }\n\t\t\t\t\t{ ...bindDragGesture() }\n\t\t\t\t/>\n\t\t\t</Tooltip>\n\t\t\t<VisuallyHidden id={ separatorHelpId }>\n\t\t\t\t{ __(\n\t\t\t\t\t'Use up and down arrow keys to resize the meta box pane.'\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n\n\treturn (\n\t\t<NavigableRegion\n\t\t\tariaLabel={ paneLabel }\n\t\t\tref={ setMainRefs }\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-post-meta-boxes-main',\n\t\t\t\t! isShort && 'is-resizable'\n\t\t\t) }\n\t\t\tstyle={ { height: usedHeight } }\n\t\t>\n\t\t\t<div className=\"edit-post-meta-boxes-main__presenter\">\n\t\t\t\t{ toggle }\n\t\t\t\t{ separator }\n\t\t\t</div>\n\t\t\t{ contents }\n\t\t</NavigableRegion>\n\t);\n}\n\nfunction Layout( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n} ) {\n\tuseEditPostCommands();\n\tconst shouldIframe = useShouldIframe();\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tcurrentPost: { postId: currentPostId, postType: currentPostType },\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useNavigateToEntityRecord(\n\t\tinitialPostId,\n\t\tinitialPostType,\n\t\t'post-only'\n\t);\n\tconst isEditingTemplate = currentPostType === 'wp_template';\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\thasResolvedMode,\n\t\thasActiveMetaboxes,\n\t\thasBlockSelected,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowMetaBoxes,\n\t\tisWelcomeGuideVisible,\n\t\ttemplateId,\n\t\tisDevicePreview,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isFeatureActive, hasMetaBoxes } = select( editPostStore );\n\t\t\tconst { canUser, getPostType, getTemplateId } = unlock(\n\t\t\t\tselect( coreStore )\n\t\t\t);\n\n\t\t\tconst supportsTemplateMode = settings.supportsTemplateMode;\n\t\t\tconst isViewable =\n\t\t\t\tgetPostType( currentPostType )?.viewable ?? false;\n\t\t\tconst canViewTemplate = canUser( 'read', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\t\t\tconst { getBlockSelectionStart, isZoomOut } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\tconst { getEditorMode, getDefaultRenderingMode, getDeviceType } =\n\t\t\t\tunlock( select( editorStore ) );\n\t\t\tconst isNotDesignPostType =\n\t\t\t\t! DESIGN_POST_TYPES.includes( currentPostType );\n\t\t\tconst isDirectlyEditingPattern =\n\t\t\t\tcurrentPostType === 'wp_block' &&\n\t\t\t\t! onNavigateToPreviousEntityRecord;\n\t\t\tconst _templateId = getTemplateId( currentPostType, currentPostId );\n\t\t\tconst defaultMode = getDefaultRenderingMode( currentPostType );\n\n\t\t\treturn {\n\t\t\t\tmode: getEditorMode(),\n\t\t\t\tisFullscreenActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\thasActiveMetaboxes: hasMetaBoxes(),\n\t\t\t\thasResolvedMode:\n\t\t\t\t\tdefaultMode === 'template-locked'\n\t\t\t\t\t\t? !! _templateId\n\t\t\t\t\t\t: defaultMode !== undefined,\n\t\t\t\thasBlockSelected: !! getBlockSelectionStart(),\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tshowMetaBoxes:\n\t\t\t\t\t( isNotDesignPostType && ! isZoomOut() ) ||\n\t\t\t\t\tisDirectlyEditingPattern,\n\t\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t\t\ttemplateId:\n\t\t\t\t\tsupportsTemplateMode &&\n\t\t\t\t\tisViewable &&\n\t\t\t\t\tcanViewTemplate &&\n\t\t\t\t\t! isEditingTemplate\n\t\t\t\t\t\t? _templateId\n\t\t\t\t\t\t: null,\n\t\t\t\tisDevicePreview: getDeviceType() !== 'Desktop',\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tcurrentPostType,\n\t\t\tcurrentPostId,\n\t\t\tisEditingTemplate,\n\t\t\tsettings.supportsTemplateMode,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t]\n\t);\n\n\tuseMetaBoxInitialization( hasActiveMetaboxes && hasResolvedMode );\n\n\t// Set the right context for the command palette\n\tconst commandContext = hasBlockSelected\n\t\t? 'block-selection-edit'\n\t\t: 'entity-edit';\n\tuseCommandContext( commandContext );\n\tconst styles = useEditorStyles( settings );\n\tconst editorSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tstyles,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t} ),\n\t\t[\n\t\t\tsettings,\n\t\t\tstyles,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t]\n\t);\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst navigateRegionsProps = useNavigateRegions();\n\n\tconst className = clsx( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t} );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.location.href = addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\ttrashed: 1,\n\t\t\t\t\t\t\tpost_type: items[ 0 ].type,\n\t\t\t\t\t\t\tids: items[ 0 ].id,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post or template, e.g: \"Hello world\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\tdecodeEntities( title ) || __( '(no title)' )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\tconst postId = newItem.id;\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.href =\n\t\t\t\t\t\t\t\t\t\t\t\taddQueryArgs( 'post.php', {\n\t\t\t\t\t\t\t\t\t\t\t\t\tpost: postId,\n\t\t\t\t\t\t\t\t\t\t\t\t\taction: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ createSuccessNotice ]\n\t);\n\n\tconst initialPost = useMemo( () => {\n\t\treturn {\n\t\t\ttype: initialPostType,\n\t\t\tid: initialPostId,\n\t\t};\n\t}, [ initialPostType, initialPostId ] );\n\n\tconst backButton =\n\t\tuseViewportMatch( 'medium' ) && isFullscreenActive ? (\n\t\t\t<BackButton initialPost={ initialPost } />\n\t\t) : null;\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<ErrorBoundary canCopyContent>\n\t\t\t\t<WelcomeGuide postType={ currentPostType } />\n\t\t\t\t<div { ...navigateRegionsProps }>\n\t\t\t\t\t<Editor\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\tpostType={ currentPostType }\n\t\t\t\t\t\tpostId={ currentPostId }\n\t\t\t\t\t\ttemplateId={ templateId }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t\tshowMetaBoxes && <MetaBoxes location=\"side\" />\n\t\t\t\t\t\t}\n\t\t\t\t\t\textraContent={\n\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\tshowMetaBoxes && (\n\t\t\t\t\t\t\t\t<MetaBoxesMain isLegacy={ isDevicePreview } />\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostLockedModal />\n\t\t\t\t\t\t<EditorInitialization />\n\t\t\t\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t\t\t\t<BrowserURL />\n\t\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t\t<AutosaveMonitor />\n\t\t\t\t\t\t<LocalAutosaveMonitor />\n\t\t\t\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t\t<BlockKeyboardShortcuts />\n\t\t\t\t\t\t{ currentPostType === 'wp_block' && (\n\t\t\t\t\t\t\t<InitPatternModal />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t\t<PostEditorMoreMenu />\n\t\t\t\t\t\t{ backButton }\n\t\t\t\t\t\t<SnackbarNotices className=\"edit-post-layout__snackbar\" />\n\t\t\t\t\t</Editor>\n\t\t\t\t</div>\n\t\t\t</ErrorBoundary>\n\t\t</SlotFillProvider>\n\t);\n}\n\nexport default Layout;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,sBAAgC;AAChC,oBASO;AACP,kBAAuC;AACvC,0BAA0C;AAC1C,kCAAgC;AAChC,qBAA2B;AAC3B,kBAA4B;AAC5B,qBAMO;AACP,mBAAuC;AACvC,qBAAuD;AACvD,yBAA0C;AAC1C,sBAAmD;AACnD,2BAAuD;AACvD,iBAA6B;AAC7B,2BAA+B;AAC/B,uBAAmC;AACnC,wBAMO;AACP,qBAKO;AACP,gBAA+B;AAK/B,yBAAuB;AACvB,mCAAiC;AACjC,gCAAsC;AACtC,gCAA6B;AAC7B,yBAAuB;AACvB,wBAAsB;AACtB,uBAA+B;AAC/B,2BAAyB;AACzB,mBAAuC;AACvC,yBAAuB;AACvB,0BAAgC;AAChC,+BAAgC;AAChC,2CAAsC;AACtC,yCAAyC;AAqNvC;AAnNF,IAAM,EAAE,kBAAkB,QAAI,2BAAQ,gBAAAA,WAAoB;AAE1D,IAAM,EAAE,QAAQ,QAAI,2BAAQ,kBAAAC,WAAsB;AAClD,IAAM,EAAE,QAAQ,eAAe,QAAI,2BAAQ,cAAAC,WAAkB;AAC7D,IAAM,EAAE,uBAAuB,QAAI,2BAAQ,qBAAAC,WAAwB;AACnE,IAAM,oBAAoB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,SAAS,gBAAiB,UAAW;AACpC,QAAM,EAAE,qBAAqB,QAAI,uBAAW,CAAE,WAAY;AACzD,WAAO;AAAA,MACN,sBACC,OAAQ,aAAAC,KAAc,EAAE,gBAAiB,aAAc;AAAA,IACzD;AAAA,EACD,GAAG,CAAC,CAAE;AAGN,aAAO,wBAAS,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;AAAA,QACA,UAAW;AAAA,QACX,QAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA,cAAe;AAAA,QACf,eAAgB,CAAE;AAAA,QAGlB,WAAY,CAAE;AAAA,QACd;AAAA,QACA,oBACC,iBAAiB,4CAAC,kBAAAV,SAAA,EAAU,UAAS,QAAO;AAAA,QAE7C,cACC,CAAE,qBACF,iBACC,4CAAC,iBAAc,UAAW,iBAAkB;AAAA,QAI9C;AAAA,sDAAC,iCAAgB;AAAA,UACjB,4CAAC,6BAAAW,SAAA,EAAqB;AAAA,UACtB,4CAAC,kBAAe,UAAW,oBAAqB;AAAA,UAChD,4CAAC,mBAAAC,SAAA,EAAW;AAAA,UACZ,4CAAC,uCAAsB;AAAA,UACvB,4CAAC,iCAAgB;AAAA,UACjB,4CAAC,sCAAqB;AAAA,UACtB,4CAAC,0BAAAC,SAAA,EAA0B;AAAA,UAC3B,4CAAC,iDAAgC;AAAA,UACjC,4CAAC,0BAAuB;AAAA,UACtB,oBAAoB,cACrB,4CAAC,0BAAAC,SAAA,EAAiB;AAAA,UAEnB,4CAAC,6BAAW,SAAU,mBAAoB;AAAA,UAC1C,4CAAC,iBAAAC,SAAA,EAAmB;AAAA,UAClB;AAAA,UACF,4CAAC,kCAAgB,WAAU,8BAA6B;AAAA;AAAA;AAAA,IACzD,GACD;AAAA,KACD,GACD;AAEF;AAEA,IAAO,iBAAQ;",
|
|
6
6
|
"names": ["commandsPrivateApis", "componentsPrivateApis", "editorPrivateApis", "blockLibraryPrivateApis", "editPostStore", "preferencesStore", "MetaBoxes", "clsx", "useEditPostCommands", "noticesStore", "useNavigateToEntityRecord", "coreStore", "blockEditorStore", "editorStore", "useNavigateRegions", "BackButton", "WelcomeGuide", "EditorInitialization", "BrowserURL", "EditPostKeyboardShortcuts", "InitPatternModal", "PostEditorMoreMenu"]
|
|
7
7
|
}
|
|
@@ -154,6 +154,8 @@ function MetaBoxesMain({ isLegacy }) {
|
|
|
154
154
|
const separatorRef = useRef();
|
|
155
155
|
const separatorHelpId = useId();
|
|
156
156
|
const heightRef = useRef();
|
|
157
|
+
const getAriaValueNow = (height) => Math.round((height - min) / (max - min) * 100);
|
|
158
|
+
const persistIsOpen = (to = !isOpen) => setPreference("core/edit-post", "metaBoxesMainIsOpen", to);
|
|
157
159
|
const applyHeight = (candidateHeight = "auto", isPersistent) => {
|
|
158
160
|
let styleHeight;
|
|
159
161
|
if (candidateHeight === "auto") {
|
|
@@ -230,9 +232,7 @@ function MetaBoxesMain({ isLegacy }) {
|
|
|
230
232
|
const isAutoHeight = openHeight === void 0;
|
|
231
233
|
const usedOpenHeight = isShort ? "auto" : openHeight;
|
|
232
234
|
const usedHeight = isOpen ? usedOpenHeight : min;
|
|
233
|
-
const getAriaValueNow = (height) => Math.round((height - min) / (max - min) * 100);
|
|
234
235
|
const usedAriaValueNow = max === void 0 || isAutoHeight ? 50 : getAriaValueNow(usedHeight);
|
|
235
|
-
const persistIsOpen = (to = !isOpen) => setPreference("core/edit-post", "metaBoxesMainIsOpen", to);
|
|
236
236
|
const paneLabel = __("Meta Boxes");
|
|
237
237
|
const toggle = /* @__PURE__ */ jsxs(
|
|
238
238
|
"button",
|
|
@@ -369,8 +369,7 @@ function Layout({
|
|
|
369
369
|
...settings,
|
|
370
370
|
styles,
|
|
371
371
|
onNavigateToEntityRecord,
|
|
372
|
-
onNavigateToPreviousEntityRecord
|
|
373
|
-
defaultRenderingMode: "post-only"
|
|
372
|
+
onNavigateToPreviousEntityRecord
|
|
374
373
|
}),
|
|
375
374
|
[
|
|
376
375
|
settings,
|
|
@@ -454,48 +453,40 @@ function Layout({
|
|
|
454
453
|
const backButton = useViewportMatch("medium") && isFullscreenActive ? /* @__PURE__ */ jsx(BackButton, { initialPost }) : null;
|
|
455
454
|
return /* @__PURE__ */ jsx(SlotFillProvider, { children: /* @__PURE__ */ jsxs(ErrorBoundary, { canCopyContent: true, children: [
|
|
456
455
|
/* @__PURE__ */ jsx(WelcomeGuide, { postType: currentPostType }),
|
|
457
|
-
/* @__PURE__ */ jsx(
|
|
458
|
-
|
|
456
|
+
/* @__PURE__ */ jsx("div", { ...navigateRegionsProps, children: /* @__PURE__ */ jsxs(
|
|
457
|
+
Editor,
|
|
459
458
|
{
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
currentPostType === "wp_block" && /* @__PURE__ */ jsx(InitPatternModal, {}),
|
|
490
|
-
/* @__PURE__ */ jsx(PluginArea, { onError: onPluginAreaError }),
|
|
491
|
-
/* @__PURE__ */ jsx(PostEditorMoreMenu, {}),
|
|
492
|
-
backButton,
|
|
493
|
-
/* @__PURE__ */ jsx(SnackbarNotices, { className: "edit-post-layout__snackbar" })
|
|
494
|
-
]
|
|
495
|
-
}
|
|
496
|
-
)
|
|
459
|
+
settings: editorSettings,
|
|
460
|
+
initialEdits,
|
|
461
|
+
postType: currentPostType,
|
|
462
|
+
postId: currentPostId,
|
|
463
|
+
templateId,
|
|
464
|
+
className,
|
|
465
|
+
forceIsDirty: hasActiveMetaboxes,
|
|
466
|
+
disableIframe: !shouldIframe,
|
|
467
|
+
autoFocus: !isWelcomeGuideVisible,
|
|
468
|
+
onActionPerformed,
|
|
469
|
+
extraSidebarPanels: showMetaBoxes && /* @__PURE__ */ jsx(MetaBoxes, { location: "side" }),
|
|
470
|
+
extraContent: !isDistractionFree && showMetaBoxes && /* @__PURE__ */ jsx(MetaBoxesMain, { isLegacy: isDevicePreview }),
|
|
471
|
+
children: [
|
|
472
|
+
/* @__PURE__ */ jsx(PostLockedModal, {}),
|
|
473
|
+
/* @__PURE__ */ jsx(EditorInitialization, {}),
|
|
474
|
+
/* @__PURE__ */ jsx(FullscreenMode, { isActive: isFullscreenActive }),
|
|
475
|
+
/* @__PURE__ */ jsx(BrowserURL, {}),
|
|
476
|
+
/* @__PURE__ */ jsx(UnsavedChangesWarning, {}),
|
|
477
|
+
/* @__PURE__ */ jsx(AutosaveMonitor, {}),
|
|
478
|
+
/* @__PURE__ */ jsx(LocalAutosaveMonitor, {}),
|
|
479
|
+
/* @__PURE__ */ jsx(EditPostKeyboardShortcuts, {}),
|
|
480
|
+
/* @__PURE__ */ jsx(EditorKeyboardShortcutsRegister, {}),
|
|
481
|
+
/* @__PURE__ */ jsx(BlockKeyboardShortcuts, {}),
|
|
482
|
+
currentPostType === "wp_block" && /* @__PURE__ */ jsx(InitPatternModal, {}),
|
|
483
|
+
/* @__PURE__ */ jsx(PluginArea, { onError: onPluginAreaError }),
|
|
484
|
+
/* @__PURE__ */ jsx(PostEditorMoreMenu, {}),
|
|
485
|
+
backButton,
|
|
486
|
+
/* @__PURE__ */ jsx(SnackbarNotices, { className: "edit-post-layout__snackbar" })
|
|
487
|
+
]
|
|
497
488
|
}
|
|
498
|
-
)
|
|
489
|
+
) })
|
|
499
490
|
] }) });
|
|
500
491
|
}
|
|
501
492
|
var layout_default = Layout;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/layout/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { NavigableRegion } from '@wordpress/admin-ui';\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorKeyboardShortcutsRegister,\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { getLayoutStyles } from '@wordpress/global-styles-engine';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { chevronDown, chevronUp } from '@wordpress/icons';\nimport { SnackbarNotices, store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as commandsPrivateApis } from '@wordpress/commands';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { addQueryArgs } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tIcon,\n\tSlotFillProvider,\n\tTooltip,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport {\n\tuseMediaQuery,\n\tuseMergeRefs,\n\tuseRefEffect,\n\tuseViewportMatch,\n} from '@wordpress/compose';\nimport { VisuallyHidden } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport BackButton from '../back-button';\nimport EditorInitialization from '../editor-initialization';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport InitPatternModal from '../init-pattern-modal';\nimport BrowserURL from '../browser-url';\nimport MetaBoxes from '../meta-boxes';\nimport PostEditorMoreMenu from '../more-menu';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useEditPostCommands from '../../commands/use-commands';\nimport { useShouldIframe } from './use-should-iframe';\nimport useNavigateToEntityRecord from '../../hooks/use-navigate-to-entity-record';\nimport { useMetaBoxInitialization } from '../meta-boxes/use-meta-box-initialization';\n\nconst { useCommandContext } = unlock( commandsPrivateApis );\n/** @type {{} & {useDrag: import('@use-gesture/react').useDrag}} */\nconst { useDrag } = unlock( componentsPrivateApis );\nconst { Editor, FullscreenMode } = unlock( editorPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\nconst DESIGN_POST_TYPES = [\n\t'wp_template',\n\t'wp_template_part',\n\t'wp_block',\n\t'wp_navigation',\n];\n\nfunction useEditorStyles( settings ) {\n\tconst { hasThemeStyleSupport } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t};\n\t}, [] );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\tsettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...( settings?.defaultEditorStyles ?? [] ),\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( settings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! settings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\treturn hasThemeStyles ? settings.styles ?? [] : defaultEditorStyles;\n\t}, [\n\t\tsettings.defaultEditorStyles,\n\t\tsettings.disableLayoutStyles,\n\t\tsettings.styles,\n\t\thasThemeStyleSupport,\n\t] );\n}\n\n/**\n * @param {Object} props\n * @param {boolean} props.isLegacy True for device previews where split view is disabled.\n */\nfunction MetaBoxesMain( { isLegacy } ) {\n\tconst [ isOpen, openHeight, hasAnyVisible ] = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { isMetaBoxLocationVisible } = select( editPostStore );\n\t\treturn [\n\t\t\t!! get( 'core/edit-post', 'metaBoxesMainIsOpen' ),\n\t\t\tget( 'core/edit-post', 'metaBoxesMainOpenHeight' ),\n\t\t\tisMetaBoxLocationVisible( 'normal' ) ||\n\t\t\t\tisMetaBoxLocationVisible( 'advanced' ) ||\n\t\t\t\tisMetaBoxLocationVisible( 'side' ),\n\t\t];\n\t}, [] );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst isShort = useMediaQuery( '(max-height: 549px)' );\n\n\tconst [ { min = 0, max }, setHeightConstraints ] = useState( () => ( {} ) );\n\t// Keeps the resizable area\u2019s size constraints updated taking into account\n\t// editor notices. The constraints are also used to derive the value for the\n\t// aria-valuenow attribute on the separator.\n\tconst effectSizeConstraints = useRefEffect( ( node ) => {\n\t\tconst container = node.closest(\n\t\t\t'.interface-interface-skeleton__content'\n\t\t);\n\t\tif ( ! container ) {\n\t\t\treturn;\n\t\t}\n\t\tconst noticeLists = container.querySelectorAll(\n\t\t\t':scope > .components-notice-list'\n\t\t);\n\t\tconst resizeHandle = container.querySelector(\n\t\t\t'.edit-post-meta-boxes-main__presenter'\n\t\t);\n\t\tconst deriveConstraints = () => {\n\t\t\tconst fullHeight = container.offsetHeight;\n\t\t\tlet nextMax = fullHeight;\n\t\t\tfor ( const element of noticeLists ) {\n\t\t\t\tnextMax -= element.offsetHeight;\n\t\t\t}\n\t\t\tconst nextMin = resizeHandle.offsetHeight;\n\t\t\tsetHeightConstraints( { min: nextMin, max: nextMax } );\n\t\t};\n\t\tconst observer = new window.ResizeObserver( deriveConstraints );\n\t\tobserver.observe( container );\n\t\tfor ( const element of noticeLists ) {\n\t\t\tobserver.observe( element );\n\t\t}\n\t\treturn () => observer.disconnect();\n\t}, [] );\n\tconst metaBoxesMainRef = useRef();\n\tconst setMainRefs = useMergeRefs( [\n\t\tmetaBoxesMainRef,\n\t\teffectSizeConstraints,\n\t] );\n\n\tconst separatorRef = useRef();\n\tconst separatorHelpId = useId();\n\n\tconst heightRef = useRef();\n\n\t/**\n\t * @param {number|'auto'} [candidateHeight] Height in pixels or 'auto'.\n\t * @param {boolean} isPersistent Whether to persist the height in preferences.\n\t */\n\tconst applyHeight = ( candidateHeight = 'auto', isPersistent ) => {\n\t\tlet styleHeight;\n\t\tif ( candidateHeight === 'auto' ) {\n\t\t\tisPersistent = false; // Just in case \u2014 \u201Cauto\u201D should never persist.\n\t\t\tstyleHeight = candidateHeight;\n\t\t} else {\n\t\t\tcandidateHeight = Math.min( max, Math.max( min, candidateHeight ) );\n\t\t\theightRef.current = candidateHeight;\n\t\t\tstyleHeight = `${ candidateHeight }px`;\n\t\t}\n\t\tif ( isPersistent ) {\n\t\t\tsetPreference(\n\t\t\t\t'core/edit-post',\n\t\t\t\t'metaBoxesMainOpenHeight',\n\t\t\t\tcandidateHeight\n\t\t\t);\n\t\t}\n\t\t// Applies imperative DOM updates only when not persisting the value\n\t\t// because otherwise it's done by the subsequent render.\n\t\telse {\n\t\t\tmetaBoxesMainRef.current.style.height = styleHeight;\n\t\t\tif ( ! isShort ) {\n\t\t\t\tseparatorRef.current.ariaValueNow =\n\t\t\t\t\tgetAriaValueNow( candidateHeight );\n\t\t\t}\n\t\t}\n\t};\n\n\t// useDrag includes keyboard support with arrow keys emulating a drag.\n\t// TODO: Support more/all keyboard interactions from the window splitter pattern:\n\t// https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/\n\tconst bindDragGesture = useDrag(\n\t\t( { movement, first, last, memo, tap, args } ) => {\n\t\t\tconst pane = metaBoxesMainRef.current;\n\t\t\tconst [ , yMovement ] = movement;\n\t\t\tif ( first ) {\n\t\t\t\tpane.classList.add( 'is-resizing' );\n\t\t\t\tlet fromHeight = heightRef.current ?? pane.offsetHeight;\n\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t// Starts from max in case shortening the window has imposed it.\n\t\t\t\t\tif ( fromHeight > max ) {\n\t\t\t\t\t\tfromHeight = max;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfromHeight = min;\n\t\t\t\t}\n\t\t\t\tapplyHeight( fromHeight - yMovement );\n\t\t\t\treturn { fromHeight };\n\t\t\t}\n\n\t\t\tif ( ! first && ! last && ! tap ) {\n\t\t\t\tapplyHeight( memo.fromHeight - yMovement );\n\t\t\t\treturn memo;\n\t\t\t}\n\t\t\t// Here, `last === true` \u2013 it\u2019s the final event of the gesture.\n\n\t\t\tpane.classList.remove( 'is-resizing' );\n\t\t\tif ( tap ) {\n\t\t\t\tconst [ onTap ] = args;\n\t\t\t\tonTap?.();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst nextIsOpen = heightRef.current > min;\n\t\t\tpersistIsOpen( nextIsOpen );\n\t\t\t// Persists height only if still open. This is so that when closed by a drag the\n\t\t\t// prior height can be restored by the toggle button instead of having to drag\n\t\t\t// the pane open again.\n\t\t\tapplyHeight( heightRef.current, nextIsOpen );\n\t\t},\n\t\t{ keyboardDisplacement: 20, filterTaps: true }\n\t);\n\n\tif ( ! hasAnyVisible ) {\n\t\treturn;\n\t}\n\n\tconst contents = (\n\t\t<div\n\t\t\t// The class name 'edit-post-layout__metaboxes' is retained because some plugins use it.\n\t\t\tclassName=\"edit-post-layout__metaboxes edit-post-meta-boxes-main__liner\"\n\t\t\thidden={ ! isLegacy && ! isOpen }\n\t\t>\n\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t</div>\n\t);\n\n\tif ( isLegacy ) {\n\t\treturn contents;\n\t}\n\n\tconst isAutoHeight = openHeight === undefined;\n\tconst usedOpenHeight = isShort ? 'auto' : openHeight;\n\tconst usedHeight = isOpen ? usedOpenHeight : min;\n\n\tconst getAriaValueNow = ( height ) =>\n\t\tMath.round( ( ( height - min ) / ( max - min ) ) * 100 );\n\tconst usedAriaValueNow =\n\t\tmax === undefined || isAutoHeight ? 50 : getAriaValueNow( usedHeight );\n\n\tconst persistIsOpen = ( to = ! isOpen ) =>\n\t\tsetPreference( 'core/edit-post', 'metaBoxesMainIsOpen', to );\n\n\tconst paneLabel = __( 'Meta Boxes' );\n\n\t// The toggle button. It also resizes when the viewport is tall to provide\n\t// a larger hit area than the small separator button.\n\tconst toggle = (\n\t\t<button\n\t\t\taria-expanded={ isOpen }\n\t\t\t// Toggles for all clicks when short and only keyboard \u201Cclicks\u201D when\n\t\t\t// resizable because pointer input is handled by the drag gesture.\n\t\t\tonClick={ ( { detail } ) => {\n\t\t\t\tif ( isShort || ! detail ) {\n\t\t\t\t\tpersistIsOpen();\n\t\t\t\t}\n\t\t\t} }\n\t\t\t// Passes a toggle callback that the drag gesture handler calls when\n\t\t\t// it interprets the input as a click/tap.\n\t\t\t{ ...( ! isShort && bindDragGesture( persistIsOpen ) ) }\n\t\t>\n\t\t\t{ paneLabel }\n\t\t\t<Icon icon={ isOpen ? chevronUp : chevronDown } />\n\t\t</button>\n\t);\n\n\t// The separator button that provides a11y for resizing.\n\tconst separator = ! isShort && (\n\t\t<>\n\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t<button\n\t\t\t\t\tref={ separatorRef }\n\t\t\t\t\trole=\"separator\" // eslint-disable-line jsx-a11y/no-interactive-element-to-noninteractive-role\n\t\t\t\t\taria-valuenow={ usedAriaValueNow }\n\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\taria-describedby={ separatorHelpId }\n\t\t\t\t\t{ ...bindDragGesture() }\n\t\t\t\t/>\n\t\t\t</Tooltip>\n\t\t\t<VisuallyHidden id={ separatorHelpId }>\n\t\t\t\t{ __(\n\t\t\t\t\t'Use up and down arrow keys to resize the meta box pane.'\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n\n\treturn (\n\t\t<NavigableRegion\n\t\t\tariaLabel={ paneLabel }\n\t\t\tref={ setMainRefs }\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-post-meta-boxes-main',\n\t\t\t\t! isShort && 'is-resizable'\n\t\t\t) }\n\t\t\tstyle={ { height: usedHeight } }\n\t\t>\n\t\t\t<div className=\"edit-post-meta-boxes-main__presenter\">\n\t\t\t\t{ toggle }\n\t\t\t\t{ separator }\n\t\t\t</div>\n\t\t\t{ contents }\n\t\t</NavigableRegion>\n\t);\n}\n\nfunction Layout( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n} ) {\n\tuseEditPostCommands();\n\tconst shouldIframe = useShouldIframe();\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tcurrentPost: { postId: currentPostId, postType: currentPostType },\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useNavigateToEntityRecord(\n\t\tinitialPostId,\n\t\tinitialPostType,\n\t\t'post-only'\n\t);\n\tconst isEditingTemplate = currentPostType === 'wp_template';\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\thasResolvedMode,\n\t\thasActiveMetaboxes,\n\t\thasBlockSelected,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowMetaBoxes,\n\t\tisWelcomeGuideVisible,\n\t\ttemplateId,\n\t\tisDevicePreview,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isFeatureActive, hasMetaBoxes } = select( editPostStore );\n\t\t\tconst { canUser, getPostType, getTemplateId } = unlock(\n\t\t\t\tselect( coreStore )\n\t\t\t);\n\n\t\t\tconst supportsTemplateMode = settings.supportsTemplateMode;\n\t\t\tconst isViewable =\n\t\t\t\tgetPostType( currentPostType )?.viewable ?? false;\n\t\t\tconst canViewTemplate = canUser( 'read', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\t\t\tconst { getBlockSelectionStart, isZoomOut } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\tconst { getEditorMode, getDefaultRenderingMode, getDeviceType } =\n\t\t\t\tunlock( select( editorStore ) );\n\t\t\tconst isNotDesignPostType =\n\t\t\t\t! DESIGN_POST_TYPES.includes( currentPostType );\n\t\t\tconst isDirectlyEditingPattern =\n\t\t\t\tcurrentPostType === 'wp_block' &&\n\t\t\t\t! onNavigateToPreviousEntityRecord;\n\t\t\tconst _templateId = getTemplateId( currentPostType, currentPostId );\n\t\t\tconst defaultMode = getDefaultRenderingMode( currentPostType );\n\n\t\t\treturn {\n\t\t\t\tmode: getEditorMode(),\n\t\t\t\tisFullscreenActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\thasActiveMetaboxes: hasMetaBoxes(),\n\t\t\t\thasResolvedMode:\n\t\t\t\t\tdefaultMode === 'template-locked'\n\t\t\t\t\t\t? !! _templateId\n\t\t\t\t\t\t: defaultMode !== undefined,\n\t\t\t\thasBlockSelected: !! getBlockSelectionStart(),\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tshowMetaBoxes:\n\t\t\t\t\t( isNotDesignPostType && ! isZoomOut() ) ||\n\t\t\t\t\tisDirectlyEditingPattern,\n\t\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t\t\ttemplateId:\n\t\t\t\t\tsupportsTemplateMode &&\n\t\t\t\t\tisViewable &&\n\t\t\t\t\tcanViewTemplate &&\n\t\t\t\t\t! isEditingTemplate\n\t\t\t\t\t\t? _templateId\n\t\t\t\t\t\t: null,\n\t\t\t\tisDevicePreview: getDeviceType() !== 'Desktop',\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tcurrentPostType,\n\t\t\tcurrentPostId,\n\t\t\tisEditingTemplate,\n\t\t\tsettings.supportsTemplateMode,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t]\n\t);\n\n\tuseMetaBoxInitialization( hasActiveMetaboxes && hasResolvedMode );\n\n\t// Set the right context for the command palette\n\tconst commandContext = hasBlockSelected\n\t\t? 'block-selection-edit'\n\t\t: 'entity-edit';\n\tuseCommandContext( commandContext );\n\tconst styles = useEditorStyles( settings );\n\tconst editorSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tstyles,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t\tdefaultRenderingMode: 'post-only',\n\t\t} ),\n\t\t[\n\t\t\tsettings,\n\t\t\tstyles,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t]\n\t);\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst navigateRegionsProps = useNavigateRegions();\n\n\tconst className = clsx( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t} );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.location.href = addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\ttrashed: 1,\n\t\t\t\t\t\t\tpost_type: items[ 0 ].type,\n\t\t\t\t\t\t\tids: items[ 0 ].id,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post or template, e.g: \"Hello world\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\tdecodeEntities( title ) || __( '(no title)' )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\tconst postId = newItem.id;\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.href =\n\t\t\t\t\t\t\t\t\t\t\t\taddQueryArgs( 'post.php', {\n\t\t\t\t\t\t\t\t\t\t\t\t\tpost: postId,\n\t\t\t\t\t\t\t\t\t\t\t\t\taction: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ createSuccessNotice ]\n\t);\n\n\tconst initialPost = useMemo( () => {\n\t\treturn {\n\t\t\ttype: initialPostType,\n\t\t\tid: initialPostId,\n\t\t};\n\t}, [ initialPostType, initialPostId ] );\n\n\tconst backButton =\n\t\tuseViewportMatch( 'medium' ) && isFullscreenActive ? (\n\t\t\t<BackButton initialPost={ initialPost } />\n\t\t) : null;\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<ErrorBoundary canCopyContent>\n\t\t\t\t<WelcomeGuide postType={ currentPostType } />\n\t\t\t\t<div\n\t\t\t\t\tclassName={ navigateRegionsProps.className }\n\t\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\t>\n\t\t\t\t\t<Editor\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\tpostType={ currentPostType }\n\t\t\t\t\t\tpostId={ currentPostId }\n\t\t\t\t\t\ttemplateId={ templateId }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t\tshowMetaBoxes && <MetaBoxes location=\"side\" />\n\t\t\t\t\t\t}\n\t\t\t\t\t\textraContent={\n\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\tshowMetaBoxes && (\n\t\t\t\t\t\t\t\t<MetaBoxesMain isLegacy={ isDevicePreview } />\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostLockedModal />\n\t\t\t\t\t\t<EditorInitialization />\n\t\t\t\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t\t\t\t<BrowserURL />\n\t\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t\t<AutosaveMonitor />\n\t\t\t\t\t\t<LocalAutosaveMonitor />\n\t\t\t\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t\t<BlockKeyboardShortcuts />\n\t\t\t\t\t\t{ currentPostType === 'wp_block' && (\n\t\t\t\t\t\t\t<InitPatternModal />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t\t<PostEditorMoreMenu />\n\t\t\t\t\t\t{ backButton }\n\t\t\t\t\t\t<SnackbarNotices className=\"edit-post-layout__snackbar\" />\n\t\t\t\t\t</Editor>\n\t\t\t\t</div>\n\t\t\t</ErrorBoundary>\n\t\t</SlotFillProvider>\n\t);\n}\n\nexport default Layout;\n"],
|
|
5
|
-
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,uBAAuB;AAChC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,eAAe;AAAA,OACT;AACP,SAAS,WAAW,mBAAmB;AACvC,SAAS,SAAS,wBAAwB;AAC1C,SAAS,uBAAuB;AAChC,SAAS,kBAAkB;AAC3B,SAAS,IAAI,eAAe;AAC5B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,aAAa,iBAAiB;AACvC,SAAS,iBAAiB,SAAS,oBAAoB;AACvD,SAAS,SAAS,wBAAwB;AAC1C,SAAS,eAAe,2BAA2B;AACnD,SAAS,eAAe,+BAA+B;AACvD,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B,SAAS,SAAS,iBAAiB;AACnC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,gCAAgC;AAAA,EAChC,eAAe;AAAA,OACT;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,sBAAsB;AAK/B,OAAO,gBAAgB;AACvB,OAAO,0BAA0B;AACjC,OAAO,+BAA+B;AACtC,OAAO,sBAAsB;AAC7B,OAAO,gBAAgB;AACvB,OAAO,eAAe;AACtB,OAAO,wBAAwB;AAC/B,OAAO,kBAAkB;AACzB,SAAS,SAAS,qBAAqB;AACvC,SAAS,cAAc;AACvB,OAAO,yBAAyB;AAChC,SAAS,uBAAuB;AAChC,OAAO,+BAA+B;AACtC,SAAS,gCAAgC;
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { NavigableRegion } from '@wordpress/admin-ui';\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorKeyboardShortcutsRegister,\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { getLayoutStyles } from '@wordpress/global-styles-engine';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { chevronDown, chevronUp } from '@wordpress/icons';\nimport { SnackbarNotices, store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as commandsPrivateApis } from '@wordpress/commands';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { addQueryArgs } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tIcon,\n\tSlotFillProvider,\n\tTooltip,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport {\n\tuseMediaQuery,\n\tuseMergeRefs,\n\tuseRefEffect,\n\tuseViewportMatch,\n} from '@wordpress/compose';\nimport { VisuallyHidden } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport BackButton from '../back-button';\nimport EditorInitialization from '../editor-initialization';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport InitPatternModal from '../init-pattern-modal';\nimport BrowserURL from '../browser-url';\nimport MetaBoxes from '../meta-boxes';\nimport PostEditorMoreMenu from '../more-menu';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useEditPostCommands from '../../commands/use-commands';\nimport { useShouldIframe } from './use-should-iframe';\nimport useNavigateToEntityRecord from '../../hooks/use-navigate-to-entity-record';\nimport { useMetaBoxInitialization } from '../meta-boxes/use-meta-box-initialization';\n\nconst { useCommandContext } = unlock( commandsPrivateApis );\n/** @type {{} & {useDrag: import('@use-gesture/react').useDrag}} */\nconst { useDrag } = unlock( componentsPrivateApis );\nconst { Editor, FullscreenMode } = unlock( editorPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\nconst DESIGN_POST_TYPES = [\n\t'wp_template',\n\t'wp_template_part',\n\t'wp_block',\n\t'wp_navigation',\n];\n\nfunction useEditorStyles( settings ) {\n\tconst { hasThemeStyleSupport } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t};\n\t}, [] );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\tsettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...( settings?.defaultEditorStyles ?? [] ),\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( settings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! settings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\treturn hasThemeStyles ? settings.styles ?? [] : defaultEditorStyles;\n\t}, [\n\t\tsettings.defaultEditorStyles,\n\t\tsettings.disableLayoutStyles,\n\t\tsettings.styles,\n\t\thasThemeStyleSupport,\n\t] );\n}\n\n/**\n * @param {Object} props\n * @param {boolean} props.isLegacy True for device previews where split view is disabled.\n */\nfunction MetaBoxesMain( { isLegacy } ) {\n\tconst [ isOpen, openHeight, hasAnyVisible ] = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { isMetaBoxLocationVisible } = select( editPostStore );\n\t\treturn [\n\t\t\t!! get( 'core/edit-post', 'metaBoxesMainIsOpen' ),\n\t\t\tget( 'core/edit-post', 'metaBoxesMainOpenHeight' ),\n\t\t\tisMetaBoxLocationVisible( 'normal' ) ||\n\t\t\t\tisMetaBoxLocationVisible( 'advanced' ) ||\n\t\t\t\tisMetaBoxLocationVisible( 'side' ),\n\t\t];\n\t}, [] );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst isShort = useMediaQuery( '(max-height: 549px)' );\n\n\tconst [ { min = 0, max }, setHeightConstraints ] = useState( () => ( {} ) );\n\t// Keeps the resizable area\u2019s size constraints updated taking into account\n\t// editor notices. The constraints are also used to derive the value for the\n\t// aria-valuenow attribute on the separator.\n\tconst effectSizeConstraints = useRefEffect( ( node ) => {\n\t\tconst container = node.closest(\n\t\t\t'.interface-interface-skeleton__content'\n\t\t);\n\t\tif ( ! container ) {\n\t\t\treturn;\n\t\t}\n\t\tconst noticeLists = container.querySelectorAll(\n\t\t\t':scope > .components-notice-list'\n\t\t);\n\t\tconst resizeHandle = container.querySelector(\n\t\t\t'.edit-post-meta-boxes-main__presenter'\n\t\t);\n\t\tconst deriveConstraints = () => {\n\t\t\tconst fullHeight = container.offsetHeight;\n\t\t\tlet nextMax = fullHeight;\n\t\t\tfor ( const element of noticeLists ) {\n\t\t\t\tnextMax -= element.offsetHeight;\n\t\t\t}\n\t\t\tconst nextMin = resizeHandle.offsetHeight;\n\t\t\tsetHeightConstraints( { min: nextMin, max: nextMax } );\n\t\t};\n\t\tconst observer = new window.ResizeObserver( deriveConstraints );\n\t\tobserver.observe( container );\n\t\tfor ( const element of noticeLists ) {\n\t\t\tobserver.observe( element );\n\t\t}\n\t\treturn () => observer.disconnect();\n\t}, [] );\n\tconst metaBoxesMainRef = useRef();\n\tconst setMainRefs = useMergeRefs( [\n\t\tmetaBoxesMainRef,\n\t\teffectSizeConstraints,\n\t] );\n\n\tconst separatorRef = useRef();\n\tconst separatorHelpId = useId();\n\n\tconst heightRef = useRef();\n\n\tconst getAriaValueNow = ( height ) =>\n\t\tMath.round( ( ( height - min ) / ( max - min ) ) * 100 );\n\tconst persistIsOpen = ( to = ! isOpen ) =>\n\t\tsetPreference( 'core/edit-post', 'metaBoxesMainIsOpen', to );\n\n\t/**\n\t * @param {number|'auto'} [candidateHeight] Height in pixels or 'auto'.\n\t * @param {boolean} isPersistent Whether to persist the height in preferences.\n\t */\n\tconst applyHeight = ( candidateHeight = 'auto', isPersistent ) => {\n\t\tlet styleHeight;\n\t\tif ( candidateHeight === 'auto' ) {\n\t\t\tisPersistent = false; // Just in case \u2014 \u201Cauto\u201D should never persist.\n\t\t\tstyleHeight = candidateHeight;\n\t\t} else {\n\t\t\tcandidateHeight = Math.min( max, Math.max( min, candidateHeight ) );\n\t\t\theightRef.current = candidateHeight;\n\t\t\tstyleHeight = `${ candidateHeight }px`;\n\t\t}\n\t\tif ( isPersistent ) {\n\t\t\tsetPreference(\n\t\t\t\t'core/edit-post',\n\t\t\t\t'metaBoxesMainOpenHeight',\n\t\t\t\tcandidateHeight\n\t\t\t);\n\t\t}\n\t\t// Applies imperative DOM updates only when not persisting the value\n\t\t// because otherwise it's done by the subsequent render.\n\t\telse {\n\t\t\tmetaBoxesMainRef.current.style.height = styleHeight;\n\t\t\tif ( ! isShort ) {\n\t\t\t\tseparatorRef.current.ariaValueNow =\n\t\t\t\t\tgetAriaValueNow( candidateHeight );\n\t\t\t}\n\t\t}\n\t};\n\n\t// useDrag includes keyboard support with arrow keys emulating a drag.\n\t// TODO: Support more/all keyboard interactions from the window splitter pattern:\n\t// https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/\n\tconst bindDragGesture = useDrag(\n\t\t( { movement, first, last, memo, tap, args } ) => {\n\t\t\tconst pane = metaBoxesMainRef.current;\n\t\t\tconst [ , yMovement ] = movement;\n\t\t\tif ( first ) {\n\t\t\t\tpane.classList.add( 'is-resizing' );\n\t\t\t\tlet fromHeight = heightRef.current ?? pane.offsetHeight;\n\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t// Starts from max in case shortening the window has imposed it.\n\t\t\t\t\tif ( fromHeight > max ) {\n\t\t\t\t\t\tfromHeight = max;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfromHeight = min;\n\t\t\t\t}\n\t\t\t\tapplyHeight( fromHeight - yMovement );\n\t\t\t\treturn { fromHeight };\n\t\t\t}\n\n\t\t\tif ( ! first && ! last && ! tap ) {\n\t\t\t\tapplyHeight( memo.fromHeight - yMovement );\n\t\t\t\treturn memo;\n\t\t\t}\n\t\t\t// Here, `last === true` \u2013 it\u2019s the final event of the gesture.\n\n\t\t\tpane.classList.remove( 'is-resizing' );\n\t\t\tif ( tap ) {\n\t\t\t\tconst [ onTap ] = args;\n\t\t\t\tonTap?.();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst nextIsOpen = heightRef.current > min;\n\t\t\tpersistIsOpen( nextIsOpen );\n\t\t\t// Persists height only if still open. This is so that when closed by a drag the\n\t\t\t// prior height can be restored by the toggle button instead of having to drag\n\t\t\t// the pane open again.\n\t\t\tapplyHeight( heightRef.current, nextIsOpen );\n\t\t},\n\t\t{ keyboardDisplacement: 20, filterTaps: true }\n\t);\n\n\tif ( ! hasAnyVisible ) {\n\t\treturn;\n\t}\n\n\tconst contents = (\n\t\t<div\n\t\t\t// The class name 'edit-post-layout__metaboxes' is retained because some plugins use it.\n\t\t\tclassName=\"edit-post-layout__metaboxes edit-post-meta-boxes-main__liner\"\n\t\t\thidden={ ! isLegacy && ! isOpen }\n\t\t>\n\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t</div>\n\t);\n\n\tif ( isLegacy ) {\n\t\treturn contents;\n\t}\n\n\tconst isAutoHeight = openHeight === undefined;\n\tconst usedOpenHeight = isShort ? 'auto' : openHeight;\n\tconst usedHeight = isOpen ? usedOpenHeight : min;\n\n\tconst usedAriaValueNow =\n\t\tmax === undefined || isAutoHeight ? 50 : getAriaValueNow( usedHeight );\n\n\tconst paneLabel = __( 'Meta Boxes' );\n\n\t// The toggle button. It also resizes when the viewport is tall to provide\n\t// a larger hit area than the small separator button.\n\tconst toggle = (\n\t\t<button\n\t\t\taria-expanded={ isOpen }\n\t\t\t// Toggles for all clicks when short and only keyboard \u201Cclicks\u201D when\n\t\t\t// resizable because pointer input is handled by the drag gesture.\n\t\t\tonClick={ ( { detail } ) => {\n\t\t\t\tif ( isShort || ! detail ) {\n\t\t\t\t\tpersistIsOpen();\n\t\t\t\t}\n\t\t\t} }\n\t\t\t// Passes a toggle callback that the drag gesture handler calls when\n\t\t\t// it interprets the input as a click/tap.\n\t\t\t{ ...( ! isShort && bindDragGesture( persistIsOpen ) ) }\n\t\t>\n\t\t\t{ paneLabel }\n\t\t\t<Icon icon={ isOpen ? chevronUp : chevronDown } />\n\t\t</button>\n\t);\n\n\t// The separator button that provides a11y for resizing.\n\tconst separator = ! isShort && (\n\t\t<>\n\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t<button\n\t\t\t\t\tref={ separatorRef }\n\t\t\t\t\trole=\"separator\" // eslint-disable-line jsx-a11y/no-interactive-element-to-noninteractive-role\n\t\t\t\t\taria-valuenow={ usedAriaValueNow }\n\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\taria-describedby={ separatorHelpId }\n\t\t\t\t\t{ ...bindDragGesture() }\n\t\t\t\t/>\n\t\t\t</Tooltip>\n\t\t\t<VisuallyHidden id={ separatorHelpId }>\n\t\t\t\t{ __(\n\t\t\t\t\t'Use up and down arrow keys to resize the meta box pane.'\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n\n\treturn (\n\t\t<NavigableRegion\n\t\t\tariaLabel={ paneLabel }\n\t\t\tref={ setMainRefs }\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-post-meta-boxes-main',\n\t\t\t\t! isShort && 'is-resizable'\n\t\t\t) }\n\t\t\tstyle={ { height: usedHeight } }\n\t\t>\n\t\t\t<div className=\"edit-post-meta-boxes-main__presenter\">\n\t\t\t\t{ toggle }\n\t\t\t\t{ separator }\n\t\t\t</div>\n\t\t\t{ contents }\n\t\t</NavigableRegion>\n\t);\n}\n\nfunction Layout( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n} ) {\n\tuseEditPostCommands();\n\tconst shouldIframe = useShouldIframe();\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tcurrentPost: { postId: currentPostId, postType: currentPostType },\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useNavigateToEntityRecord(\n\t\tinitialPostId,\n\t\tinitialPostType,\n\t\t'post-only'\n\t);\n\tconst isEditingTemplate = currentPostType === 'wp_template';\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\thasResolvedMode,\n\t\thasActiveMetaboxes,\n\t\thasBlockSelected,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowMetaBoxes,\n\t\tisWelcomeGuideVisible,\n\t\ttemplateId,\n\t\tisDevicePreview,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isFeatureActive, hasMetaBoxes } = select( editPostStore );\n\t\t\tconst { canUser, getPostType, getTemplateId } = unlock(\n\t\t\t\tselect( coreStore )\n\t\t\t);\n\n\t\t\tconst supportsTemplateMode = settings.supportsTemplateMode;\n\t\t\tconst isViewable =\n\t\t\t\tgetPostType( currentPostType )?.viewable ?? false;\n\t\t\tconst canViewTemplate = canUser( 'read', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\t\t\tconst { getBlockSelectionStart, isZoomOut } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\tconst { getEditorMode, getDefaultRenderingMode, getDeviceType } =\n\t\t\t\tunlock( select( editorStore ) );\n\t\t\tconst isNotDesignPostType =\n\t\t\t\t! DESIGN_POST_TYPES.includes( currentPostType );\n\t\t\tconst isDirectlyEditingPattern =\n\t\t\t\tcurrentPostType === 'wp_block' &&\n\t\t\t\t! onNavigateToPreviousEntityRecord;\n\t\t\tconst _templateId = getTemplateId( currentPostType, currentPostId );\n\t\t\tconst defaultMode = getDefaultRenderingMode( currentPostType );\n\n\t\t\treturn {\n\t\t\t\tmode: getEditorMode(),\n\t\t\t\tisFullscreenActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\thasActiveMetaboxes: hasMetaBoxes(),\n\t\t\t\thasResolvedMode:\n\t\t\t\t\tdefaultMode === 'template-locked'\n\t\t\t\t\t\t? !! _templateId\n\t\t\t\t\t\t: defaultMode !== undefined,\n\t\t\t\thasBlockSelected: !! getBlockSelectionStart(),\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tshowMetaBoxes:\n\t\t\t\t\t( isNotDesignPostType && ! isZoomOut() ) ||\n\t\t\t\t\tisDirectlyEditingPattern,\n\t\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t\t\ttemplateId:\n\t\t\t\t\tsupportsTemplateMode &&\n\t\t\t\t\tisViewable &&\n\t\t\t\t\tcanViewTemplate &&\n\t\t\t\t\t! isEditingTemplate\n\t\t\t\t\t\t? _templateId\n\t\t\t\t\t\t: null,\n\t\t\t\tisDevicePreview: getDeviceType() !== 'Desktop',\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tcurrentPostType,\n\t\t\tcurrentPostId,\n\t\t\tisEditingTemplate,\n\t\t\tsettings.supportsTemplateMode,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t]\n\t);\n\n\tuseMetaBoxInitialization( hasActiveMetaboxes && hasResolvedMode );\n\n\t// Set the right context for the command palette\n\tconst commandContext = hasBlockSelected\n\t\t? 'block-selection-edit'\n\t\t: 'entity-edit';\n\tuseCommandContext( commandContext );\n\tconst styles = useEditorStyles( settings );\n\tconst editorSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tstyles,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t} ),\n\t\t[\n\t\t\tsettings,\n\t\t\tstyles,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t]\n\t);\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst navigateRegionsProps = useNavigateRegions();\n\n\tconst className = clsx( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t} );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.location.href = addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\ttrashed: 1,\n\t\t\t\t\t\t\tpost_type: items[ 0 ].type,\n\t\t\t\t\t\t\tids: items[ 0 ].id,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post or template, e.g: \"Hello world\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\tdecodeEntities( title ) || __( '(no title)' )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\tconst postId = newItem.id;\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.href =\n\t\t\t\t\t\t\t\t\t\t\t\taddQueryArgs( 'post.php', {\n\t\t\t\t\t\t\t\t\t\t\t\t\tpost: postId,\n\t\t\t\t\t\t\t\t\t\t\t\t\taction: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ createSuccessNotice ]\n\t);\n\n\tconst initialPost = useMemo( () => {\n\t\treturn {\n\t\t\ttype: initialPostType,\n\t\t\tid: initialPostId,\n\t\t};\n\t}, [ initialPostType, initialPostId ] );\n\n\tconst backButton =\n\t\tuseViewportMatch( 'medium' ) && isFullscreenActive ? (\n\t\t\t<BackButton initialPost={ initialPost } />\n\t\t) : null;\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<ErrorBoundary canCopyContent>\n\t\t\t\t<WelcomeGuide postType={ currentPostType } />\n\t\t\t\t<div { ...navigateRegionsProps }>\n\t\t\t\t\t<Editor\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\tpostType={ currentPostType }\n\t\t\t\t\t\tpostId={ currentPostId }\n\t\t\t\t\t\ttemplateId={ templateId }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t\tshowMetaBoxes && <MetaBoxes location=\"side\" />\n\t\t\t\t\t\t}\n\t\t\t\t\t\textraContent={\n\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\tshowMetaBoxes && (\n\t\t\t\t\t\t\t\t<MetaBoxesMain isLegacy={ isDevicePreview } />\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostLockedModal />\n\t\t\t\t\t\t<EditorInitialization />\n\t\t\t\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t\t\t\t<BrowserURL />\n\t\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t\t<AutosaveMonitor />\n\t\t\t\t\t\t<LocalAutosaveMonitor />\n\t\t\t\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t\t<BlockKeyboardShortcuts />\n\t\t\t\t\t\t{ currentPostType === 'wp_block' && (\n\t\t\t\t\t\t\t<InitPatternModal />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t\t<PostEditorMoreMenu />\n\t\t\t\t\t\t{ backButton }\n\t\t\t\t\t\t<SnackbarNotices className=\"edit-post-layout__snackbar\" />\n\t\t\t\t\t</Editor>\n\t\t\t\t</div>\n\t\t\t</ErrorBoundary>\n\t\t</SlotFillProvider>\n\t);\n}\n\nexport default Layout;\n"],
|
|
5
|
+
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,uBAAuB;AAChC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,eAAe;AAAA,OACT;AACP,SAAS,WAAW,mBAAmB;AACvC,SAAS,SAAS,wBA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,QACA,oBACC,iBAAiB,oBAAC,aAAU,UAAS,QAAO;AAAA,QAE7C,cACC,CAAE,qBACF,iBACC,oBAAC,iBAAc,UAAW,iBAAkB;AAAA,QAI9C;AAAA,8BAAC,mBAAgB;AAAA,UACjB,oBAAC,wBAAqB;AAAA,UACtB,oBAAC,kBAAe,UAAW,oBAAqB;AAAA,UAChD,oBAAC,cAAW;AAAA,UACZ,oBAAC,yBAAsB;AAAA,UACvB,oBAAC,mBAAgB;AAAA,UACjB,oBAAC,wBAAqB;AAAA,UACtB,oBAAC,6BAA0B;AAAA,UAC3B,oBAAC,mCAAgC;AAAA,UACjC,oBAAC,0BAAuB;AAAA,UACtB,oBAAoB,cACrB,oBAAC,oBAAiB;AAAA,UAEnB,oBAAC,cAAW,SAAU,mBAAoB;AAAA,UAC1C,oBAAC,sBAAmB;AAAA,UAClB;AAAA,UACF,oBAAC,mBAAgB,WAAU,8BAA6B;AAAA;AAAA;AAAA,IACzD,GACD;AAAA,KACD,GACD;AAEF;AAEA,IAAO,iBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-post",
|
|
3
|
-
"version": "8.45.0",
|
|
3
|
+
"version": "8.45.1-next.v.202605131006.0+2a3d07cab",
|
|
4
4
|
"description": "Edit Post module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -48,38 +48,38 @@
|
|
|
48
48
|
"postbox"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@wordpress/a11y": "^4.45.0",
|
|
52
|
-
"@wordpress/admin-ui": "^2.0.0",
|
|
53
|
-
"@wordpress/api-fetch": "^7.45.0",
|
|
54
|
-
"@wordpress/base-styles": "^
|
|
55
|
-
"@wordpress/block-editor": "^15.
|
|
56
|
-
"@wordpress/block-library": "^9.45.0",
|
|
57
|
-
"@wordpress/blocks": "^15.18.0",
|
|
58
|
-
"@wordpress/commands": "^1.45.0",
|
|
59
|
-
"@wordpress/components": "^33.
|
|
60
|
-
"@wordpress/compose": "^7.45.0",
|
|
61
|
-
"@wordpress/core-data": "^7.45.0",
|
|
62
|
-
"@wordpress/data": "^10.45.0",
|
|
63
|
-
"@wordpress/deprecated": "^4.45.0",
|
|
64
|
-
"@wordpress/dom": "^4.45.0",
|
|
65
|
-
"@wordpress/editor": "^14.45.0",
|
|
66
|
-
"@wordpress/element": "^6.45.0",
|
|
67
|
-
"@wordpress/global-styles-engine": "^1.12.0",
|
|
68
|
-
"@wordpress/hooks": "^4.45.0",
|
|
69
|
-
"@wordpress/html-entities": "^4.45.0",
|
|
70
|
-
"@wordpress/i18n": "^6.18.0",
|
|
71
|
-
"@wordpress/icons": "^13.0.0",
|
|
72
|
-
"@wordpress/keyboard-shortcuts": "^5.45.0",
|
|
73
|
-
"@wordpress/keycodes": "^4.45.0",
|
|
74
|
-
"@wordpress/notices": "^5.45.0",
|
|
75
|
-
"@wordpress/plugins": "^7.45.0",
|
|
76
|
-
"@wordpress/preferences": "^4.45.0",
|
|
77
|
-
"@wordpress/private-apis": "^1.45.0",
|
|
78
|
-
"@wordpress/ui": "^0.
|
|
79
|
-
"@wordpress/url": "^4.45.0",
|
|
80
|
-
"@wordpress/viewport": "^6.45.0",
|
|
81
|
-
"@wordpress/warning": "^3.45.0",
|
|
82
|
-
"@wordpress/widgets": "^4.45.0",
|
|
51
|
+
"@wordpress/a11y": "^4.45.1-next.v.202605131006.0+2a3d07cab",
|
|
52
|
+
"@wordpress/admin-ui": "^2.0.2-next.v.202605131006.0+2a3d07cab",
|
|
53
|
+
"@wordpress/api-fetch": "^7.45.1-next.v.202605131006.0+2a3d07cab",
|
|
54
|
+
"@wordpress/base-styles": "^8.0.1-next.v.202605131006.0+2a3d07cab",
|
|
55
|
+
"@wordpress/block-editor": "^15.19.1-next.v.202605131006.0+2a3d07cab",
|
|
56
|
+
"@wordpress/block-library": "^9.45.1-next.v.202605131006.0+2a3d07cab",
|
|
57
|
+
"@wordpress/blocks": "^15.18.1-next.v.202605131006.0+2a3d07cab",
|
|
58
|
+
"@wordpress/commands": "^1.45.1-next.v.202605131006.0+2a3d07cab",
|
|
59
|
+
"@wordpress/components": "^33.1.1-next.v.202605131006.0+2a3d07cab",
|
|
60
|
+
"@wordpress/compose": "^7.45.1-next.v.202605131006.0+2a3d07cab",
|
|
61
|
+
"@wordpress/core-data": "^7.45.1-next.v.202605131006.0+2a3d07cab",
|
|
62
|
+
"@wordpress/data": "^10.45.1-next.v.202605131006.0+2a3d07cab",
|
|
63
|
+
"@wordpress/deprecated": "^4.45.1-next.v.202605131006.0+2a3d07cab",
|
|
64
|
+
"@wordpress/dom": "^4.45.1-next.v.202605131006.0+2a3d07cab",
|
|
65
|
+
"@wordpress/editor": "^14.45.2-next.v.202605131006.0+2a3d07cab",
|
|
66
|
+
"@wordpress/element": "^6.45.1-next.v.202605131006.0+2a3d07cab",
|
|
67
|
+
"@wordpress/global-styles-engine": "^1.12.1-next.v.202605131006.0+2a3d07cab",
|
|
68
|
+
"@wordpress/hooks": "^4.45.1-next.v.202605131006.0+2a3d07cab",
|
|
69
|
+
"@wordpress/html-entities": "^4.45.1-next.v.202605131006.0+2a3d07cab",
|
|
70
|
+
"@wordpress/i18n": "^6.18.1-next.v.202605131006.0+2a3d07cab",
|
|
71
|
+
"@wordpress/icons": "^13.0.1-next.v.202605131006.0+2a3d07cab",
|
|
72
|
+
"@wordpress/keyboard-shortcuts": "^5.45.1-next.v.202605131006.0+2a3d07cab",
|
|
73
|
+
"@wordpress/keycodes": "^4.45.1-next.v.202605131006.0+2a3d07cab",
|
|
74
|
+
"@wordpress/notices": "^5.45.1-next.v.202605131006.0+2a3d07cab",
|
|
75
|
+
"@wordpress/plugins": "^7.45.1-next.v.202605131006.0+2a3d07cab",
|
|
76
|
+
"@wordpress/preferences": "^4.45.1-next.v.202605131006.0+2a3d07cab",
|
|
77
|
+
"@wordpress/private-apis": "^1.45.1-next.v.202605131006.0+2a3d07cab",
|
|
78
|
+
"@wordpress/ui": "^0.13.1-next.v.202605131006.0+2a3d07cab",
|
|
79
|
+
"@wordpress/url": "^4.45.1-next.v.202605131006.0+2a3d07cab",
|
|
80
|
+
"@wordpress/viewport": "^6.45.1-next.v.202605131006.0+2a3d07cab",
|
|
81
|
+
"@wordpress/warning": "^3.45.1-next.v.202605131006.0+2a3d07cab",
|
|
82
|
+
"@wordpress/widgets": "^4.45.1-next.v.202605131006.0+2a3d07cab",
|
|
83
83
|
"clsx": "^2.1.1",
|
|
84
84
|
"memize": "^2.1.0"
|
|
85
85
|
},
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"publishConfig": {
|
|
91
91
|
"access": "public"
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "8804fa29bc78a1d98e5a4d40c3e180ddd907016c"
|
|
94
94
|
}
|
|
@@ -195,6 +195,11 @@ function MetaBoxesMain( { isLegacy } ) {
|
|
|
195
195
|
|
|
196
196
|
const heightRef = useRef();
|
|
197
197
|
|
|
198
|
+
const getAriaValueNow = ( height ) =>
|
|
199
|
+
Math.round( ( ( height - min ) / ( max - min ) ) * 100 );
|
|
200
|
+
const persistIsOpen = ( to = ! isOpen ) =>
|
|
201
|
+
setPreference( 'core/edit-post', 'metaBoxesMainIsOpen', to );
|
|
202
|
+
|
|
198
203
|
/**
|
|
199
204
|
* @param {number|'auto'} [candidateHeight] Height in pixels or 'auto'.
|
|
200
205
|
* @param {boolean} isPersistent Whether to persist the height in preferences.
|
|
@@ -294,14 +299,9 @@ function MetaBoxesMain( { isLegacy } ) {
|
|
|
294
299
|
const usedOpenHeight = isShort ? 'auto' : openHeight;
|
|
295
300
|
const usedHeight = isOpen ? usedOpenHeight : min;
|
|
296
301
|
|
|
297
|
-
const getAriaValueNow = ( height ) =>
|
|
298
|
-
Math.round( ( ( height - min ) / ( max - min ) ) * 100 );
|
|
299
302
|
const usedAriaValueNow =
|
|
300
303
|
max === undefined || isAutoHeight ? 50 : getAriaValueNow( usedHeight );
|
|
301
304
|
|
|
302
|
-
const persistIsOpen = ( to = ! isOpen ) =>
|
|
303
|
-
setPreference( 'core/edit-post', 'metaBoxesMainIsOpen', to );
|
|
304
|
-
|
|
305
305
|
const paneLabel = __( 'Meta Boxes' );
|
|
306
306
|
|
|
307
307
|
// The toggle button. It also resizes when the viewport is tall to provide
|
|
@@ -472,7 +472,6 @@ function Layout( {
|
|
|
472
472
|
styles,
|
|
473
473
|
onNavigateToEntityRecord,
|
|
474
474
|
onNavigateToPreviousEntityRecord,
|
|
475
|
-
defaultRenderingMode: 'post-only',
|
|
476
475
|
} ),
|
|
477
476
|
[
|
|
478
477
|
settings,
|
|
@@ -575,11 +574,7 @@ function Layout( {
|
|
|
575
574
|
<SlotFillProvider>
|
|
576
575
|
<ErrorBoundary canCopyContent>
|
|
577
576
|
<WelcomeGuide postType={ currentPostType } />
|
|
578
|
-
<div
|
|
579
|
-
className={ navigateRegionsProps.className }
|
|
580
|
-
{ ...navigateRegionsProps }
|
|
581
|
-
ref={ navigateRegionsProps.ref }
|
|
582
|
-
>
|
|
577
|
+
<div { ...navigateRegionsProps }>
|
|
583
578
|
<Editor
|
|
584
579
|
settings={ editorSettings }
|
|
585
580
|
initialEdits={ initialEdits }
|