@wordpress/edit-post 8.11.0 → 8.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/keyboard-shortcuts/index.js +2 -2
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/index.js +1 -1
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/use-should-iframe.js +15 -25
- package/build/components/layout/use-should-iframe.js.map +1 -1
- package/build/components/more-menu/index.js +3 -3
- package/build/components/more-menu/index.js.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/index.native.js +1 -0
- package/build/index.native.js.map +1 -1
- package/build/store/actions.js +24 -1
- package/build/store/actions.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +2 -2
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/index.js +1 -1
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/use-should-iframe.js +15 -25
- package/build-module/components/layout/use-should-iframe.js.map +1 -1
- package/build-module/components/more-menu/index.js +3 -3
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +1 -0
- package/build-module/index.native.js.map +1 -1
- package/build-module/store/actions.js +22 -0
- package/build-module/store/actions.js.map +1 -1
- package/package.json +3 -3
- package/src/components/keyboard-shortcuts/index.js +2 -2
- package/src/components/layout/index.js +1 -1
- package/src/components/layout/use-should-iframe.js +19 -31
- package/src/components/more-menu/index.js +3 -3
- package/src/index.js +1 -0
- package/src/index.native.js +1 -0
- package/src/store/actions.js +43 -0
package/CHANGELOG.md
CHANGED
|
@@ -19,7 +19,7 @@ var _store = require("../../store");
|
|
|
19
19
|
|
|
20
20
|
function KeyboardShortcuts() {
|
|
21
21
|
const {
|
|
22
|
-
|
|
22
|
+
toggleFullscreenMode
|
|
23
23
|
} = (0, _data.useDispatch)(_store.store);
|
|
24
24
|
const {
|
|
25
25
|
registerShortcut
|
|
@@ -36,7 +36,7 @@ function KeyboardShortcuts() {
|
|
|
36
36
|
});
|
|
37
37
|
}, []);
|
|
38
38
|
(0, _keyboardShortcuts.useShortcut)('core/edit-post/toggle-fullscreen', () => {
|
|
39
|
-
|
|
39
|
+
toggleFullscreenMode();
|
|
40
40
|
});
|
|
41
41
|
return null;
|
|
42
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_keyboardShortcuts","_i18n","_store","KeyboardShortcuts","
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_keyboardShortcuts","_i18n","_store","KeyboardShortcuts","toggleFullscreenMode","useDispatch","editPostStore","registerShortcut","keyboardShortcutsStore","useEffect","name","category","description","__","keyCombination","modifier","character","useShortcut","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/keyboard-shortcuts/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction KeyboardShortcuts() {\n\tconst { toggleFullscreenMode } = useDispatch( editPostStore );\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/toggle-fullscreen',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Enable or disable fullscreen mode.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'secondary',\n\t\t\t\tcharacter: 'f',\n\t\t\t},\n\t\t} );\n\t}, [] );\n\n\tuseShortcut( 'core/edit-post/toggle-fullscreen', () => {\n\t\ttoggleFullscreenMode();\n\t} );\n\n\treturn null;\n}\n\nexport default KeyboardShortcuts;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AAIA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAdA;AACA;AACA;;AASA;AACA;AACA;;AAGA,SAASK,iBAAiBA,CAAA,EAAG;EAC5B,MAAM;IAAEC;EAAqB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAc,CAAC;EAC7D,MAAM;IAAEC;EAAiB,CAAC,GAAG,IAAAF,iBAAW,EAAEG,wBAAuB,CAAC;EAElE,IAAAC,kBAAS,EAAE,MAAM;IAChBF,gBAAgB,CAAE;MACjBG,IAAI,EAAE,kCAAkC;MACxCC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAE,IAAAC,QAAE,EAAE,oCAAqC,CAAC;MACvDC,cAAc,EAAE;QACfC,QAAQ,EAAE,WAAW;QACrBC,SAAS,EAAE;MACZ;IACD,CAAE,CAAC;EACJ,CAAC,EAAE,EAAG,CAAC;EAEP,IAAAC,8BAAW,EAAE,kCAAkC,EAAE,MAAM;IACtDb,oBAAoB,CAAC,CAAC;EACvB,CAAE,CAAC;EAEH,OAAO,IAAI;AACZ;AAAC,IAAAc,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcjB,iBAAiB","ignoreList":[]}
|
|
@@ -381,7 +381,7 @@ function Layout({
|
|
|
381
381
|
hasBlockSelected: !!select(_blockEditor.store).getBlockSelectionStart(),
|
|
382
382
|
showIconLabels: get('core', 'showIconLabels'),
|
|
383
383
|
isDistractionFree: get('core', 'distractionFree'),
|
|
384
|
-
showMetaBoxes: !DESIGN_POST_TYPES.includes(currentPostType) &&
|
|
384
|
+
showMetaBoxes: !DESIGN_POST_TYPES.includes(currentPostType) && !isZoomOut(),
|
|
385
385
|
isWelcomeGuideVisible: isFeatureActive('welcomeGuide'),
|
|
386
386
|
templateId: supportsTemplateMode && isViewable && canViewTemplate && !isEditingTemplate ? getEditedPostTemplateId() : null,
|
|
387
387
|
enablePaddingAppender: !isZoomOut() && isRenderingPostOnly && !DESIGN_POST_TYPES.includes(currentPostType)
|
|
@@ -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","additionalStyles","hasThemeStyleSupport","editorSettings","useSelect","select","editPostStore","isFeatureActive","editorStore","getEditorSettings","addedStyles","join","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","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","postType","initialPostType","settings","initialEdits","useEditPostCommands","shouldIframe","useShouldIframe","createErrorNotice","noticesStore","currentPost","currentPostId","currentPostType","onNavigateToEntityRecord","onNavigateToPreviousEntityRecord","useNavigateToEntityRecord","isEditingTemplate","mode","isFullscreenActive","hasActiveMetaboxes","hasBlockSelected","showIconLabels","isDistractionFree","showMetaBoxes","hasHistory","isWelcomeGuideVisible","templateId","enablePaddingAppender","_getPostType$viewable","getEditedPostTemplateId","canUser","getPostType","coreStore","supportsTemplateMode","isViewable","viewable","canViewTemplate","kind","name","isZoomOut","blockEditorStore","getEditorMode","getRenderingMode","isRenderingPostOnly","hasMetaBoxes","getBlockSelectionStart","includes","paddingAppenderRef","paddingStyle","usePaddingAppender","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( ...additionalStyles ) {\n\tconst { hasThemeStyleSupport, editorSettings } = useSelect( ( select ) => {\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};\n\t}, [] );\n\n\tconst addedStyles = additionalStyles.join( '\\n' );\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\tif ( addedStyles ) {\n\t\t\treturn [ ...baseStyles, { css: addedStyles } ];\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\taddedStyles,\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 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\tenablePaddingAppender,\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\n\t\t\tconst supportsTemplateMode = settings.supportsTemplateMode;\n\t\t\tconst isViewable =\n\t\t\t\tgetPostType( currentPostType )?.viewable ?? false;\n\t\t\tconst canViewTemplate = canUser( 'read', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\t\t\tconst { isZoomOut } = unlock( select( blockEditorStore ) );\n\t\t\tconst { getEditorMode, getRenderingMode } = select( editorStore );\n\t\t\tconst isRenderingPostOnly = getRenderingMode() === 'post-only';\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\tisRenderingPostOnly,\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\tenablePaddingAppender:\n\t\t\t\t\t! isZoomOut() &&\n\t\t\t\t\tisRenderingPostOnly &&\n\t\t\t\t\t! DESIGN_POST_TYPES.includes( currentPostType ),\n\t\t\t};\n\t\t},\n\t\t[ currentPostType, isEditingTemplate, settings.supportsTemplateMode ]\n\t);\n\tconst [ paddingAppenderRef, paddingStyle ] = usePaddingAppender(\n\t\tenablePaddingAppender\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( paddingStyle );\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":";;;;;;;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,OAAA;AAIA,IAAAW,aAAA,GAAAX,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AACA,IAAAa,IAAA,GAAAb,OAAA;AACA,IAAAc,aAAA,GAAAd,OAAA;AACA,IAAAe,SAAA,GAAAf,OAAA;AACA,IAAAgB,WAAA,GAAAhB,OAAA;AAQA,I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AC;QAAA,CACZ;MAAC,CACL,CAAC;IAAA,CACQ;EAAC,CACC,CAAC;AAErB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArK,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","_jsxRuntime","getLayoutStyles","unlock","blockEditorPrivateApis","useCommands","coreCommandsPrivateApis","useCommandContext","commandsPrivateApis","Editor","FullscreenMode","NavigableRegion","editorPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","DESIGN_POST_TYPES","useEditorStyles","additionalStyles","hasThemeStyleSupport","editorSettings","useSelect","select","editPostStore","isFeatureActive","editorStore","getEditorSettings","addedStyles","join","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","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","postType","initialPostType","settings","initialEdits","useEditPostCommands","shouldIframe","useShouldIframe","createErrorNotice","noticesStore","currentPost","currentPostId","currentPostType","onNavigateToEntityRecord","onNavigateToPreviousEntityRecord","useNavigateToEntityRecord","isEditingTemplate","mode","isFullscreenActive","hasActiveMetaboxes","hasBlockSelected","showIconLabels","isDistractionFree","showMetaBoxes","hasHistory","isWelcomeGuideVisible","templateId","enablePaddingAppender","_getPostType$viewable","getEditedPostTemplateId","canUser","getPostType","coreStore","supportsTemplateMode","isViewable","viewable","canViewTemplate","kind","name","isZoomOut","blockEditorStore","getEditorMode","getRenderingMode","isRenderingPostOnly","hasMetaBoxes","getBlockSelectionStart","includes","paddingAppenderRef","paddingStyle","usePaddingAppender","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( ...additionalStyles ) {\n\tconst { hasThemeStyleSupport, editorSettings } = useSelect( ( select ) => {\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};\n\t}, [] );\n\n\tconst addedStyles = additionalStyles.join( '\\n' );\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\tif ( addedStyles ) {\n\t\t\treturn [ ...baseStyles, { css: addedStyles } ];\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\taddedStyles,\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 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\tenablePaddingAppender,\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\n\t\t\tconst supportsTemplateMode = settings.supportsTemplateMode;\n\t\t\tconst isViewable =\n\t\t\t\tgetPostType( currentPostType )?.viewable ?? false;\n\t\t\tconst canViewTemplate = canUser( 'read', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\t\t\tconst { isZoomOut } = unlock( select( blockEditorStore ) );\n\t\t\tconst { getEditorMode, getRenderingMode } = select( editorStore );\n\t\t\tconst isRenderingPostOnly = getRenderingMode() === 'post-only';\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\tenablePaddingAppender:\n\t\t\t\t\t! isZoomOut() &&\n\t\t\t\t\tisRenderingPostOnly &&\n\t\t\t\t\t! DESIGN_POST_TYPES.includes( currentPostType ),\n\t\t\t};\n\t\t},\n\t\t[ currentPostType, isEditingTemplate, settings.supportsTemplateMode ]\n\t);\n\tconst [ paddingAppenderRef, paddingStyle ] = usePaddingAppender(\n\t\tenablePaddingAppender\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( paddingStyle );\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":";;;;;;;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,OAAA;AAIA,IAAAW,aAAA,GAAAX,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AACA,IAAAa,IAAA,GAAAb,OAAA;AACA,IAAAc,aAAA,GAAAd,OAAA;AACA,IAAAe,SAAA,GAAAf,OAAA;AACA,IAAAgB,WAAA,GAAAhB,OAAA;AAQA,IAAAi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IAAE,CAAC;QAAA,CACZ;MAAC,CACL,CAAC;IAAA,CACQ;EAAC,CACC,CAAC;AAErB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArK,OAAA,GAEc6D,MAAM","ignoreList":[]}
|
|
@@ -17,37 +17,27 @@ var _lockUnlock = require("../../lock-unlock");
|
|
|
17
17
|
* Internal dependencies
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
const isGutenbergPlugin = globalThis.IS_GUTENBERG_PLUGIN ? true : false;
|
|
21
20
|
function useShouldIframe() {
|
|
22
|
-
|
|
23
|
-
isBlockBasedTheme,
|
|
24
|
-
hasV3BlocksOnly,
|
|
25
|
-
isEditingTemplateOrPattern,
|
|
26
|
-
isZoomOutMode,
|
|
27
|
-
deviceType
|
|
28
|
-
} = (0, _data.useSelect)(select => {
|
|
21
|
+
return (0, _data.useSelect)(select => {
|
|
29
22
|
const {
|
|
30
23
|
getEditorSettings,
|
|
31
24
|
getCurrentPostType,
|
|
32
25
|
getDeviceType
|
|
33
26
|
} = select(_editor.store);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
deviceType: getDeviceType()
|
|
49
|
-
};
|
|
27
|
+
return (
|
|
28
|
+
// If the theme is block based, we ALWAYS use the iframe for
|
|
29
|
+
// consistency across the post and site editor. The iframe was
|
|
30
|
+
// introduced long before the sited editor and block themes, so
|
|
31
|
+
// these themes are expecting it.
|
|
32
|
+
getEditorSettings().__unstableIsBlockBasedTheme ||
|
|
33
|
+
// For classic themes, we also still want to iframe all the special
|
|
34
|
+
// editor features and modes such as device previews, zoom out, and
|
|
35
|
+
// template/pattern editing.
|
|
36
|
+
getDeviceType() !== 'Desktop' || ['wp_template', 'wp_block'].includes(getCurrentPostType()) || (0, _lockUnlock.unlock)(select(_blockEditor.store)).isZoomOut() ||
|
|
37
|
+
// Finally, still iframe the editor for classic themes if all blocks
|
|
38
|
+
// are v3 (which means they are marked as iframe-compatible).
|
|
39
|
+
select(_blocks.store).getBlockTypes().every(type => type.apiVersion >= 3)
|
|
40
|
+
);
|
|
50
41
|
}, []);
|
|
51
|
-
return hasV3BlocksOnly || isGutenbergPlugin && isBlockBasedTheme || isEditingTemplateOrPattern || isZoomOutMode || ['Tablet', 'Mobile'].includes(deviceType);
|
|
52
42
|
}
|
|
53
43
|
//# sourceMappingURL=use-should-iframe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_editor","require","_data","_blocks","_blockEditor","_lockUnlock","
|
|
1
|
+
{"version":3,"names":["_editor","require","_data","_blocks","_blockEditor","_lockUnlock","useShouldIframe","useSelect","select","getEditorSettings","getCurrentPostType","getDeviceType","editorStore","__unstableIsBlockBasedTheme","includes","unlock","blockEditorStore","isZoomOut","blocksStore","getBlockTypes","every","type","apiVersion"],"sources":["@wordpress/edit-post/src/components/layout/use-should-iframe.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nexport function useShouldIframe() {\n\treturn useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getCurrentPostType, getDeviceType } =\n\t\t\tselect( editorStore );\n\t\treturn (\n\t\t\t// If the theme is block based, we ALWAYS use the iframe for\n\t\t\t// consistency across the post and site editor. The iframe was\n\t\t\t// introduced long before the sited editor and block themes, so\n\t\t\t// these themes are expecting it.\n\t\t\tgetEditorSettings().__unstableIsBlockBasedTheme ||\n\t\t\t// For classic themes, we also still want to iframe all the special\n\t\t\t// editor features and modes such as device previews, zoom out, and\n\t\t\t// template/pattern editing.\n\t\t\tgetDeviceType() !== 'Desktop' ||\n\t\t\t[ 'wp_template', 'wp_block' ].includes( getCurrentPostType() ) ||\n\t\t\tunlock( select( blockEditorStore ) ).isZoomOut() ||\n\t\t\t// Finally, still iframe the editor for classic themes if all blocks\n\t\t\t// are v3 (which means they are marked as iframe-compatible).\n\t\t\tselect( blocksStore )\n\t\t\t\t.getBlockTypes()\n\t\t\t\t.every( ( type ) => type.apiVersion >= 3 )\n\t\t);\n\t}, [] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGO,SAASK,eAAeA,CAAA,EAAG;EACjC,OAAO,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC/B,MAAM;MAAEC,iBAAiB;MAAEC,kBAAkB;MAAEC;IAAc,CAAC,GAC7DH,MAAM,CAAEI,aAAY,CAAC;IACtB;MACC;MACA;MACA;MACA;MACAH,iBAAiB,CAAC,CAAC,CAACI,2BAA2B;MAC/C;MACA;MACA;MACAF,aAAa,CAAC,CAAC,KAAK,SAAS,IAC7B,CAAE,aAAa,EAAE,UAAU,CAAE,CAACG,QAAQ,CAAEJ,kBAAkB,CAAC,CAAE,CAAC,IAC9D,IAAAK,kBAAM,EAAEP,MAAM,CAAEQ,kBAAiB,CAAE,CAAC,CAACC,SAAS,CAAC,CAAC;MAChD;MACA;MACAT,MAAM,CAAEU,aAAY,CAAC,CACnBC,aAAa,CAAC,CAAC,CACfC,KAAK,CAAIC,IAAI,IAAMA,IAAI,CAACC,UAAU,IAAI,CAAE;IAAC;EAE7C,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
|
|
@@ -8,8 +8,8 @@ exports.default = void 0;
|
|
|
8
8
|
var _i18n = require("@wordpress/i18n");
|
|
9
9
|
var _compose = require("@wordpress/compose");
|
|
10
10
|
var _editor = require("@wordpress/editor");
|
|
11
|
-
var _preferences = require("@wordpress/preferences");
|
|
12
11
|
var _keycodes = require("@wordpress/keycodes");
|
|
12
|
+
var _preferences = require("@wordpress/preferences");
|
|
13
13
|
var _lockUnlock = require("../../lock-unlock");
|
|
14
14
|
var _managePatternsMenuItem = _interopRequireDefault(require("./manage-patterns-menu-item"));
|
|
15
15
|
var _welcomeGuideMenuItem = _interopRequireDefault(require("./welcome-guide-menu-item"));
|
|
@@ -36,8 +36,8 @@ const MoreMenu = () => {
|
|
|
36
36
|
name: "fullscreenMode",
|
|
37
37
|
label: (0, _i18n.__)('Fullscreen mode'),
|
|
38
38
|
info: (0, _i18n.__)('Show and hide the admin user interface'),
|
|
39
|
-
messageActivated: (0, _i18n.__)('Fullscreen mode activated'),
|
|
40
|
-
messageDeactivated: (0, _i18n.__)('Fullscreen mode deactivated'),
|
|
39
|
+
messageActivated: (0, _i18n.__)('Fullscreen mode activated.'),
|
|
40
|
+
messageDeactivated: (0, _i18n.__)('Fullscreen mode deactivated.'),
|
|
41
41
|
shortcut: _keycodes.displayShortcut.secondary('f')
|
|
42
42
|
})
|
|
43
43
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(ToolsMoreMenuGroup, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_compose","_editor","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_compose","_editor","_keycodes","_preferences","_lockUnlock","_managePatternsMenuItem","_interopRequireDefault","_welcomeGuideMenuItem","_preferencesModal","_jsxRuntime","ToolsMoreMenuGroup","ViewMoreMenuGroup","unlock","editorPrivateApis","MoreMenu","isLargeViewport","useViewportMatch","jsxs","Fragment","children","jsx","PreferenceToggleMenuItem","scope","name","label","__","info","messageActivated","messageDeactivated","shortcut","displayShortcut","secondary","default","_default","exports"],"sources":["@wordpress/edit-post/src/components/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport ManagePatternsMenuItem from './manage-patterns-menu-item';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\nimport EditPostPreferencesModal from '../preferences-modal';\n\nconst { ToolsMoreMenuGroup, ViewMoreMenuGroup } = unlock( editorPrivateApis );\n\nconst MoreMenu = () => {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\treturn (\n\t\t<>\n\t\t\t{ isLargeViewport && (\n\t\t\t\t<ViewMoreMenuGroup>\n\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\t\t\tname=\"fullscreenMode\"\n\t\t\t\t\t\tlabel={ __( 'Fullscreen mode' ) }\n\t\t\t\t\t\tinfo={ __( 'Show and hide the admin user interface' ) }\n\t\t\t\t\t\tmessageActivated={ __( 'Fullscreen mode activated.' ) }\n\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t'Fullscreen mode deactivated.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tshortcut={ displayShortcut.secondary( 'f' ) }\n\t\t\t\t\t/>\n\t\t\t\t</ViewMoreMenuGroup>\n\t\t\t) }\n\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t<ManagePatternsMenuItem />\n\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t</ToolsMoreMenuGroup>\n\t\t\t<EditPostPreferencesModal />\n\t\t</>\n\t);\n};\n\nexport default MoreMenu;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;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AAoB,IAAE,CAAC;IAAA,CACL,CAAC,eACrB,IAAAvB,WAAA,CAAAW,GAAA,EAACZ,iBAAA,CAAAwB,OAAwB,IAAE,CAAC;EAAA,CAC3B,CAAC;AAEL,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEalB,QAAQ","ignoreList":[]}
|
package/build/index.js
CHANGED
|
@@ -89,6 +89,7 @@ function initializeEditor(id, postType, postId, settings, initialEdits) {
|
|
|
89
89
|
(0, _data.dispatch)(_preferences.store).setDefaults('core', {
|
|
90
90
|
allowRightClickOverrides: true,
|
|
91
91
|
editorMode: 'visual',
|
|
92
|
+
editorTool: 'edit',
|
|
92
93
|
fixedToolbar: false,
|
|
93
94
|
hiddenBlockTypes: [],
|
|
94
95
|
inactivePanels: [],
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_blockLibrary","_deprecated","_interopRequireDefault","_element","_data","_preferences","_widgets","_editor","_layout","_lockUnlock","_jsxRuntime","_fullscreenModeClose","_store","_deprecated2","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","BackButton","__experimentalMainDashboardButton","registerCoreBlockBindingsSources","unlock","editorPrivateApis","initializeEditor","id","postType","postId","settings","initialEdits","isMediumOrBigger","window","matchMedia","matches","target","document","getElementById","root","createRoot","dispatch","preferencesStore","setDefaults","fullscreenMode","themeStyles","welcomeGuide","welcomeGuideTemplate","allowRightClickOverrides","editorMode","fixedToolbar","hiddenBlockTypes","inactivePanels","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","enableChoosePatternModal","isPublishSidebarEnabled","__experimentalMediaProcessing","requireApproval","optimizeOnUpload","blocksStore","reapplyBlockTypeFilters","select","editorStore","setIsListViewOpened","registerCoreBlocks","registerLegacyWidgetBlock","inserter","registerWidgetGroupBlock","globalThis","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","documentMode","compatMode","console","warn","isIphone","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","jsx","StrictMode","children","default","reinitializeEditor","deprecated","since","version"],"sources":["@wordpress/edit-post/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport { unlock } from './lock-unlock';\n\nconst {\n\tBackButton: __experimentalMainDashboardButton,\n\tregisterCoreBlockBindingsSources,\n} = unlock( editorPrivateApis );\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tenableChoosePatternModal: true,\n\t\tisPublishSidebarEnabled: true,\n\t} );\n\n\tif ( window.__experimentalMediaProcessing ) {\n\t\tdispatch( preferencesStore ).setDefaults( 'core/media', {\n\t\t\trequireApproval: true,\n\t\t\toptimizeOnUpload: true,\n\t\t} );\n\t}\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterCoreBlockBindingsSources();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<Layout\n\t\t\t\tsettings={ settings }\n\t\t\t\tpostId={ postId }\n\t\t\t\tpostType={ postType }\n\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t/>\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as __experimentalFullscreenModeClose } from './components/back-button/fullscreen-mode-close';\nexport { __experimentalMainDashboardButton };\nexport { store } from './store';\nexport * from './deprecated';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAIA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAIA,IAAAQ,OAAA,GAAAR,OAAA;AAQA,IAAAS,OAAA,GAAAN,sBAAA,CAAAH,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAAuC,IAAAW,WAAA,GAAAX,OAAA;AAoJvC,IAAAY,oBAAA,GAAAT,sBAAA,CAAAH,OAAA;AAEA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,YAAA,GAAAd,OAAA;AAAAe,MAAA,CAAAC,IAAA,CAAAF,YAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,YAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,YAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAhLA;AACA;AACA;;AAmBA;AACA;AACA;;AAIA,MAAM;EACLS,UAAU,EAAEC,iCAAiC;EAC7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AAM,KAAKC,QAAQ,EAAG;QAChC;QACA;QACA,IAAKJ,MAAM,CAACuD,OAAO,GAAG,GAAG,EAAG;UAC3BF,qBAAqB,CAACG,SAAS,GAC9BH,qBAAqB,CAACG,SAAS,GAAGxD,MAAM,CAACuD,OAAO;QAClD;QACA;QACA,IACCnD,QAAQ,CAACkD,sBAAsB,CAAE,gBAAiB,CAAC,CAAE,CAAC,CAAE,EACvD;UACDtD,MAAM,CAACyD,QAAQ,CAAE,CAAC,EAAE,CAAE,CAAC;QACxB;MACD;IACD,CAAE,CAAC;EACJ;;EAEA;EACAzD,MAAM,CAACmD,gBAAgB,CAAE,UAAU,EAAIO,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EACzE3D,MAAM,CAACmD,gBAAgB,CAAE,MAAM,EAAIO,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EAErErD,IAAI,CAACsD,MAAM,cACV,IAAAxF,WAAA,CAAAyF,GAAA,EAAChG,QAAA,CAAAiG,UAAU;IAAAC,QAAA,eACV,IAAA3F,WAAA,CAAAyF,GAAA,EAAC3F,OAAA,CAAA8F,OAAM;MACNnE,QAAQ,EAAGA,QAAU;MACrBD,MAAM,EAAGA,MAAQ;MACjBD,QAAQ,EAAGA,QAAU;MACrBG,YAAY,EAAGA;IAAc,CAC7B;EAAC,CACS,CACb,CAAC;EAED,OAAOQ,IAAI;AACZ;;AAEA;AACA;AACA;AACO,SAAS2D,kBAAkBA,CAAA,EAAG;EACpC,IAAAC,mBAAU,EAAE,gCAAgC,EAAE;IAC7CC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_blocks","require","_blockLibrary","_deprecated","_interopRequireDefault","_element","_data","_preferences","_widgets","_editor","_layout","_lockUnlock","_jsxRuntime","_fullscreenModeClose","_store","_deprecated2","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","BackButton","__experimentalMainDashboardButton","registerCoreBlockBindingsSources","unlock","editorPrivateApis","initializeEditor","id","postType","postId","settings","initialEdits","isMediumOrBigger","window","matchMedia","matches","target","document","getElementById","root","createRoot","dispatch","preferencesStore","setDefaults","fullscreenMode","themeStyles","welcomeGuide","welcomeGuideTemplate","allowRightClickOverrides","editorMode","editorTool","fixedToolbar","hiddenBlockTypes","inactivePanels","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","enableChoosePatternModal","isPublishSidebarEnabled","__experimentalMediaProcessing","requireApproval","optimizeOnUpload","blocksStore","reapplyBlockTypeFilters","select","editorStore","setIsListViewOpened","registerCoreBlocks","registerLegacyWidgetBlock","inserter","registerWidgetGroupBlock","globalThis","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","documentMode","compatMode","console","warn","isIphone","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","jsx","StrictMode","children","default","reinitializeEditor","deprecated","since","version"],"sources":["@wordpress/edit-post/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport { unlock } from './lock-unlock';\n\nconst {\n\tBackButton: __experimentalMainDashboardButton,\n\tregisterCoreBlockBindingsSources,\n} = unlock( editorPrivateApis );\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\teditorTool: 'edit',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tenableChoosePatternModal: true,\n\t\tisPublishSidebarEnabled: true,\n\t} );\n\n\tif ( window.__experimentalMediaProcessing ) {\n\t\tdispatch( preferencesStore ).setDefaults( 'core/media', {\n\t\t\trequireApproval: true,\n\t\t\toptimizeOnUpload: true,\n\t\t} );\n\t}\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterCoreBlockBindingsSources();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<Layout\n\t\t\t\tsettings={ settings }\n\t\t\t\tpostId={ postId }\n\t\t\t\tpostType={ postType }\n\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t/>\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as __experimentalFullscreenModeClose } from './components/back-button/fullscreen-mode-close';\nexport { __experimentalMainDashboardButton };\nexport { store } from './store';\nexport * from './deprecated';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAIA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAIA,IAAAQ,OAAA,GAAAR,OAAA;AAQA,IAAAS,OAAA,GAAAN,sBAAA,CAAAH,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAAuC,IAAAW,WAAA,GAAAX,OAAA;AAqJvC,IAAAY,oBAAA,GAAAT,sBAAA,CAAA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GAAA,EAACjG,QAAA,CAAAkG,UAAU;IAAAC,QAAA,eACV,IAAA5F,WAAA,CAAA0F,GAAA,EAAC5F,OAAA,CAAA+F,OAAM;MACNpE,QAAQ,EAAGA,QAAU;MACrBD,MAAM,EAAGA,MAAQ;MACjBD,QAAQ,EAAGA,QAAU;MACrBG,YAAY,EAAGA;IAAc,CAC7B;EAAC,CACS,CACb,CAAC;EAED,OAAOQ,IAAI;AACZ;;AAEA;AACA;AACA;AACO,SAAS4D,kBAAkBA,CAAA,EAAG;EACpC,IAAAC,mBAAU,EAAE,gCAAgC,EAAE;IAC7CC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ","ignoreList":[]}
|
package/build/index.native.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["require","_data","_preferences","_store","_editor","_interopRequireDefault","_jsxRuntime","initializeEditor","id","postType","postId","dispatch","preferencesStore","setDefaults","editorMode","fullscreenMode","inactivePanels","openPanels","welcomeGuide","hiddenBlockTypes","isPublishSidebarEnabled","fixedToolbar","jsx","default"],"sources":["@wordpress/edit-post/src/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport '@wordpress/core-data';\nimport '@wordpress/format-library';\nimport { dispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nexport { store } from './store';\nimport Editor from './editor';\n\n/**\n * Initializes the Editor and returns a componentProvider\n * that can be registered with `AppRegistry.registerComponent`\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {Object} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit (unused right now)\n */\nexport function initializeEditor( id, postType, postId ) {\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfullscreenMode: true,\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\twelcomeGuide: true,\n\t} );\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tisPublishSidebarEnabled: true,\n\t\tfixedToolbar: false,\n\t} );\n\n\treturn <Editor postId={ postId } postType={ postType } />;\n}\n"],"mappings":";;;;;;;;;;;;;AAGAA,OAAA;AACAA,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAC,sBAAA,CAAAL,OAAA;AAA8B,IAAAM,WAAA,GAAAN,OAAA;AAZ9B;AACA;AACA;;AAMA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASO,gBAAgBA,CAAEC,EAAE,EAAEC,QAAQ,EAAEC,MAAM,EAAG;EACxD,IAAAC,cAAQ,EAAEC,kBAAiB,CAAC,CAACC,WAAW,CAAE,gBAAgB,EAAE;IAC3DC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,IAAI;IACpBC,cAAc,EAAE,EAAE;IAClBC,UAAU,EAAE,CAAE,aAAa,CAAE;IAC7BC,YAAY,EAAE;EACf,CAAE,CAAC;EACH,IAAAP,cAAQ,EAAEC,kBAAiB,CAAC,CAACC,WAAW,CAAE,MAAM,EAAE;IACjDM,gBAAgB,EAAE,EAAE;
|
|
1
|
+
{"version":3,"names":["require","_data","_preferences","_store","_editor","_interopRequireDefault","_jsxRuntime","initializeEditor","id","postType","postId","dispatch","preferencesStore","setDefaults","editorMode","fullscreenMode","inactivePanels","openPanels","welcomeGuide","editorTool","hiddenBlockTypes","isPublishSidebarEnabled","fixedToolbar","jsx","default"],"sources":["@wordpress/edit-post/src/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport '@wordpress/core-data';\nimport '@wordpress/format-library';\nimport { dispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nexport { store } from './store';\nimport Editor from './editor';\n\n/**\n * Initializes the Editor and returns a componentProvider\n * that can be registered with `AppRegistry.registerComponent`\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {Object} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit (unused right now)\n */\nexport function initializeEditor( id, postType, postId ) {\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfullscreenMode: true,\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\twelcomeGuide: true,\n\t} );\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\teditorTool: 'edit',\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tisPublishSidebarEnabled: true,\n\t\tfixedToolbar: false,\n\t} );\n\n\treturn <Editor postId={ postId } postType={ postType } />;\n}\n"],"mappings":";;;;;;;;;;;;;AAGAA,OAAA;AACAA,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAC,sBAAA,CAAAL,OAAA;AAA8B,IAAAM,WAAA,GAAAN,OAAA;AAZ9B;AACA;AACA;;AAMA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASO,gBAAgBA,CAAEC,EAAE,EAAEC,QAAQ,EAAEC,MAAM,EAAG;EACxD,IAAAC,cAAQ,EAAEC,kBAAiB,CAAC,CAACC,WAAW,CAAE,gBAAgB,EAAE;IAC3DC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,IAAI;IACpBC,cAAc,EAAE,EAAE;IAClBC,UAAU,EAAE,CAAE,aAAa,CAAE;IAC7BC,YAAY,EAAE;EACf,CAAE,CAAC;EACH,IAAAP,cAAQ,EAAEC,kBAAiB,CAAC,CAACC,WAAW,CAAE,MAAM,EAAE;IACjDM,UAAU,EAAE,MAAM;IAClBC,gBAAgB,EAAE,EAAE;IACpBJ,cAAc,EAAE,EAAE;IAClBC,UAAU,EAAE,CAAE,aAAa,CAAE;IAC7BI,uBAAuB,EAAE,IAAI;IAC7BC,YAAY,EAAE;EACf,CAAE,CAAC;EAEH,oBAAO,IAAAhB,WAAA,CAAAiB,GAAA,EAACnB,OAAA,CAAAoB,OAAM;IAACd,MAAM,EAAGA,MAAQ;IAACD,QAAQ,EAAGA;EAAU,CAAE,CAAC;AAC1D","ignoreList":[]}
|
package/build/store/actions.js
CHANGED
|
@@ -12,7 +12,7 @@ exports.metaBoxUpdatesSuccess = metaBoxUpdatesSuccess;
|
|
|
12
12
|
exports.requestMetaBoxUpdates = exports.removeEditorPanel = exports.openPublishSidebar = exports.openModal = exports.openGeneralSidebar = void 0;
|
|
13
13
|
exports.setAvailableMetaBoxesPerLocation = setAvailableMetaBoxesPerLocation;
|
|
14
14
|
exports.setIsEditingTemplate = setIsEditingTemplate;
|
|
15
|
-
exports.togglePublishSidebar = exports.togglePinnedPluginItem = exports.toggleFeature = exports.toggleEditorPanelOpened = exports.toggleEditorPanelEnabled = exports.toggleDistractionFree = exports.switchEditorMode = exports.showBlockTypes = exports.setIsListViewOpened = exports.setIsInserterOpened = void 0;
|
|
15
|
+
exports.togglePublishSidebar = exports.togglePinnedPluginItem = exports.toggleFullscreenMode = exports.toggleFeature = exports.toggleEditorPanelOpened = exports.toggleEditorPanelEnabled = exports.toggleDistractionFree = exports.switchEditorMode = exports.showBlockTypes = exports.setIsListViewOpened = exports.setIsInserterOpened = void 0;
|
|
16
16
|
exports.updatePreferredStyleVariations = updatePreferredStyleVariations;
|
|
17
17
|
var _apiFetch = _interopRequireDefault(require("@wordpress/api-fetch"));
|
|
18
18
|
var _preferences = require("@wordpress/preferences");
|
|
@@ -20,6 +20,8 @@ var _editor = require("@wordpress/editor");
|
|
|
20
20
|
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
21
21
|
var _hooks = require("@wordpress/hooks");
|
|
22
22
|
var _coreData = require("@wordpress/core-data");
|
|
23
|
+
var _notices = require("@wordpress/notices");
|
|
24
|
+
var _i18n = require("@wordpress/i18n");
|
|
23
25
|
var _metaBoxes = require("../utils/meta-boxes");
|
|
24
26
|
var _lockUnlock = require("../lock-unlock");
|
|
25
27
|
/**
|
|
@@ -509,5 +511,26 @@ const toggleDistractionFree = () => ({
|
|
|
509
511
|
});
|
|
510
512
|
registry.dispatch(_editor.store).toggleDistractionFree();
|
|
511
513
|
};
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Action that toggles the Fullscreen Mode view option.
|
|
517
|
+
*/
|
|
512
518
|
exports.toggleDistractionFree = toggleDistractionFree;
|
|
519
|
+
const toggleFullscreenMode = () => ({
|
|
520
|
+
registry
|
|
521
|
+
}) => {
|
|
522
|
+
const isFullscreen = registry.select(_preferences.store).get('core/edit-post', 'fullscreenMode');
|
|
523
|
+
registry.dispatch(_preferences.store).toggle('core/edit-post', 'fullscreenMode');
|
|
524
|
+
registry.dispatch(_notices.store).createInfoNotice(isFullscreen ? (0, _i18n.__)('Fullscreen mode activated.') : (0, _i18n.__)('Fullscreen mode deactivated.'), {
|
|
525
|
+
id: 'core/edit-post/toggle-fullscreen-mode/notice',
|
|
526
|
+
type: 'snackbar',
|
|
527
|
+
actions: [{
|
|
528
|
+
label: (0, _i18n.__)('Undo'),
|
|
529
|
+
onClick: () => {
|
|
530
|
+
registry.dispatch(_preferences.store).toggle('core/edit-post', 'fullscreenMode');
|
|
531
|
+
}
|
|
532
|
+
}]
|
|
533
|
+
});
|
|
534
|
+
};
|
|
535
|
+
exports.toggleFullscreenMode = toggleFullscreenMode;
|
|
513
536
|
//# sourceMappingURL=actions.js.map
|