@wordpress/edit-post 8.8.18 → 8.8.20
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.
- package/build/components/layout/index.js +13 -5
- package/build/components/layout/index.js.map +1 -1
- package/build/components/meta-boxes/index.js +1 -34
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/use-meta-box-initialization.js +38 -0
- package/build/components/meta-boxes/use-meta-box-initialization.js.map +1 -0
- package/build-module/components/layout/index.js +13 -5
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/meta-boxes/index.js +2 -35
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/meta-boxes/use-meta-box-initialization.js +31 -0
- package/build-module/components/meta-boxes/use-meta-box-initialization.js.map +1 -0
- package/build-style/style-rtl.css +4 -2
- package/build-style/style.css +4 -2
- package/package.json +18 -18
- package/src/components/layout/index.js +11 -3
- package/src/components/layout/style.scss +8 -5
- package/src/components/meta-boxes/index.js +4 -33
- package/src/components/meta-boxes/use-meta-box-initialization.js +32 -0
|
@@ -37,6 +37,7 @@ var _useCommands = _interopRequireDefault(require("../../commands/use-commands")
|
|
|
37
37
|
var _usePaddingAppender = require("./use-padding-appender");
|
|
38
38
|
var _useShouldIframe = require("./use-should-iframe");
|
|
39
39
|
var _useNavigateToEntityRecord = _interopRequireDefault(require("../../hooks/use-navigate-to-entity-record"));
|
|
40
|
+
var _useMetaBoxInitialization = require("../meta-boxes/use-meta-box-initialization");
|
|
40
41
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
41
42
|
/**
|
|
42
43
|
* External dependencies
|
|
@@ -362,7 +363,8 @@ function Layout({
|
|
|
362
363
|
showMetaBoxes,
|
|
363
364
|
hasHistory,
|
|
364
365
|
isWelcomeGuideVisible,
|
|
365
|
-
templateId
|
|
366
|
+
templateId,
|
|
367
|
+
isDevicePreview
|
|
366
368
|
} = (0, _data.useSelect)(select => {
|
|
367
369
|
var _getPostType$viewable;
|
|
368
370
|
const {
|
|
@@ -376,6 +378,10 @@ function Layout({
|
|
|
376
378
|
canUser,
|
|
377
379
|
getPostType
|
|
378
380
|
} = select(_coreData.store);
|
|
381
|
+
const {
|
|
382
|
+
getDeviceType,
|
|
383
|
+
getEditorMode
|
|
384
|
+
} = select(_editor.store);
|
|
379
385
|
const {
|
|
380
386
|
__unstableGetEditorMode
|
|
381
387
|
} = (0, _lockUnlock.unlock)(select(_blockEditor.store));
|
|
@@ -387,17 +393,19 @@ function Layout({
|
|
|
387
393
|
});
|
|
388
394
|
const isZoomOut = __unstableGetEditorMode() === 'zoom-out';
|
|
389
395
|
return {
|
|
390
|
-
mode:
|
|
396
|
+
mode: getEditorMode(),
|
|
391
397
|
isFullscreenActive: select(_store.store).isFeatureActive('fullscreenMode'),
|
|
392
398
|
hasActiveMetaboxes: select(_store.store).hasMetaBoxes(),
|
|
393
399
|
hasBlockSelected: !!select(_blockEditor.store).getBlockSelectionStart(),
|
|
394
400
|
showIconLabels: get('core', 'showIconLabels'),
|
|
395
401
|
isDistractionFree: get('core', 'distractionFree'),
|
|
396
|
-
showMetaBoxes: !DESIGN_POST_TYPES.includes(currentPostType) &&
|
|
402
|
+
showMetaBoxes: !DESIGN_POST_TYPES.includes(currentPostType) && !isZoomOut,
|
|
397
403
|
isWelcomeGuideVisible: isFeatureActive('welcomeGuide'),
|
|
398
|
-
templateId: supportsTemplateMode && isViewable && canViewTemplate && !isEditingTemplate ? getEditedPostTemplateId() : null
|
|
404
|
+
templateId: supportsTemplateMode && isViewable && canViewTemplate && !isEditingTemplate ? getEditedPostTemplateId() : null,
|
|
405
|
+
isDevicePreview: getDeviceType() !== 'Desktop'
|
|
399
406
|
};
|
|
400
407
|
}, [currentPostType, isEditingTemplate, settings.supportsTemplateMode]);
|
|
408
|
+
(0, _useMetaBoxInitialization.useMetaBoxInitialization)(hasActiveMetaboxes);
|
|
401
409
|
|
|
402
410
|
// Set the right context for the command palette
|
|
403
411
|
const commandContext = hasBlockSelected ? 'block-selection-edit' : 'entity-edit';
|
|
@@ -499,7 +507,7 @@ function Layout({
|
|
|
499
507
|
location: "side"
|
|
500
508
|
}),
|
|
501
509
|
extraContent: !isDistractionFree && showMetaBoxes && /*#__PURE__*/(0, _jsxRuntime.jsx)(MetaBoxesMain, {
|
|
502
|
-
isLegacy: !shouldIframe
|
|
510
|
+
isLegacy: !shouldIframe || isDevicePreview
|
|
503
511
|
}),
|
|
504
512
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.PostLockedModal, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_editorInitialization.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(FullscreenMode, {
|
|
505
513
|
isActive: isFullscreenActive
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_editor","_data","_blockEditor","_plugins","_i18n","_element","_icons","_notices","_preferences","_commands","_coreCommands","_blockLibrary","_url","_htmlEntities","_coreData","_components","_compose","_backButton","_editorInitialization","_keyboardShortcuts","_initPatternModal","_browserUrl","_metaBoxes","_moreMenu","_welcomeGuide","_store","_lockUnlock","_useCommands","_usePaddingAppender","_useShouldIframe","_useNavigateToEntityRecord","_jsxRuntime","getLayoutStyles","unlock","blockEditorPrivateApis","useCommands","coreCommandsPrivateApis","useCommandContext","commandsPrivateApis","Editor","FullscreenMode","NavigableRegion","editorPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","DESIGN_POST_TYPES","useEditorStyles","hasThemeStyleSupport","editorSettings","isZoomedOutView","renderingMode","postType","useSelect","select","__unstableGetEditorMode","blockEditorStore","getCurrentPostType","getRenderingMode","editorStore","_postType","editPostStore","isFeatureActive","getEditorSettings","useMemo","_editorSettings$style","_editorSettings$defau","_editorSettings$style2","_editorSettings$style3","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","baseStyles","includes","MetaBoxesMain","isLegacy","isOpen","openHeight","hasAnyVisible","get","preferencesStore","isMetaBoxLocationVisible","set","setPreference","useDispatch","metaBoxesMainRef","useRef","isShort","useMediaQuery","min","max","setHeightConstraints","useState","effectSizeConstraints","useRefEffect","node","container","closest","noticeLists","querySelectorAll","resizeHandle","querySelector","deriveConstraints","fullHeight","offsetHeight","nextMax","element","nextMin","observer","window","ResizeObserver","observe","disconnect","separatorRef","separatorHelpId","useId","isUntouched","setIsUntouched","applyHeight","candidateHeight","isPersistent","isInstant","nextHeight","Math","current","ariaValueNow","getAriaValueNow","updateSize","height","width","contents","jsxs","className","clsx","hidden","children","jsx","default","location","isAutoHeight","undefined","usedMax","round","usedAriaValueNow","toggle","onSeparatorKeyDown","event","delta","ArrowUp","ArrowDown","key","pane","resizable","fromHeight","preventDefault","paneLabel","__","Pane","paneProps","ResizableBox","as","ref","defaultSize","minHeight","maxHeight","enable","top","right","bottom","left","topLeft","topRight","bottomRight","bottomLeft","handleClasses","handleComponent","Fragment","Tooltip","text","role","onKeyDown","VisuallyHidden","id","onPointerDown","pointerId","target","setPointerCapture","onResizeStart","direction","elementRef","onResize","state","onResizeStop","onClick","Icon","icon","chevronUp","chevronDown","Layout","postId","initialPostId","initialPostType","settings","initialEdits","useEditPostCommands","paddingAppenderRef","usePaddingAppender","shouldIframe","useShouldIframe","createErrorNotice","noticesStore","currentPost","currentPostId","currentPostType","onNavigateToEntityRecord","onNavigateToPreviousEntityRecord","useNavigateToEntityRecord","isEditingTemplate","mode","isFullscreenActive","hasActiveMetaboxes","hasBlockSelected","showIconLabels","isDistractionFree","showMetaBoxes","hasHistory","isWelcomeGuideVisible","templateId","_getPostType$viewable","getEditedPostTemplateId","canUser","getPostType","coreStore","supportsTemplateMode","isViewable","viewable","canViewTemplate","kind","name","isZoomOut","getEditorMode","hasMetaBoxes","getBlockSelectionStart","commandContext","defaultRenderingMode","document","body","classList","add","remove","navigateRegionsProps","useNavigateRegions","onPluginAreaError","sprintf","createSuccessNotice","onActionPerformed","useCallback","actionId","items","href","addQueryArgs","trashed","post_type","type","ids","newItem","title","rendered","decodeEntities","actions","label","post","action","initialPost","backButton","useViewportMatch","SlotFillProvider","ErrorBoundary","CommandMenu","forceIsDirty","contentRef","disableIframe","autoFocus","extraSidebarPanels","extraContent","PostLockedModal","isActive","UnsavedChangesWarning","AutosaveMonitor","LocalAutosaveMonitor","EditorKeyboardShortcutsRegister","PluginArea","onError","EditorSnackbars","_default","exports"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorKeyboardShortcutsRegister,\n\tEditorSnackbars,\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\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 { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tCommandMenu,\n\tprivateApis as commandsPrivateApis,\n} from '@wordpress/commands';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-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\tResizableBox,\n\tSlotFillProvider,\n\tTooltip,\n\tVisuallyHidden,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n} from '@wordpress/components';\nimport {\n\tuseMediaQuery,\n\tuseRefEffect,\n\tuseViewportMatch,\n} from '@wordpress/compose';\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 { usePaddingAppender } from './use-padding-appender';\nimport { useShouldIframe } from './use-should-iframe';\nimport useNavigateToEntityRecord from '../../hooks/use-navigate-to-entity-record';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { Editor, FullscreenMode, NavigableRegion } = 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() {\n\tconst {\n\t\thasThemeStyleSupport,\n\t\teditorSettings,\n\t\tisZoomedOutView,\n\t\trenderingMode,\n\t\tpostType,\n\t} = useSelect( ( select ) => {\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getCurrentPostType, getRenderingMode } = select( editorStore );\n\t\tconst _postType = getCurrentPostType();\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t\tisZoomedOutView: __unstableGetEditorMode() === 'zoom-out',\n\t\t\trenderingMode: getRenderingMode(),\n\t\t\tpostType: _postType,\n\t\t};\n\t}, [] );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.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...( editorSettings?.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 !== ( editorSettings.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 ( ! editorSettings.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\tconst baseStyles = hasThemeStyles\n\t\t\t? editorSettings.styles ?? []\n\t\t\t: defaultEditorStyles;\n\n\t\t// Add a space for the typewriter effect. When typing in the last block,\n\t\t// there needs to be room to scroll up.\n\t\tif (\n\t\t\t! isZoomedOutView &&\n\t\t\trenderingMode === 'post-only' &&\n\t\t\t! DESIGN_POST_TYPES.includes( postType )\n\t\t) {\n\t\t\treturn [\n\t\t\t\t...baseStyles,\n\t\t\t\t{\n\t\t\t\t\tcss: ':root :where(.editor-styles-wrapper)::after {content: \"\"; display: block; height: 40vh;}',\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\treturn baseStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t\tpostType,\n\t] );\n}\n\n/**\n * @param {Object} props\n * @param {boolean} props.isLegacy True when the editor canvas is not in an iframe.\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\tget( '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\tconst metaBoxesMainRef = useRef();\n\tconst isShort = useMediaQuery( '(max-height: 549px)' );\n\n\tconst [ { min, max }, setHeightConstraints ] = useState( () => ( {} ) );\n\t// Keeps the resizable area’s 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 seperator.\n\tconst effectSizeConstraints = useRefEffect( ( node ) => {\n\t\tconst container = node.closest(\n\t\t\t'.interface-interface-skeleton__content'\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\n\tconst separatorRef = useRef();\n\tconst separatorHelpId = useId();\n\n\tconst [ isUntouched, setIsUntouched ] = useState( true );\n\tconst applyHeight = ( candidateHeight, isPersistent, isInstant ) => {\n\t\tconst nextHeight = Math.min( max, Math.max( min, candidateHeight ) );\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\tnextHeight\n\t\t\t);\n\t\t} else {\n\t\t\tseparatorRef.current.ariaValueNow = getAriaValueNow( nextHeight );\n\t\t}\n\t\tif ( isInstant ) {\n\t\t\tmetaBoxesMainRef.current.updateSize( {\n\t\t\t\theight: nextHeight,\n\t\t\t\t// Oddly, when the event that triggered this was not from the mouse (e.g. keydown),\n\t\t\t\t// if `width` is left unspecified a subsequent drag gesture applies a fixed\n\t\t\t\t// width and the pane fails to widen/narrow with parent width changes from\n\t\t\t\t// sidebars opening/closing or window resizes.\n\t\t\t\twidth: 'auto',\n\t\t\t} );\n\t\t}\n\t};\n\n\tif ( ! hasAnyVisible ) {\n\t\treturn;\n\t}\n\n\tconst contents = (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t// The class name 'edit-post-layout__metaboxes' is retained because some plugins use it.\n\t\t\t\t'edit-post-layout__metaboxes',\n\t\t\t\t! isLegacy && 'edit-post-meta-boxes-main__liner'\n\t\t\t) }\n\t\t\thidden={ ! isLegacy && isShort && ! 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\tlet usedMax = '50%'; // Approximation before max has a value.\n\tif ( max !== undefined ) {\n\t\t// Halves the available max height until a user height is set.\n\t\tusedMax = isAutoHeight && isUntouched ? max / 2 : max;\n\t}\n\n\tconst getAriaValueNow = ( height ) =>\n\t\tMath.round( ( ( height - min ) / ( max - min ) ) * 100 );\n\tconst usedAriaValueNow =\n\t\tmax === undefined || isAutoHeight ? 50 : getAriaValueNow( openHeight );\n\n\tconst toggle = () =>\n\t\tsetPreference( 'core/edit-post', 'metaBoxesMainIsOpen', ! isOpen );\n\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 onSeparatorKeyDown = ( event ) => {\n\t\tconst delta = { ArrowUp: 20, ArrowDown: -20 }[ event.key ];\n\t\tif ( delta ) {\n\t\t\tconst pane = metaBoxesMainRef.current.resizable;\n\t\t\tconst fromHeight = isAutoHeight ? pane.offsetHeight : openHeight;\n\t\t\tconst nextHeight = delta + fromHeight;\n\t\t\tapplyHeight( nextHeight, true, true );\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\tconst className = 'edit-post-meta-boxes-main';\n\tconst paneLabel = __( 'Meta Boxes' );\n\tlet Pane, paneProps;\n\tif ( isShort ) {\n\t\tPane = NavigableRegion;\n\t\tpaneProps = {\n\t\t\tclassName: clsx( className, 'is-toggle-only' ),\n\t\t};\n\t} else {\n\t\tPane = ResizableBox;\n\t\tpaneProps = /** @type {Parameters<typeof ResizableBox>[0]} */ ( {\n\t\t\tas: NavigableRegion,\n\t\t\tref: metaBoxesMainRef,\n\t\t\tclassName: clsx( className, 'is-resizable' ),\n\t\t\tdefaultSize: { height: openHeight },\n\t\t\tminHeight: min,\n\t\t\tmaxHeight: usedMax,\n\t\t\tenable: {\n\t\t\t\ttop: true,\n\t\t\t\tright: false,\n\t\t\t\tbottom: false,\n\t\t\t\tleft: false,\n\t\t\t\ttopLeft: false,\n\t\t\t\ttopRight: false,\n\t\t\t\tbottomRight: false,\n\t\t\t\tbottomLeft: false,\n\t\t\t},\n\t\t\thandleClasses: { top: 'edit-post-meta-boxes-main__presenter' },\n\t\t\thandleComponent: {\n\t\t\t\ttop: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t\t\t\t<button // eslint-disable-line jsx-a11y/role-supports-aria-props\n\t\t\t\t\t\t\t\tref={ separatorRef }\n\t\t\t\t\t\t\t\trole=\"separator\" // eslint-disable-line jsx-a11y/no-interactive-element-to-noninteractive-role\n\t\t\t\t\t\t\t\taria-valuenow={ usedAriaValueNow }\n\t\t\t\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\t\t\t\taria-describedby={ separatorHelpId }\n\t\t\t\t\t\t\t\tonKeyDown={ onSeparatorKeyDown }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t<VisuallyHidden id={ separatorHelpId }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Use up and down arrow keys to resize the meta box panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t// Avoids hiccups while dragging over objects like iframes and ensures that\n\t\t\t// the event to end the drag is captured by the target (resize handle)\n\t\t\t// whether or not it’s under the pointer.\n\t\t\tonPointerDown: ( { pointerId, target } ) => {\n\t\t\t\ttarget.setPointerCapture( pointerId );\n\t\t\t},\n\t\t\tonResizeStart: ( event, direction, elementRef ) => {\n\t\t\t\tif ( isAutoHeight ) {\n\t\t\t\t\t// Sets the starting height to avoid visual jumps in height and\n\t\t\t\t\t// aria-valuenow being `NaN` for the first (few) resize events.\n\t\t\t\t\tapplyHeight( elementRef.offsetHeight, false, true );\n\t\t\t\t\tsetIsUntouched( false );\n\t\t\t\t}\n\t\t\t},\n\t\t\tonResize: () =>\n\t\t\t\tapplyHeight( metaBoxesMainRef.current.state.height ),\n\t\t\tonResizeStop: () =>\n\t\t\t\tapplyHeight( metaBoxesMainRef.current.state.height, true ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<Pane aria-label={ paneLabel } { ...paneProps }>\n\t\t\t{ isShort ? (\n\t\t\t\t<button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\tclassName=\"edit-post-meta-boxes-main__presenter\"\n\t\t\t\t\tonClick={ toggle }\n\t\t\t\t>\n\t\t\t\t\t{ paneLabel }\n\t\t\t\t\t<Icon icon={ isOpen ? chevronUp : chevronDown } />\n\t\t\t\t</button>\n\t\t\t) : (\n\t\t\t\t<meta ref={ effectSizeConstraints } />\n\t\t\t) }\n\t\t\t{ contents }\n\t\t</Pane>\n\t);\n}\n\nfunction Layout( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n} ) {\n\tuseCommands();\n\tuseEditPostCommands();\n\tconst paddingAppenderRef = usePaddingAppender();\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\thasActiveMetaboxes,\n\t\thasBlockSelected,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowMetaBoxes,\n\t\thasHistory,\n\t\tisWelcomeGuideVisible,\n\t\ttemplateId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isFeatureActive, getEditedPostTemplateId } = unlock(\n\t\t\t\tselect( editPostStore )\n\t\t\t);\n\t\t\tconst { canUser, getPostType } = select( coreStore );\n\t\t\tconst { __unstableGetEditorMode } = unlock(\n\t\t\t\tselect( blockEditorStore )\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\n\t\t\tconst isZoomOut = __unstableGetEditorMode() === 'zoom-out';\n\n\t\t\treturn {\n\t\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\t\tisFullscreenActive:\n\t\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\t\thasBlockSelected:\n\t\t\t\t\t!! select( blockEditorStore ).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! DESIGN_POST_TYPES.includes( currentPostType ) &&\n\t\t\t\t\tselect( editorStore ).getRenderingMode() === 'post-only' &&\n\t\t\t\t\t! isZoomOut,\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? getEditedPostTemplateId()\n\t\t\t\t\t\t: null,\n\t\t\t};\n\t\t},\n\t\t[ currentPostType, isEditingTemplate, settings.supportsTemplateMode ]\n\t);\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 editorSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t\tdefaultRenderingMode: 'post-only',\n\t\t} ),\n\t\t[ settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord ]\n\t);\n\tconst styles = useEditorStyles();\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 )\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>\n\t\t\t\t<CommandMenu />\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\tstyles={ styles }\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tcontentRef={ paddingAppenderRef }\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={ ! shouldIframe } />\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 hasHistory={ hasHistory } />\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<InitPatternModal />\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<EditorSnackbars />\n\t\t\t\t\t</Editor>\n\t\t\t\t</div>\n\t\t\t</Err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,WAAA,CAAA+H,OAAU;YAACwF,UAAU,EAAGA;UAAY,CAAE,CAAC,eACxC,IAAA7M,WAAA,CAAAoH,GAAA,EAACnJ,OAAA,CAAA0S,qBAAqB,IAAE,CAAC,eACzB,IAAA3Q,WAAA,CAAAoH,GAAA,EAACnJ,OAAA,CAAA2S,eAAe,IAAE,CAAC,eACnB,IAAA5Q,WAAA,CAAAoH,GAAA,EAACnJ,OAAA,CAAA4S,oBAAoB,IAAE,CAAC,eACxB,IAAA7Q,WAAA,CAAAoH,GAAA,EAAChI,kBAAA,CAAAiI,OAAyB,IAAE,CAAC,eAC7B,IAAArH,WAAA,CAAAoH,GAAA,EAACnJ,OAAA,CAAA6S,+BAA+B,IAAE,CAAC,eACnC,IAAA9Q,WAAA,CAAAoH,GAAA,EAACxG,sBAAsB,IAAE,CAAC,eAC1B,IAAAZ,WAAA,CAAAoH,GAAA,EAAC/H,iBAAA,CAAAgI,OAAgB,IAAE,CAAC,eACpB,IAAArH,WAAA,CAAAoH,GAAA,EAAChJ,QAAA,CAAA2S,UAAU;YAACC,OAAO,EAAGxC;UAAmB,CAAE,CAAC,eAC5C,IAAAxO,WAAA,CAAAoH,GAAA,EAAC5H,SAAA,CAAA6H,OAAkB,IAAE,CAAC,EACpByI,UAAU,eACZ,IAAA9P,WAAA,CAAAoH,GAAA,EAACnJ,OAAA,CAAAgT,eAAe,IAAE,CAAC;QAAA,CACZ;MAAC,CACL,CAAC;IAAA,CACQ;EAAC,CACC,CAAC;AAErB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA9J,OAAA,GAEc6D,MAAM","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_editor","_data","_blockEditor","_plugins","_i18n","_element","_icons","_notices","_preferences","_commands","_coreCommands","_blockLibrary","_url","_htmlEntities","_coreData","_components","_compose","_backButton","_editorInitialization","_keyboardShortcuts","_initPatternModal","_browserUrl","_metaBoxes","_moreMenu","_welcomeGuide","_store","_lockUnlock","_useCommands","_usePaddingAppender","_useShouldIframe","_useNavigateToEntityRecord","_useMetaBoxInitialization","_jsxRuntime","getLayoutStyles","unlock","blockEditorPrivateApis","useCommands","coreCommandsPrivateApis","useCommandContext","commandsPrivateApis","Editor","FullscreenMode","NavigableRegion","editorPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","DESIGN_POST_TYPES","useEditorStyles","hasThemeStyleSupport","editorSettings","isZoomedOutView","renderingMode","postType","useSelect","select","__unstableGetEditorMode","blockEditorStore","getCurrentPostType","getRenderingMode","editorStore","_postType","editPostStore","isFeatureActive","getEditorSettings","useMemo","_editorSettings$style","_editorSettings$defau","_editorSettings$style2","_editorSettings$style3","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","baseStyles","includes","MetaBoxesMain","isLegacy","isOpen","openHeight","hasAnyVisible","get","preferencesStore","isMetaBoxLocationVisible","set","setPreference","useDispatch","metaBoxesMainRef","useRef","isShort","useMediaQuery","min","max","setHeightConstraints","useState","effectSizeConstraints","useRefEffect","node","container","closest","noticeLists","querySelectorAll","resizeHandle","querySelector","deriveConstraints","fullHeight","offsetHeight","nextMax","element","nextMin","observer","window","ResizeObserver","observe","disconnect","separatorRef","separatorHelpId","useId","isUntouched","setIsUntouched","applyHeight","candidateHeight","isPersistent","isInstant","nextHeight","Math","current","ariaValueNow","getAriaValueNow","updateSize","height","width","contents","jsxs","className","clsx","hidden","children","jsx","default","location","isAutoHeight","undefined","usedMax","round","usedAriaValueNow","toggle","onSeparatorKeyDown","event","delta","ArrowUp","ArrowDown","key","pane","resizable","fromHeight","preventDefault","paneLabel","__","Pane","paneProps","ResizableBox","as","ref","defaultSize","minHeight","maxHeight","enable","top","right","bottom","left","topLeft","topRight","bottomRight","bottomLeft","handleClasses","handleComponent","Fragment","Tooltip","text","role","onKeyDown","VisuallyHidden","id","onPointerDown","pointerId","target","setPointerCapture","onResizeStart","direction","elementRef","onResize","state","onResizeStop","onClick","Icon","icon","chevronUp","chevronDown","Layout","postId","initialPostId","initialPostType","settings","initialEdits","useEditPostCommands","paddingAppenderRef","usePaddingAppender","shouldIframe","useShouldIframe","createErrorNotice","noticesStore","currentPost","currentPostId","currentPostType","onNavigateToEntityRecord","onNavigateToPreviousEntityRecord","useNavigateToEntityRecord","isEditingTemplate","mode","isFullscreenActive","hasActiveMetaboxes","hasBlockSelected","showIconLabels","isDistractionFree","showMetaBoxes","hasHistory","isWelcomeGuideVisible","templateId","isDevicePreview","_getPostType$viewable","getEditedPostTemplateId","canUser","getPostType","coreStore","getDeviceType","getEditorMode","supportsTemplateMode","isViewable","viewable","canViewTemplate","kind","name","isZoomOut","hasMetaBoxes","getBlockSelectionStart","useMetaBoxInitialization","commandContext","defaultRenderingMode","document","body","classList","add","remove","navigateRegionsProps","useNavigateRegions","onPluginAreaError","sprintf","createSuccessNotice","onActionPerformed","useCallback","actionId","items","href","addQueryArgs","trashed","post_type","type","ids","newItem","title","rendered","decodeEntities","actions","label","post","action","initialPost","backButton","useViewportMatch","SlotFillProvider","ErrorBoundary","CommandMenu","forceIsDirty","contentRef","disableIframe","autoFocus","extraSidebarPanels","extraContent","PostLockedModal","isActive","UnsavedChangesWarning","AutosaveMonitor","LocalAutosaveMonitor","EditorKeyboardShortcutsRegister","PluginArea","onError","EditorSnackbars","_default","exports"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorKeyboardShortcutsRegister,\n\tEditorSnackbars,\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\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 { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tCommandMenu,\n\tprivateApis as commandsPrivateApis,\n} from '@wordpress/commands';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-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\tResizableBox,\n\tSlotFillProvider,\n\tTooltip,\n\tVisuallyHidden,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n} from '@wordpress/components';\nimport {\n\tuseMediaQuery,\n\tuseRefEffect,\n\tuseViewportMatch,\n} from '@wordpress/compose';\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 { usePaddingAppender } from './use-padding-appender';\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 { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { Editor, FullscreenMode, NavigableRegion } = 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() {\n\tconst {\n\t\thasThemeStyleSupport,\n\t\teditorSettings,\n\t\tisZoomedOutView,\n\t\trenderingMode,\n\t\tpostType,\n\t} = useSelect( ( select ) => {\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getCurrentPostType, getRenderingMode } = select( editorStore );\n\t\tconst _postType = getCurrentPostType();\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t\tisZoomedOutView: __unstableGetEditorMode() === 'zoom-out',\n\t\t\trenderingMode: getRenderingMode(),\n\t\t\tpostType: _postType,\n\t\t};\n\t}, [] );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.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...( editorSettings?.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 !== ( editorSettings.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 ( ! editorSettings.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\tconst baseStyles = hasThemeStyles\n\t\t\t? editorSettings.styles ?? []\n\t\t\t: defaultEditorStyles;\n\n\t\t// Add a space for the typewriter effect. When typing in the last block,\n\t\t// there needs to be room to scroll up.\n\t\tif (\n\t\t\t! isZoomedOutView &&\n\t\t\trenderingMode === 'post-only' &&\n\t\t\t! DESIGN_POST_TYPES.includes( postType )\n\t\t) {\n\t\t\treturn [\n\t\t\t\t...baseStyles,\n\t\t\t\t{\n\t\t\t\t\tcss: ':root :where(.editor-styles-wrapper)::after {content: \"\"; display: block; height: 40vh;}',\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\treturn baseStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t\tpostType,\n\t] );\n}\n\n/**\n * @param {Object} props\n * @param {boolean} props.isLegacy True when the editor canvas is not in an iframe.\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\tget( '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\tconst metaBoxesMainRef = useRef();\n\tconst isShort = useMediaQuery( '(max-height: 549px)' );\n\n\tconst [ { min, max }, setHeightConstraints ] = useState( () => ( {} ) );\n\t// Keeps the resizable area’s 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 seperator.\n\tconst effectSizeConstraints = useRefEffect( ( node ) => {\n\t\tconst container = node.closest(\n\t\t\t'.interface-interface-skeleton__content'\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\n\tconst separatorRef = useRef();\n\tconst separatorHelpId = useId();\n\n\tconst [ isUntouched, setIsUntouched ] = useState( true );\n\tconst applyHeight = ( candidateHeight, isPersistent, isInstant ) => {\n\t\tconst nextHeight = Math.min( max, Math.max( min, candidateHeight ) );\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\tnextHeight\n\t\t\t);\n\t\t} else {\n\t\t\tseparatorRef.current.ariaValueNow = getAriaValueNow( nextHeight );\n\t\t}\n\t\tif ( isInstant ) {\n\t\t\tmetaBoxesMainRef.current.updateSize( {\n\t\t\t\theight: nextHeight,\n\t\t\t\t// Oddly, when the event that triggered this was not from the mouse (e.g. keydown),\n\t\t\t\t// if `width` is left unspecified a subsequent drag gesture applies a fixed\n\t\t\t\t// width and the pane fails to widen/narrow with parent width changes from\n\t\t\t\t// sidebars opening/closing or window resizes.\n\t\t\t\twidth: 'auto',\n\t\t\t} );\n\t\t}\n\t};\n\n\tif ( ! hasAnyVisible ) {\n\t\treturn;\n\t}\n\n\tconst contents = (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t// The class name 'edit-post-layout__metaboxes' is retained because some plugins use it.\n\t\t\t\t'edit-post-layout__metaboxes',\n\t\t\t\t! isLegacy && 'edit-post-meta-boxes-main__liner'\n\t\t\t) }\n\t\t\thidden={ ! isLegacy && isShort && ! 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\tlet usedMax = '50%'; // Approximation before max has a value.\n\tif ( max !== undefined ) {\n\t\t// Halves the available max height until a user height is set.\n\t\tusedMax = isAutoHeight && isUntouched ? max / 2 : max;\n\t}\n\n\tconst getAriaValueNow = ( height ) =>\n\t\tMath.round( ( ( height - min ) / ( max - min ) ) * 100 );\n\tconst usedAriaValueNow =\n\t\tmax === undefined || isAutoHeight ? 50 : getAriaValueNow( openHeight );\n\n\tconst toggle = () =>\n\t\tsetPreference( 'core/edit-post', 'metaBoxesMainIsOpen', ! isOpen );\n\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 onSeparatorKeyDown = ( event ) => {\n\t\tconst delta = { ArrowUp: 20, ArrowDown: -20 }[ event.key ];\n\t\tif ( delta ) {\n\t\t\tconst pane = metaBoxesMainRef.current.resizable;\n\t\t\tconst fromHeight = isAutoHeight ? pane.offsetHeight : openHeight;\n\t\t\tconst nextHeight = delta + fromHeight;\n\t\t\tapplyHeight( nextHeight, true, true );\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\tconst className = 'edit-post-meta-boxes-main';\n\tconst paneLabel = __( 'Meta Boxes' );\n\tlet Pane, paneProps;\n\tif ( isShort ) {\n\t\tPane = NavigableRegion;\n\t\tpaneProps = {\n\t\t\tclassName: clsx( className, 'is-toggle-only' ),\n\t\t};\n\t} else {\n\t\tPane = ResizableBox;\n\t\tpaneProps = /** @type {Parameters<typeof ResizableBox>[0]} */ ( {\n\t\t\tas: NavigableRegion,\n\t\t\tref: metaBoxesMainRef,\n\t\t\tclassName: clsx( className, 'is-resizable' ),\n\t\t\tdefaultSize: { height: openHeight },\n\t\t\tminHeight: min,\n\t\t\tmaxHeight: usedMax,\n\t\t\tenable: {\n\t\t\t\ttop: true,\n\t\t\t\tright: false,\n\t\t\t\tbottom: false,\n\t\t\t\tleft: false,\n\t\t\t\ttopLeft: false,\n\t\t\t\ttopRight: false,\n\t\t\t\tbottomRight: false,\n\t\t\t\tbottomLeft: false,\n\t\t\t},\n\t\t\thandleClasses: { top: 'edit-post-meta-boxes-main__presenter' },\n\t\t\thandleComponent: {\n\t\t\t\ttop: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t\t\t\t<button // eslint-disable-line jsx-a11y/role-supports-aria-props\n\t\t\t\t\t\t\t\tref={ separatorRef }\n\t\t\t\t\t\t\t\trole=\"separator\" // eslint-disable-line jsx-a11y/no-interactive-element-to-noninteractive-role\n\t\t\t\t\t\t\t\taria-valuenow={ usedAriaValueNow }\n\t\t\t\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\t\t\t\taria-describedby={ separatorHelpId }\n\t\t\t\t\t\t\t\tonKeyDown={ onSeparatorKeyDown }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t<VisuallyHidden id={ separatorHelpId }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Use up and down arrow keys to resize the meta box panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t// Avoids hiccups while dragging over objects like iframes and ensures that\n\t\t\t// the event to end the drag is captured by the target (resize handle)\n\t\t\t// whether or not it’s under the pointer.\n\t\t\tonPointerDown: ( { pointerId, target } ) => {\n\t\t\t\ttarget.setPointerCapture( pointerId );\n\t\t\t},\n\t\t\tonResizeStart: ( event, direction, elementRef ) => {\n\t\t\t\tif ( isAutoHeight ) {\n\t\t\t\t\t// Sets the starting height to avoid visual jumps in height and\n\t\t\t\t\t// aria-valuenow being `NaN` for the first (few) resize events.\n\t\t\t\t\tapplyHeight( elementRef.offsetHeight, false, true );\n\t\t\t\t\tsetIsUntouched( false );\n\t\t\t\t}\n\t\t\t},\n\t\t\tonResize: () =>\n\t\t\t\tapplyHeight( metaBoxesMainRef.current.state.height ),\n\t\t\tonResizeStop: () =>\n\t\t\t\tapplyHeight( metaBoxesMainRef.current.state.height, true ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<Pane aria-label={ paneLabel } { ...paneProps }>\n\t\t\t{ isShort ? (\n\t\t\t\t<button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\tclassName=\"edit-post-meta-boxes-main__presenter\"\n\t\t\t\t\tonClick={ toggle }\n\t\t\t\t>\n\t\t\t\t\t{ paneLabel }\n\t\t\t\t\t<Icon icon={ isOpen ? chevronUp : chevronDown } />\n\t\t\t\t</button>\n\t\t\t) : (\n\t\t\t\t<meta ref={ effectSizeConstraints } />\n\t\t\t) }\n\t\t\t{ contents }\n\t\t</Pane>\n\t);\n}\n\nfunction Layout( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n} ) {\n\tuseCommands();\n\tuseEditPostCommands();\n\tconst paddingAppenderRef = usePaddingAppender();\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\thasActiveMetaboxes,\n\t\thasBlockSelected,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowMetaBoxes,\n\t\thasHistory,\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, getEditedPostTemplateId } = unlock(\n\t\t\t\tselect( editPostStore )\n\t\t\t);\n\t\t\tconst { canUser, getPostType } = select( coreStore );\n\t\t\tconst { getDeviceType, getEditorMode } = select( editorStore );\n\t\t\tconst { __unstableGetEditorMode } = unlock(\n\t\t\t\tselect( blockEditorStore )\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\n\t\t\tconst isZoomOut = __unstableGetEditorMode() === 'zoom-out';\n\n\t\t\treturn {\n\t\t\t\tmode: getEditorMode(),\n\t\t\t\tisFullscreenActive:\n\t\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\t\thasBlockSelected:\n\t\t\t\t\t!! select( blockEditorStore ).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! DESIGN_POST_TYPES.includes( currentPostType ) &&\n\t\t\t\t\t! isZoomOut,\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? getEditedPostTemplateId()\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[ currentPostType, isEditingTemplate, settings.supportsTemplateMode ]\n\t);\n\tuseMetaBoxInitialization( hasActiveMetaboxes );\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 editorSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t\tdefaultRenderingMode: 'post-only',\n\t\t} ),\n\t\t[ settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord ]\n\t);\n\tconst styles = useEditorStyles();\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 )\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>\n\t\t\t\t<CommandMenu />\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\tstyles={ styles }\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tcontentRef={ paddingAppenderRef }\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\n\t\t\t\t\t\t\t\t\tisLegacy={\n\t\t\t\t\t\t\t\t\t\t! shouldIframe || isDevicePreview\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\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 hasHistory={ hasHistory } />\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<InitPatternModal />\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<EditorSnackbars />\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"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AAWA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAIA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAOA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAV,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ACxB,IAAAhR,WAAA,CAAAoH,GAAA,EAACjI,kBAAA,CAAAkI,OAAyB,IAAE,CAAC,eAC7B,IAAArH,WAAA,CAAAoH,GAAA,EAACpJ,OAAA,CAAAiT,+BAA+B,IAAE,CAAC,eACnC,IAAAjR,WAAA,CAAAoH,GAAA,EAACxG,sBAAsB,IAAE,CAAC,eAC1B,IAAAZ,WAAA,CAAAoH,GAAA,EAAChI,iBAAA,CAAAiI,OAAgB,IAAE,CAAC,eACpB,IAAArH,WAAA,CAAAoH,GAAA,EAACjJ,QAAA,CAAA+S,UAAU;YAACC,OAAO,EAAGxC;UAAmB,CAAE,CAAC,eAC5C,IAAA3O,WAAA,CAAAoH,GAAA,EAAC7H,SAAA,CAAA8H,OAAkB,IAAE,CAAC,EACpB4I,UAAU,eACZ,IAAAjQ,WAAA,CAAAoH,GAAA,EAACpJ,OAAA,CAAAoT,eAAe,IAAE,CAAC;QAAA,CACZ;MAAC,CACL,CAAC;IAAA,CACQ;EAAC,CACC,CAAC;AAErB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjK,OAAA,GAEc6D,MAAM","ignoreList":[]}
|
|
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = MetaBoxes;
|
|
8
8
|
var _data = require("@wordpress/data");
|
|
9
|
-
var _element = require("@wordpress/element");
|
|
10
|
-
var _editor = require("@wordpress/editor");
|
|
11
9
|
var _metaBoxesArea = _interopRequireDefault(require("./meta-boxes-area"));
|
|
12
10
|
var _metaBoxVisibility = _interopRequireDefault(require("./meta-box-visibility"));
|
|
13
11
|
var _store = require("../../store");
|
|
@@ -23,38 +21,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
23
21
|
function MetaBoxes({
|
|
24
22
|
location
|
|
25
23
|
}) {
|
|
26
|
-
const
|
|
27
|
-
const {
|
|
28
|
-
metaBoxes,
|
|
29
|
-
areMetaBoxesInitialized,
|
|
30
|
-
isEditorReady
|
|
31
|
-
} = (0, _data.useSelect)(select => {
|
|
32
|
-
const {
|
|
33
|
-
__unstableIsEditorReady
|
|
34
|
-
} = select(_editor.store);
|
|
35
|
-
const {
|
|
36
|
-
getMetaBoxesPerLocation,
|
|
37
|
-
areMetaBoxesInitialized: _areMetaBoxesInitialized
|
|
38
|
-
} = select(_store.store);
|
|
39
|
-
return {
|
|
40
|
-
metaBoxes: getMetaBoxesPerLocation(location),
|
|
41
|
-
areMetaBoxesInitialized: _areMetaBoxesInitialized(),
|
|
42
|
-
isEditorReady: __unstableIsEditorReady()
|
|
43
|
-
};
|
|
44
|
-
}, [location]);
|
|
45
|
-
const hasMetaBoxes = !!metaBoxes?.length;
|
|
46
|
-
|
|
47
|
-
// When editor is ready, initialize postboxes (wp core script) and metabox
|
|
48
|
-
// saving. This initializes all meta box locations, not just this specific
|
|
49
|
-
// one.
|
|
50
|
-
(0, _element.useEffect)(() => {
|
|
51
|
-
if (isEditorReady && hasMetaBoxes && !areMetaBoxesInitialized) {
|
|
52
|
-
registry.dispatch(_store.store).initializeMetaBoxes();
|
|
53
|
-
}
|
|
54
|
-
}, [isEditorReady, hasMetaBoxes, areMetaBoxesInitialized]);
|
|
55
|
-
if (!areMetaBoxesInitialized) {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
24
|
+
const metaBoxes = (0, _data.useSelect)(select => select(_store.store).getMetaBoxesPerLocation(location), [location]);
|
|
58
25
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
59
26
|
children: [(metaBoxes !== null && metaBoxes !== void 0 ? metaBoxes : []).map(({
|
|
60
27
|
id
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","
|
|
1
|
+
{"version":3,"names":["_data","require","_metaBoxesArea","_interopRequireDefault","_metaBoxVisibility","_store","_jsxRuntime","MetaBoxes","location","metaBoxes","useSelect","select","editPostStore","getMetaBoxesPerLocation","jsxs","Fragment","children","map","id","jsx","default"],"sources":["@wordpress/edit-post/src/components/meta-boxes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport MetaBoxesArea from './meta-boxes-area';\nimport MetaBoxVisibility from './meta-box-visibility';\nimport { store as editPostStore } from '../../store';\n\nexport default function MetaBoxes( { location } ) {\n\tconst metaBoxes = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editPostStore ).getMetaBoxesPerLocation( location ),\n\t\t[ location ]\n\t);\n\treturn (\n\t\t<>\n\t\t\t{ ( metaBoxes ?? [] ).map( ( { id } ) => (\n\t\t\t\t<MetaBoxVisibility key={ id } id={ id } />\n\t\t\t) ) }\n\t\t\t<MetaBoxesArea location={ location } />\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,cAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAAqD,IAAAK,WAAA,GAAAL,OAAA;AAVrD;AACA;AACA;;AAGA;AACA;AACA;;AAKe,SAASM,SAASA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACjD,MAAMC,SAAS,GAAG,IAAAC,eAAS,EACxBC,MAAM,IACPA,MAAM,CAAEC,YAAc,CAAC,CAACC,uBAAuB,CAAEL,QAAS,CAAC,EAC5D,CAAEA,QAAQ,CACX,CAAC;EACD,oBACC,IAAAF,WAAA,CAAAQ,IAAA,EAAAR,WAAA,CAAAS,QAAA;IAAAC,QAAA,GACG,CAAEP,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EAAE,EAAGQ,GAAG,CAAE,CAAE;MAAEC;IAAG,CAAC,kBAClC,IAAAZ,WAAA,CAAAa,GAAA,EAACf,kBAAA,CAAAgB,OAAiB;MAAYF,EAAE,EAAGA;IAAI,GAAdA,EAAgB,CACxC,CAAC,eACH,IAAAZ,WAAA,CAAAa,GAAA,EAACjB,cAAA,CAAAkB,OAAa;MAACZ,QAAQ,EAAGA;IAAU,CAAE,CAAC;EAAA,CACtC,CAAC;AAEL","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useMetaBoxInitialization = void 0;
|
|
7
|
+
var _data = require("@wordpress/data");
|
|
8
|
+
var _editor = require("@wordpress/editor");
|
|
9
|
+
var _element = require("@wordpress/element");
|
|
10
|
+
var _store = require("../../store");
|
|
11
|
+
/**
|
|
12
|
+
* WordPress dependencies
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Initializes WordPress `postboxes` script and the logic for saving meta boxes.
|
|
21
|
+
*
|
|
22
|
+
* @param { boolean } enabled
|
|
23
|
+
*/
|
|
24
|
+
const useMetaBoxInitialization = enabled => {
|
|
25
|
+
const isEnabledAndEditorReady = (0, _data.useSelect)(select => enabled && select(_editor.store).__unstableIsEditorReady(), [enabled]);
|
|
26
|
+
const {
|
|
27
|
+
initializeMetaBoxes
|
|
28
|
+
} = (0, _data.useDispatch)(_store.store);
|
|
29
|
+
// The effect has to rerun when the editor is ready because initializeMetaBoxes
|
|
30
|
+
// will noop until then.
|
|
31
|
+
(0, _element.useEffect)(() => {
|
|
32
|
+
if (isEnabledAndEditorReady) {
|
|
33
|
+
initializeMetaBoxes();
|
|
34
|
+
}
|
|
35
|
+
}, [isEnabledAndEditorReady, initializeMetaBoxes]);
|
|
36
|
+
};
|
|
37
|
+
exports.useMetaBoxInitialization = useMetaBoxInitialization;
|
|
38
|
+
//# sourceMappingURL=use-meta-box-initialization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_data","require","_editor","_element","_store","useMetaBoxInitialization","enabled","isEnabledAndEditorReady","useSelect","select","editorStore","__unstableIsEditorReady","initializeMetaBoxes","useDispatch","editPostStore","useEffect","exports"],"sources":["@wordpress/edit-post/src/components/meta-boxes/use-meta-box-initialization.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\n/**\n * Initializes WordPress `postboxes` script and the logic for saving meta boxes.\n *\n * @param { boolean } enabled\n */\nexport const useMetaBoxInitialization = ( enabled ) => {\n\tconst isEnabledAndEditorReady = useSelect(\n\t\t( select ) =>\n\t\t\tenabled && select( editorStore ).__unstableIsEditorReady(),\n\t\t[ enabled ]\n\t);\n\tconst { initializeMetaBoxes } = useDispatch( editPostStore );\n\t// The effect has to rerun when the editor is ready because initializeMetaBoxes\n\t// will noop until then.\n\tuseEffect( () => {\n\t\tif ( isEnabledAndEditorReady ) {\n\t\t\tinitializeMetaBoxes();\n\t\t}\n\t}, [ isEnabledAndEditorReady, initializeMetaBoxes ] );\n};\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMI,wBAAwB,GAAKC,OAAO,IAAM;EACtD,MAAMC,uBAAuB,GAAG,IAAAC,eAAS,EACtCC,MAAM,IACPH,OAAO,IAAIG,MAAM,CAAEC,aAAY,CAAC,CAACC,uBAAuB,CAAC,CAAC,EAC3D,CAAEL,OAAO,CACV,CAAC;EACD,MAAM;IAAEM;EAAoB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAc,CAAC;EAC5D;EACA;EACA,IAAAC,kBAAS,EAAE,MAAM;IAChB,IAAKR,uBAAuB,EAAG;MAC9BK,mBAAmB,CAAC,CAAC;IACtB;EACD,CAAC,EAAE,CAAEL,uBAAuB,EAAEK,mBAAmB,CAAG,CAAC;AACtD,CAAC;AAACI,OAAA,CAAAX,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -41,6 +41,7 @@ import useEditPostCommands from '../../commands/use-commands';
|
|
|
41
41
|
import { usePaddingAppender } from './use-padding-appender';
|
|
42
42
|
import { useShouldIframe } from './use-should-iframe';
|
|
43
43
|
import useNavigateToEntityRecord from '../../hooks/use-navigate-to-entity-record';
|
|
44
|
+
import { useMetaBoxInitialization } from '../meta-boxes/use-meta-box-initialization';
|
|
44
45
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
45
46
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
46
47
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -356,7 +357,8 @@ function Layout({
|
|
|
356
357
|
showMetaBoxes,
|
|
357
358
|
hasHistory,
|
|
358
359
|
isWelcomeGuideVisible,
|
|
359
|
-
templateId
|
|
360
|
+
templateId,
|
|
361
|
+
isDevicePreview
|
|
360
362
|
} = useSelect(select => {
|
|
361
363
|
var _getPostType$viewable;
|
|
362
364
|
const {
|
|
@@ -370,6 +372,10 @@ function Layout({
|
|
|
370
372
|
canUser,
|
|
371
373
|
getPostType
|
|
372
374
|
} = select(coreStore);
|
|
375
|
+
const {
|
|
376
|
+
getDeviceType,
|
|
377
|
+
getEditorMode
|
|
378
|
+
} = select(editorStore);
|
|
373
379
|
const {
|
|
374
380
|
__unstableGetEditorMode
|
|
375
381
|
} = unlock(select(blockEditorStore));
|
|
@@ -381,17 +387,19 @@ function Layout({
|
|
|
381
387
|
});
|
|
382
388
|
const isZoomOut = __unstableGetEditorMode() === 'zoom-out';
|
|
383
389
|
return {
|
|
384
|
-
mode:
|
|
390
|
+
mode: getEditorMode(),
|
|
385
391
|
isFullscreenActive: select(editPostStore).isFeatureActive('fullscreenMode'),
|
|
386
392
|
hasActiveMetaboxes: select(editPostStore).hasMetaBoxes(),
|
|
387
393
|
hasBlockSelected: !!select(blockEditorStore).getBlockSelectionStart(),
|
|
388
394
|
showIconLabels: get('core', 'showIconLabels'),
|
|
389
395
|
isDistractionFree: get('core', 'distractionFree'),
|
|
390
|
-
showMetaBoxes: !DESIGN_POST_TYPES.includes(currentPostType) &&
|
|
396
|
+
showMetaBoxes: !DESIGN_POST_TYPES.includes(currentPostType) && !isZoomOut,
|
|
391
397
|
isWelcomeGuideVisible: isFeatureActive('welcomeGuide'),
|
|
392
|
-
templateId: supportsTemplateMode && isViewable && canViewTemplate && !isEditingTemplate ? getEditedPostTemplateId() : null
|
|
398
|
+
templateId: supportsTemplateMode && isViewable && canViewTemplate && !isEditingTemplate ? getEditedPostTemplateId() : null,
|
|
399
|
+
isDevicePreview: getDeviceType() !== 'Desktop'
|
|
393
400
|
};
|
|
394
401
|
}, [currentPostType, isEditingTemplate, settings.supportsTemplateMode]);
|
|
402
|
+
useMetaBoxInitialization(hasActiveMetaboxes);
|
|
395
403
|
|
|
396
404
|
// Set the right context for the command palette
|
|
397
405
|
const commandContext = hasBlockSelected ? 'block-selection-edit' : 'entity-edit';
|
|
@@ -493,7 +501,7 @@ function Layout({
|
|
|
493
501
|
location: "side"
|
|
494
502
|
}),
|
|
495
503
|
extraContent: !isDistractionFree && showMetaBoxes && /*#__PURE__*/_jsx(MetaBoxesMain, {
|
|
496
|
-
isLegacy: !shouldIframe
|
|
504
|
+
isLegacy: !shouldIframe || isDevicePreview
|
|
497
505
|
}),
|
|
498
506
|
children: [/*#__PURE__*/_jsx(PostLockedModal, {}), /*#__PURE__*/_jsx(EditorInitialization, {}), /*#__PURE__*/_jsx(FullscreenMode, {
|
|
499
507
|
isActive: isFullscreenActive
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","AutosaveMonitor","LocalAutosaveMonitor","UnsavedChangesWarning","EditorKeyboardShortcutsRegister","EditorSnackbars","ErrorBoundary","PostLockedModal","store","editorStore","privateApis","editorPrivateApis","useSelect","useDispatch","blockEditorPrivateApis","blockEditorStore","PluginArea","__","sprintf","useCallback","useMemo","useId","useRef","useState","chevronDown","chevronUp","noticesStore","preferencesStore","CommandMenu","commandsPrivateApis","coreCommandsPrivateApis","blockLibraryPrivateApis","addQueryArgs","decodeEntities","coreStore","Icon","ResizableBox","SlotFillProvider","Tooltip","VisuallyHidden","__unstableUseNavigateRegions","useNavigateRegions","useMediaQuery","useRefEffect","useViewportMatch","BackButton","EditorInitialization","EditPostKeyboardShortcuts","InitPatternModal","BrowserURL","MetaBoxes","PostEditorMoreMenu","WelcomeGuide","editPostStore","unlock","useEditPostCommands","usePaddingAppender","useShouldIframe","useNavigateToEntityRecord","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","getLayoutStyles","useCommands","useCommandContext","Editor","FullscreenMode","NavigableRegion","BlockKeyboardShortcuts","DESIGN_POST_TYPES","useEditorStyles","hasThemeStyleSupport","editorSettings","isZoomedOutView","renderingMode","postType","select","__unstableGetEditorMode","getCurrentPostType","getRenderingMode","_postType","isFeatureActive","getEditorSettings","_editorSettings$style","_editorSettings$defau","_editorSettings$style2","_editorSettings$style3","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","baseStyles","includes","MetaBoxesMain","isLegacy","isOpen","openHeight","hasAnyVisible","get","isMetaBoxLocationVisible","set","setPreference","metaBoxesMainRef","isShort","min","max","setHeightConstraints","effectSizeConstraints","node","container","closest","noticeLists","querySelectorAll","resizeHandle","querySelector","deriveConstraints","fullHeight","offsetHeight","nextMax","element","nextMin","observer","window","ResizeObserver","observe","disconnect","separatorRef","separatorHelpId","isUntouched","setIsUntouched","applyHeight","candidateHeight","isPersistent","isInstant","nextHeight","Math","current","ariaValueNow","getAriaValueNow","updateSize","height","width","contents","className","hidden","children","location","isAutoHeight","undefined","usedMax","round","usedAriaValueNow","toggle","onSeparatorKeyDown","event","delta","ArrowUp","ArrowDown","key","pane","resizable","fromHeight","preventDefault","paneLabel","Pane","paneProps","as","ref","defaultSize","minHeight","maxHeight","enable","top","right","bottom","left","topLeft","topRight","bottomRight","bottomLeft","handleClasses","handleComponent","text","role","onKeyDown","id","onPointerDown","pointerId","target","setPointerCapture","onResizeStart","direction","elementRef","onResize","state","onResizeStop","onClick","icon","Layout","postId","initialPostId","initialPostType","settings","initialEdits","paddingAppenderRef","shouldIframe","createErrorNotice","currentPost","currentPostId","currentPostType","onNavigateToEntityRecord","onNavigateToPreviousEntityRecord","isEditingTemplate","mode","isFullscreenActive","hasActiveMetaboxes","hasBlockSelected","showIconLabels","isDistractionFree","showMetaBoxes","hasHistory","isWelcomeGuideVisible","templateId","_getPostType$viewable","getEditedPostTemplateId","canUser","getPostType","supportsTemplateMode","isViewable","viewable","canViewTemplate","kind","name","isZoomOut","getEditorMode","hasMetaBoxes","getBlockSelectionStart","commandContext","defaultRenderingMode","document","body","classList","add","remove","navigateRegionsProps","onPluginAreaError","createSuccessNotice","onActionPerformed","actionId","items","href","trashed","post_type","type","ids","newItem","title","rendered","actions","label","post","action","initialPost","backButton","forceIsDirty","contentRef","disableIframe","autoFocus","extraSidebarPanels","extraContent","isActive","onError"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorKeyboardShortcutsRegister,\n\tEditorSnackbars,\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\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 { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tCommandMenu,\n\tprivateApis as commandsPrivateApis,\n} from '@wordpress/commands';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-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\tResizableBox,\n\tSlotFillProvider,\n\tTooltip,\n\tVisuallyHidden,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n} from '@wordpress/components';\nimport {\n\tuseMediaQuery,\n\tuseRefEffect,\n\tuseViewportMatch,\n} from '@wordpress/compose';\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 { usePaddingAppender } from './use-padding-appender';\nimport { useShouldIframe } from './use-should-iframe';\nimport useNavigateToEntityRecord from '../../hooks/use-navigate-to-entity-record';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { Editor, FullscreenMode, NavigableRegion } = 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() {\n\tconst {\n\t\thasThemeStyleSupport,\n\t\teditorSettings,\n\t\tisZoomedOutView,\n\t\trenderingMode,\n\t\tpostType,\n\t} = useSelect( ( select ) => {\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getCurrentPostType, getRenderingMode } = select( editorStore );\n\t\tconst _postType = getCurrentPostType();\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t\tisZoomedOutView: __unstableGetEditorMode() === 'zoom-out',\n\t\t\trenderingMode: getRenderingMode(),\n\t\t\tpostType: _postType,\n\t\t};\n\t}, [] );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.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...( editorSettings?.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 !== ( editorSettings.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 ( ! editorSettings.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\tconst baseStyles = hasThemeStyles\n\t\t\t? editorSettings.styles ?? []\n\t\t\t: defaultEditorStyles;\n\n\t\t// Add a space for the typewriter effect. When typing in the last block,\n\t\t// there needs to be room to scroll up.\n\t\tif (\n\t\t\t! isZoomedOutView &&\n\t\t\trenderingMode === 'post-only' &&\n\t\t\t! DESIGN_POST_TYPES.includes( postType )\n\t\t) {\n\t\t\treturn [\n\t\t\t\t...baseStyles,\n\t\t\t\t{\n\t\t\t\t\tcss: ':root :where(.editor-styles-wrapper)::after {content: \"\"; display: block; height: 40vh;}',\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\treturn baseStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t\tpostType,\n\t] );\n}\n\n/**\n * @param {Object} props\n * @param {boolean} props.isLegacy True when the editor canvas is not in an iframe.\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\tget( '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\tconst metaBoxesMainRef = useRef();\n\tconst isShort = useMediaQuery( '(max-height: 549px)' );\n\n\tconst [ { min, max }, setHeightConstraints ] = useState( () => ( {} ) );\n\t// Keeps the resizable area’s 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 seperator.\n\tconst effectSizeConstraints = useRefEffect( ( node ) => {\n\t\tconst container = node.closest(\n\t\t\t'.interface-interface-skeleton__content'\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\n\tconst separatorRef = useRef();\n\tconst separatorHelpId = useId();\n\n\tconst [ isUntouched, setIsUntouched ] = useState( true );\n\tconst applyHeight = ( candidateHeight, isPersistent, isInstant ) => {\n\t\tconst nextHeight = Math.min( max, Math.max( min, candidateHeight ) );\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\tnextHeight\n\t\t\t);\n\t\t} else {\n\t\t\tseparatorRef.current.ariaValueNow = getAriaValueNow( nextHeight );\n\t\t}\n\t\tif ( isInstant ) {\n\t\t\tmetaBoxesMainRef.current.updateSize( {\n\t\t\t\theight: nextHeight,\n\t\t\t\t// Oddly, when the event that triggered this was not from the mouse (e.g. keydown),\n\t\t\t\t// if `width` is left unspecified a subsequent drag gesture applies a fixed\n\t\t\t\t// width and the pane fails to widen/narrow with parent width changes from\n\t\t\t\t// sidebars opening/closing or window resizes.\n\t\t\t\twidth: 'auto',\n\t\t\t} );\n\t\t}\n\t};\n\n\tif ( ! hasAnyVisible ) {\n\t\treturn;\n\t}\n\n\tconst contents = (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t// The class name 'edit-post-layout__metaboxes' is retained because some plugins use it.\n\t\t\t\t'edit-post-layout__metaboxes',\n\t\t\t\t! isLegacy && 'edit-post-meta-boxes-main__liner'\n\t\t\t) }\n\t\t\thidden={ ! isLegacy && isShort && ! 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\tlet usedMax = '50%'; // Approximation before max has a value.\n\tif ( max !== undefined ) {\n\t\t// Halves the available max height until a user height is set.\n\t\tusedMax = isAutoHeight && isUntouched ? max / 2 : max;\n\t}\n\n\tconst getAriaValueNow = ( height ) =>\n\t\tMath.round( ( ( height - min ) / ( max - min ) ) * 100 );\n\tconst usedAriaValueNow =\n\t\tmax === undefined || isAutoHeight ? 50 : getAriaValueNow( openHeight );\n\n\tconst toggle = () =>\n\t\tsetPreference( 'core/edit-post', 'metaBoxesMainIsOpen', ! isOpen );\n\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 onSeparatorKeyDown = ( event ) => {\n\t\tconst delta = { ArrowUp: 20, ArrowDown: -20 }[ event.key ];\n\t\tif ( delta ) {\n\t\t\tconst pane = metaBoxesMainRef.current.resizable;\n\t\t\tconst fromHeight = isAutoHeight ? pane.offsetHeight : openHeight;\n\t\t\tconst nextHeight = delta + fromHeight;\n\t\t\tapplyHeight( nextHeight, true, true );\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\tconst className = 'edit-post-meta-boxes-main';\n\tconst paneLabel = __( 'Meta Boxes' );\n\tlet Pane, paneProps;\n\tif ( isShort ) {\n\t\tPane = NavigableRegion;\n\t\tpaneProps = {\n\t\t\tclassName: clsx( className, 'is-toggle-only' ),\n\t\t};\n\t} else {\n\t\tPane = ResizableBox;\n\t\tpaneProps = /** @type {Parameters<typeof ResizableBox>[0]} */ ( {\n\t\t\tas: NavigableRegion,\n\t\t\tref: metaBoxesMainRef,\n\t\t\tclassName: clsx( className, 'is-resizable' ),\n\t\t\tdefaultSize: { height: openHeight },\n\t\t\tminHeight: min,\n\t\t\tmaxHeight: usedMax,\n\t\t\tenable: {\n\t\t\t\ttop: true,\n\t\t\t\tright: false,\n\t\t\t\tbottom: false,\n\t\t\t\tleft: false,\n\t\t\t\ttopLeft: false,\n\t\t\t\ttopRight: false,\n\t\t\t\tbottomRight: false,\n\t\t\t\tbottomLeft: false,\n\t\t\t},\n\t\t\thandleClasses: { top: 'edit-post-meta-boxes-main__presenter' },\n\t\t\thandleComponent: {\n\t\t\t\ttop: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t\t\t\t<button // eslint-disable-line jsx-a11y/role-supports-aria-props\n\t\t\t\t\t\t\t\tref={ separatorRef }\n\t\t\t\t\t\t\t\trole=\"separator\" // eslint-disable-line jsx-a11y/no-interactive-element-to-noninteractive-role\n\t\t\t\t\t\t\t\taria-valuenow={ usedAriaValueNow }\n\t\t\t\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\t\t\t\taria-describedby={ separatorHelpId }\n\t\t\t\t\t\t\t\tonKeyDown={ onSeparatorKeyDown }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t<VisuallyHidden id={ separatorHelpId }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Use up and down arrow keys to resize the meta box panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t// Avoids hiccups while dragging over objects like iframes and ensures that\n\t\t\t// the event to end the drag is captured by the target (resize handle)\n\t\t\t// whether or not it’s under the pointer.\n\t\t\tonPointerDown: ( { pointerId, target } ) => {\n\t\t\t\ttarget.setPointerCapture( pointerId );\n\t\t\t},\n\t\t\tonResizeStart: ( event, direction, elementRef ) => {\n\t\t\t\tif ( isAutoHeight ) {\n\t\t\t\t\t// Sets the starting height to avoid visual jumps in height and\n\t\t\t\t\t// aria-valuenow being `NaN` for the first (few) resize events.\n\t\t\t\t\tapplyHeight( elementRef.offsetHeight, false, true );\n\t\t\t\t\tsetIsUntouched( false );\n\t\t\t\t}\n\t\t\t},\n\t\t\tonResize: () =>\n\t\t\t\tapplyHeight( metaBoxesMainRef.current.state.height ),\n\t\t\tonResizeStop: () =>\n\t\t\t\tapplyHeight( metaBoxesMainRef.current.state.height, true ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<Pane aria-label={ paneLabel } { ...paneProps }>\n\t\t\t{ isShort ? (\n\t\t\t\t<button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\tclassName=\"edit-post-meta-boxes-main__presenter\"\n\t\t\t\t\tonClick={ toggle }\n\t\t\t\t>\n\t\t\t\t\t{ paneLabel }\n\t\t\t\t\t<Icon icon={ isOpen ? chevronUp : chevronDown } />\n\t\t\t\t</button>\n\t\t\t) : (\n\t\t\t\t<meta ref={ effectSizeConstraints } />\n\t\t\t) }\n\t\t\t{ contents }\n\t\t</Pane>\n\t);\n}\n\nfunction Layout( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n} ) {\n\tuseCommands();\n\tuseEditPostCommands();\n\tconst paddingAppenderRef = usePaddingAppender();\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\thasActiveMetaboxes,\n\t\thasBlockSelected,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowMetaBoxes,\n\t\thasHistory,\n\t\tisWelcomeGuideVisible,\n\t\ttemplateId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isFeatureActive, getEditedPostTemplateId } = unlock(\n\t\t\t\tselect( editPostStore )\n\t\t\t);\n\t\t\tconst { canUser, getPostType } = select( coreStore );\n\t\t\tconst { __unstableGetEditorMode } = unlock(\n\t\t\t\tselect( blockEditorStore )\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\n\t\t\tconst isZoomOut = __unstableGetEditorMode() === 'zoom-out';\n\n\t\t\treturn {\n\t\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\t\tisFullscreenActive:\n\t\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\t\thasBlockSelected:\n\t\t\t\t\t!! select( blockEditorStore ).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! DESIGN_POST_TYPES.includes( currentPostType ) &&\n\t\t\t\t\tselect( editorStore ).getRenderingMode() === 'post-only' &&\n\t\t\t\t\t! isZoomOut,\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? getEditedPostTemplateId()\n\t\t\t\t\t\t: null,\n\t\t\t};\n\t\t},\n\t\t[ currentPostType, isEditingTemplate, settings.supportsTemplateMode ]\n\t);\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 editorSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t\tdefaultRenderingMode: 'post-only',\n\t\t} ),\n\t\t[ settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord ]\n\t);\n\tconst styles = useEditorStyles();\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 )\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>\n\t\t\t\t<CommandMenu />\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\tstyles={ styles }\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tcontentRef={ paddingAppenderRef }\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={ ! shouldIframe } />\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 hasHistory={ hasHistory } />\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<InitPatternModal />\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<EditorSnackbars />\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"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,eAAe,EACfC,oBAAoB,EACpBC,qBAAqB,EACrBC,+BAA+B,EAC/BC,eAAe,EACfC,aAAa,EACbC,eAAe,EACfC,KAAK,IAAIC,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;AAC1B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCH,WAAW,IAAII,sBAAsB,EACrCN,KAAK,IAAIO,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,WAAW,EACXC,OAAO,EACPC,KAAK,EACLC,MAAM,EACNC,QAAQ,QACF,oBAAoB;AAC3B,SAASC,WAAW,EAAEC,SAAS,QAAQ,kBAAkB;AACzD,SAASjB,KAAK,IAAIkB,YAAY,QAAQ,oBAAoB;AAC1D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ACuN,QAAQ,EAAGxD;UAAoB,CAAE,CAAC,eAClDxK,IAAA,CAACX,UAAU;YAACyL,UAAU,EAAGA;UAAY,CAAE,CAAC,eACxC9K,IAAA,CAACzD,qBAAqB,IAAE,CAAC,eACzByD,IAAA,CAAC3D,eAAe,IAAE,CAAC,eACnB2D,IAAA,CAAC1D,oBAAoB,IAAE,CAAC,eACxB0D,IAAA,CAACb,yBAAyB,IAAE,CAAC,eAC7Ba,IAAA,CAACxD,+BAA+B,IAAE,CAAC,eACnCwD,IAAA,CAACW,sBAAsB,IAAE,CAAC,eAC1BX,IAAA,CAACZ,gBAAgB,IAAE,CAAC,eACpBY,IAAA,CAAC5C,UAAU;YAAC6Q,OAAO,EAAG1B;UAAmB,CAAE,CAAC,eAC5CvM,IAAA,CAACT,kBAAkB,IAAE,CAAC,EACpBkO,UAAU,eACZzN,IAAA,CAACvD,eAAe,IAAE,CAAC;QAAA,CACZ;MAAC,CACL,CAAC;IAAA,CACQ;EAAC,CACC,CAAC;AAErB;AAEA,eAAe+M,MAAM","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","AutosaveMonitor","LocalAutosaveMonitor","UnsavedChangesWarning","EditorKeyboardShortcutsRegister","EditorSnackbars","ErrorBoundary","PostLockedModal","store","editorStore","privateApis","editorPrivateApis","useSelect","useDispatch","blockEditorPrivateApis","blockEditorStore","PluginArea","__","sprintf","useCallback","useMemo","useId","useRef","useState","chevronDown","chevronUp","noticesStore","preferencesStore","CommandMenu","commandsPrivateApis","coreCommandsPrivateApis","blockLibraryPrivateApis","addQueryArgs","decodeEntities","coreStore","Icon","ResizableBox","SlotFillProvider","Tooltip","VisuallyHidden","__unstableUseNavigateRegions","useNavigateRegions","useMediaQuery","useRefEffect","useViewportMatch","BackButton","EditorInitialization","EditPostKeyboardShortcuts","InitPatternModal","BrowserURL","MetaBoxes","PostEditorMoreMenu","WelcomeGuide","editPostStore","unlock","useEditPostCommands","usePaddingAppender","useShouldIframe","useNavigateToEntityRecord","useMetaBoxInitialization","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","getLayoutStyles","useCommands","useCommandContext","Editor","FullscreenMode","NavigableRegion","BlockKeyboardShortcuts","DESIGN_POST_TYPES","useEditorStyles","hasThemeStyleSupport","editorSettings","isZoomedOutView","renderingMode","postType","select","__unstableGetEditorMode","getCurrentPostType","getRenderingMode","_postType","isFeatureActive","getEditorSettings","_editorSettings$style","_editorSettings$defau","_editorSettings$style2","_editorSettings$style3","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","baseStyles","includes","MetaBoxesMain","isLegacy","isOpen","openHeight","hasAnyVisible","get","isMetaBoxLocationVisible","set","setPreference","metaBoxesMainRef","isShort","min","max","setHeightConstraints","effectSizeConstraints","node","container","closest","noticeLists","querySelectorAll","resizeHandle","querySelector","deriveConstraints","fullHeight","offsetHeight","nextMax","element","nextMin","observer","window","ResizeObserver","observe","disconnect","separatorRef","separatorHelpId","isUntouched","setIsUntouched","applyHeight","candidateHeight","isPersistent","isInstant","nextHeight","Math","current","ariaValueNow","getAriaValueNow","updateSize","height","width","contents","className","hidden","children","location","isAutoHeight","undefined","usedMax","round","usedAriaValueNow","toggle","onSeparatorKeyDown","event","delta","ArrowUp","ArrowDown","key","pane","resizable","fromHeight","preventDefault","paneLabel","Pane","paneProps","as","ref","defaultSize","minHeight","maxHeight","enable","top","right","bottom","left","topLeft","topRight","bottomRight","bottomLeft","handleClasses","handleComponent","text","role","onKeyDown","id","onPointerDown","pointerId","target","setPointerCapture","onResizeStart","direction","elementRef","onResize","state","onResizeStop","onClick","icon","Layout","postId","initialPostId","initialPostType","settings","initialEdits","paddingAppenderRef","shouldIframe","createErrorNotice","currentPost","currentPostId","currentPostType","onNavigateToEntityRecord","onNavigateToPreviousEntityRecord","isEditingTemplate","mode","isFullscreenActive","hasActiveMetaboxes","hasBlockSelected","showIconLabels","isDistractionFree","showMetaBoxes","hasHistory","isWelcomeGuideVisible","templateId","isDevicePreview","_getPostType$viewable","getEditedPostTemplateId","canUser","getPostType","getDeviceType","getEditorMode","supportsTemplateMode","isViewable","viewable","canViewTemplate","kind","name","isZoomOut","hasMetaBoxes","getBlockSelectionStart","commandContext","defaultRenderingMode","document","body","classList","add","remove","navigateRegionsProps","onPluginAreaError","createSuccessNotice","onActionPerformed","actionId","items","href","trashed","post_type","type","ids","newItem","title","rendered","actions","label","post","action","initialPost","backButton","forceIsDirty","contentRef","disableIframe","autoFocus","extraSidebarPanels","extraContent","isActive","onError"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorKeyboardShortcutsRegister,\n\tEditorSnackbars,\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\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 { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tCommandMenu,\n\tprivateApis as commandsPrivateApis,\n} from '@wordpress/commands';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-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\tResizableBox,\n\tSlotFillProvider,\n\tTooltip,\n\tVisuallyHidden,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n} from '@wordpress/components';\nimport {\n\tuseMediaQuery,\n\tuseRefEffect,\n\tuseViewportMatch,\n} from '@wordpress/compose';\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 { usePaddingAppender } from './use-padding-appender';\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 { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { Editor, FullscreenMode, NavigableRegion } = 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() {\n\tconst {\n\t\thasThemeStyleSupport,\n\t\teditorSettings,\n\t\tisZoomedOutView,\n\t\trenderingMode,\n\t\tpostType,\n\t} = useSelect( ( select ) => {\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getCurrentPostType, getRenderingMode } = select( editorStore );\n\t\tconst _postType = getCurrentPostType();\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t\tisZoomedOutView: __unstableGetEditorMode() === 'zoom-out',\n\t\t\trenderingMode: getRenderingMode(),\n\t\t\tpostType: _postType,\n\t\t};\n\t}, [] );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.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...( editorSettings?.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 !== ( editorSettings.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 ( ! editorSettings.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\tconst baseStyles = hasThemeStyles\n\t\t\t? editorSettings.styles ?? []\n\t\t\t: defaultEditorStyles;\n\n\t\t// Add a space for the typewriter effect. When typing in the last block,\n\t\t// there needs to be room to scroll up.\n\t\tif (\n\t\t\t! isZoomedOutView &&\n\t\t\trenderingMode === 'post-only' &&\n\t\t\t! DESIGN_POST_TYPES.includes( postType )\n\t\t) {\n\t\t\treturn [\n\t\t\t\t...baseStyles,\n\t\t\t\t{\n\t\t\t\t\tcss: ':root :where(.editor-styles-wrapper)::after {content: \"\"; display: block; height: 40vh;}',\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\treturn baseStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t\tpostType,\n\t] );\n}\n\n/**\n * @param {Object} props\n * @param {boolean} props.isLegacy True when the editor canvas is not in an iframe.\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\tget( '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\tconst metaBoxesMainRef = useRef();\n\tconst isShort = useMediaQuery( '(max-height: 549px)' );\n\n\tconst [ { min, max }, setHeightConstraints ] = useState( () => ( {} ) );\n\t// Keeps the resizable area’s 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 seperator.\n\tconst effectSizeConstraints = useRefEffect( ( node ) => {\n\t\tconst container = node.closest(\n\t\t\t'.interface-interface-skeleton__content'\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\n\tconst separatorRef = useRef();\n\tconst separatorHelpId = useId();\n\n\tconst [ isUntouched, setIsUntouched ] = useState( true );\n\tconst applyHeight = ( candidateHeight, isPersistent, isInstant ) => {\n\t\tconst nextHeight = Math.min( max, Math.max( min, candidateHeight ) );\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\tnextHeight\n\t\t\t);\n\t\t} else {\n\t\t\tseparatorRef.current.ariaValueNow = getAriaValueNow( nextHeight );\n\t\t}\n\t\tif ( isInstant ) {\n\t\t\tmetaBoxesMainRef.current.updateSize( {\n\t\t\t\theight: nextHeight,\n\t\t\t\t// Oddly, when the event that triggered this was not from the mouse (e.g. keydown),\n\t\t\t\t// if `width` is left unspecified a subsequent drag gesture applies a fixed\n\t\t\t\t// width and the pane fails to widen/narrow with parent width changes from\n\t\t\t\t// sidebars opening/closing or window resizes.\n\t\t\t\twidth: 'auto',\n\t\t\t} );\n\t\t}\n\t};\n\n\tif ( ! hasAnyVisible ) {\n\t\treturn;\n\t}\n\n\tconst contents = (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t// The class name 'edit-post-layout__metaboxes' is retained because some plugins use it.\n\t\t\t\t'edit-post-layout__metaboxes',\n\t\t\t\t! isLegacy && 'edit-post-meta-boxes-main__liner'\n\t\t\t) }\n\t\t\thidden={ ! isLegacy && isShort && ! 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\tlet usedMax = '50%'; // Approximation before max has a value.\n\tif ( max !== undefined ) {\n\t\t// Halves the available max height until a user height is set.\n\t\tusedMax = isAutoHeight && isUntouched ? max / 2 : max;\n\t}\n\n\tconst getAriaValueNow = ( height ) =>\n\t\tMath.round( ( ( height - min ) / ( max - min ) ) * 100 );\n\tconst usedAriaValueNow =\n\t\tmax === undefined || isAutoHeight ? 50 : getAriaValueNow( openHeight );\n\n\tconst toggle = () =>\n\t\tsetPreference( 'core/edit-post', 'metaBoxesMainIsOpen', ! isOpen );\n\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 onSeparatorKeyDown = ( event ) => {\n\t\tconst delta = { ArrowUp: 20, ArrowDown: -20 }[ event.key ];\n\t\tif ( delta ) {\n\t\t\tconst pane = metaBoxesMainRef.current.resizable;\n\t\t\tconst fromHeight = isAutoHeight ? pane.offsetHeight : openHeight;\n\t\t\tconst nextHeight = delta + fromHeight;\n\t\t\tapplyHeight( nextHeight, true, true );\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\tconst className = 'edit-post-meta-boxes-main';\n\tconst paneLabel = __( 'Meta Boxes' );\n\tlet Pane, paneProps;\n\tif ( isShort ) {\n\t\tPane = NavigableRegion;\n\t\tpaneProps = {\n\t\t\tclassName: clsx( className, 'is-toggle-only' ),\n\t\t};\n\t} else {\n\t\tPane = ResizableBox;\n\t\tpaneProps = /** @type {Parameters<typeof ResizableBox>[0]} */ ( {\n\t\t\tas: NavigableRegion,\n\t\t\tref: metaBoxesMainRef,\n\t\t\tclassName: clsx( className, 'is-resizable' ),\n\t\t\tdefaultSize: { height: openHeight },\n\t\t\tminHeight: min,\n\t\t\tmaxHeight: usedMax,\n\t\t\tenable: {\n\t\t\t\ttop: true,\n\t\t\t\tright: false,\n\t\t\t\tbottom: false,\n\t\t\t\tleft: false,\n\t\t\t\ttopLeft: false,\n\t\t\t\ttopRight: false,\n\t\t\t\tbottomRight: false,\n\t\t\t\tbottomLeft: false,\n\t\t\t},\n\t\t\thandleClasses: { top: 'edit-post-meta-boxes-main__presenter' },\n\t\t\thandleComponent: {\n\t\t\t\ttop: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t\t\t\t<button // eslint-disable-line jsx-a11y/role-supports-aria-props\n\t\t\t\t\t\t\t\tref={ separatorRef }\n\t\t\t\t\t\t\t\trole=\"separator\" // eslint-disable-line jsx-a11y/no-interactive-element-to-noninteractive-role\n\t\t\t\t\t\t\t\taria-valuenow={ usedAriaValueNow }\n\t\t\t\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\t\t\t\taria-describedby={ separatorHelpId }\n\t\t\t\t\t\t\t\tonKeyDown={ onSeparatorKeyDown }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t<VisuallyHidden id={ separatorHelpId }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Use up and down arrow keys to resize the meta box panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t// Avoids hiccups while dragging over objects like iframes and ensures that\n\t\t\t// the event to end the drag is captured by the target (resize handle)\n\t\t\t// whether or not it’s under the pointer.\n\t\t\tonPointerDown: ( { pointerId, target } ) => {\n\t\t\t\ttarget.setPointerCapture( pointerId );\n\t\t\t},\n\t\t\tonResizeStart: ( event, direction, elementRef ) => {\n\t\t\t\tif ( isAutoHeight ) {\n\t\t\t\t\t// Sets the starting height to avoid visual jumps in height and\n\t\t\t\t\t// aria-valuenow being `NaN` for the first (few) resize events.\n\t\t\t\t\tapplyHeight( elementRef.offsetHeight, false, true );\n\t\t\t\t\tsetIsUntouched( false );\n\t\t\t\t}\n\t\t\t},\n\t\t\tonResize: () =>\n\t\t\t\tapplyHeight( metaBoxesMainRef.current.state.height ),\n\t\t\tonResizeStop: () =>\n\t\t\t\tapplyHeight( metaBoxesMainRef.current.state.height, true ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<Pane aria-label={ paneLabel } { ...paneProps }>\n\t\t\t{ isShort ? (\n\t\t\t\t<button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\tclassName=\"edit-post-meta-boxes-main__presenter\"\n\t\t\t\t\tonClick={ toggle }\n\t\t\t\t>\n\t\t\t\t\t{ paneLabel }\n\t\t\t\t\t<Icon icon={ isOpen ? chevronUp : chevronDown } />\n\t\t\t\t</button>\n\t\t\t) : (\n\t\t\t\t<meta ref={ effectSizeConstraints } />\n\t\t\t) }\n\t\t\t{ contents }\n\t\t</Pane>\n\t);\n}\n\nfunction Layout( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n} ) {\n\tuseCommands();\n\tuseEditPostCommands();\n\tconst paddingAppenderRef = usePaddingAppender();\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\thasActiveMetaboxes,\n\t\thasBlockSelected,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowMetaBoxes,\n\t\thasHistory,\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, getEditedPostTemplateId } = unlock(\n\t\t\t\tselect( editPostStore )\n\t\t\t);\n\t\t\tconst { canUser, getPostType } = select( coreStore );\n\t\t\tconst { getDeviceType, getEditorMode } = select( editorStore );\n\t\t\tconst { __unstableGetEditorMode } = unlock(\n\t\t\t\tselect( blockEditorStore )\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\n\t\t\tconst isZoomOut = __unstableGetEditorMode() === 'zoom-out';\n\n\t\t\treturn {\n\t\t\t\tmode: getEditorMode(),\n\t\t\t\tisFullscreenActive:\n\t\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\t\thasBlockSelected:\n\t\t\t\t\t!! select( blockEditorStore ).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! DESIGN_POST_TYPES.includes( currentPostType ) &&\n\t\t\t\t\t! isZoomOut,\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? getEditedPostTemplateId()\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[ currentPostType, isEditingTemplate, settings.supportsTemplateMode ]\n\t);\n\tuseMetaBoxInitialization( hasActiveMetaboxes );\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 editorSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t\tdefaultRenderingMode: 'post-only',\n\t\t} ),\n\t\t[ settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord ]\n\t);\n\tconst styles = useEditorStyles();\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 )\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>\n\t\t\t\t<CommandMenu />\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\tstyles={ styles }\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tcontentRef={ paddingAppenderRef }\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\n\t\t\t\t\t\t\t\t\tisLegacy={\n\t\t\t\t\t\t\t\t\t\t! shouldIframe || isDevicePreview\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\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 hasHistory={ hasHistory } />\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<InitPatternModal />\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<EditorSnackbars />\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"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,eAAe,EACfC,oBAAoB,EACpBC,qBAAqB,EACrBC,+BAA+B,EAC/BC,eAAe,EACfC,aAAa,EACbC,eAAe,EACfC,KAAK,IAAIC,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;AAC1B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCH,WAAW,IAAII,sBAAsB,EACrCN,KAAK,IAAIO,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,WAAW,EACXC,OAAO,EACPC,KAAK,EACLC,MAAM,EACNC,QAAQ,QACF,oBAAoB;AAC3B,SAASC,WAAW,EAAEC,SAAS,QAAQ,kBAAkB;AACzD,SAASjB,KAAK,IAAIkB,YAAY,QAAQ,oBAAoB;AAC1D,SAASlB,KAAK,IAAImB,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,WAAW,EACXlB,WAAW,IAAImB,mBAAmB,QAC5B,qBAAqB;AAC5B,SAASnB,WAAW,IAAIoB,uBAAuB,QAAQ,0BAA0B;AACjF,SAASpB,WAAW,IAAIqB,uBAAuB,QAAQ,0BAA0B;AACjF,SAASC,YAAY,QAAQ,gBAA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AA,CAAC1D,qBAAqB,IAAE,CAAC,eACzB0D,IAAA,CAAC5D,eAAe,IAAE,CAAC,eACnB4D,IAAA,CAAC3D,oBAAoB,IAAE,CAAC,eACxB2D,IAAA,CAACd,yBAAyB,IAAE,CAAC,eAC7Bc,IAAA,CAACzD,+BAA+B,IAAE,CAAC,eACnCyD,IAAA,CAACW,sBAAsB,IAAE,CAAC,eAC1BX,IAAA,CAACb,gBAAgB,IAAE,CAAC,eACpBa,IAAA,CAAC7C,UAAU;YAACgR,OAAO,EAAG1B;UAAmB,CAAE,CAAC,eAC5CzM,IAAA,CAACV,kBAAkB,IAAE,CAAC,EACpBqO,UAAU,eACZ3N,IAAA,CAACxD,eAAe,IAAE,CAAC;QAAA,CACZ;MAAC,CACL,CAAC;IAAA,CACQ;EAAC,CACC,CAAC;AAErB;AAEA,eAAegN,MAAM","ignoreList":[]}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { useSelect
|
|
5
|
-
import { useEffect } from '@wordpress/element';
|
|
6
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
4
|
+
import { useSelect } from '@wordpress/data';
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* Internal dependencies
|
|
@@ -17,38 +15,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
17
15
|
export default function MetaBoxes({
|
|
18
16
|
location
|
|
19
17
|
}) {
|
|
20
|
-
const
|
|
21
|
-
const {
|
|
22
|
-
metaBoxes,
|
|
23
|
-
areMetaBoxesInitialized,
|
|
24
|
-
isEditorReady
|
|
25
|
-
} = useSelect(select => {
|
|
26
|
-
const {
|
|
27
|
-
__unstableIsEditorReady
|
|
28
|
-
} = select(editorStore);
|
|
29
|
-
const {
|
|
30
|
-
getMetaBoxesPerLocation,
|
|
31
|
-
areMetaBoxesInitialized: _areMetaBoxesInitialized
|
|
32
|
-
} = select(editPostStore);
|
|
33
|
-
return {
|
|
34
|
-
metaBoxes: getMetaBoxesPerLocation(location),
|
|
35
|
-
areMetaBoxesInitialized: _areMetaBoxesInitialized(),
|
|
36
|
-
isEditorReady: __unstableIsEditorReady()
|
|
37
|
-
};
|
|
38
|
-
}, [location]);
|
|
39
|
-
const hasMetaBoxes = !!metaBoxes?.length;
|
|
40
|
-
|
|
41
|
-
// When editor is ready, initialize postboxes (wp core script) and metabox
|
|
42
|
-
// saving. This initializes all meta box locations, not just this specific
|
|
43
|
-
// one.
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
if (isEditorReady && hasMetaBoxes && !areMetaBoxesInitialized) {
|
|
46
|
-
registry.dispatch(editPostStore).initializeMetaBoxes();
|
|
47
|
-
}
|
|
48
|
-
}, [isEditorReady, hasMetaBoxes, areMetaBoxesInitialized]);
|
|
49
|
-
if (!areMetaBoxesInitialized) {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
18
|
+
const metaBoxes = useSelect(select => select(editPostStore).getMetaBoxesPerLocation(location), [location]);
|
|
52
19
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
53
20
|
children: [(metaBoxes !== null && metaBoxes !== void 0 ? metaBoxes : []).map(({
|
|
54
21
|
id
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","
|
|
1
|
+
{"version":3,"names":["useSelect","MetaBoxesArea","MetaBoxVisibility","store","editPostStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","MetaBoxes","location","metaBoxes","select","getMetaBoxesPerLocation","children","map","id"],"sources":["@wordpress/edit-post/src/components/meta-boxes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport MetaBoxesArea from './meta-boxes-area';\nimport MetaBoxVisibility from './meta-box-visibility';\nimport { store as editPostStore } from '../../store';\n\nexport default function MetaBoxes( { location } ) {\n\tconst metaBoxes = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editPostStore ).getMetaBoxesPerLocation( location ),\n\t\t[ location ]\n\t);\n\treturn (\n\t\t<>\n\t\t\t{ ( metaBoxes ?? [] ).map( ( { id } ) => (\n\t\t\t\t<MetaBoxVisibility key={ id } id={ id } />\n\t\t\t) ) }\n\t\t\t<MetaBoxesArea location={ location } />\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAErD,eAAe,SAASC,SAASA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACjD,MAAMC,SAAS,GAAGb,SAAS,CACxBc,MAAM,IACPA,MAAM,CAAEV,aAAc,CAAC,CAACW,uBAAuB,CAAEH,QAAS,CAAC,EAC5D,CAAEA,QAAQ,CACX,CAAC;EACD,oBACCF,KAAA,CAAAF,SAAA;IAAAQ,QAAA,GACG,CAAEH,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EAAE,EAAGI,GAAG,CAAE,CAAE;MAAEC;IAAG,CAAC,kBAClCZ,IAAA,CAACJ,iBAAiB;MAAYgB,EAAE,EAAGA;IAAI,GAAdA,EAAgB,CACxC,CAAC,eACHZ,IAAA,CAACL,aAAa;MAACW,QAAQ,EAAGA;IAAU,CAAE,CAAC;EAAA,CACtC,CAAC;AAEL","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
5
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
6
|
+
import { useEffect } from '@wordpress/element';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { store as editPostStore } from '../../store';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Initializes WordPress `postboxes` script and the logic for saving meta boxes.
|
|
15
|
+
*
|
|
16
|
+
* @param { boolean } enabled
|
|
17
|
+
*/
|
|
18
|
+
export const useMetaBoxInitialization = enabled => {
|
|
19
|
+
const isEnabledAndEditorReady = useSelect(select => enabled && select(editorStore).__unstableIsEditorReady(), [enabled]);
|
|
20
|
+
const {
|
|
21
|
+
initializeMetaBoxes
|
|
22
|
+
} = useDispatch(editPostStore);
|
|
23
|
+
// The effect has to rerun when the editor is ready because initializeMetaBoxes
|
|
24
|
+
// will noop until then.
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (isEnabledAndEditorReady) {
|
|
27
|
+
initializeMetaBoxes();
|
|
28
|
+
}
|
|
29
|
+
}, [isEnabledAndEditorReady, initializeMetaBoxes]);
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=use-meta-box-initialization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useDispatch","useSelect","store","editorStore","useEffect","editPostStore","useMetaBoxInitialization","enabled","isEnabledAndEditorReady","select","__unstableIsEditorReady","initializeMetaBoxes"],"sources":["@wordpress/edit-post/src/components/meta-boxes/use-meta-box-initialization.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\n/**\n * Initializes WordPress `postboxes` script and the logic for saving meta boxes.\n *\n * @param { boolean } enabled\n */\nexport const useMetaBoxInitialization = ( enabled ) => {\n\tconst isEnabledAndEditorReady = useSelect(\n\t\t( select ) =>\n\t\t\tenabled && select( editorStore ).__unstableIsEditorReady(),\n\t\t[ enabled ]\n\t);\n\tconst { initializeMetaBoxes } = useDispatch( editPostStore );\n\t// The effect has to rerun when the editor is ready because initializeMetaBoxes\n\t// will noop until then.\n\tuseEffect( () => {\n\t\tif ( isEnabledAndEditorReady ) {\n\t\t\tinitializeMetaBoxes();\n\t\t}\n\t}, [ isEnabledAndEditorReady, initializeMetaBoxes ] );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA,SAASF,KAAK,IAAIG,aAAa,QAAQ,aAAa;;AAEpD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,GAAKC,OAAO,IAAM;EACtD,MAAMC,uBAAuB,GAAGP,SAAS,CACtCQ,MAAM,IACPF,OAAO,IAAIE,MAAM,CAAEN,WAAY,CAAC,CAACO,uBAAuB,CAAC,CAAC,EAC3D,CAAEH,OAAO,CACV,CAAC;EACD,MAAM;IAAEI;EAAoB,CAAC,GAAGX,WAAW,CAAEK,aAAc,CAAC;EAC5D;EACA;EACAD,SAAS,CAAE,MAAM;IAChB,IAAKI,uBAAuB,EAAG;MAC9BG,mBAAmB,CAAC,CAAC;IACtB;EACD,CAAC,EAAE,CAAEH,uBAAuB,EAAEG,mBAAmB,CAAG,CAAC;AACtD,CAAC","ignoreList":[]}
|
|
@@ -278,9 +278,11 @@
|
|
|
278
278
|
clear: both;
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
.has-metaboxes .editor-visual-editor {
|
|
282
|
-
flex: 1;
|
|
281
|
+
.has-metaboxes .interface-interface-skeleton__content:has(.edit-post-meta-boxes-main) .editor-visual-editor {
|
|
282
|
+
flex-shrink: 1;
|
|
283
|
+
flex-basis: 0%;
|
|
283
284
|
}
|
|
285
|
+
|
|
284
286
|
.has-metaboxes .editor-visual-editor.is-iframed {
|
|
285
287
|
isolation: isolate;
|
|
286
288
|
}
|
package/build-style/style.css
CHANGED
|
@@ -278,9 +278,11 @@
|
|
|
278
278
|
clear: both;
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
.has-metaboxes .editor-visual-editor {
|
|
282
|
-
flex: 1;
|
|
281
|
+
.has-metaboxes .interface-interface-skeleton__content:has(.edit-post-meta-boxes-main) .editor-visual-editor {
|
|
282
|
+
flex-shrink: 1;
|
|
283
|
+
flex-basis: 0%;
|
|
283
284
|
}
|
|
285
|
+
|
|
284
286
|
.has-metaboxes .editor-visual-editor.is-iframed {
|
|
285
287
|
isolation: isolate;
|
|
286
288
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-post",
|
|
3
|
-
"version": "8.8.
|
|
3
|
+
"version": "8.8.20",
|
|
4
4
|
"description": "Edit Post module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -30,33 +30,33 @@
|
|
|
30
30
|
"@babel/runtime": "^7.16.0",
|
|
31
31
|
"@wordpress/a11y": "^4.8.2",
|
|
32
32
|
"@wordpress/api-fetch": "^7.8.2",
|
|
33
|
-
"@wordpress/block-editor": "^14.3.
|
|
34
|
-
"@wordpress/block-library": "^9.8.
|
|
35
|
-
"@wordpress/blocks": "^13.8.
|
|
36
|
-
"@wordpress/commands": "^1.8.
|
|
37
|
-
"@wordpress/components": "^28.8.
|
|
38
|
-
"@wordpress/compose": "^7.8.
|
|
39
|
-
"@wordpress/core-commands": "^1.8.
|
|
40
|
-
"@wordpress/core-data": "^7.8.
|
|
41
|
-
"@wordpress/data": "^10.8.
|
|
33
|
+
"@wordpress/block-editor": "^14.3.16",
|
|
34
|
+
"@wordpress/block-library": "^9.8.17",
|
|
35
|
+
"@wordpress/blocks": "^13.8.6",
|
|
36
|
+
"@wordpress/commands": "^1.8.12",
|
|
37
|
+
"@wordpress/components": "^28.8.12",
|
|
38
|
+
"@wordpress/compose": "^7.8.4",
|
|
39
|
+
"@wordpress/core-commands": "^1.8.16",
|
|
40
|
+
"@wordpress/core-data": "^7.8.16",
|
|
41
|
+
"@wordpress/data": "^10.8.4",
|
|
42
42
|
"@wordpress/deprecated": "^4.8.2",
|
|
43
43
|
"@wordpress/dom": "^4.8.2",
|
|
44
|
-
"@wordpress/editor": "^14.8.
|
|
44
|
+
"@wordpress/editor": "^14.8.19",
|
|
45
45
|
"@wordpress/element": "^6.8.1",
|
|
46
46
|
"@wordpress/hooks": "^4.8.2",
|
|
47
47
|
"@wordpress/html-entities": "^4.8.1",
|
|
48
48
|
"@wordpress/i18n": "^5.8.2",
|
|
49
49
|
"@wordpress/icons": "^10.8.2",
|
|
50
|
-
"@wordpress/keyboard-shortcuts": "^5.8.
|
|
50
|
+
"@wordpress/keyboard-shortcuts": "^5.8.4",
|
|
51
51
|
"@wordpress/keycodes": "^4.8.2",
|
|
52
|
-
"@wordpress/notices": "^5.8.
|
|
53
|
-
"@wordpress/plugins": "^7.8.
|
|
54
|
-
"@wordpress/preferences": "^4.8.
|
|
52
|
+
"@wordpress/notices": "^5.8.4",
|
|
53
|
+
"@wordpress/plugins": "^7.8.12",
|
|
54
|
+
"@wordpress/preferences": "^4.8.12",
|
|
55
55
|
"@wordpress/private-apis": "^1.8.1",
|
|
56
56
|
"@wordpress/url": "^4.8.1",
|
|
57
|
-
"@wordpress/viewport": "^6.8.
|
|
57
|
+
"@wordpress/viewport": "^6.8.4",
|
|
58
58
|
"@wordpress/warning": "^3.8.1",
|
|
59
|
-
"@wordpress/widgets": "^4.8.
|
|
59
|
+
"@wordpress/widgets": "^4.8.16",
|
|
60
60
|
"clsx": "^2.1.1",
|
|
61
61
|
"memize": "^2.1.0"
|
|
62
62
|
},
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "1446c6b709590e4822f0c47c030e7bc0d1731b23"
|
|
71
71
|
}
|
|
@@ -74,6 +74,7 @@ import useEditPostCommands from '../../commands/use-commands';
|
|
|
74
74
|
import { usePaddingAppender } from './use-padding-appender';
|
|
75
75
|
import { useShouldIframe } from './use-should-iframe';
|
|
76
76
|
import useNavigateToEntityRecord from '../../hooks/use-navigate-to-entity-record';
|
|
77
|
+
import { useMetaBoxInitialization } from '../meta-boxes/use-meta-box-initialization';
|
|
77
78
|
|
|
78
79
|
const { getLayoutStyles } = unlock( blockEditorPrivateApis );
|
|
79
80
|
const { useCommands } = unlock( coreCommandsPrivateApis );
|
|
@@ -417,6 +418,7 @@ function Layout( {
|
|
|
417
418
|
hasHistory,
|
|
418
419
|
isWelcomeGuideVisible,
|
|
419
420
|
templateId,
|
|
421
|
+
isDevicePreview,
|
|
420
422
|
} = useSelect(
|
|
421
423
|
( select ) => {
|
|
422
424
|
const { get } = select( preferencesStore );
|
|
@@ -424,6 +426,7 @@ function Layout( {
|
|
|
424
426
|
select( editPostStore )
|
|
425
427
|
);
|
|
426
428
|
const { canUser, getPostType } = select( coreStore );
|
|
429
|
+
const { getDeviceType, getEditorMode } = select( editorStore );
|
|
427
430
|
const { __unstableGetEditorMode } = unlock(
|
|
428
431
|
select( blockEditorStore )
|
|
429
432
|
);
|
|
@@ -439,7 +442,7 @@ function Layout( {
|
|
|
439
442
|
const isZoomOut = __unstableGetEditorMode() === 'zoom-out';
|
|
440
443
|
|
|
441
444
|
return {
|
|
442
|
-
mode:
|
|
445
|
+
mode: getEditorMode(),
|
|
443
446
|
isFullscreenActive:
|
|
444
447
|
select( editPostStore ).isFeatureActive( 'fullscreenMode' ),
|
|
445
448
|
hasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),
|
|
@@ -449,7 +452,6 @@ function Layout( {
|
|
|
449
452
|
isDistractionFree: get( 'core', 'distractionFree' ),
|
|
450
453
|
showMetaBoxes:
|
|
451
454
|
! DESIGN_POST_TYPES.includes( currentPostType ) &&
|
|
452
|
-
select( editorStore ).getRenderingMode() === 'post-only' &&
|
|
453
455
|
! isZoomOut,
|
|
454
456
|
isWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),
|
|
455
457
|
templateId:
|
|
@@ -459,10 +461,12 @@ function Layout( {
|
|
|
459
461
|
! isEditingTemplate
|
|
460
462
|
? getEditedPostTemplateId()
|
|
461
463
|
: null,
|
|
464
|
+
isDevicePreview: getDeviceType() !== 'Desktop',
|
|
462
465
|
};
|
|
463
466
|
},
|
|
464
467
|
[ currentPostType, isEditingTemplate, settings.supportsTemplateMode ]
|
|
465
468
|
);
|
|
469
|
+
useMetaBoxInitialization( hasActiveMetaboxes );
|
|
466
470
|
|
|
467
471
|
// Set the right context for the command palette
|
|
468
472
|
const commandContext = hasBlockSelected
|
|
@@ -600,7 +604,11 @@ function Layout( {
|
|
|
600
604
|
extraContent={
|
|
601
605
|
! isDistractionFree &&
|
|
602
606
|
showMetaBoxes && (
|
|
603
|
-
<MetaBoxesMain
|
|
607
|
+
<MetaBoxesMain
|
|
608
|
+
isLegacy={
|
|
609
|
+
! shouldIframe || isDevicePreview
|
|
610
|
+
}
|
|
611
|
+
/>
|
|
604
612
|
)
|
|
605
613
|
}
|
|
606
614
|
>
|
|
@@ -106,12 +106,15 @@
|
|
|
106
106
|
clear: both;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
// Only when the split view is active the visual editor should allow shrinking and
|
|
110
|
+
// its main size should be zero.
|
|
111
|
+
.has-metaboxes .interface-interface-skeleton__content:has(.edit-post-meta-boxes-main) .editor-visual-editor {
|
|
112
|
+
flex-shrink: 1;
|
|
113
|
+
flex-basis: 0%;
|
|
114
|
+
}
|
|
111
115
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
116
|
+
.has-metaboxes .editor-visual-editor.is-iframed {
|
|
117
|
+
isolation: isolate;
|
|
115
118
|
}
|
|
116
119
|
|
|
117
120
|
// Adjust the position of the notices
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { useSelect
|
|
5
|
-
import { useEffect } from '@wordpress/element';
|
|
6
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
4
|
+
import { useSelect } from '@wordpress/data';
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* Internal dependencies
|
|
@@ -13,38 +11,11 @@ import MetaBoxVisibility from './meta-box-visibility';
|
|
|
13
11
|
import { store as editPostStore } from '../../store';
|
|
14
12
|
|
|
15
13
|
export default function MetaBoxes( { location } ) {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const { __unstableIsEditorReady } = select( editorStore );
|
|
20
|
-
const {
|
|
21
|
-
getMetaBoxesPerLocation,
|
|
22
|
-
areMetaBoxesInitialized: _areMetaBoxesInitialized,
|
|
23
|
-
} = select( editPostStore );
|
|
24
|
-
return {
|
|
25
|
-
metaBoxes: getMetaBoxesPerLocation( location ),
|
|
26
|
-
areMetaBoxesInitialized: _areMetaBoxesInitialized(),
|
|
27
|
-
isEditorReady: __unstableIsEditorReady(),
|
|
28
|
-
};
|
|
29
|
-
},
|
|
14
|
+
const metaBoxes = useSelect(
|
|
15
|
+
( select ) =>
|
|
16
|
+
select( editPostStore ).getMetaBoxesPerLocation( location ),
|
|
30
17
|
[ location ]
|
|
31
18
|
);
|
|
32
|
-
|
|
33
|
-
const hasMetaBoxes = !! metaBoxes?.length;
|
|
34
|
-
|
|
35
|
-
// When editor is ready, initialize postboxes (wp core script) and metabox
|
|
36
|
-
// saving. This initializes all meta box locations, not just this specific
|
|
37
|
-
// one.
|
|
38
|
-
useEffect( () => {
|
|
39
|
-
if ( isEditorReady && hasMetaBoxes && ! areMetaBoxesInitialized ) {
|
|
40
|
-
registry.dispatch( editPostStore ).initializeMetaBoxes();
|
|
41
|
-
}
|
|
42
|
-
}, [ isEditorReady, hasMetaBoxes, areMetaBoxesInitialized ] );
|
|
43
|
-
|
|
44
|
-
if ( ! areMetaBoxesInitialized ) {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
19
|
return (
|
|
49
20
|
<>
|
|
50
21
|
{ ( metaBoxes ?? [] ).map( ( { id } ) => (
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
5
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
6
|
+
import { useEffect } from '@wordpress/element';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { store as editPostStore } from '../../store';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Initializes WordPress `postboxes` script and the logic for saving meta boxes.
|
|
15
|
+
*
|
|
16
|
+
* @param { boolean } enabled
|
|
17
|
+
*/
|
|
18
|
+
export const useMetaBoxInitialization = ( enabled ) => {
|
|
19
|
+
const isEnabledAndEditorReady = useSelect(
|
|
20
|
+
( select ) =>
|
|
21
|
+
enabled && select( editorStore ).__unstableIsEditorReady(),
|
|
22
|
+
[ enabled ]
|
|
23
|
+
);
|
|
24
|
+
const { initializeMetaBoxes } = useDispatch( editPostStore );
|
|
25
|
+
// The effect has to rerun when the editor is ready because initializeMetaBoxes
|
|
26
|
+
// will noop until then.
|
|
27
|
+
useEffect( () => {
|
|
28
|
+
if ( isEnabledAndEditorReady ) {
|
|
29
|
+
initializeMetaBoxes();
|
|
30
|
+
}
|
|
31
|
+
}, [ isEnabledAndEditorReady, initializeMetaBoxes ] );
|
|
32
|
+
};
|