@wordpress/edit-post 8.0.8 → 8.0.9

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.
@@ -67,7 +67,6 @@ function useEditorStyles() {
67
67
  hasThemeStyleSupport,
68
68
  editorSettings,
69
69
  isZoomedOutView,
70
- hasMetaBoxes,
71
70
  renderingMode,
72
71
  postType
73
72
  } = (0, _data.useSelect)(select => {
@@ -83,7 +82,6 @@ function useEditorStyles() {
83
82
  hasThemeStyleSupport: select(_store.store).isFeatureActive('themeStyles'),
84
83
  editorSettings: select(_editor.store).getEditorSettings(),
85
84
  isZoomedOutView: __unstableGetEditorMode() === 'zoom-out',
86
- hasMetaBoxes: select(_store.store).hasMetaBoxes(),
87
85
  renderingMode: getRenderingMode(),
88
86
  postType: _postType
89
87
  };
@@ -113,13 +111,11 @@ function useEditorStyles() {
113
111
  }
114
112
  const baseStyles = hasThemeStyles ? (_editorSettings$style3 = editorSettings.styles) !== null && _editorSettings$style3 !== void 0 ? _editorSettings$style3 : [] : defaultEditorStyles;
115
113
 
116
- // Add a constant padding for the typewriter effect. When typing at the
117
- // bottom, there needs to be room to scroll up.
118
- if (!isZoomedOutView && !hasMetaBoxes && renderingMode === 'post-only' && !DESIGN_POST_TYPES.includes(postType)) {
114
+ // Add a space for the typewriter effect. When typing in the last block,
115
+ // there needs to be room to scroll up.
116
+ if (!isZoomedOutView && renderingMode === 'post-only' && !DESIGN_POST_TYPES.includes(postType)) {
119
117
  return [...baseStyles, {
120
- // Should override global styles padding, so ensure 0-1-0
121
- // specificity.
122
- css: ':root :where(body){padding-bottom: 40vh}'
118
+ css: ':root :where(.editor-styles-wrapper)::after {content: ""; display: block; height: 40vh;}'
123
119
  }];
124
120
  }
125
121
  return baseStyles;
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_editor","_data","_blockEditor","_plugins","_i18n","_element","_notices","_preferences","_commands","_coreCommands","_blockLibrary","_url","_htmlEntities","_backButton","_keyboardShortcuts","_initPatternModal","_browserUrl","_metaBoxes","_moreMenu","_welcomeGuide","_store","_lockUnlock","_useCommands","_usePaddingAppender","_useShouldIframe","_jsxRuntime","getLayoutStyles","unlock","blockEditorPrivateApis","useCommands","coreCommandsPrivateApis","useCommandContext","commandsPrivateApis","EditorInterface","FullscreenMode","Sidebar","editorPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","DESIGN_POST_TYPES","useEditorStyles","hasThemeStyleSupport","editorSettings","isZoomedOutView","hasMetaBoxes","renderingMode","postType","useSelect","select","__unstableGetEditorMode","blockEditorStore","getCurrentPostType","getRenderingMode","editorStore","_postType","editPostStore","isFeatureActive","getEditorSettings","useMemo","_editorSettings$style","_editorSettings$style2","_editorSettings$style3","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","baseStyles","includes","Layout","initialPost","useEditPostCommands","paddingAppenderRef","usePaddingAppender","shouldIframe","useShouldIframe","createErrorNotice","useDispatch","noticesStore","mode","isFullscreenActive","hasActiveMetaboxes","hasBlockSelected","showIconLabels","isDistractionFree","showMetaBoxes","hasHistory","isEditingTemplate","isWelcomeGuideVisible","get","preferencesStore","getEditorMode","getBlockSelectionStart","onNavigateToPreviousEntityRecord","commandContext","document","body","classList","add","remove","className","clsx","onPluginAreaError","name","sprintf","__","createSuccessNotice","onActionPerformed","useCallback","actionId","items","location","href","addQueryArgs","trashed","post_type","type","ids","id","newItem","title","rendered","decodeEntities","actions","label","onClick","postId","post","action","jsxs","Fragment","children","jsx","isActive","default","UnsavedChangesWarning","AutosaveMonitor","LocalAutosaveMonitor","EditorKeyboardShortcutsRegister","PluginArea","onError","extraPanels","EditorSnackbars","forceIsDirty","contentRef","disableIframe","autoFocus","_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\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 { useCallback, useMemo } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as commandsPrivateApis } 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';\n\n/**\n * Internal dependencies\n */\nimport BackButton from '../back-button';\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';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { EditorInterface, FullscreenMode, Sidebar } =\n\tunlock( editorPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\nconst DESIGN_POST_TYPES = [\n\t'wp_template',\n\t'wp_template_part',\n\t'wp_block',\n\t'wp_navigation',\n];\n\nfunction useEditorStyles() {\n\tconst {\n\t\thasThemeStyleSupport,\n\t\teditorSettings,\n\t\tisZoomedOutView,\n\t\thasMetaBoxes,\n\t\trenderingMode,\n\t\tpostType,\n\t} = useSelect( ( select ) => {\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getCurrentPostType, getRenderingMode } = select( editorStore );\n\t\tconst _postType = getCurrentPostType();\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t\tisZoomedOutView: __unstableGetEditorMode() === 'zoom-out',\n\t\t\thasMetaBoxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\trenderingMode: getRenderingMode(),\n\t\t\tpostType: _postType,\n\t\t};\n\t}, [] );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...editorSettings.defaultEditorStyles,\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( editorSettings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! editorSettings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\tconst baseStyles = hasThemeStyles\n\t\t\t? editorSettings.styles ?? []\n\t\t\t: defaultEditorStyles;\n\n\t\t// Add a constant padding for the typewriter effect. When typing at the\n\t\t// bottom, there needs to be room to scroll up.\n\t\tif (\n\t\t\t! isZoomedOutView &&\n\t\t\t! hasMetaBoxes &&\n\t\t\trenderingMode === 'post-only' &&\n\t\t\t! DESIGN_POST_TYPES.includes( postType )\n\t\t) {\n\t\t\treturn [\n\t\t\t\t...baseStyles,\n\t\t\t\t{\n\t\t\t\t\t// Should override global styles padding, so ensure 0-1-0\n\t\t\t\t\t// specificity.\n\t\t\t\t\tcss: ':root :where(body){padding-bottom: 40vh}',\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\treturn baseStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t\tpostType,\n\t] );\n}\n\nfunction Layout( { initialPost } ) {\n\tuseCommands();\n\tuseEditPostCommands();\n\tconst paddingAppenderRef = usePaddingAppender();\n\tconst shouldIframe = useShouldIframe();\n\tconst { createErrorNotice } = useDispatch( noticesStore );\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\tisEditingTemplate,\n\t\tisWelcomeGuideVisible,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { isFeatureActive } = select( editPostStore );\n\n\t\treturn {\n\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\thasBlockSelected:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tshowMetaBoxes:\n\t\t\t\tselect( editorStore ).getRenderingMode() === 'post-only',\n\t\t\thasHistory: !! getEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t\tisEditingTemplate:\n\t\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t};\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\n\tconst styles = useEditorStyles();\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst 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 e.g: \"Post 1\".\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\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL hasHistory={ hasHistory } />\n\t\t\t<UnsavedChangesWarning />\n\t\t\t<AutosaveMonitor />\n\t\t\t<LocalAutosaveMonitor />\n\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t<BlockKeyboardShortcuts />\n\t\t\t<WelcomeGuide />\n\t\t\t<InitPatternModal />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t{ ! isDistractionFree && (\n\t\t\t\t<Sidebar\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\textraPanels={\n\t\t\t\t\t\t! isEditingTemplate && <MetaBoxes location=\"side\" />\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<PostEditorMoreMenu />\n\t\t\t<BackButton initialPost={ initialPost } />\n\t\t\t<EditorSnackbars />\n\t\t\t<EditorInterface\n\t\t\t\tclassName={ className }\n\t\t\t\tstyles={ styles }\n\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\tcontentRef={ paddingAppenderRef }\n\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t>\n\t\t\t\t{ ! isDistractionFree && showMetaBoxes && (\n\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</EditorInterface>\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AASA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAIA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GA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,6BAA6B;QAAA+B,QAAA,gBAC3C,IAAApH,WAAA,CAAAqH,GAAA,EAAC7H,UAAA,CAAA+H,OAAS;UAACvB,QAAQ,EAAC;QAAQ,CAAE,CAAC,eAC/B,IAAAhG,WAAA,CAAAqH,GAAA,EAAC7H,UAAA,CAAA+H,OAAS;UAACvB,QAAQ,EAAC;QAAU,CAAE,CAAC;MAAA,CAC7B;IACL,CACe,CAAC;EAAA,CACjB,CAAC;AAEL;AAAC,IAAAoC,QAAA,GAAAC,OAAA,CAAAd,OAAA,GAEcjE,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_editor","_data","_blockEditor","_plugins","_i18n","_element","_notices","_preferences","_commands","_coreCommands","_blockLibrary","_url","_htmlEntities","_backButton","_keyboardShortcuts","_initPatternModal","_browserUrl","_metaBoxes","_moreMenu","_welcomeGuide","_store","_lockUnlock","_useCommands","_usePaddingAppender","_useShouldIframe","_jsxRuntime","getLayoutStyles","unlock","blockEditorPrivateApis","useCommands","coreCommandsPrivateApis","useCommandContext","commandsPrivateApis","EditorInterface","FullscreenMode","Sidebar","editorPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","DESIGN_POST_TYPES","useEditorStyles","hasThemeStyleSupport","editorSettings","isZoomedOutView","renderingMode","postType","useSelect","select","__unstableGetEditorMode","blockEditorStore","getCurrentPostType","getRenderingMode","editorStore","_postType","editPostStore","isFeatureActive","getEditorSettings","useMemo","_editorSettings$style","_editorSettings$style2","_editorSettings$style3","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","baseStyles","includes","Layout","initialPost","useEditPostCommands","paddingAppenderRef","usePaddingAppender","shouldIframe","useShouldIframe","createErrorNotice","useDispatch","noticesStore","mode","isFullscreenActive","hasActiveMetaboxes","hasBlockSelected","showIconLabels","isDistractionFree","showMetaBoxes","hasHistory","isEditingTemplate","isWelcomeGuideVisible","get","preferencesStore","getEditorMode","hasMetaBoxes","getBlockSelectionStart","onNavigateToPreviousEntityRecord","commandContext","document","body","classList","add","remove","className","clsx","onPluginAreaError","name","sprintf","__","createSuccessNotice","onActionPerformed","useCallback","actionId","items","location","href","addQueryArgs","trashed","post_type","type","ids","id","newItem","title","rendered","decodeEntities","actions","label","onClick","postId","post","action","jsxs","Fragment","children","jsx","isActive","default","UnsavedChangesWarning","AutosaveMonitor","LocalAutosaveMonitor","EditorKeyboardShortcutsRegister","PluginArea","onError","extraPanels","EditorSnackbars","forceIsDirty","contentRef","disableIframe","autoFocus","_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\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 { useCallback, useMemo } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as commandsPrivateApis } 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';\n\n/**\n * Internal dependencies\n */\nimport BackButton from '../back-button';\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';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { EditorInterface, FullscreenMode, Sidebar } =\n\tunlock( editorPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\nconst DESIGN_POST_TYPES = [\n\t'wp_template',\n\t'wp_template_part',\n\t'wp_block',\n\t'wp_navigation',\n];\n\nfunction useEditorStyles() {\n\tconst {\n\t\thasThemeStyleSupport,\n\t\teditorSettings,\n\t\tisZoomedOutView,\n\t\trenderingMode,\n\t\tpostType,\n\t} = useSelect( ( select ) => {\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getCurrentPostType, getRenderingMode } = select( editorStore );\n\t\tconst _postType = getCurrentPostType();\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t\tisZoomedOutView: __unstableGetEditorMode() === 'zoom-out',\n\t\t\trenderingMode: getRenderingMode(),\n\t\t\tpostType: _postType,\n\t\t};\n\t}, [] );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...editorSettings.defaultEditorStyles,\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( editorSettings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! editorSettings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\tconst baseStyles = hasThemeStyles\n\t\t\t? editorSettings.styles ?? []\n\t\t\t: defaultEditorStyles;\n\n\t\t// Add a space for the typewriter effect. When typing in the last block,\n\t\t// there needs to be room to scroll up.\n\t\tif (\n\t\t\t! isZoomedOutView &&\n\t\t\trenderingMode === 'post-only' &&\n\t\t\t! DESIGN_POST_TYPES.includes( postType )\n\t\t) {\n\t\t\treturn [\n\t\t\t\t...baseStyles,\n\t\t\t\t{\n\t\t\t\t\tcss: ':root :where(.editor-styles-wrapper)::after {content: \"\"; display: block; height: 40vh;}',\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\treturn baseStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t\tpostType,\n\t] );\n}\n\nfunction Layout( { initialPost } ) {\n\tuseCommands();\n\tuseEditPostCommands();\n\tconst paddingAppenderRef = usePaddingAppender();\n\tconst shouldIframe = useShouldIframe();\n\tconst { createErrorNotice } = useDispatch( noticesStore );\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\tisEditingTemplate,\n\t\tisWelcomeGuideVisible,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { isFeatureActive } = select( editPostStore );\n\n\t\treturn {\n\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\thasBlockSelected:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tshowMetaBoxes:\n\t\t\t\tselect( editorStore ).getRenderingMode() === 'post-only',\n\t\t\thasHistory: !! getEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t\tisEditingTemplate:\n\t\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t};\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\n\tconst styles = useEditorStyles();\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst 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 e.g: \"Post 1\".\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\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL hasHistory={ hasHistory } />\n\t\t\t<UnsavedChangesWarning />\n\t\t\t<AutosaveMonitor />\n\t\t\t<LocalAutosaveMonitor />\n\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t<BlockKeyboardShortcuts />\n\t\t\t<WelcomeGuide />\n\t\t\t<InitPatternModal />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t{ ! isDistractionFree && (\n\t\t\t\t<Sidebar\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\textraPanels={\n\t\t\t\t\t\t! isEditingTemplate && <MetaBoxes location=\"side\" />\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<PostEditorMoreMenu />\n\t\t\t<BackButton initialPost={ initialPost } />\n\t\t\t<EditorSnackbars />\n\t\t\t<EditorInterface\n\t\t\t\tclassName={ className }\n\t\t\t\tstyles={ styles }\n\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\tcontentRef={ paddingAppenderRef }\n\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t>\n\t\t\t\t{ ! isDistractionFree && showMetaBoxes && (\n\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t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,YAAY,EAAG/D,kBAAoB;MACnCgE,UAAU,EAAGzE,kBAAoB;MACjC0E,aAAa,EAAG,CAAExE;MAClB;MACA;MAAA;MACAyE,SAAS,EAAG,CAAE3D,qBAAuB;MAAA4C,QAAA,EAEnC,CAAEhD,iBAAiB,IAAIC,aAAa,iBACrC,IAAArE,WAAA,CAAAkH,IAAA;QAAK7B,SAAS,EAAC,6BAA6B;QAAA+B,QAAA,gBAC3C,IAAApH,WAAA,CAAAqH,GAAA,EAAC7H,UAAA,CAAA+H,OAAS;UAACvB,QAAQ,EAAC;QAAQ,CAAE,CAAC,eAC/B,IAAAhG,WAAA,CAAAqH,GAAA,EAAC7H,UAAA,CAAA+H,OAAS;UAACvB,QAAQ,EAAC;QAAU,CAAE,CAAC;MAAA,CAC7B;IACL,CACe,CAAC;EAAA,CACjB,CAAC;AAEL;AAAC,IAAAoC,QAAA,GAAAC,OAAA,CAAAd,OAAA,GAEclE,MAAM","ignoreList":[]}
@@ -25,8 +25,8 @@ function usePaddingAppender() {
25
25
  const {
26
26
  defaultView
27
27
  } = ownerDocument;
28
- const paddingBottom = defaultView.parseInt(defaultView.getComputedStyle(node).paddingBottom, 10);
29
- if (!paddingBottom) {
28
+ const pseudoHeight = defaultView.parseInt(defaultView.getComputedStyle(node, ':after').height, 10);
29
+ if (!pseudoHeight) {
30
30
  return;
31
31
  }
32
32
 
@@ -39,20 +39,15 @@ function usePaddingAppender() {
39
39
  if (event.clientY < lastChildRect.bottom) {
40
40
  return;
41
41
  }
42
- event.preventDefault();
42
+ event.stopPropagation();
43
43
  const blockOrder = registry.select(_blockEditor.store).getBlockOrder('');
44
44
  const lastBlockClientId = blockOrder[blockOrder.length - 1];
45
-
46
- // Do nothing when only default block appender is present.
47
- if (!lastBlockClientId) {
48
- return;
49
- }
50
45
  const lastBlock = registry.select(_blockEditor.store).getBlock(lastBlockClientId);
51
46
  const {
52
47
  selectBlock,
53
48
  insertDefaultBlock
54
49
  } = registry.dispatch(_blockEditor.store);
55
- if ((0, _blocks.isUnmodifiedDefaultBlock)(lastBlock)) {
50
+ if (lastBlock && (0, _blocks.isUnmodifiedDefaultBlock)(lastBlock)) {
56
51
  selectBlock(lastBlockClientId);
57
52
  } else {
58
53
  insertDefaultBlock();
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_compose","_blockEditor","_blocks","usePaddingAppender","registry","useRegistry","useRefEffect","node","onMouseDown","event","target","ownerDocument","defaultView","paddingBottom","parseInt","getComputedStyle","lastChild","lastElementChild","lastChildRect","getBoundingClientRect","clientY","bottom","preventDefault","blockOrder","select","blockEditorStore","getBlockOrder","lastBlockClientId","length","lastBlock","getBlock","selectBlock","insertDefaultBlock","dispatch","isUnmodifiedDefaultBlock","addEventListener","removeEventListener"],"sources":["@wordpress/edit-post/src/components/layout/use-padding-appender.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\n\nexport function usePaddingAppender() {\n\tconst registry = useRegistry();\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tfunction onMouseDown( event ) {\n\t\t\t\tif ( event.target !== node ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst { ownerDocument } = node;\n\t\t\t\tconst { defaultView } = ownerDocument;\n\n\t\t\t\tconst paddingBottom = defaultView.parseInt(\n\t\t\t\t\tdefaultView.getComputedStyle( node ).paddingBottom,\n\t\t\t\t\t10\n\t\t\t\t);\n\n\t\t\t\tif ( ! paddingBottom ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Only handle clicks under the last child.\n\t\t\t\tconst lastChild = node.lastElementChild;\n\t\t\t\tif ( ! lastChild ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst lastChildRect = lastChild.getBoundingClientRect();\n\t\t\t\tif ( event.clientY < lastChildRect.bottom ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tconst blockOrder = registry\n\t\t\t\t\t.select( blockEditorStore )\n\t\t\t\t\t.getBlockOrder( '' );\n\t\t\t\tconst lastBlockClientId = blockOrder[ blockOrder.length - 1 ];\n\n\t\t\t\t// Do nothing when only default block appender is present.\n\t\t\t\tif ( ! lastBlockClientId ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst lastBlock = registry\n\t\t\t\t\t.select( blockEditorStore )\n\t\t\t\t\t.getBlock( lastBlockClientId );\n\t\t\t\tconst { selectBlock, insertDefaultBlock } =\n\t\t\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\t\t\tif ( isUnmodifiedDefaultBlock( lastBlock ) ) {\n\t\t\t\t\tselectBlock( lastBlockClientId );\n\t\t\t\t} else {\n\t\t\t\t\tinsertDefaultBlock();\n\t\t\t\t}\n\t\t\t}\n\t\t\tnode.addEventListener( 'mousedown', onMouseDown );\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'mousedown', onMouseDown );\n\t\t\t};\n\t\t},\n\t\t[ registry ]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMO,SAASI,kBAAkBA,CAAA,EAAG;EACpC,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC9B,OAAO,IAAAC,qBAAY,EAChBC,IAAI,IAAM;IACX,SAASC,WAAWA,CAAEC,KAAK,EAAG;MAC7B,IAAKA,KAAK,CAACC,MAAM,KAAKH,IAAI,EAAG;QAC5B;MACD;MAEA,MAAM;QAAEI;MAAc,CAAC,GAAGJ,IAAI;MAC9B,MAAM;QAAEK;MAAY,CAAC,GAAGD,aAAa;M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version":3,"names":["_data","require","_compose","_blockEditor","_blocks","usePaddingAppender","registry","useRegistry","useRefEffect","node","onMouseDown","event","target","ownerDocument","defaultView","pseudoHeight","parseInt","getComputedStyle","height","lastChild","lastElementChild","lastChildRect","getBoundingClientRect","clientY","bottom","stopPropagation","blockOrder","select","blockEditorStore","getBlockOrder","lastBlockClientId","length","lastBlock","getBlock","selectBlock","insertDefaultBlock","dispatch","isUnmodifiedDefaultBlock","addEventListener","removeEventListener"],"sources":["@wordpress/edit-post/src/components/layout/use-padding-appender.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\n\nexport function usePaddingAppender() {\n\tconst registry = useRegistry();\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tfunction onMouseDown( event ) {\n\t\t\t\tif ( event.target !== node ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst { ownerDocument } = node;\n\t\t\t\tconst { defaultView } = ownerDocument;\n\n\t\t\t\tconst pseudoHeight = defaultView.parseInt(\n\t\t\t\t\tdefaultView.getComputedStyle( node, ':after' ).height,\n\t\t\t\t\t10\n\t\t\t\t);\n\n\t\t\t\tif ( ! pseudoHeight ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Only handle clicks under the last child.\n\t\t\t\tconst lastChild = node.lastElementChild;\n\t\t\t\tif ( ! lastChild ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst lastChildRect = lastChild.getBoundingClientRect();\n\t\t\t\tif ( event.clientY < lastChildRect.bottom ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tevent.stopPropagation();\n\n\t\t\t\tconst blockOrder = registry\n\t\t\t\t\t.select( blockEditorStore )\n\t\t\t\t\t.getBlockOrder( '' );\n\t\t\t\tconst lastBlockClientId = blockOrder[ blockOrder.length - 1 ];\n\n\t\t\t\tconst lastBlock = registry\n\t\t\t\t\t.select( blockEditorStore )\n\t\t\t\t\t.getBlock( lastBlockClientId );\n\t\t\t\tconst { selectBlock, insertDefaultBlock } =\n\t\t\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\t\t\tif ( lastBlock && isUnmodifiedDefaultBlock( lastBlock ) ) {\n\t\t\t\t\tselectBlock( lastBlockClientId );\n\t\t\t\t} else {\n\t\t\t\t\tinsertDefaultBlock();\n\t\t\t\t}\n\t\t\t}\n\t\t\tnode.addEventListener( 'mousedown', onMouseDown );\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'mousedown', onMouseDown );\n\t\t\t};\n\t\t},\n\t\t[ registry ]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMO,SAASI,kBAAkBA,CAAA,EAAG;EACpC,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC9B,OAAO,IAAAC,qBAAY,EAChBC,IAAI,IAAM;IACX,SAASC,WAAWA,CAAEC,KAAK,EAAG;MAC7B,IAAKA,KAAK,CAACC,MAAM,KAAKH,IAAI,EAAG;QAC5B;MACD;MAEA,MAAM;QAAEI;MAAc,CAAC,GAAGJ,IAAI;MAC9B,MAAM;QAAEK;MAAY,CAAC,GAAGD,aAAa;MAErC,MAAME,YAAY,GAAGD,WAAW,CAACE,QAAQ,CACxCF,WAAW,CAACG,gBAAgB,CAAER,IAAI,EAAE,QAAS,CAAC,CAACS,MAAM,EACrD,EACD,CAAC;MAED,IAAK,CAAEH,YAAY,EAAG;QACrB;MACD;;MAEA;MACA,MAAMI,SAAS,GAAGV,IAAI,CAACW,gBAAgB;MACvC,IAAK,CAAED,SAAS,EAAG;QAClB;MACD;MAEA,MAAME,aAAa,GAAGF,SAAS,CAACG,qBAAqB,CAAC,CAAC;MACvD,IAAKX,KAAK,CAACY,OAAO,GAAGF,aAAa,CAACG,MAAM,EAAG;QAC3C;MACD;MAEAb,KAAK,CAACc,eAAe,CAAC,CAAC;MAEvB,MAAMC,UAAU,GAAGpB,QAAQ,CACzBqB,MAAM,CAAEC,kBAAiB,CAAC,CAC1BC,aAAa,CAAE,EAAG,CAAC;MACrB,MAAMC,iBAAiB,GAAGJ,UAAU,CAAEA,UAAU,CAACK,MAAM,GAAG,CAAC,CAAE;MAE7D,MAAMC,SAAS,GAAG1B,QAAQ,CACxBqB,MAAM,CAAEC,kBAAiB,CAAC,CAC1BK,QAAQ,CAAEH,iBAAkB,CAAC;MAC/B,MAAM;QAAEI,WAAW;QAAEC;MAAmB,CAAC,GACxC7B,QAAQ,CAAC8B,QAAQ,CAAER,kBAAiB,CAAC;MAEtC,IAAKI,SAAS,IAAI,IAAAK,gCAAwB,EAAEL,SAAU,CAAC,EAAG;QACzDE,WAAW,CAAEJ,iBAAkB,CAAC;MACjC,CAAC,MAAM;QACNK,kBAAkB,CAAC,CAAC;MACrB;IACD;IACA1B,IAAI,CAAC6B,gBAAgB,CAAE,WAAW,EAAE5B,WAAY,CAAC;IACjD,OAAO,MAAM;MACZD,IAAI,CAAC8B,mBAAmB,CAAE,WAAW,EAAE7B,WAAY,CAAC;IACrD,CAAC;EACF,CAAC,EACD,CAAEJ,QAAQ,CACX,CAAC;AACF","ignoreList":[]}
@@ -61,7 +61,6 @@ function useEditorStyles() {
61
61
  hasThemeStyleSupport,
62
62
  editorSettings,
63
63
  isZoomedOutView,
64
- hasMetaBoxes,
65
64
  renderingMode,
66
65
  postType
67
66
  } = useSelect(select => {
@@ -77,7 +76,6 @@ function useEditorStyles() {
77
76
  hasThemeStyleSupport: select(editPostStore).isFeatureActive('themeStyles'),
78
77
  editorSettings: select(editorStore).getEditorSettings(),
79
78
  isZoomedOutView: __unstableGetEditorMode() === 'zoom-out',
80
- hasMetaBoxes: select(editPostStore).hasMetaBoxes(),
81
79
  renderingMode: getRenderingMode(),
82
80
  postType: _postType
83
81
  };
@@ -107,13 +105,11 @@ function useEditorStyles() {
107
105
  }
108
106
  const baseStyles = hasThemeStyles ? (_editorSettings$style3 = editorSettings.styles) !== null && _editorSettings$style3 !== void 0 ? _editorSettings$style3 : [] : defaultEditorStyles;
109
107
 
110
- // Add a constant padding for the typewriter effect. When typing at the
111
- // bottom, there needs to be room to scroll up.
112
- if (!isZoomedOutView && !hasMetaBoxes && renderingMode === 'post-only' && !DESIGN_POST_TYPES.includes(postType)) {
108
+ // Add a space for the typewriter effect. When typing in the last block,
109
+ // there needs to be room to scroll up.
110
+ if (!isZoomedOutView && renderingMode === 'post-only' && !DESIGN_POST_TYPES.includes(postType)) {
113
111
  return [...baseStyles, {
114
- // Should override global styles padding, so ensure 0-1-0
115
- // specificity.
116
- css: ':root :where(body){padding-bottom: 40vh}'
112
+ css: ':root :where(.editor-styles-wrapper)::after {content: ""; display: block; height: 40vh;}'
117
113
  }];
118
114
  }
119
115
  return baseStyles;
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","AutosaveMonitor","LocalAutosaveMonitor","UnsavedChangesWarning","EditorKeyboardShortcutsRegister","EditorSnackbars","store","editorStore","privateApis","editorPrivateApis","useSelect","useDispatch","blockEditorPrivateApis","blockEditorStore","PluginArea","__","sprintf","useCallback","useMemo","noticesStore","preferencesStore","commandsPrivateApis","coreCommandsPrivateApis","blockLibraryPrivateApis","addQueryArgs","decodeEntities","BackButton","EditPostKeyboardShortcuts","InitPatternModal","BrowserURL","MetaBoxes","PostEditorMoreMenu","WelcomeGuide","editPostStore","unlock","useEditPostCommands","usePaddingAppender","useShouldIframe","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","getLayoutStyles","useCommands","useCommandContext","EditorInterface","FullscreenMode","Sidebar","BlockKeyboardShortcuts","DESIGN_POST_TYPES","useEditorStyles","hasThemeStyleSupport","editorSettings","isZoomedOutView","hasMetaBoxes","renderingMode","postType","select","__unstableGetEditorMode","getCurrentPostType","getRenderingMode","_postType","isFeatureActive","getEditorSettings","_editorSettings$style","_editorSettings$style2","_editorSettings$style3","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","baseStyles","includes","Layout","initialPost","paddingAppenderRef","shouldIframe","createErrorNotice","mode","isFullscreenActive","hasActiveMetaboxes","hasBlockSelected","showIconLabels","isDistractionFree","showMetaBoxes","hasHistory","isEditingTemplate","isWelcomeGuideVisible","get","getEditorMode","getBlockSelectionStart","onNavigateToPreviousEntityRecord","commandContext","document","body","classList","add","remove","className","onPluginAreaError","name","createSuccessNotice","onActionPerformed","actionId","items","location","href","trashed","post_type","type","ids","id","newItem","title","rendered","actions","label","onClick","postId","post","action","children","isActive","onError","extraPanels","forceIsDirty","contentRef","disableIframe","autoFocus"],"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\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 { useCallback, useMemo } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as commandsPrivateApis } 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';\n\n/**\n * Internal dependencies\n */\nimport BackButton from '../back-button';\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';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { EditorInterface, FullscreenMode, Sidebar } =\n\tunlock( editorPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\nconst DESIGN_POST_TYPES = [\n\t'wp_template',\n\t'wp_template_part',\n\t'wp_block',\n\t'wp_navigation',\n];\n\nfunction useEditorStyles() {\n\tconst {\n\t\thasThemeStyleSupport,\n\t\teditorSettings,\n\t\tisZoomedOutView,\n\t\thasMetaBoxes,\n\t\trenderingMode,\n\t\tpostType,\n\t} = useSelect( ( select ) => {\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getCurrentPostType, getRenderingMode } = select( editorStore );\n\t\tconst _postType = getCurrentPostType();\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t\tisZoomedOutView: __unstableGetEditorMode() === 'zoom-out',\n\t\t\thasMetaBoxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\trenderingMode: getRenderingMode(),\n\t\t\tpostType: _postType,\n\t\t};\n\t}, [] );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...editorSettings.defaultEditorStyles,\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( editorSettings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! editorSettings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\tconst baseStyles = hasThemeStyles\n\t\t\t? editorSettings.styles ?? []\n\t\t\t: defaultEditorStyles;\n\n\t\t// Add a constant padding for the typewriter effect. When typing at the\n\t\t// bottom, there needs to be room to scroll up.\n\t\tif (\n\t\t\t! isZoomedOutView &&\n\t\t\t! hasMetaBoxes &&\n\t\t\trenderingMode === 'post-only' &&\n\t\t\t! DESIGN_POST_TYPES.includes( postType )\n\t\t) {\n\t\t\treturn [\n\t\t\t\t...baseStyles,\n\t\t\t\t{\n\t\t\t\t\t// Should override global styles padding, so ensure 0-1-0\n\t\t\t\t\t// specificity.\n\t\t\t\t\tcss: ':root :where(body){padding-bottom: 40vh}',\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\treturn baseStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t\tpostType,\n\t] );\n}\n\nfunction Layout( { initialPost } ) {\n\tuseCommands();\n\tuseEditPostCommands();\n\tconst paddingAppenderRef = usePaddingAppender();\n\tconst shouldIframe = useShouldIframe();\n\tconst { createErrorNotice } = useDispatch( noticesStore );\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\tisEditingTemplate,\n\t\tisWelcomeGuideVisible,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { isFeatureActive } = select( editPostStore );\n\n\t\treturn {\n\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\thasBlockSelected:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tshowMetaBoxes:\n\t\t\t\tselect( editorStore ).getRenderingMode() === 'post-only',\n\t\t\thasHistory: !! getEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t\tisEditingTemplate:\n\t\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t};\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\n\tconst styles = useEditorStyles();\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst 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 e.g: \"Post 1\".\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\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL hasHistory={ hasHistory } />\n\t\t\t<UnsavedChangesWarning />\n\t\t\t<AutosaveMonitor />\n\t\t\t<LocalAutosaveMonitor />\n\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t<BlockKeyboardShortcuts />\n\t\t\t<WelcomeGuide />\n\t\t\t<InitPatternModal />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t{ ! isDistractionFree && (\n\t\t\t\t<Sidebar\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\textraPanels={\n\t\t\t\t\t\t! isEditingTemplate && <MetaBoxes location=\"side\" />\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<PostEditorMoreMenu />\n\t\t\t<BackButton initialPost={ initialPost } />\n\t\t\t<EditorSnackbars />\n\t\t\t<EditorInterface\n\t\t\t\tclassName={ className }\n\t\t\t\tstyles={ styles }\n\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\tcontentRef={ paddingAppenderRef }\n\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t>\n\t\t\t\t{ ! isDistractionFree && showMetaBoxes && (\n\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</EditorInterface>\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,eAAe,EACfC,oBAAoB,EACpBC,qBAAqB,EACrBC,+BAA+B,EAC/BC,eAAe,EACfC,KAAK,IAAIC,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;AAC1B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCH,WAAW,IAAII,sBAAsB,EACrCN,KAAK,IAAIO,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,WAAW,EAAEC,OAAO,QAAQ,oBAAoB;AACzD,SAASZ,KAAK,IAAIa,YAAY,QAAQ,oBAAoB;AAC1D,SAASb,KAAK,IAAIc,gBAAgB,QAAQ,wBAAwB;AAClE,SAASZ,WAAW,IAAIa,mBAAmB,QAAQ,qBAAqB;AACxE,SAASb,WAAW,IAAIc,uBAAuB,QAAQ,0BAA0B;AACjF,SAASd,WAAW,IAAIe,uBAAuB,QAAQ,0BAA0B;AACjF,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;A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AQ;MACjBoE,YAAY,EAAG7C,kBAAoB;MACnC8C,UAAU,EAAGnD,kBAAoB;MACjCoD,aAAa,EAAG,CAAEnD;MAClB;MACA;MAAA;MACAoD,SAAS,EAAG,CAAEzC,qBAAuB;MAAAkC,QAAA,EAEnC,CAAEtC,iBAAiB,IAAIC,aAAa,iBACrCxD,KAAA;QAAKsE,SAAS,EAAC,6BAA6B;QAAAuB,QAAA,gBAC3C/F,IAAA,CAACT,SAAS;UAACwF,QAAQ,EAAC;QAAQ,CAAE,CAAC,eAC/B/E,IAAA,CAACT,SAAS;UAACwF,QAAQ,EAAC;QAAU,CAAE,CAAC;MAAA,CAC7B;IACL,CACe,CAAC;EAAA,CACjB,CAAC;AAEL;AAEA,eAAehC,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["clsx","AutosaveMonitor","LocalAutosaveMonitor","UnsavedChangesWarning","EditorKeyboardShortcutsRegister","EditorSnackbars","store","editorStore","privateApis","editorPrivateApis","useSelect","useDispatch","blockEditorPrivateApis","blockEditorStore","PluginArea","__","sprintf","useCallback","useMemo","noticesStore","preferencesStore","commandsPrivateApis","coreCommandsPrivateApis","blockLibraryPrivateApis","addQueryArgs","decodeEntities","BackButton","EditPostKeyboardShortcuts","InitPatternModal","BrowserURL","MetaBoxes","PostEditorMoreMenu","WelcomeGuide","editPostStore","unlock","useEditPostCommands","usePaddingAppender","useShouldIframe","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","getLayoutStyles","useCommands","useCommandContext","EditorInterface","FullscreenMode","Sidebar","BlockKeyboardShortcuts","DESIGN_POST_TYPES","useEditorStyles","hasThemeStyleSupport","editorSettings","isZoomedOutView","renderingMode","postType","select","__unstableGetEditorMode","getCurrentPostType","getRenderingMode","_postType","isFeatureActive","getEditorSettings","_editorSettings$style","_editorSettings$style2","_editorSettings$style3","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","baseStyles","includes","Layout","initialPost","paddingAppenderRef","shouldIframe","createErrorNotice","mode","isFullscreenActive","hasActiveMetaboxes","hasBlockSelected","showIconLabels","isDistractionFree","showMetaBoxes","hasHistory","isEditingTemplate","isWelcomeGuideVisible","get","getEditorMode","hasMetaBoxes","getBlockSelectionStart","onNavigateToPreviousEntityRecord","commandContext","document","body","classList","add","remove","className","onPluginAreaError","name","createSuccessNotice","onActionPerformed","actionId","items","location","href","trashed","post_type","type","ids","id","newItem","title","rendered","actions","label","onClick","postId","post","action","children","isActive","onError","extraPanels","forceIsDirty","contentRef","disableIframe","autoFocus"],"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\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 { useCallback, useMemo } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as commandsPrivateApis } 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';\n\n/**\n * Internal dependencies\n */\nimport BackButton from '../back-button';\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';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { EditorInterface, FullscreenMode, Sidebar } =\n\tunlock( editorPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\nconst DESIGN_POST_TYPES = [\n\t'wp_template',\n\t'wp_template_part',\n\t'wp_block',\n\t'wp_navigation',\n];\n\nfunction useEditorStyles() {\n\tconst {\n\t\thasThemeStyleSupport,\n\t\teditorSettings,\n\t\tisZoomedOutView,\n\t\trenderingMode,\n\t\tpostType,\n\t} = useSelect( ( select ) => {\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getCurrentPostType, getRenderingMode } = select( editorStore );\n\t\tconst _postType = getCurrentPostType();\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t\tisZoomedOutView: __unstableGetEditorMode() === 'zoom-out',\n\t\t\trenderingMode: getRenderingMode(),\n\t\t\tpostType: _postType,\n\t\t};\n\t}, [] );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...editorSettings.defaultEditorStyles,\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( editorSettings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! editorSettings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\tconst baseStyles = hasThemeStyles\n\t\t\t? editorSettings.styles ?? []\n\t\t\t: defaultEditorStyles;\n\n\t\t// Add a space for the typewriter effect. When typing in the last block,\n\t\t// there needs to be room to scroll up.\n\t\tif (\n\t\t\t! isZoomedOutView &&\n\t\t\trenderingMode === 'post-only' &&\n\t\t\t! DESIGN_POST_TYPES.includes( postType )\n\t\t) {\n\t\t\treturn [\n\t\t\t\t...baseStyles,\n\t\t\t\t{\n\t\t\t\t\tcss: ':root :where(.editor-styles-wrapper)::after {content: \"\"; display: block; height: 40vh;}',\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\treturn baseStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t\tpostType,\n\t] );\n}\n\nfunction Layout( { initialPost } ) {\n\tuseCommands();\n\tuseEditPostCommands();\n\tconst paddingAppenderRef = usePaddingAppender();\n\tconst shouldIframe = useShouldIframe();\n\tconst { createErrorNotice } = useDispatch( noticesStore );\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\tisEditingTemplate,\n\t\tisWelcomeGuideVisible,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { isFeatureActive } = select( editPostStore );\n\n\t\treturn {\n\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\thasBlockSelected:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tshowMetaBoxes:\n\t\t\t\tselect( editorStore ).getRenderingMode() === 'post-only',\n\t\t\thasHistory: !! getEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t\tisEditingTemplate:\n\t\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t};\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\n\tconst styles = useEditorStyles();\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst 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 e.g: \"Post 1\".\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\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL hasHistory={ hasHistory } />\n\t\t\t<UnsavedChangesWarning />\n\t\t\t<AutosaveMonitor />\n\t\t\t<LocalAutosaveMonitor />\n\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t<BlockKeyboardShortcuts />\n\t\t\t<WelcomeGuide />\n\t\t\t<InitPatternModal />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t{ ! isDistractionFree && (\n\t\t\t\t<Sidebar\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\textraPanels={\n\t\t\t\t\t\t! isEditingTemplate && <MetaBoxes location=\"side\" />\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<PostEditorMoreMenu />\n\t\t\t<BackButton initialPost={ initialPost } />\n\t\t\t<EditorSnackbars />\n\t\t\t<EditorInterface\n\t\t\t\tclassName={ className }\n\t\t\t\tstyles={ styles }\n\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\tcontentRef={ paddingAppenderRef }\n\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t>\n\t\t\t\t{ ! isDistractionFree && showMetaBoxes && (\n\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t</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":[]}
@@ -18,8 +18,8 @@ export function usePaddingAppender() {
18
18
  const {
19
19
  defaultView
20
20
  } = ownerDocument;
21
- const paddingBottom = defaultView.parseInt(defaultView.getComputedStyle(node).paddingBottom, 10);
22
- if (!paddingBottom) {
21
+ const pseudoHeight = defaultView.parseInt(defaultView.getComputedStyle(node, ':after').height, 10);
22
+ if (!pseudoHeight) {
23
23
  return;
24
24
  }
25
25
 
@@ -32,20 +32,15 @@ export function usePaddingAppender() {
32
32
  if (event.clientY < lastChildRect.bottom) {
33
33
  return;
34
34
  }
35
- event.preventDefault();
35
+ event.stopPropagation();
36
36
  const blockOrder = registry.select(blockEditorStore).getBlockOrder('');
37
37
  const lastBlockClientId = blockOrder[blockOrder.length - 1];
38
-
39
- // Do nothing when only default block appender is present.
40
- if (!lastBlockClientId) {
41
- return;
42
- }
43
38
  const lastBlock = registry.select(blockEditorStore).getBlock(lastBlockClientId);
44
39
  const {
45
40
  selectBlock,
46
41
  insertDefaultBlock
47
42
  } = registry.dispatch(blockEditorStore);
48
- if (isUnmodifiedDefaultBlock(lastBlock)) {
43
+ if (lastBlock && isUnmodifiedDefaultBlock(lastBlock)) {
49
44
  selectBlock(lastBlockClientId);
50
45
  } else {
51
46
  insertDefaultBlock();
@@ -1 +1 @@
1
- {"version":3,"names":["useRegistry","useRefEffect","store","blockEditorStore","isUnmodifiedDefaultBlock","usePaddingAppender","registry","node","onMouseDown","event","target","ownerDocument","defaultView","paddingBottom","parseInt","getComputedStyle","lastChild","lastElementChild","lastChildRect","getBoundingClientRect","clientY","bottom","preventDefault","blockOrder","select","getBlockOrder","lastBlockClientId","length","lastBlock","getBlock","selectBlock","insertDefaultBlock","dispatch","addEventListener","removeEventListener"],"sources":["@wordpress/edit-post/src/components/layout/use-padding-appender.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\n\nexport function usePaddingAppender() {\n\tconst registry = useRegistry();\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tfunction onMouseDown( event ) {\n\t\t\t\tif ( event.target !== node ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst { ownerDocument } = node;\n\t\t\t\tconst { defaultView } = ownerDocument;\n\n\t\t\t\tconst paddingBottom = defaultView.parseInt(\n\t\t\t\t\tdefaultView.getComputedStyle( node ).paddingBottom,\n\t\t\t\t\t10\n\t\t\t\t);\n\n\t\t\t\tif ( ! paddingBottom ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Only handle clicks under the last child.\n\t\t\t\tconst lastChild = node.lastElementChild;\n\t\t\t\tif ( ! lastChild ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst lastChildRect = lastChild.getBoundingClientRect();\n\t\t\t\tif ( event.clientY < lastChildRect.bottom ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tconst blockOrder = registry\n\t\t\t\t\t.select( blockEditorStore )\n\t\t\t\t\t.getBlockOrder( '' );\n\t\t\t\tconst lastBlockClientId = blockOrder[ blockOrder.length - 1 ];\n\n\t\t\t\t// Do nothing when only default block appender is present.\n\t\t\t\tif ( ! lastBlockClientId ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst lastBlock = registry\n\t\t\t\t\t.select( blockEditorStore )\n\t\t\t\t\t.getBlock( lastBlockClientId );\n\t\t\t\tconst { selectBlock, insertDefaultBlock } =\n\t\t\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\t\t\tif ( isUnmodifiedDefaultBlock( lastBlock ) ) {\n\t\t\t\t\tselectBlock( lastBlockClientId );\n\t\t\t\t} else {\n\t\t\t\t\tinsertDefaultBlock();\n\t\t\t\t}\n\t\t\t}\n\t\t\tnode.addEventListener( 'mousedown', onM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,CAAED,iBAAiB,EAAG;QAC1B;MACD;MAEA,MAAME,SAAS,GAAGtB,QAAQ,CACxBkB,MAAM,CAAErB,gBAAiB,CAAC,CAC1B0B,QAAQ,CAAEH,iBAAkB,CAAC;MAC/B,MAAM;QAAEI,WAAW;QAAEC;MAAmB,CAAC,GACxCzB,QAAQ,CAAC0B,QAAQ,CAAE7B,gBAAiB,CAAC;MAEtC,IAAKC,wBAAwB,CAAEwB,SAAU,CAAC,EAAG;QAC5CE,WAAW,CAAEJ,iBAAkB,CAAC;MACjC,CAAC,MAAM;QACNK,kBAAkB,CAAC,CAAC;MACrB;IACD;IACAxB,IAAI,CAAC0B,gBAAgB,CAAE,WAAW,EAAEzB,WAAY,CAAC;IACjD,OAAO,MAAM;MACZD,IAAI,CAAC2B,mBAAmB,CAAE,WAAW,EAAE1B,WAAY,CAAC;IACrD,CAAC;EACF,CAAC,EACD,CAAEF,QAAQ,CACX,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["useRegistry","useRefEffect","store","blockEditorStore","isUnmodifiedDefaultBlock","usePaddingAppender","registry","node","onMouseDown","event","target","ownerDocument","defaultView","pseudoHeight","parseInt","getComputedStyle","height","lastChild","lastElementChild","lastChildRect","getBoundingClientRect","clientY","bottom","stopPropagation","blockOrder","select","getBlockOrder","lastBlockClientId","length","lastBlock","getBlock","selectBlock","insertDefaultBlock","dispatch","addEventListener","removeEventListener"],"sources":["@wordpress/edit-post/src/components/layout/use-padding-appender.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\n\nexport function usePaddingAppender() {\n\tconst registry = useRegistry();\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tfunction onMouseDown( event ) {\n\t\t\t\tif ( event.target !== node ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst { ownerDocument } = node;\n\t\t\t\tconst { defaultView } = ownerDocument;\n\n\t\t\t\tconst pseudoHeight = defaultView.parseInt(\n\t\t\t\t\tdefaultView.getComputedStyle( node, ':after' ).height,\n\t\t\t\t\t10\n\t\t\t\t);\n\n\t\t\t\tif ( ! pseudoHeight ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Only handle clicks under the last child.\n\t\t\t\tconst lastChild = node.lastElementChild;\n\t\t\t\tif ( ! lastChild ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst lastChildRect = lastChild.getBoundingClientRect();\n\t\t\t\tif ( event.clientY < lastChildRect.bottom ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tevent.stopPropagation();\n\n\t\t\t\tconst blockOrder = registry\n\t\t\t\t\t.select( blockEditorStore )\n\t\t\t\t\t.getBlockOrder( '' );\n\t\t\t\tconst lastBlockClientId = blockOrder[ blockOrder.length - 1 ];\n\n\t\t\t\tconst lastBlock = registry\n\t\t\t\t\t.select( blockEditorStore )\n\t\t\t\t\t.getBlock( lastBlockClientId );\n\t\t\t\tconst { selectBlock, insertDefaultBlock } =\n\t\t\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\t\t\tif ( lastBlock && isUnmodifiedDefaultBlock( lastBlock ) ) {\n\t\t\t\t\tselectBlock( lastBlockClientId );\n\t\t\t\t} else {\n\t\t\t\t\tinsertDefaultBlock();\n\t\t\t\t}\n\t\t\t}\n\t\t\tnode.addEventListener( 'mousedown', onMouseDown );\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'mousedown', onMouseDown );\n\t\t\t};\n\t\t},\n\t\t[ registry ]\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,wBAAw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AG;QACzDE,WAAW,CAAEJ,iBAAkB,CAAC;MACjC,CAAC,MAAM;QACNK,kBAAkB,CAAC,CAAC;MACrB;IACD;IACAzB,IAAI,CAAC2B,gBAAgB,CAAE,WAAW,EAAE1B,WAAY,CAAC;IACjD,OAAO,MAAM;MACZD,IAAI,CAAC4B,mBAAmB,CAAE,WAAW,EAAE3B,WAAY,CAAC;IACrD,CAAC;EACF,CAAC,EACD,CAAEF,QAAQ,CACX,CAAC;AACF","ignoreList":[]}
@@ -181,11 +181,6 @@
181
181
  content: none;
182
182
  }
183
183
 
184
- .edit-post-visual-editor:not(.is-iframed) {
185
- flex: 1 0 auto;
186
- height: auto;
187
- }
188
-
189
184
  .edit-post-layout__metaboxes {
190
185
  flex-shrink: 0;
191
186
  clear: both;
@@ -181,11 +181,6 @@
181
181
  content: none;
182
182
  }
183
183
 
184
- .edit-post-visual-editor:not(.is-iframed) {
185
- flex: 1 0 auto;
186
- height: auto;
187
- }
188
-
189
184
  .edit-post-layout__metaboxes {
190
185
  flex-shrink: 0;
191
186
  clear: both;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-post",
3
- "version": "8.0.8",
3
+ "version": "8.0.9",
4
4
  "description": "Edit Post module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -30,18 +30,18 @@
30
30
  "@babel/runtime": "^7.16.0",
31
31
  "@wordpress/a11y": "^4.0.1",
32
32
  "@wordpress/api-fetch": "^7.0.1",
33
- "@wordpress/block-editor": "^13.0.6",
34
- "@wordpress/block-library": "^9.0.7",
33
+ "@wordpress/block-editor": "^13.0.7",
34
+ "@wordpress/block-library": "^9.0.8",
35
35
  "@wordpress/blocks": "^13.0.3",
36
36
  "@wordpress/commands": "^1.0.3",
37
37
  "@wordpress/components": "^28.0.3",
38
38
  "@wordpress/compose": "^7.0.1",
39
- "@wordpress/core-commands": "^1.0.6",
40
- "@wordpress/core-data": "^7.0.6",
39
+ "@wordpress/core-commands": "^1.0.7",
40
+ "@wordpress/core-data": "^7.0.7",
41
41
  "@wordpress/data": "^10.0.2",
42
42
  "@wordpress/deprecated": "^4.0.1",
43
43
  "@wordpress/dom": "^4.0.1",
44
- "@wordpress/editor": "^14.0.7",
44
+ "@wordpress/editor": "^14.0.8",
45
45
  "@wordpress/element": "^6.0.1",
46
46
  "@wordpress/hooks": "^4.0.1",
47
47
  "@wordpress/html-entities": "^4.0.1",
@@ -56,7 +56,7 @@
56
56
  "@wordpress/url": "^4.0.1",
57
57
  "@wordpress/viewport": "^6.0.2",
58
58
  "@wordpress/warning": "^3.0.1",
59
- "@wordpress/widgets": "^4.0.6",
59
+ "@wordpress/widgets": "^4.0.7",
60
60
  "clsx": "^2.1.1",
61
61
  "memize": "^2.1.0"
62
62
  },
@@ -67,5 +67,5 @@
67
67
  "publishConfig": {
68
68
  "access": "public"
69
69
  },
70
- "gitHead": "5c1d6bb774e6f78f0bbd4cdc85c4a7087da2f8a0"
70
+ "gitHead": "a74a70ed203bbcbb5f3d34335df9631178647acb"
71
71
  }
@@ -65,7 +65,6 @@ function useEditorStyles() {
65
65
  hasThemeStyleSupport,
66
66
  editorSettings,
67
67
  isZoomedOutView,
68
- hasMetaBoxes,
69
68
  renderingMode,
70
69
  postType,
71
70
  } = useSelect( ( select ) => {
@@ -77,7 +76,6 @@ function useEditorStyles() {
77
76
  select( editPostStore ).isFeatureActive( 'themeStyles' ),
78
77
  editorSettings: select( editorStore ).getEditorSettings(),
79
78
  isZoomedOutView: __unstableGetEditorMode() === 'zoom-out',
80
- hasMetaBoxes: select( editPostStore ).hasMetaBoxes(),
81
79
  renderingMode: getRenderingMode(),
82
80
  postType: _postType,
83
81
  };
@@ -119,20 +117,17 @@ function useEditorStyles() {
119
117
  ? editorSettings.styles ?? []
120
118
  : defaultEditorStyles;
121
119
 
122
- // Add a constant padding for the typewriter effect. When typing at the
123
- // bottom, there needs to be room to scroll up.
120
+ // Add a space for the typewriter effect. When typing in the last block,
121
+ // there needs to be room to scroll up.
124
122
  if (
125
123
  ! isZoomedOutView &&
126
- ! hasMetaBoxes &&
127
124
  renderingMode === 'post-only' &&
128
125
  ! DESIGN_POST_TYPES.includes( postType )
129
126
  ) {
130
127
  return [
131
128
  ...baseStyles,
132
129
  {
133
- // Should override global styles padding, so ensure 0-1-0
134
- // specificity.
135
- css: ':root :where(body){padding-bottom: 40vh}',
130
+ css: ':root :where(.editor-styles-wrapper)::after {content: ""; display: block; height: 40vh;}',
136
131
  },
137
132
  ];
138
133
  }
@@ -1,8 +1,3 @@
1
- .edit-post-visual-editor:not(.is-iframed) {
2
- flex: 1 0 auto;
3
- height: auto;
4
- }
5
-
6
1
  .edit-post-layout__metaboxes {
7
2
  flex-shrink: 0;
8
3
  clear: both;
@@ -18,12 +18,12 @@ export function usePaddingAppender() {
18
18
  const { ownerDocument } = node;
19
19
  const { defaultView } = ownerDocument;
20
20
 
21
- const paddingBottom = defaultView.parseInt(
22
- defaultView.getComputedStyle( node ).paddingBottom,
21
+ const pseudoHeight = defaultView.parseInt(
22
+ defaultView.getComputedStyle( node, ':after' ).height,
23
23
  10
24
24
  );
25
25
 
26
- if ( ! paddingBottom ) {
26
+ if ( ! pseudoHeight ) {
27
27
  return;
28
28
  }
29
29
 
@@ -38,25 +38,20 @@ export function usePaddingAppender() {
38
38
  return;
39
39
  }
40
40
 
41
- event.preventDefault();
41
+ event.stopPropagation();
42
42
 
43
43
  const blockOrder = registry
44
44
  .select( blockEditorStore )
45
45
  .getBlockOrder( '' );
46
46
  const lastBlockClientId = blockOrder[ blockOrder.length - 1 ];
47
47
 
48
- // Do nothing when only default block appender is present.
49
- if ( ! lastBlockClientId ) {
50
- return;
51
- }
52
-
53
48
  const lastBlock = registry
54
49
  .select( blockEditorStore )
55
50
  .getBlock( lastBlockClientId );
56
51
  const { selectBlock, insertDefaultBlock } =
57
52
  registry.dispatch( blockEditorStore );
58
53
 
59
- if ( isUnmodifiedDefaultBlock( lastBlock ) ) {
54
+ if ( lastBlock && isUnmodifiedDefaultBlock( lastBlock ) ) {
60
55
  selectBlock( lastBlockClientId );
61
56
  } else {
62
57
  insertDefaultBlock();