@wordpress/edit-post 7.18.1-next.5a1d1283.0 → 7.19.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/header/index.js +6 -0
  3. package/build/components/header/index.js.map +1 -1
  4. package/build/components/layout/index.js +9 -3
  5. package/build/components/layout/index.js.map +1 -1
  6. package/build/components/start-page-options/index.js +2 -3
  7. package/build/components/start-page-options/index.js.map +1 -1
  8. package/build/components/visual-editor/index.js +34 -44
  9. package/build/components/visual-editor/index.js.map +1 -1
  10. package/build/editor.js +2 -3
  11. package/build/editor.js.map +1 -1
  12. package/build-module/components/header/index.js +6 -0
  13. package/build-module/components/header/index.js.map +1 -1
  14. package/build-module/components/layout/index.js +9 -3
  15. package/build-module/components/layout/index.js.map +1 -1
  16. package/build-module/components/start-page-options/index.js +2 -3
  17. package/build-module/components/start-page-options/index.js.map +1 -1
  18. package/build-module/components/visual-editor/index.js +35 -45
  19. package/build-module/components/visual-editor/index.js.map +1 -1
  20. package/build-module/editor.js +2 -3
  21. package/build-module/editor.js.map +1 -1
  22. package/build-style/style-rtl.css +94 -8
  23. package/build-style/style.css +94 -8
  24. package/package.json +32 -32
  25. package/src/components/header/index.js +2 -0
  26. package/src/components/keyboard-shortcut-help-modal/test/index.js +4 -5
  27. package/src/components/layout/index.js +9 -2
  28. package/src/components/preferences-modal/test/index.js +35 -8
  29. package/src/components/start-page-options/index.js +4 -5
  30. package/src/components/visual-editor/index.js +49 -55
  31. package/src/components/visual-editor/style.scss +89 -0
  32. package/src/editor.js +17 -20
  33. package/src/style.scss +0 -9
  34. package/src/components/preferences-modal/test/__snapshots__/index.js.snap +0 -942
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 7.19.0 (2023-09-20)
6
+
5
7
  ## 7.18.0 (2023-08-31)
6
8
 
7
9
  ## 7.17.0 (2023-08-16)
@@ -32,6 +32,9 @@ const slideY = {
32
32
  hidden: {
33
33
  y: '-50px'
34
34
  },
35
+ distractionFreeInactive: {
36
+ y: 0
37
+ },
35
38
  hover: {
36
39
  y: 0,
37
40
  transition: {
@@ -44,6 +47,9 @@ const slideX = {
44
47
  hidden: {
45
48
  x: '-100%'
46
49
  },
50
+ distractionFreeInactive: {
51
+ x: 0
52
+ },
47
53
  hover: {
48
54
  x: 0,
49
55
  transition: {
@@ -1 +1 @@
1
- {"version":3,"names":["_editor","require","_data","_interface","_compose","_components","_fullscreenModeClose","_interopRequireDefault","_headerToolbar","_moreMenu","_postPublishButtonOrToggle","_devicePreview","_viewLink","_mainDashboardButton","_store","_documentActions","slideY","hidden","y","hover","transition","type","delay","slideX","x","Header","setEntitiesSavedStatesCallback","isLargeViewport","useViewportMatch","hasActiveMetaboxes","isPublishSidebarOpened","showIconLabels","useSelect","select","editPostStore","hasMetaBoxes","isFeatureActive","_element","createElement","className","default","Slot","__unstableMotion","div","variants","showTooltip","PostSavedState","forceIsDirty","PostPreviewButton","forceIsAutosaveable","Fragment","PinnedItems","scope","_default","exports"],"sources":["@wordpress/edit-post/src/components/header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PostSavedState, PostPreviewButton } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { __unstableMotion as motion } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport HeaderToolbar from './header-toolbar';\nimport MoreMenu from './more-menu';\nimport PostPublishButtonOrToggle from './post-publish-button-or-toggle';\nimport { default as DevicePreview } from '../device-preview';\nimport ViewLink from '../view-link';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport DocumentActions from './document-actions';\n\nconst slideY = {\n\thidden: { y: '-50px' },\n\thover: { y: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nconst slideX = {\n\thidden: { x: '-100%' },\n\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nfunction Header( { setEntitiesSavedStatesCallback } ) {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\tconst { hasActiveMetaboxes, isPublishSidebarOpened, showIconLabels } =\n\t\tuseSelect(\n\t\t\t( select ) => ( {\n\t\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\t\tisPublishSidebarOpened:\n\t\t\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\t\t\tshowIconLabels:\n\t\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\t} ),\n\t\t\t[]\n\t\t);\n\n\treturn (\n\t\t<div className=\"edit-post-header\">\n\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ slideX }\n\t\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\t>\n\t\t\t\t\t<FullscreenModeClose showTooltip />\n\t\t\t\t</motion.div>\n\t\t\t</MainDashboardButton.Slot>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__toolbar\"\n\t\t\t>\n\t\t\t\t<HeaderToolbar />\n\t\t\t\t<div className=\"edit-post-header__center\">\n\t\t\t\t\t<DocumentActions />\n\t\t\t\t</div>\n\t\t\t</motion.div>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__settings\"\n\t\t\t>\n\t\t\t\t{ ! isPublishSidebarOpened && (\n\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t<PostSavedState\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<DevicePreview />\n\t\t\t\t<PostPreviewButton forceIsAutosaveable={ hasActiveMetaboxes } />\n\t\t\t\t<ViewLink />\n\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isLargeViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ showIconLabels && ! isLargeViewport && (\n\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t) }\n\t\t\t</motion.div>\n\t\t</div>\n\t);\n}\n\nexport default Header;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAKA,IAAAK,oBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,cAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,SAAA,GAAAF,sBAAA,CAAAN,OAAA;AACA,IAAAS,0BAAA,GAAAH,sBAAA,CAAAN,OAAA;AACA,IAAAU,cAAA,GAAAJ,sBAAA,CAAAN,OAAA;AACA,IAAAW,SAAA,GA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CAAC,EAChE,IAAAQ,QAAA,CAAAC,aAAA,EAAC1B,SAAA,CAAA4B,OAAQ,MAAE,CAAC,EACZ,IAAAH,QAAA,CAAAC,aAAA,EAAC5B,0BAAA,CAAA8B,OAAyB;IACzBO,YAAY,EAAGlB,kBAAoB;IACnCH,8BAA8B,EAC7BA;EACA,CACD,CAAC,EACA,CAAEC,eAAe,IAAI,CAAEI,cAAc,KACtC,IAAAM,QAAA,CAAAC,aAAA,EAAAD,QAAA,CAAAa,QAAA,QACC,IAAAb,QAAA,CAAAC,aAAA,EAACnC,UAAA,CAAAgD,WAAW,CAACV,IAAI;IAACW,KAAK,EAAC;EAAgB,CAAE,CAAC,EAC3C,IAAAf,QAAA,CAAAC,aAAA,EAAC7B,SAAA,CAAA+B,OAAQ;IAACT,cAAc,EAAGA;EAAgB,CAAE,CAC5C,CACF,EACCA,cAAc,IAAI,CAAEJ,eAAe,IACpC,IAAAU,QAAA,CAAAC,aAAA,EAAC7B,SAAA,CAAA+B,OAAQ;IAACT,cAAc,EAAGA;EAAgB,CAAE,CAEnC,CACR,CAAC;AAER;AAAC,IAAAsB,QAAA,GAEc5B,MAAM;AAAA6B,OAAA,CAAAd,OAAA,GAAAa,QAAA"}
1
+ {"version":3,"names":["_editor","require","_data","_interface","_compose","_components","_fullscreenModeClose","_interopRequireDefault","_headerToolbar","_moreMenu","_postPublishButtonOrToggle","_devicePreview","_viewLink","_mainDashboardButton","_store","_documentActions","slideY","hidden","y","distractionFreeInactive","hover","transition","type","delay","slideX","x","Header","setEntitiesSavedStatesCallback","isLargeViewport","useViewportMatch","hasActiveMetaboxes","isPublishSidebarOpened","showIconLabels","useSelect","select","editPostStore","hasMetaBoxes","isFeatureActive","_element","createElement","className","default","Slot","__unstableMotion","div","variants","showTooltip","PostSavedState","forceIsDirty","PostPreviewButton","forceIsAutosaveable","Fragment","PinnedItems","scope","_default","exports"],"sources":["@wordpress/edit-post/src/components/header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PostSavedState, PostPreviewButton } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { __unstableMotion as motion } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport HeaderToolbar from './header-toolbar';\nimport MoreMenu from './more-menu';\nimport PostPublishButtonOrToggle from './post-publish-button-or-toggle';\nimport { default as DevicePreview } from '../device-preview';\nimport ViewLink from '../view-link';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport DocumentActions from './document-actions';\n\nconst slideY = {\n\thidden: { y: '-50px' },\n\tdistractionFreeInactive: { y: 0 },\n\thover: { y: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nconst slideX = {\n\thidden: { x: '-100%' },\n\tdistractionFreeInactive: { x: 0 },\n\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nfunction Header( { setEntitiesSavedStatesCallback } ) {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\tconst { hasActiveMetaboxes, isPublishSidebarOpened, showIconLabels } =\n\t\tuseSelect(\n\t\t\t( select ) => ( {\n\t\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\t\tisPublishSidebarOpened:\n\t\t\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\t\t\tshowIconLabels:\n\t\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\t} ),\n\t\t\t[]\n\t\t);\n\n\treturn (\n\t\t<div className=\"edit-post-header\">\n\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ slideX }\n\t\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\t>\n\t\t\t\t\t<FullscreenModeClose showTooltip />\n\t\t\t\t</motion.div>\n\t\t\t</MainDashboardButton.Slot>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__toolbar\"\n\t\t\t>\n\t\t\t\t<HeaderToolbar />\n\t\t\t\t<div className=\"edit-post-header__center\">\n\t\t\t\t\t<DocumentActions />\n\t\t\t\t</div>\n\t\t\t</motion.div>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__settings\"\n\t\t\t>\n\t\t\t\t{ ! isPublishSidebarOpened && (\n\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t<PostSavedState\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<DevicePreview />\n\t\t\t\t<PostPreviewButton forceIsAutosaveable={ hasActiveMetaboxes } />\n\t\t\t\t<ViewLink />\n\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isLargeViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ showIconLabels && ! isLargeViewport && (\n\t\t\t\t\t<MoreMenu showIcon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AAgC,OAAQ;IAACT,cAAc,EAAGA;EAAgB,CAAE,CAEnC,CACR,CAAC;AAER;AAAC,IAAAsB,QAAA,GAEc5B,MAAM;AAAA6B,OAAA,CAAAd,OAAA,GAAAa,QAAA"}
@@ -174,11 +174,17 @@ function Layout() {
174
174
  }
175
175
  setEntitiesSavedStatesCallback(false);
176
176
  }, [entitiesSavedStatesCallback]);
177
+
178
+ // We need to add the show-icon-labels class to the body element so it is applied to modals.
179
+ if (showIconLabels) {
180
+ document.body.classList.add('show-icon-labels');
181
+ } else {
182
+ document.body.classList.remove('show-icon-labels');
183
+ }
177
184
  const className = (0, _classnames.default)('edit-post-layout', 'is-mode-' + mode, {
178
185
  'is-sidebar-opened': sidebarIsOpened,
179
186
  'has-fixed-toolbar': hasFixedToolbar,
180
187
  'has-metaboxes': hasActiveMetaboxes,
181
- 'show-icon-labels': showIconLabels,
182
188
  'is-distraction-free': isDistractionFree && isLargeViewport,
183
189
  'is-entity-save-view-open': !!entitiesSavedStatesCallback
184
190
  });
@@ -198,7 +204,7 @@ function Layout() {
198
204
  }
199
205
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_interface.FullscreenMode, {
200
206
  isActive: isFullscreenActive
201
- }), (0, _element.createElement)(_browserUrl.default, null), (0, _element.createElement)(_editor.UnsavedChangesWarning, null), (0, _element.createElement)(_editor.AutosaveMonitor, null), (0, _element.createElement)(_editor.LocalAutosaveMonitor, null), (0, _element.createElement)(_keyboardShortcuts2.default, null), (0, _element.createElement)(_editor.EditorKeyboardShortcutsRegister, null), (0, _element.createElement)(_editor.EditorKeyboardShortcuts, null), (0, _element.createElement)(_settingsSidebar.default, null), (0, _element.createElement)(_interface.InterfaceSkeleton, {
207
+ }), (0, _element.createElement)(_browserUrl.default, null), (0, _element.createElement)(_editor.UnsavedChangesWarning, null), (0, _element.createElement)(_editor.AutosaveMonitor, null), (0, _element.createElement)(_editor.LocalAutosaveMonitor, null), (0, _element.createElement)(_keyboardShortcuts2.default, null), (0, _element.createElement)(_editor.EditorKeyboardShortcutsRegister, null), (0, _element.createElement)(_editor.EditorKeyboardShortcuts, null), (0, _element.createElement)(_interface.InterfaceSkeleton, {
202
208
  isDistractionFree: isDistractionFree && isLargeViewport,
203
209
  className: className,
204
210
  labels: {
@@ -246,7 +252,7 @@ function Layout() {
246
252
  }
247
253
  }), (0, _element.createElement)(_preferencesModal.default, null), (0, _element.createElement)(_keyboardShortcutHelpModal.default, null), (0, _element.createElement)(_welcomeGuide.default, null), (0, _element.createElement)(_editor.PostSyncStatusModal, null), (0, _element.createElement)(_startPageOptions.default, null), (0, _element.createElement)(_plugins.PluginArea, {
248
254
  onError: onPluginAreaError
249
- }));
255
+ }), (0, _element.createElement)(_settingsSidebar.default, null));
250
256
  }
251
257
  var _default = Layout;
252
258
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_classnames","_interopRequireDefault","_editor","_data","_blockEditor","_components","_compose","_plugins","_i18n","_interface","_keyboardShortcuts","_notices","_textEditor","_visualEditor","_keyboardShortcuts2","_keyboardShortcutHelpModal","_preferencesModal","_browserUrl","_header","_inserterSidebar","_listViewSidebar","_settingsSidebar","_metaBoxes","_welcomeGuide","_actionsPanel","_startPageOptions","_store","_lockUnlock","getLayoutStyles","unlock","blockEditorPrivateApis","interfaceLabels","header","__","body","sidebar","actions","footer","useEditorStyles","hasThemeStyleSupport","editorSettings","useSelect","select","editPostStore","isFeatureActive","editorStore","getEditorSettings","useMemo","_editorSettings$style","_editorSettings$style2","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","Layout","useBlockCommands","isMobileViewport","useViewportMatch","isHugeViewport","isLargeViewport","openGeneralSidebar","closeGeneralSidebar","setIsInserterOpened","useDispatch","createErrorNotice","noticesStore","mode","isFullscreenActive","isRichEditingEnabled","sidebarIsOpened","hasActiveMetaboxes","hasFixedToolbar","previousShortcut","nextShortcut","hasBlockSelected","isInserterOpened","isListViewOpened","showIconLabels","isDistractionFree","showBlockBreadcrumbs","isTemplateMode","documentLabel","getPostTypeLabel","postTypeLabel","isEditingTemplate","interfaceStore","getActiveComplementaryArea","name","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","keyboardShortcutsStore","getAllShortcutKeyCombinations","_x","openSidebarPanel","useEffect","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","useState","closeEntitiesSavedStates","useCallback","arg","className","classnames","secondarySidebarLabel","secondarySidebar","createElement","default","onPluginAreaError","sprintf","Fragment","FullscreenMode","isActive","UnsavedChangesWarning","AutosaveMonitor","LocalAutosaveMonitor","EditorKeyboardShortcutsRegister","EditorKeyboardShortcuts","InterfaceSkeleton","labels","editorNotices","EditorNotices","Button","variant","onClick","ComplementaryArea","Slot","scope","notices","EditorSnackbars","content","location","ScrollLock","BlockBreadcrumb","rootLabelText","isEntitiesSavedStatesOpen","shortcuts","previous","next","PostSyncStatusModal","PluginArea","onError","_default","exports"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorNotices,\n\tEditorKeyboardShortcutsRegister,\n\tEditorKeyboardShortcuts,\n\tEditorSnackbars,\n\tPostSyncStatusModal,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseBlockCommands,\n\tBlockBreadcrumb,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { Button, ScrollLock } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tFullscreenMode,\n\tInterfaceSkeleton,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { useState, useEffect, useCallback, useMemo } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport EditPostPreferencesModal from '../preferences-modal';\nimport BrowserURL from '../browser-url';\nimport Header from '../header';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport SettingsSidebar from '../sidebar/settings-sidebar';\nimport MetaBoxes from '../meta-boxes';\nimport WelcomeGuide from '../welcome-guide';\nimport ActionsPanel from './actions-panel';\nimport StartPageOptions from '../start-page-options';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nfunction useEditorStyles() {\n\tconst { hasThemeStyleSupport, editorSettings } = useSelect(\n\t\t( select ) => ( {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t} ),\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\treturn hasThemeStyles ? editorSettings.styles : defaultEditorStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t] );\n}\n\nfunction Layout() {\n\tuseBlockCommands();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\tconst { openGeneralSidebar, closeGeneralSidebar, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\tisRichEditingEnabled,\n\t\tsidebarIsOpened,\n\t\thasActiveMetaboxes,\n\t\thasFixedToolbar,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\thasBlockSelected,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowBlockBreadcrumbs,\n\t\tisTemplateMode,\n\t\tdocumentLabel,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t\thasFixedToolbar:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fixedToolbar' ),\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t\teditPostStore.name\n\t\t\t\t) || select( editPostStore ).isPublishSidebarOpened()\n\t\t\t),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\tisInserterOpened: select( editPostStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editPostStore ).isListViewOpened(),\n\t\t\tmode: select( editPostStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\tisDistractionFree:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: select( editPostStore ).isFeatureActive(\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t};\n\t}, [] );\n\n\tconst styles = useEditorStyles();\n\n\tconst openSidebarPanel = () =>\n\t\topenGeneralSidebar(\n\t\t\thasBlockSelected ? 'edit-post/block' : 'edit-post/document'\n\t\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( sidebarIsOpened && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t}\n\t}, [ sidebarIsOpened, isHugeViewport ] );\n\tuseEffect( () => {\n\t\tif ( isInserterOpened && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isHugeViewport ] );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\tconst className = classnames( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'is-sidebar-opened': sidebarIsOpened,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t\t'show-icon-labels': showIconLabels,\n\t\t'is-distraction-free': isDistractionFree && isLargeViewport,\n\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t} );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\tconst secondarySidebar = () => {\n\t\tif ( mode === 'visual' && isInserterOpened ) {\n\t\t\treturn <InserterSidebar />;\n\t\t}\n\t\tif ( mode === 'visual' && isListViewOpened ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\n\t\treturn null;\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\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL />\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<EditorKeyboardShortcuts />\n\t\t\t<SettingsSidebar />\n\t\t\t<InterfaceSkeleton\n\t\t\t\tisDistractionFree={ isDistractionFree && isLargeViewport }\n\t\t\t\tclassName={ className }\n\t\t\t\tlabels={ {\n\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t} }\n\t\t\t\theader={\n\t\t\t\t\t<Header\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\tsidebar={\n\t\t\t\t\t( ! isMobileViewport || sidebarIsOpened ) && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isMobileViewport && ! sidebarIsOpened && (\n\t\t\t\t\t\t\t\t<div className=\"edit-post-layout__toggle-sidebar-panel\">\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-post-layout__toggle-sidebar-panel-button\"\n\t\t\t\t\t\t\t\t\t\tonClick={ openSidebarPanel }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ hasBlockSelected\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Open block settings' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Open document settings' ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isDistractionFree && <EditorNotices /> }\n\t\t\t\t\t\t{ ( mode === 'text' || ! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t<TextEditor />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isRichEditingEnabled && mode === 'visual' && (\n\t\t\t\t\t\t\t<VisualEditor styles={ styles } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isDistractionFree && ! isTemplateMode && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isMobileViewport && sidebarIsOpened && (\n\t\t\t\t\t\t\t<ScrollLock />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t! isMobileViewport &&\n\t\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t<div className=\"edit-post-layout__footer\">\n\t\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<ActionsPanel\n\t\t\t\t\t\tcloseEntitiesSavedStates={ closeEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tshortcuts={ {\n\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\tnext: nextShortcut,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<EditPostPreferencesModal />\n\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t<WelcomeGuide />\n\t\t\t<PostSyncStatusModal />\n\t\t\t<StartPageOptions />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";;;;;;;AAmCA,IAAAA,QAAA,GAAAC,OAAA;AAhCA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAH,OAAA;AAWA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAOA,IAAAW,kBAAA,GAAAX,OAAA;AACA,IAAAY,QAAA,GAAAZ,OAAA;AAKA,IAAAa,WAAA,GAAAX,sBAAA,CAAAF,OAAA;AACA,IAAAc,aAAA,GAAAZ,sBAAA,CAAAF,OAAA;AACA,IAAAe,mBAAA,GAAAb,sBAAA,CAAAF,OAAA;AACA,IAAAgB,0BAA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AAAwG,OAAyB,MAAE,CAAC,EAC7B,IAAAzH,QAAA,CAAAwH,aAAA,EAAC/F,aAAA,CAAAgG,OAAY,MAAE,CAAC,EAChB,IAAAzH,QAAA,CAAAwH,aAAA,EAACpH,OAAA,CAAAqJ,mBAAmB,MAAE,CAAC,EACvB,IAAAzJ,QAAA,CAAAwH,aAAA,EAAC7F,iBAAA,CAAA8F,OAAgB,MAAE,CAAC,EACpB,IAAAzH,QAAA,CAAAwH,aAAA,EAAC/G,QAAA,CAAAiJ,UAAU;IAACC,OAAO,EAAGjC;EAAmB,CAAE,CAC1C,CAAC;AAEL;AAAC,IAAAkC,QAAA,GAEczF,MAAM;AAAA0F,OAAA,CAAApC,OAAA,GAAAmC,QAAA"}
1
+ {"version":3,"names":["_element","require","_classnames","_interopRequireDefault","_editor","_data","_blockEditor","_components","_compose","_plugins","_i18n","_interface","_keyboardShortcuts","_notices","_textEditor","_visualEditor","_keyboardShortcuts2","_keyboardShortcutHelpModal","_preferencesModal","_browserUrl","_header","_inserterSidebar","_listViewSidebar","_settingsSidebar","_metaBoxes","_welcomeGuide","_actionsPanel","_startPageOptions","_store","_lockUnlock","getLayoutStyles","unlock","blockEditorPrivateApis","interfaceLabels","header","__","body","sidebar","actions","footer","useEditorStyles","hasThemeStyleSupport","editorSettings","useSelect","select","editPostStore","isFeatureActive","editorStore","getEditorSettings","useMemo","_editorSettings$style","_editorSettings$style2","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","Layout","useBlockCommands","isMobileViewport","useViewportMatch","isHugeViewport","isLargeViewport","openGeneralSidebar","closeGeneralSidebar","setIsInserterOpened","useDispatch","createErrorNotice","noticesStore","mode","isFullscreenActive","isRichEditingEnabled","sidebarIsOpened","hasActiveMetaboxes","hasFixedToolbar","previousShortcut","nextShortcut","hasBlockSelected","isInserterOpened","isListViewOpened","showIconLabels","isDistractionFree","showBlockBreadcrumbs","isTemplateMode","documentLabel","getPostTypeLabel","postTypeLabel","isEditingTemplate","interfaceStore","getActiveComplementaryArea","name","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","keyboardShortcutsStore","getAllShortcutKeyCombinations","_x","openSidebarPanel","useEffect","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","useState","closeEntitiesSavedStates","useCallback","arg","document","classList","add","remove","className","classnames","secondarySidebarLabel","secondarySidebar","createElement","default","onPluginAreaError","sprintf","Fragment","FullscreenMode","isActive","UnsavedChangesWarning","AutosaveMonitor","LocalAutosaveMonitor","EditorKeyboardShortcutsRegister","EditorKeyboardShortcuts","InterfaceSkeleton","labels","editorNotices","EditorNotices","Button","variant","onClick","ComplementaryArea","Slot","scope","notices","EditorSnackbars","content","location","ScrollLock","BlockBreadcrumb","rootLabelText","isEntitiesSavedStatesOpen","shortcuts","previous","next","PostSyncStatusModal","PluginArea","onError","_default","exports"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorNotices,\n\tEditorKeyboardShortcutsRegister,\n\tEditorKeyboardShortcuts,\n\tEditorSnackbars,\n\tPostSyncStatusModal,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseBlockCommands,\n\tBlockBreadcrumb,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { Button, ScrollLock } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tFullscreenMode,\n\tInterfaceSkeleton,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { useState, useEffect, useCallback, useMemo } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport EditPostPreferencesModal from '../preferences-modal';\nimport BrowserURL from '../browser-url';\nimport Header from '../header';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport SettingsSidebar from '../sidebar/settings-sidebar';\nimport MetaBoxes from '../meta-boxes';\nimport WelcomeGuide from '../welcome-guide';\nimport ActionsPanel from './actions-panel';\nimport StartPageOptions from '../start-page-options';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nfunction useEditorStyles() {\n\tconst { hasThemeStyleSupport, editorSettings } = useSelect(\n\t\t( select ) => ( {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t} ),\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\treturn hasThemeStyles ? editorSettings.styles : defaultEditorStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t] );\n}\n\nfunction Layout() {\n\tuseBlockCommands();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\tconst { openGeneralSidebar, closeGeneralSidebar, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\tisRichEditingEnabled,\n\t\tsidebarIsOpened,\n\t\thasActiveMetaboxes,\n\t\thasFixedToolbar,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\thasBlockSelected,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowBlockBreadcrumbs,\n\t\tisTemplateMode,\n\t\tdocumentLabel,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t\thasFixedToolbar:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fixedToolbar' ),\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t\teditPostStore.name\n\t\t\t\t) || select( editPostStore ).isPublishSidebarOpened()\n\t\t\t),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\tisInserterOpened: select( editPostStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editPostStore ).isListViewOpened(),\n\t\t\tmode: select( editPostStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\tisDistractionFree:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: select( editPostStore ).isFeatureActive(\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t};\n\t}, [] );\n\n\tconst styles = useEditorStyles();\n\n\tconst openSidebarPanel = () =>\n\t\topenGeneralSidebar(\n\t\t\thasBlockSelected ? 'edit-post/block' : 'edit-post/document'\n\t\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( sidebarIsOpened && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t}\n\t}, [ sidebarIsOpened, isHugeViewport ] );\n\tuseEffect( () => {\n\t\tif ( isInserterOpened && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isHugeViewport ] );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst className = classnames( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'is-sidebar-opened': sidebarIsOpened,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t\t'is-distraction-free': isDistractionFree && isLargeViewport,\n\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t} );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\tconst secondarySidebar = () => {\n\t\tif ( mode === 'visual' && isInserterOpened ) {\n\t\t\treturn <InserterSidebar />;\n\t\t}\n\t\tif ( mode === 'visual' && isListViewOpened ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\n\t\treturn null;\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\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL />\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<EditorKeyboardShortcuts />\n\n\t\t\t<InterfaceSkeleton\n\t\t\t\tisDistractionFree={ isDistractionFree && isLargeViewport }\n\t\t\t\tclassName={ className }\n\t\t\t\tlabels={ {\n\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t} }\n\t\t\t\theader={\n\t\t\t\t\t<Header\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\tsidebar={\n\t\t\t\t\t( ! isMobileViewport || sidebarIsOpened ) && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isMobileViewport && ! sidebarIsOpened && (\n\t\t\t\t\t\t\t\t<div className=\"edit-post-layout__toggle-sidebar-panel\">\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-post-layout__toggle-sidebar-panel-button\"\n\t\t\t\t\t\t\t\t\t\tonClick={ openSidebarPanel }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ hasBlockSelected\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Open block settings' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Open document settings' ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isDistractionFree && <EditorNotices /> }\n\t\t\t\t\t\t{ ( mode === 'text' || ! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t<TextEditor />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isRichEditingEnabled && mode === 'visual' && (\n\t\t\t\t\t\t\t<VisualEditor styles={ styles } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isDistractionFree && ! isTemplateMode && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isMobileViewport && sidebarIsOpened && (\n\t\t\t\t\t\t\t<ScrollLock />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t! isMobileViewport &&\n\t\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t<div className=\"edit-post-layout__footer\">\n\t\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<ActionsPanel\n\t\t\t\t\t\tcloseEntitiesSavedStates={ closeEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tshortcuts={ {\n\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\tnext: nextShortcut,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<EditPostPreferencesModal />\n\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t<WelcomeGuide />\n\t\t\t<PostSyncStatusModal />\n\t\t\t<StartPageOptions />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t<SettingsSidebar />\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";;;;;;;AAmCA,IAAAA,QAAA,GAAAC,OAAA;AAhCA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAH,OAAA;AAWA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAOA,IAAAW,kBAAA,GAAAX,OAAA;AACA,IAAAY,QAAA,GAAAZ,OAAA;AAKA,IAAAa,WAAA,GAAAX,sBAAA,CAAAF,OAAA;AACA,IAAAc,aAAA,GAAAZ,sBAAA,CAAAF,OA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C1BuE,IAAI,EAAEtE;IACP;EAAG,CACH,CAAC,EACF,IAAAtF,QAAA,CAAA4H,aAAA,EAAC1G,iBAAA,CAAA2G,OAAwB,MAAE,CAAC,EAC5B,IAAA7H,QAAA,CAAA4H,aAAA,EAAC3G,0BAAA,CAAA4G,OAAyB,MAAE,CAAC,EAC7B,IAAA7H,QAAA,CAAA4H,aAAA,EAACnG,aAAA,CAAAoG,OAAY,MAAE,CAAC,EAChB,IAAA7H,QAAA,CAAA4H,aAAA,EAACxH,OAAA,CAAAyJ,mBAAmB,MAAE,CAAC,EACvB,IAAA7J,QAAA,CAAA4H,aAAA,EAACjG,iBAAA,CAAAkG,OAAgB,MAAE,CAAC,EACpB,IAAA7H,QAAA,CAAA4H,aAAA,EAACnH,QAAA,CAAAqJ,UAAU;IAACC,OAAO,EAAGjC;EAAmB,CAAE,CAAC,EAC5C,IAAA9H,QAAA,CAAA4H,aAAA,EAACrG,gBAAA,CAAAsG,OAAe,MAAE,CACjB,CAAC;AAEL;AAAC,IAAAmC,QAAA,GAEc7F,MAAM;AAAA8F,OAAA,CAAApC,OAAA,GAAAmC,QAAA"}
@@ -92,14 +92,13 @@ function StartPageOptionsModal() {
92
92
  function StartPageOptions() {
93
93
  const shouldEnableModal = (0, _data.useSelect)(select => {
94
94
  const {
95
- getEditedPostContent,
96
- isEditedPostSaveable
95
+ isCleanNewPost
97
96
  } = select(_editor.store);
98
97
  const {
99
98
  isEditingTemplate,
100
99
  isFeatureActive
101
100
  } = select(_store.store);
102
- return !isEditedPostSaveable() && '' === getEditedPostContent() && !isEditingTemplate() && !isFeatureActive('welcomeGuide');
101
+ return !isEditingTemplate() && !isFeatureActive('welcomeGuide') && isCleanNewPost();
103
102
  }, []);
104
103
  if (!shouldEnableModal) {
105
104
  return null;
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_components","_i18n","_blockEditor","_data","_compose","_editor","_store","useStartPatterns","blockPatternsWithPostContentBlockType","postType","useSelect","select","getPatternsByBlockTypes","blockEditorStore","getCurrentPostType","editorStore","useMemo","filter","pattern","postTypes","Array","isArray","includes","PatternSelection","blockPatterns","onChoosePattern","shownBlockPatterns","useAsyncList","resetEditorBlocks","useDispatch","createElement","__experimentalBlockPatternsList","shownPatterns","onClickPattern","_pattern","blocks","StartPageOptionsModal","modalState","setModalState","useState","startPatterns","hasStartPattern","length","shouldOpenModal","useEffect","Modal","className","title","__","isFullScreen","onRequestClose","StartPageOptions","shouldEnableModal","getEditedPostContent","isEditedPostSaveable","isEditingTemplate","isFeatureActive","editPostStore"],"sources":["@wordpress/edit-post/src/components/start-page-options/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport {\n\tstore as blockEditorStore,\n\t__experimentalBlockPatternsList as BlockPatternsList,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useAsyncList } from '@wordpress/compose';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction useStartPatterns() {\n\t// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,\n\t// and it has no postTypes declared and the current post type is page or if\n\t// the current post type is part of the postTypes declared.\n\tconst { blockPatternsWithPostContentBlockType, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPatternsByBlockTypes } = select( blockEditorStore );\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\treturn {\n\t\t\t\tblockPatternsWithPostContentBlockType:\n\t\t\t\t\tgetPatternsByBlockTypes( 'core/post-content' ),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\treturn useMemo( () => {\n\t\t// filter patterns without postTypes declared if the current postType is page\n\t\t// or patterns that declare the current postType in its post type array.\n\t\treturn blockPatternsWithPostContentBlockType.filter( ( pattern ) => {\n\t\t\treturn (\n\t\t\t\t( postType === 'page' && ! pattern.postTypes ) ||\n\t\t\t\t( Array.isArray( pattern.postTypes ) &&\n\t\t\t\t\tpattern.postTypes.includes( postType ) )\n\t\t\t);\n\t\t} );\n\t}, [ postType, blockPatternsWithPostContentBlockType ] );\n}\n\nfunction PatternSelection( { blockPatterns, onChoosePattern } ) {\n\tconst shownBlockPatterns = useAsyncList( blockPatterns );\n\tconst { resetEditorBlocks } = useDispatch( editorStore );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tshownPatterns={ shownBlockPatterns }\n\t\t\tonClickPattern={ ( _pattern, blocks ) => {\n\t\t\t\tresetEditorBlocks( blocks );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction StartPageOptionsModal() {\n\tconst [ modalState, setModalState ] = useState( 'initial' );\n\tconst startPatterns = useStartPatterns();\n\tconst hasStartPattern = startPatterns.length > 0;\n\tconst shouldOpenModal = hasStartPattern && modalState === 'initial';\n\n\tuseEffect( () => {\n\t\tif ( shouldOpenModal ) {\n\t\t\tsetModalState( 'open' );\n\t\t}\n\t}, [ shouldOpenModal ] );\n\n\tif ( modalState !== 'open' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-post-start-page-options__modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tisFullScreen\n\t\t\tonRequestClose={ () => setModalState( 'closed' ) }\n\t\t>\n\t\t\t<div className=\"edit-post-start-page-options__modal-content\">\n\t\t\t\t<PatternSelection\n\t\t\t\t\tblockPatterns={ startPatterns }\n\t\t\t\t\tonChoosePattern={ () => setModalState( 'closed' ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</Modal>\n\t);\n}\n\nexport default function StartPageOptions() {\n\tconst shouldEnableModal = useSelect( ( select ) => {\n\t\tconst { getEditedPostContent, isEditedPostSaveable } =\n\t\t\tselect( editorStore );\n\t\tconst { isEditingTemplate, isFeatureActive } = select( editPostStore );\n\t\treturn (\n\t\t\t! isEditedPostSaveable() &&\n\t\t\t'' === getEditedPostContent() &&\n\t\t\t! isEditingTemplate() &&\n\t\t\t! isFeatureActive( 'welcomeGuide' )\n\t\t);\n\t}, [] );\n\n\tif ( ! shouldEnableModal ) {\n\t\treturn null;\n\t}\n\n\treturn <StartPageOptionsModal />;\n}\n"],"mappings":";;;;;;AAKA,IAAAA,QAAA,GAAAC,OAAA;AAFA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AAIA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AAjBA;AACA;AACA;;AAYA;AACA;AACA;;AAGA,SAASQ,gBAAgBA,CAAA,EAAG;EAC3B;EACA;EACA;EACA,MAAM;IAAEC,qCAAqC;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAClEC,MAAM,IAAM;IACb,MAAM;MAAEC;IAAwB,CAAC,GAAGD,MAAM,CAAEE,kBAAiB,CAAC;IAC9D,MAAM;MAAEC;IAAmB,CAAC,GAAGH,MAAM,CAAEI,aAAY,CAAC;IACpD,OAAO;MACNP,qCAAqC,EACpCI,uBAAuB,CAAE,mBAAoB,CAAC;MAC/CH,QAAQ,EAAEK,kBAAkB,CAAC;IAC9B,CAAC;EACF,CAAC,EACD,EACD,CAAC;EAED,OAAO,IAAAE,gBAAO,EAAE,MAAM;IACrB;IACA;IACA,OAAOR,qCAAqC,CAACS,MAAM,CAAIC,OAAO,IAAM;MACnE,OACGT,QAAQ,KAAK,MAAM,IAAI,CAAES,OAAO,CAACC,SAAS,IAC1CC,KAAK,CAACC,OAAO,CAAEH,OAAO,CAACC,SAAU,CAAC,IACnCD,OAAO,CAACC,SAAS,CAACG,QAAQ,CAAEb,QAAS,C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CAAA,KAAMZ,aAAa,CAAE,QAAS;EAAG,GAElD,IAAAxC,QAAA,CAAAgC,aAAA;IAAKgB,SAAS,EAAC;EAA6C,GAC3D,IAAAhD,QAAA,CAAAgC,aAAA,EAACP,gBAAgB;IAChBC,aAAa,EAAGgB,aAAe;IAC/Bf,eAAe,EAAGA,CAAA,KAAMa,aAAa,CAAE,QAAS;EAAG,CACnD,CACG,CACC,CAAC;AAEV;AAEe,SAASa,gBAAgBA,CAAA,EAAG;EAC1C,MAAMC,iBAAiB,GAAG,IAAA1C,eAAS,EAAIC,MAAM,IAAM;IAClD,MAAM;MAAE0C,oBAAoB;MAAEC;IAAqB,CAAC,GACnD3C,MAAM,CAAEI,aAAY,CAAC;IACtB,MAAM;MAAEwC,iBAAiB;MAAEC;IAAgB,CAAC,GAAG7C,MAAM,CAAE8C,YAAc,CAAC;IACtE,OACC,CAAEH,oBAAoB,CAAC,CAAC,IACxB,EAAE,KAAKD,oBAAoB,CAAC,CAAC,IAC7B,CAAEE,iBAAiB,CAAC,CAAC,IACrB,CAAEC,eAAe,CAAE,cAAe,CAAC;EAErC,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEJ,iBAAiB,EAAG;IAC1B,OAAO,IAAI;EACZ;EAEA,OAAO,IAAAtD,QAAA,CAAAgC,aAAA,EAACM,qBAAqB,MAAE,CAAC;AACjC"}
1
+ {"version":3,"names":["_element","require","_components","_i18n","_blockEditor","_data","_compose","_editor","_store","useStartPatterns","blockPatternsWithPostContentBlockType","postType","useSelect","select","getPatternsByBlockTypes","blockEditorStore","getCurrentPostType","editorStore","useMemo","filter","pattern","postTypes","Array","isArray","includes","PatternSelection","blockPatterns","onChoosePattern","shownBlockPatterns","useAsyncList","resetEditorBlocks","useDispatch","createElement","__experimentalBlockPatternsList","shownPatterns","onClickPattern","_pattern","blocks","StartPageOptionsModal","modalState","setModalState","useState","startPatterns","hasStartPattern","length","shouldOpenModal","useEffect","Modal","className","title","__","isFullScreen","onRequestClose","StartPageOptions","shouldEnableModal","isCleanNewPost","isEditingTemplate","isFeatureActive","editPostStore"],"sources":["@wordpress/edit-post/src/components/start-page-options/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport {\n\tstore as blockEditorStore,\n\t__experimentalBlockPatternsList as BlockPatternsList,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useAsyncList } from '@wordpress/compose';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction useStartPatterns() {\n\t// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,\n\t// and it has no postTypes declared and the current post type is page or if\n\t// the current post type is part of the postTypes declared.\n\tconst { blockPatternsWithPostContentBlockType, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPatternsByBlockTypes } = select( blockEditorStore );\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\treturn {\n\t\t\t\tblockPatternsWithPostContentBlockType:\n\t\t\t\t\tgetPatternsByBlockTypes( 'core/post-content' ),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\treturn useMemo( () => {\n\t\t// filter patterns without postTypes declared if the current postType is page\n\t\t// or patterns that declare the current postType in its post type array.\n\t\treturn blockPatternsWithPostContentBlockType.filter( ( pattern ) => {\n\t\t\treturn (\n\t\t\t\t( postType === 'page' && ! pattern.postTypes ) ||\n\t\t\t\t( Array.isArray( pattern.postTypes ) &&\n\t\t\t\t\tpattern.postTypes.includes( postType ) )\n\t\t\t);\n\t\t} );\n\t}, [ postType, blockPatternsWithPostContentBlockType ] );\n}\n\nfunction PatternSelection( { blockPatterns, onChoosePattern } ) {\n\tconst shownBlockPatterns = useAsyncList( blockPatterns );\n\tconst { resetEditorBlocks } = useDispatch( editorStore );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tshownPatterns={ shownBlockPatterns }\n\t\t\tonClickPattern={ ( _pattern, blocks ) => {\n\t\t\t\tresetEditorBlocks( blocks );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction StartPageOptionsModal() {\n\tconst [ modalState, setModalState ] = useState( 'initial' );\n\tconst startPatterns = useStartPatterns();\n\tconst hasStartPattern = startPatterns.length > 0;\n\tconst shouldOpenModal = hasStartPattern && modalState === 'initial';\n\n\tuseEffect( () => {\n\t\tif ( shouldOpenModal ) {\n\t\t\tsetModalState( 'open' );\n\t\t}\n\t}, [ shouldOpenModal ] );\n\n\tif ( modalState !== 'open' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-post-start-page-options__modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tisFullScreen\n\t\t\tonRequestClose={ () => setModalState( 'closed' ) }\n\t\t>\n\t\t\t<div className=\"edit-post-start-page-options__modal-content\">\n\t\t\t\t<PatternSelection\n\t\t\t\t\tblockPatterns={ startPatterns }\n\t\t\t\t\tonChoosePattern={ () => setModalState( 'closed' ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</Modal>\n\t);\n}\n\nexport default function StartPageOptions() {\n\tconst shouldEnableModal = useSelect( ( select ) => {\n\t\tconst { isCleanNewPost } = select( editorStore );\n\t\tconst { isEditingTemplate, isFeatureActive } = select( editPostStore );\n\n\t\treturn (\n\t\t\t! isEditingTemplate() &&\n\t\t\t! isFeatureActive( 'welcomeGuide' ) &&\n\t\t\tisCleanNewPost()\n\t\t);\n\t}, [] );\n\n\tif ( ! shouldEnableModal ) {\n\t\treturn null;\n\t}\n\n\treturn <StartPageOptionsModal />;\n}\n"],"mappings":";;;;;;AAKA,IAAAA,QAAA,GAAAC,OAAA;AAFA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAA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A1C,eAAS,EAAIC,MAAM,IAAM;IAClD,MAAM;MAAE0C;IAAe,CAAC,GAAG1C,MAAM,CAAEI,aAAY,CAAC;IAChD,MAAM;MAAEuC,iBAAiB;MAAEC;IAAgB,CAAC,GAAG5C,MAAM,CAAE6C,YAAc,CAAC;IAEtE,OACC,CAAEF,iBAAiB,CAAC,CAAC,IACrB,CAAEC,eAAe,CAAE,cAAe,CAAC,IACnCF,cAAc,CAAC,CAAC;EAElB,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAED,iBAAiB,EAAG;IAC1B,OAAO,IAAI;EACZ;EAEA,OAAO,IAAAtD,QAAA,CAAAgC,aAAA,EAACM,qBAAqB,MAAE,CAAC;AACjC"}
@@ -31,43 +31,10 @@ var _lockUnlock = require("../../lock-unlock");
31
31
  const {
32
32
  LayoutStyle,
33
33
  useLayoutClasses,
34
- useLayoutStyles
34
+ useLayoutStyles,
35
+ ExperimentalBlockCanvas: BlockCanvas
35
36
  } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
36
37
  const isGutenbergPlugin = process.env.IS_GUTENBERG_PLUGIN ? true : false;
37
- function MaybeIframe({
38
- children,
39
- contentRef,
40
- shouldIframe,
41
- styles,
42
- style
43
- }) {
44
- const ref = (0, _blockEditor.__unstableUseMouseMoveTypingReset)();
45
- if (!shouldIframe) {
46
- return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.__unstableEditorStyles, {
47
- styles: styles
48
- }), (0, _element.createElement)(_blockEditor.WritingFlow, {
49
- ref: contentRef,
50
- className: "editor-styles-wrapper",
51
- style: {
52
- flex: '1',
53
- ...style
54
- },
55
- tabIndex: -1
56
- }, children));
57
- }
58
- return (0, _element.createElement)(_blockEditor.__unstableIframe, {
59
- ref: ref,
60
- contentRef: contentRef,
61
- style: {
62
- width: '100%',
63
- height: '100%',
64
- display: 'block'
65
- },
66
- name: "editor-canvas"
67
- }, (0, _element.createElement)(_blockEditor.__unstableEditorStyles, {
68
- styles: styles
69
- }), children);
70
- }
71
38
 
72
39
  /**
73
40
  * Given an array of nested blocks, find the first Post Content
@@ -91,6 +58,14 @@ function getPostContentAttributes(blocks) {
91
58
  }
92
59
  }
93
60
  }
61
+ function checkForPostContentAtRootLevel(blocks) {
62
+ for (let i = 0; i < blocks.length; i++) {
63
+ if (blocks[i].name === 'core/post-content') {
64
+ return true;
65
+ }
66
+ }
67
+ return false;
68
+ }
94
69
  function VisualEditor({
95
70
  styles
96
71
  }) {
@@ -120,14 +95,16 @@ function VisualEditor({
120
95
  getBlockTypes
121
96
  } = select(_blocks.store);
122
97
  const _isTemplateMode = isEditingTemplate();
98
+ const postTypeSlug = getCurrentPostType();
123
99
  let _wrapperBlockName;
124
- if (getCurrentPostType() === 'wp_block') {
100
+ if (postTypeSlug === 'wp_block') {
125
101
  _wrapperBlockName = 'core/block';
126
102
  } else if (!_isTemplateMode) {
127
103
  _wrapperBlockName = 'core/post-content';
128
104
  }
129
105
  const editorSettings = getEditorSettings();
130
106
  const supportsTemplateMode = editorSettings.supportsTemplateMode;
107
+ const postType = select(_coreData.store).getPostType(postTypeSlug);
131
108
  const canEditTemplate = select(_coreData.store).canUser('create', 'templates');
132
109
  return {
133
110
  deviceType: __experimentalGetPreviewDeviceType(),
@@ -136,7 +113,7 @@ function VisualEditor({
136
113
  postContentAttributes: getEditorSettings().postContentAttributes,
137
114
  // Post template fetch returns a 404 on classic themes, which
138
115
  // messes with e2e tests, so check it's a block theme first.
139
- editedPostTemplate: supportsTemplateMode && canEditTemplate ? getEditedPostTemplate() : undefined,
116
+ editedPostTemplate: postType?.viewable && supportsTemplateMode && canEditTemplate ? getEditedPostTemplate() : undefined,
140
117
  wrapperBlockName: _wrapperBlockName,
141
118
  wrapperUniqueId: getCurrentPostId(),
142
119
  isBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme,
@@ -195,8 +172,7 @@ function VisualEditor({
195
172
  paddingBottom = '40vh';
196
173
  }
197
174
  const ref = (0, _element.useRef)();
198
- const contentRef = (0, _compose.useMergeRefs)([ref, (0, _blockEditor.__unstableUseClipboardHandler)(), (0, _blockEditor.__unstableUseTypewriter)(), (0, _blockEditor.__unstableUseBlockSelectionClearer)()]);
199
- const blockSelectionClearerRef = (0, _blockEditor.__unstableUseBlockSelectionClearer)();
175
+ const contentRef = (0, _compose.useMergeRefs)([ref, (0, _blockEditor.__unstableUseTypewriter)()]);
200
176
 
201
177
  // fallbackLayout is used if there is no Post Content,
202
178
  // and for Post Title.
@@ -232,6 +208,19 @@ function VisualEditor({
232
208
  const parseableContent = typeof editedPostTemplate?.content === 'string' ? editedPostTemplate?.content : '';
233
209
  return getPostContentAttributes((0, _blocks.parse)(parseableContent)) || {};
234
210
  }, [editedPostTemplate?.content, editedPostTemplate?.blocks, postContentAttributes]);
211
+ const hasPostContentAtRootLevel = (0, _element.useMemo)(() => {
212
+ if (!editedPostTemplate?.content && !editedPostTemplate?.blocks) {
213
+ return false;
214
+ }
215
+ // When in template editing mode, we can access the blocks directly.
216
+ if (editedPostTemplate?.blocks) {
217
+ return checkForPostContentAtRootLevel(editedPostTemplate?.blocks);
218
+ }
219
+ // If there are no blocks, we have to parse the content string.
220
+ // Best double-check it's a string otherwise the parse function gets unhappy.
221
+ const parseableContent = typeof editedPostTemplate?.content === 'string' ? editedPostTemplate?.content : '';
222
+ return checkForPostContentAtRootLevel((0, _blocks.parse)(parseableContent)) || false;
223
+ }, [editedPostTemplate?.content, editedPostTemplate?.blocks]);
235
224
  const {
236
225
  layout = {},
237
226
  align = ''
@@ -258,6 +247,7 @@ function VisualEditor({
258
247
  // If there is a Post Content block we use its layout for the block list;
259
248
  // if not, this must be a classic theme, in which case we use the fallback layout.
260
249
  const blockListLayout = postContentAttributes ? postContentLayout : fallbackLayout;
250
+ const postEditorLayout = blockListLayout?.type === 'default' && !hasPostContentAtRootLevel ? fallbackLayout : blockListLayout;
261
251
  const observeTypingRef = (0, _blockEditor.__unstableUseTypingObserver)();
262
252
  const titleRef = (0, _element.useRef)();
263
253
  (0, _element.useEffect)(() => {
@@ -287,22 +277,22 @@ function VisualEditor({
287
277
  className: "edit-post-visual-editor__content-area",
288
278
  animate: {
289
279
  padding: isTemplateMode ? '48px 48px 0' : 0
290
- },
291
- ref: blockSelectionClearerRef
280
+ }
292
281
  }, (0, _element.createElement)(_components.__unstableMotion.div, {
293
282
  animate: animatedStyles,
294
283
  initial: desktopCanvasStyles,
295
284
  className: previewMode
296
- }, (0, _element.createElement)(MaybeIframe, {
285
+ }, (0, _element.createElement)(BlockCanvas, {
297
286
  shouldIframe: isToBeIframed,
298
287
  contentRef: contentRef,
299
- styles: styles
288
+ styles: styles,
289
+ height: "100%"
300
290
  }, themeSupportsLayout && !themeHasDisabledLayoutStyles && !isTemplateMode && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(LayoutStyle, {
301
291
  selector: ".edit-post-visual-editor__post-title-wrapper",
302
292
  layout: fallbackLayout
303
293
  }), (0, _element.createElement)(LayoutStyle, {
304
294
  selector: ".block-editor-block-list__layout.is-root-container",
305
- layout: blockListLayout
295
+ layout: postEditorLayout
306
296
  }), align && (0, _element.createElement)(LayoutStyle, {
307
297
  css: alignCSS
308
298
  }), postContentLayoutStyles && (0, _element.createElement)(LayoutStyle, {
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_classnames","_interopRequireDefault","_editor","_blockEditor","_components","_data","_compose","_blocks","_coreData","_store","_lockUnlock","LayoutStyle","useLayoutClasses","useLayoutStyles","unlock","blockEditorPrivateApis","isGutenbergPlugin","process","env","IS_GUTENBERG_PLUGIN","MaybeIframe","children","contentRef","shouldIframe","styles","style","ref","useMouseMoveTypingReset","createElement","Fragment","__unstableEditorStyles","WritingFlow","className","flex","tabIndex","__unstableIframe","width","height","display","name","getPostContentAttributes","blocks","i","length","attributes","innerBlocks","nestedPostContent","VisualEditor","deviceType","isWelcomeGuideVisible","isTemplateMode","postContentAttributes","editedPostTemplate","wrapperBlockName","wrapperUniqueId","isBlockBasedTheme","hasV3BlocksOnly","useSelect","select","isFeatureActive","isEditingTemplate","getEditedPostTemplate","__experimentalGetPreviewDeviceType","editPostStore","getCurrentPostId","getCurrentPostType","getEditorSettings","editorStore","getBlockTypes","blocksStore","_isTemplateMode","_wrapperBlockName","editorSettings","supportsTemplateMode","canEditTemplate","coreStore","canUser","undefined","__unstableIsBlockBasedTheme","every","type","apiVersion","isCleanNewPost","hasMetaBoxes","hasRootPaddingAwareAlignments","isFocusMode","themeHasDisabledLayoutStyles","themeSupportsLayout","_settings","blockEditorStore","getSettings","disableLayoutStyles","supportsLayout","focusMode","__experimentalFeatures","useRootPaddingAwareAlignments","desktopCanvasStyles","marginLeft","marginRight","flexFlow","background","templateModeStyles","borderRadius","border","borderBottom","resizedCanvasStyles","useResizeCanvas","globalLayoutSettings","useSetting","previewMode","toLowerCase","animatedStyles","paddingBottom","useRef","useMergeRefs","useClipboardHandler","useTypewriter","useBlockSelectionClearer","blockSelectionClearerRef","fallbackLayout","useMemo","newestPostContentAttributes","content","parseableContent","parse","layout","align","postContentLayoutClasses","blockListLayoutClass","classnames","postContentLayoutStyles","postContentLayout","inherit","contentSize","wideSize","blockListLayout","observeTypingRef","useTypingObserver","titleRef","useEffect","current","focus","css","alignCSS","isToBeIframed","BlockTools","__unstableContentRef","__unstableMotion","div","animate","padding","initial","selector","contentEditable","PostTitle","__experimentalRecursionProvider","blockName","uniqueId","BlockList"],"sources":["@wordpress/edit-post/src/components/visual-editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { PostTitle, store as editorStore } from '@wordpress/editor';\nimport {\n\tWritingFlow,\n\tBlockList,\n\tBlockTools,\n\tstore as blockEditorStore,\n\t__unstableUseBlockSelectionClearer as useBlockSelectionClearer,\n\t__unstableUseTypewriter as useTypewriter,\n\t__unstableUseClipboardHandler as useClipboardHandler,\n\t__unstableUseTypingObserver as useTypingObserver,\n\t__experimentalUseResizeCanvas as useResizeCanvas,\n\t__unstableEditorStyles as EditorStyles,\n\tuseSetting,\n\t__unstableUseMouseMoveTypingReset as useMouseMoveTypingReset,\n\t__unstableIframe as Iframe,\n\t__experimentalRecursionProvider as RecursionProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useEffect, useRef, useMemo } from '@wordpress/element';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { parse, store as blocksStore } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { LayoutStyle, useLayoutClasses, useLayoutStyles } = unlock(\n\tblockEditorPrivateApis\n);\n\nconst isGutenbergPlugin = process.env.IS_GUTENBERG_PLUGIN ? true : false;\n\nfunction MaybeIframe( { children, contentRef, shouldIframe, styles, style } ) {\n\tconst ref = useMouseMoveTypingReset();\n\n\tif ( ! shouldIframe ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorStyles styles={ styles } />\n\t\t\t\t<WritingFlow\n\t\t\t\t\tref={ contentRef }\n\t\t\t\t\tclassName=\"editor-styles-wrapper\"\n\t\t\t\t\tstyle={ { flex: '1', ...style } }\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</WritingFlow>\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Iframe\n\t\t\tref={ ref }\n\t\t\tcontentRef={ contentRef }\n\t\t\tstyle={ { width: '100%', height: '100%', display: 'block' } }\n\t\t\tname=\"editor-canvas\"\n\t\t>\n\t\t\t<EditorStyles styles={ styles } />\n\t\t\t{ children }\n\t\t</Iframe>\n\t);\n}\n\n/**\n * Given an array of nested blocks, find the first Post Content\n * block inside it, recursing through any nesting levels,\n * and return its attributes.\n *\n * @param {Array} blocks A list of blocks.\n *\n * @return {Object | undefined} The Post Content block.\n */\nfunction getPostContentAttributes( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn blocks[ i ].attributes;\n\t\t}\n\t\tif ( blocks[ i ].innerBlocks.length ) {\n\t\t\tconst nestedPostContent = getPostContentAttributes(\n\t\t\t\tblocks[ i ].innerBlocks\n\t\t\t);\n\n\t\t\tif ( nestedPostContent ) {\n\t\t\t\treturn nestedPostContent;\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport default function VisualEditor( { styles } ) {\n\tconst {\n\t\tdeviceType,\n\t\tisWelcomeGuideVisible,\n\t\tisTemplateMode,\n\t\tpostContentAttributes,\n\t\teditedPostTemplate = {},\n\t\twrapperBlockName,\n\t\twrapperUniqueId,\n\t\tisBlockBasedTheme,\n\t\thasV3BlocksOnly,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisFeatureActive,\n\t\t\tisEditingTemplate,\n\t\t\tgetEditedPostTemplate,\n\t\t\t__experimentalGetPreviewDeviceType,\n\t\t} = select( editPostStore );\n\t\tconst { getCurrentPostId, getCurrentPostType, getEditorSettings } =\n\t\t\tselect( editorStore );\n\t\tconst { getBlockTypes } = select( blocksStore );\n\t\tconst _isTemplateMode = isEditingTemplate();\n\t\tlet _wrapperBlockName;\n\n\t\tif ( getCurrentPostType() === 'wp_block' ) {\n\t\t\t_wrapperBlockName = 'core/block';\n\t\t} else if ( ! _isTemplateMode ) {\n\t\t\t_wrapperBlockName = 'core/post-content';\n\t\t}\n\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst supportsTemplateMode = editorSettings.supportsTemplateMode;\n\t\tconst canEditTemplate = select( coreStore ).canUser(\n\t\t\t'create',\n\t\t\t'templates'\n\t\t);\n\n\t\treturn {\n\t\t\tdeviceType: __experimentalGetPreviewDeviceType(),\n\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t\tisTemplateMode: _isTemplateMode,\n\t\t\tpostContentAttributes: getEditorSettings().postContentAttributes,\n\t\t\t// Post template fetch returns a 404 on classic themes, which\n\t\t\t// messes with e2e tests, so check it's a block theme first.\n\t\t\teditedPostTemplate:\n\t\t\t\tsupportsTemplateMode && canEditTemplate\n\t\t\t\t\t? getEditedPostTemplate()\n\t\t\t\t\t: undefined,\n\t\t\twrapperBlockName: _wrapperBlockName,\n\t\t\twrapperUniqueId: getCurrentPostId(),\n\t\t\tisBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme,\n\t\t\thasV3BlocksOnly: getBlockTypes().every( ( type ) => {\n\t\t\t\treturn type.apiVersion >= 3;\n\t\t\t} ),\n\t\t};\n\t}, [] );\n\tconst { isCleanNewPost } = useSelect( editorStore );\n\tconst hasMetaBoxes = useSelect(\n\t\t( select ) => select( editPostStore ).hasMetaBoxes(),\n\t\t[]\n\t);\n\tconst {\n\t\thasRootPaddingAwareAlignments,\n\t\tisFocusMode,\n\t\tthemeHasDisabledLayoutStyles,\n\t\tthemeSupportsLayout,\n\t} = useSelect( ( select ) => {\n\t\tconst _settings = select( blockEditorStore ).getSettings();\n\t\treturn {\n\t\t\tthemeHasDisabledLayoutStyles: _settings.disableLayoutStyles,\n\t\t\tthemeSupportsLayout: _settings.supportsLayout,\n\t\t\tisFocusMode: _settings.focusMode,\n\t\t\thasRootPaddingAwareAlignments:\n\t\t\t\t_settings.__experimentalFeatures?.useRootPaddingAwareAlignments,\n\t\t};\n\t}, [] );\n\tconst desktopCanvasStyles = {\n\t\theight: '100%',\n\t\twidth: '100%',\n\t\tmarginLeft: 'auto',\n\t\tmarginRight: 'auto',\n\t\tdisplay: 'flex',\n\t\tflexFlow: 'column',\n\t\t// Default background color so that grey\n\t\t// .edit-post-editor-regions__content color doesn't show through.\n\t\tbackground: 'white',\n\t};\n\tconst templateModeStyles = {\n\t\t...desktopCanvasStyles,\n\t\tborderRadius: '2px 2px 0 0',\n\t\tborder: '1px solid #ddd',\n\t\tborderBottom: 0,\n\t};\n\tconst resizedCanvasStyles = useResizeCanvas( deviceType, isTemplateMode );\n\tconst globalLayoutSettings = useSetting( 'layout' );\n\tconst previewMode = 'is-' + deviceType.toLowerCase() + '-preview';\n\n\tlet animatedStyles = isTemplateMode\n\t\t? templateModeStyles\n\t\t: desktopCanvasStyles;\n\tif ( resizedCanvasStyles ) {\n\t\tanimatedStyles = resizedCanvasStyles;\n\t}\n\n\tlet paddingBottom;\n\n\t// Add a constant padding for the typewritter effect. When typing at the\n\t// bottom, there needs to be room to scroll up.\n\tif ( ! hasMetaBoxes && ! resizedCanvasStyles && ! isTemplateMode ) {\n\t\tpaddingBottom = '40vh';\n\t}\n\n\tconst ref = useRef();\n\tconst contentRef = useMergeRefs( [\n\t\tref,\n\t\tuseClipboardHandler(),\n\t\tuseTypewriter(),\n\t\tuseBlockSelectionClearer(),\n\t] );\n\n\tconst blockSelectionClearerRef = useBlockSelectionClearer();\n\n\t// fallbackLayout is used if there is no Post Content,\n\t// and for Post Title.\n\tconst fallbackLayout = useMemo( () => {\n\t\tif ( isTemplateMode ) {\n\t\t\treturn { type: 'default' };\n\t\t}\n\n\t\tif ( themeSupportsLayout ) {\n\t\t\t// We need to ensure support for wide and full alignments,\n\t\t\t// so we add the constrained type.\n\t\t\treturn { ...globalLayoutSettings, type: 'constrained' };\n\t\t}\n\t\t// Set default layout for classic themes so all alignments are supported.\n\t\treturn { type: 'default' };\n\t}, [ isTemplateMode, themeSupportsLayout, globalLayoutSettings ] );\n\n\tconst newestPostContentAttributes = useMemo( () => {\n\t\tif ( ! editedPostTemplate?.content && ! editedPostTemplate?.blocks ) {\n\t\t\treturn postContentAttributes;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn getPostContentAttributes( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn getPostContentAttributes( parse( parseableContent ) ) || {};\n\t}, [\n\t\teditedPostTemplate?.content,\n\t\teditedPostTemplate?.blocks,\n\t\tpostContentAttributes,\n\t] );\n\n\tconst { layout = {}, align = '' } = newestPostContentAttributes || {};\n\n\tconst postContentLayoutClasses = useLayoutClasses(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content'\n\t);\n\n\tconst blockListLayoutClass = classnames(\n\t\t{\n\t\t\t'is-layout-flow': ! themeSupportsLayout,\n\t\t},\n\t\tthemeSupportsLayout && postContentLayoutClasses,\n\t\talign && `align${ align }`\n\t);\n\n\tconst postContentLayoutStyles = useLayoutStyles(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content',\n\t\t'.block-editor-block-list__layout.is-root-container'\n\t);\n\n\t// Update type for blocks using legacy layouts.\n\tconst postContentLayout = useMemo( () => {\n\t\treturn layout &&\n\t\t\t( layout?.type === 'constrained' ||\n\t\t\t\tlayout?.inherit ||\n\t\t\t\tlayout?.contentSize ||\n\t\t\t\tlayout?.wideSize )\n\t\t\t? { ...globalLayoutSettings, ...layout, type: 'constrained' }\n\t\t\t: { ...globalLayoutSettings, ...layout, type: 'default' };\n\t}, [\n\t\tlayout?.type,\n\t\tlayout?.inherit,\n\t\tlayout?.contentSize,\n\t\tlayout?.wideSize,\n\t\tglobalLayoutSettings,\n\t] );\n\n\t// If there is a Post Content block we use its layout for the block list;\n\t// if not, this must be a classic theme, in which case we use the fallback layout.\n\tconst blockListLayout = postContentAttributes\n\t\t? postContentLayout\n\t\t: fallbackLayout;\n\n\tconst observeTypingRef = useTypingObserver();\n\tconst titleRef = useRef();\n\tuseEffect( () => {\n\t\tif ( isWelcomeGuideVisible || ! isCleanNewPost() ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ isWelcomeGuideVisible, isCleanNewPost ] );\n\n\tstyles = useMemo(\n\t\t() => [\n\t\t\t...styles,\n\t\t\t{\n\t\t\t\t// We should move this in to future to the body.\n\t\t\t\tcss:\n\t\t\t\t\t`.edit-post-visual-editor__post-title-wrapper{margin-top:4rem}` +\n\t\t\t\t\t( paddingBottom\n\t\t\t\t\t\t? `body{padding-bottom:${ paddingBottom }}`\n\t\t\t\t\t\t: '' ),\n\t\t\t},\n\t\t],\n\t\t[ styles ]\n\t);\n\n\t// Add some styles for alignwide/alignfull Post Content and its children.\n\tconst alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;\n\n\tconst isToBeIframed =\n\t\t( ( hasV3BlocksOnly || ( isGutenbergPlugin && isBlockBasedTheme ) ) &&\n\t\t\t! hasMetaBoxes ) ||\n\t\tisTemplateMode ||\n\t\tdeviceType === 'Tablet' ||\n\t\tdeviceType === 'Mobile';\n\n\treturn (\n\t\t<BlockTools\n\t\t\t__unstableContentRef={ ref }\n\t\t\tclassName={ classnames( 'edit-post-visual-editor', {\n\t\t\t\t'is-template-mode': isTemplateMode,\n\t\t\t\t'has-inline-canvas': ! isToBeIframed,\n\t\t\t} ) }\n\t\t>\n\t\t\t<motion.div\n\t\t\t\tclassName=\"edit-post-visual-editor__content-area\"\n\t\t\t\tanimate={ {\n\t\t\t\t\tpadding: isTemplateMode ? '48px 48px 0' : 0,\n\t\t\t\t} }\n\t\t\t\tref={ blockSelectionClearerRef }\n\t\t\t>\n\t\t\t\t<motion.div\n\t\t\t\t\tanimate={ animatedStyles }\n\t\t\t\t\tinitial={ desktopCanvasStyles }\n\t\t\t\t\tclassName={ previewMode }\n\t\t\t\t>\n\t\t\t\t\t<MaybeIframe\n\t\t\t\t\t\tshouldIframe={ isToBeIframed }\n\t\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ themeSupportsLayout &&\n\t\t\t\t\t\t\t! themeHasDisabledLayoutStyles &&\n\t\t\t\t\t\t\t! isTemplateMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\tselector=\".edit-post-visual-editor__post-title-wrapper\"\n\t\t\t\t\t\t\t\t\t\tlayout={ fallbackLayout }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\tselector=\".block-editor-block-list__layout.is-root-container\"\n\t\t\t\t\t\t\t\t\t\tlayout={ blockListLayout }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{ align && (\n\t\t\t\t\t\t\t\t\t\t<LayoutStyle css={ alignCSS } />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ postContentLayoutStyles && (\n\t\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\t\tlayout={ postContentLayout }\n\t\t\t\t\t\t\t\t\t\t\tcss={ postContentLayoutStyles }\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{ ! isTemplateMode && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t'edit-post-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t'is-focus-mode': isFocusMode,\n\t\t\t\t\t\t\t\t\t\t'has-global-padding':\n\t\t\t\t\t\t\t\t\t\t\thasRootPaddingAwareAlignments,\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\tcontentEditable={ false }\n\t\t\t\t\t\t\t\tref={ observeTypingRef }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostTitle ref={ titleRef } />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<RecursionProvider\n\t\t\t\t\t\t\tblockName={ wrapperBlockName }\n\t\t\t\t\t\t\tuniqueId={ wrapperUniqueId }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockList\n\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\tisTemplateMode\n\t\t\t\t\t\t\t\t\t\t? 'wp-site-blocks'\n\t\t\t\t\t\t\t\t\t\t: `${ blockListLayoutClass } wp-block-post-content` // Ensure root level blocks receive default/flow blockGap styling rules.\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlayout={ blockListLayout }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</RecursionProvider>\n\t\t\t\t\t</MaybeIframe>\n\t\t\t\t</motion.div>\n\t\t\t</motion.div>\n\t\t</BlockTools>\n\t);\n}\n"],"mappings":";;;;;;;AA0BA,IAAAA,QAAA,GAAAC,OAAA;AAvBA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAkBA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AAKA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,WAAA,GAAAX,OAAA;AArCA;AACA;AACA;;AAGA;AACA;AACA;;AA0BA;AACA;AACA;;AAIA,MAAM;EAAEY,WAAW;EAAEC,gBAAgB;EAAEC;AAAgB,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C,8CAA8C;IACvD3B,MAAM,EAAGN;EAAgB,CACzB,CAAC,EACF,IAAAzH,QAAA,CAAA8B,aAAA,EAACjB,WAAW;IACX6I,QAAQ,EAAC,oDAAoD;IAC7D3B,MAAM,EAAGU;EAAiB,CAC1B,CAAC,EACAT,KAAK,IACN,IAAAhI,QAAA,CAAA8B,aAAA,EAACjB,WAAW;IAACmI,GAAG,EAAGC;EAAU,CAAE,CAC/B,EACCb,uBAAuB,IACxB,IAAApI,QAAA,CAAA8B,aAAA,EAACjB,WAAW;IACXkH,MAAM,EAAGM,iBAAmB;IAC5BW,GAAG,EAAGZ;EAAyB,CAC/B,CAED,CACF,EACA,CAAEhF,cAAc,IACjB,IAAApD,QAAA,CAAA8B,aAAA;IACCI,SAAS,EAAG,IAAAiG,mBAAU,EACrB,6CAA6C,EAC7C;MACC,eAAe,EAAE5C,WAAW;MAC5B,oBAAoB,EACnBD;IACF,CACD,CAAG;IACHqE,eAAe,EAAG,KAAO;IACzB/H,GAAG,EAAG8G;EAAkB,GAExB,IAAA1I,QAAA,CAAA8B,aAAA,EAAC1B,OAAA,CAAAwJ,SAAS;IAAChI,GAAG,EAAGgH;EAAU,CAAE,CACzB,CACL,EACD,IAAA5I,QAAA,CAAA8B,aAAA,EAACzB,YAAA,CAAAwJ,+BAAiB;IACjBC,SAAS,EAAGvG,gBAAkB;IAC9BwG,QAAQ,EAAGvG;EAAiB,GAE5B,IAAAxD,QAAA,CAAA8B,aAAA,EAACzB,YAAA,CAAA2J,SAAS;IACT9H,SAAS,EACRkB,cAAc,GACX,gBAAgB,GACf,GAAG8E,oBAAsB,wBAAuB,CAAC;IACrD;;IACDH,MAAM,EAAGU;EAAiB,CAC1B,CACiB,CACP,CACF,CACD,CACD,CAAC;AAEf"}
1
+ {"version":3,"names":["_element","require","_classnames","_interopRequireDefault","_editor","_blockEditor","_components","_data","_compose","_blocks","_coreData","_store","_lockUnlock","LayoutStyle","useLayoutClasses","useLayoutStyles","ExperimentalBlockCanvas","BlockCanvas","unlock","blockEditorPrivateApis","isGutenbergPlugin","process","env","IS_GUTENBERG_PLUGIN","getPostContentAttributes","blocks","i","length","name","attributes","innerBlocks","nestedPostContent","checkForPostContentAtRootLevel","VisualEditor","styles","deviceType","isWelcomeGuideVisible","isTemplateMode","postContentAttributes","editedPostTemplate","wrapperBlockName","wrapperUniqueId","isBlockBasedTheme","hasV3BlocksOnly","useSelect","select","isFeatureActive","isEditingTemplate","getEditedPostTemplate","__experimentalGetPreviewDeviceType","editPostStore","getCurrentPostId","getCurrentPostType","getEditorSettings","editorStore","getBlockTypes","blocksStore","_isTemplateMode","postTypeSlug","_wrapperBlockName","editorSettings","supportsTemplateMode","postType","coreStore","getPostType","canEditTemplate","canUser","viewable","undefined","__unstableIsBlockBasedTheme","every","type","apiVersion","isCleanNewPost","hasMetaBoxes","hasRootPaddingAwareAlignments","isFocusMode","themeHasDisabledLayoutStyles","themeSupportsLayout","_settings","blockEditorStore","getSettings","disableLayoutStyles","supportsLayout","focusMode","__experimentalFeatures","useRootPaddingAwareAlignments","desktopCanvasStyles","height","width","marginLeft","marginRight","display","flexFlow","background","templateModeStyles","borderRadius","border","borderBottom","resizedCanvasStyles","useResizeCanvas","globalLayoutSettings","useSetting","previewMode","toLowerCase","animatedStyles","paddingBottom","ref","useRef","contentRef","useMergeRefs","useTypewriter","fallbackLayout","useMemo","newestPostContentAttributes","content","parseableContent","parse","hasPostContentAtRootLevel","layout","align","postContentLayoutClasses","blockListLayoutClass","classnames","postContentLayoutStyles","postContentLayout","inherit","contentSize","wideSize","blockListLayout","postEditorLayout","observeTypingRef","useTypingObserver","titleRef","useEffect","current","focus","css","alignCSS","isToBeIframed","createElement","BlockTools","__unstableContentRef","className","__unstableMotion","div","animate","padding","initial","shouldIframe","Fragment","selector","contentEditable","PostTitle","__experimentalRecursionProvider","blockName","uniqueId","BlockList"],"sources":["@wordpress/edit-post/src/components/visual-editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { PostTitle, store as editorStore } from '@wordpress/editor';\nimport {\n\tBlockList,\n\tBlockTools,\n\tstore as blockEditorStore,\n\t__unstableUseTypewriter as useTypewriter,\n\t__unstableUseTypingObserver as useTypingObserver,\n\t__experimentalUseResizeCanvas as useResizeCanvas,\n\tuseSetting,\n\t__experimentalRecursionProvider as RecursionProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useEffect, useRef, useMemo } from '@wordpress/element';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { parse, store as blocksStore } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tLayoutStyle,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tExperimentalBlockCanvas: BlockCanvas,\n} = unlock( blockEditorPrivateApis );\n\nconst isGutenbergPlugin = process.env.IS_GUTENBERG_PLUGIN ? true : false;\n\n/**\n * Given an array of nested blocks, find the first Post Content\n * block inside it, recursing through any nesting levels,\n * and return its attributes.\n *\n * @param {Array} blocks A list of blocks.\n *\n * @return {Object | undefined} The Post Content block.\n */\nfunction getPostContentAttributes( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn blocks[ i ].attributes;\n\t\t}\n\t\tif ( blocks[ i ].innerBlocks.length ) {\n\t\t\tconst nestedPostContent = getPostContentAttributes(\n\t\t\t\tblocks[ i ].innerBlocks\n\t\t\t);\n\n\t\t\tif ( nestedPostContent ) {\n\t\t\t\treturn nestedPostContent;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction checkForPostContentAtRootLevel( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nexport default function VisualEditor( { styles } ) {\n\tconst {\n\t\tdeviceType,\n\t\tisWelcomeGuideVisible,\n\t\tisTemplateMode,\n\t\tpostContentAttributes,\n\t\teditedPostTemplate = {},\n\t\twrapperBlockName,\n\t\twrapperUniqueId,\n\t\tisBlockBasedTheme,\n\t\thasV3BlocksOnly,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisFeatureActive,\n\t\t\tisEditingTemplate,\n\t\t\tgetEditedPostTemplate,\n\t\t\t__experimentalGetPreviewDeviceType,\n\t\t} = select( editPostStore );\n\t\tconst { getCurrentPostId, getCurrentPostType, getEditorSettings } =\n\t\t\tselect( editorStore );\n\t\tconst { getBlockTypes } = select( blocksStore );\n\t\tconst _isTemplateMode = isEditingTemplate();\n\t\tconst postTypeSlug = getCurrentPostType();\n\t\tlet _wrapperBlockName;\n\n\t\tif ( postTypeSlug === 'wp_block' ) {\n\t\t\t_wrapperBlockName = 'core/block';\n\t\t} else if ( ! _isTemplateMode ) {\n\t\t\t_wrapperBlockName = 'core/post-content';\n\t\t}\n\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst supportsTemplateMode = editorSettings.supportsTemplateMode;\n\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\t\tconst canEditTemplate = select( coreStore ).canUser(\n\t\t\t'create',\n\t\t\t'templates'\n\t\t);\n\n\t\treturn {\n\t\t\tdeviceType: __experimentalGetPreviewDeviceType(),\n\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t\tisTemplateMode: _isTemplateMode,\n\t\t\tpostContentAttributes: getEditorSettings().postContentAttributes,\n\t\t\t// Post template fetch returns a 404 on classic themes, which\n\t\t\t// messes with e2e tests, so check it's a block theme first.\n\t\t\teditedPostTemplate:\n\t\t\t\tpostType?.viewable && supportsTemplateMode && canEditTemplate\n\t\t\t\t\t? getEditedPostTemplate()\n\t\t\t\t\t: undefined,\n\t\t\twrapperBlockName: _wrapperBlockName,\n\t\t\twrapperUniqueId: getCurrentPostId(),\n\t\t\tisBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme,\n\t\t\thasV3BlocksOnly: getBlockTypes().every( ( type ) => {\n\t\t\t\treturn type.apiVersion >= 3;\n\t\t\t} ),\n\t\t};\n\t}, [] );\n\tconst { isCleanNewPost } = useSelect( editorStore );\n\tconst hasMetaBoxes = useSelect(\n\t\t( select ) => select( editPostStore ).hasMetaBoxes(),\n\t\t[]\n\t);\n\tconst {\n\t\thasRootPaddingAwareAlignments,\n\t\tisFocusMode,\n\t\tthemeHasDisabledLayoutStyles,\n\t\tthemeSupportsLayout,\n\t} = useSelect( ( select ) => {\n\t\tconst _settings = select( blockEditorStore ).getSettings();\n\t\treturn {\n\t\t\tthemeHasDisabledLayoutStyles: _settings.disableLayoutStyles,\n\t\t\tthemeSupportsLayout: _settings.supportsLayout,\n\t\t\tisFocusMode: _settings.focusMode,\n\t\t\thasRootPaddingAwareAlignments:\n\t\t\t\t_settings.__experimentalFeatures?.useRootPaddingAwareAlignments,\n\t\t};\n\t}, [] );\n\tconst desktopCanvasStyles = {\n\t\theight: '100%',\n\t\twidth: '100%',\n\t\tmarginLeft: 'auto',\n\t\tmarginRight: 'auto',\n\t\tdisplay: 'flex',\n\t\tflexFlow: 'column',\n\t\t// Default background color so that grey\n\t\t// .edit-post-editor-regions__content color doesn't show through.\n\t\tbackground: 'white',\n\t};\n\tconst templateModeStyles = {\n\t\t...desktopCanvasStyles,\n\t\tborderRadius: '2px 2px 0 0',\n\t\tborder: '1px solid #ddd',\n\t\tborderBottom: 0,\n\t};\n\tconst resizedCanvasStyles = useResizeCanvas( deviceType, isTemplateMode );\n\tconst globalLayoutSettings = useSetting( 'layout' );\n\tconst previewMode = 'is-' + deviceType.toLowerCase() + '-preview';\n\n\tlet animatedStyles = isTemplateMode\n\t\t? templateModeStyles\n\t\t: desktopCanvasStyles;\n\tif ( resizedCanvasStyles ) {\n\t\tanimatedStyles = resizedCanvasStyles;\n\t}\n\n\tlet paddingBottom;\n\n\t// Add a constant padding for the typewritter effect. When typing at the\n\t// bottom, there needs to be room to scroll up.\n\tif ( ! hasMetaBoxes && ! resizedCanvasStyles && ! isTemplateMode ) {\n\t\tpaddingBottom = '40vh';\n\t}\n\n\tconst ref = useRef();\n\tconst contentRef = useMergeRefs( [ ref, useTypewriter() ] );\n\n\t// fallbackLayout is used if there is no Post Content,\n\t// and for Post Title.\n\tconst fallbackLayout = useMemo( () => {\n\t\tif ( isTemplateMode ) {\n\t\t\treturn { type: 'default' };\n\t\t}\n\n\t\tif ( themeSupportsLayout ) {\n\t\t\t// We need to ensure support for wide and full alignments,\n\t\t\t// so we add the constrained type.\n\t\t\treturn { ...globalLayoutSettings, type: 'constrained' };\n\t\t}\n\t\t// Set default layout for classic themes so all alignments are supported.\n\t\treturn { type: 'default' };\n\t}, [ isTemplateMode, themeSupportsLayout, globalLayoutSettings ] );\n\n\tconst newestPostContentAttributes = useMemo( () => {\n\t\tif ( ! editedPostTemplate?.content && ! editedPostTemplate?.blocks ) {\n\t\t\treturn postContentAttributes;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn getPostContentAttributes( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn getPostContentAttributes( parse( parseableContent ) ) || {};\n\t}, [\n\t\teditedPostTemplate?.content,\n\t\teditedPostTemplate?.blocks,\n\t\tpostContentAttributes,\n\t] );\n\n\tconst hasPostContentAtRootLevel = useMemo( () => {\n\t\tif ( ! editedPostTemplate?.content && ! editedPostTemplate?.blocks ) {\n\t\t\treturn false;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn checkForPostContentAtRootLevel( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn (\n\t\t\tcheckForPostContentAtRootLevel( parse( parseableContent ) ) || false\n\t\t);\n\t}, [ editedPostTemplate?.content, editedPostTemplate?.blocks ] );\n\n\tconst { layout = {}, align = '' } = newestPostContentAttributes || {};\n\n\tconst postContentLayoutClasses = useLayoutClasses(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content'\n\t);\n\n\tconst blockListLayoutClass = classnames(\n\t\t{\n\t\t\t'is-layout-flow': ! themeSupportsLayout,\n\t\t},\n\t\tthemeSupportsLayout && postContentLayoutClasses,\n\t\talign && `align${ align }`\n\t);\n\n\tconst postContentLayoutStyles = useLayoutStyles(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content',\n\t\t'.block-editor-block-list__layout.is-root-container'\n\t);\n\n\t// Update type for blocks using legacy layouts.\n\tconst postContentLayout = useMemo( () => {\n\t\treturn layout &&\n\t\t\t( layout?.type === 'constrained' ||\n\t\t\t\tlayout?.inherit ||\n\t\t\t\tlayout?.contentSize ||\n\t\t\t\tlayout?.wideSize )\n\t\t\t? { ...globalLayoutSettings, ...layout, type: 'constrained' }\n\t\t\t: { ...globalLayoutSettings, ...layout, type: 'default' };\n\t}, [\n\t\tlayout?.type,\n\t\tlayout?.inherit,\n\t\tlayout?.contentSize,\n\t\tlayout?.wideSize,\n\t\tglobalLayoutSettings,\n\t] );\n\n\t// If there is a Post Content block we use its layout for the block list;\n\t// if not, this must be a classic theme, in which case we use the fallback layout.\n\tconst blockListLayout = postContentAttributes\n\t\t? postContentLayout\n\t\t: fallbackLayout;\n\n\tconst postEditorLayout =\n\t\tblockListLayout?.type === 'default' && ! hasPostContentAtRootLevel\n\t\t\t? fallbackLayout\n\t\t\t: blockListLayout;\n\n\tconst observeTypingRef = useTypingObserver();\n\tconst titleRef = useRef();\n\tuseEffect( () => {\n\t\tif ( isWelcomeGuideVisible || ! isCleanNewPost() ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ isWelcomeGuideVisible, isCleanNewPost ] );\n\n\tstyles = useMemo(\n\t\t() => [\n\t\t\t...styles,\n\t\t\t{\n\t\t\t\t// We should move this in to future to the body.\n\t\t\t\tcss:\n\t\t\t\t\t`.edit-post-visual-editor__post-title-wrapper{margin-top:4rem}` +\n\t\t\t\t\t( paddingBottom\n\t\t\t\t\t\t? `body{padding-bottom:${ paddingBottom }}`\n\t\t\t\t\t\t: '' ),\n\t\t\t},\n\t\t],\n\t\t[ styles ]\n\t);\n\n\t// Add some styles for alignwide/alignfull Post Content and its children.\n\tconst alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;\n\n\tconst isToBeIframed =\n\t\t( ( hasV3BlocksOnly || ( isGutenbergPlugin && isBlockBasedTheme ) ) &&\n\t\t\t! hasMetaBoxes ) ||\n\t\tisTemplateMode ||\n\t\tdeviceType === 'Tablet' ||\n\t\tdeviceType === 'Mobile';\n\n\treturn (\n\t\t<BlockTools\n\t\t\t__unstableContentRef={ ref }\n\t\t\tclassName={ classnames( 'edit-post-visual-editor', {\n\t\t\t\t'is-template-mode': isTemplateMode,\n\t\t\t\t'has-inline-canvas': ! isToBeIframed,\n\t\t\t} ) }\n\t\t>\n\t\t\t<motion.div\n\t\t\t\tclassName=\"edit-post-visual-editor__content-area\"\n\t\t\t\tanimate={ {\n\t\t\t\t\tpadding: isTemplateMode ? '48px 48px 0' : 0,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<motion.div\n\t\t\t\t\tanimate={ animatedStyles }\n\t\t\t\t\tinitial={ desktopCanvasStyles }\n\t\t\t\t\tclassName={ previewMode }\n\t\t\t\t>\n\t\t\t\t\t<BlockCanvas\n\t\t\t\t\t\tshouldIframe={ isToBeIframed }\n\t\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t\theight=\"100%\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ themeSupportsLayout &&\n\t\t\t\t\t\t\t! themeHasDisabledLayoutStyles &&\n\t\t\t\t\t\t\t! isTemplateMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\tselector=\".edit-post-visual-editor__post-title-wrapper\"\n\t\t\t\t\t\t\t\t\t\tlayout={ fallbackLayout }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\tselector=\".block-editor-block-list__layout.is-root-container\"\n\t\t\t\t\t\t\t\t\t\tlayout={ postEditorLayout }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{ align && (\n\t\t\t\t\t\t\t\t\t\t<LayoutStyle css={ alignCSS } />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ postContentLayoutStyles && (\n\t\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\t\tlayout={ postContentLayout }\n\t\t\t\t\t\t\t\t\t\t\tcss={ postContentLayoutStyles }\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{ ! isTemplateMode && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t'edit-post-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t'is-focus-mode': isFocusMode,\n\t\t\t\t\t\t\t\t\t\t'has-global-padding':\n\t\t\t\t\t\t\t\t\t\t\thasRootPaddingAwareAlignments,\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\tcontentEditable={ false }\n\t\t\t\t\t\t\t\tref={ observeTypingRef }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostTitle ref={ titleRef } />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<RecursionProvider\n\t\t\t\t\t\t\tblockName={ wrapperBlockName }\n\t\t\t\t\t\t\tuniqueId={ wrapperUniqueId }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockList\n\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\tisTemplateMode\n\t\t\t\t\t\t\t\t\t\t? 'wp-site-blocks'\n\t\t\t\t\t\t\t\t\t\t: `${ blockListLayoutClass } wp-block-post-content` // Ensure root level blocks receive default/flow blockGap styling rules.\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlayout={ blockListLayout }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</RecursionProvider>\n\t\t\t\t\t</BlockCanvas>\n\t\t\t\t</motion.div>\n\t\t\t</motion.div>\n\t\t</BlockTools>\n\t);\n}\n"],"mappings":";;;;;;;AAoBA,IAAAA,QAAA,GAAAC,OAAA;AAjBA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAYA,IAAAK,WAAA,GAAAL,OAAA;AACA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AS;IACTd,SAAS,EACR1G,cAAc,GACX,gBAAgB,GACf,GAAGqF,oBAAsB,wBAAuB,CAAC;IACrD;;IACDH,MAAM,EAAGU;EAAiB,CAC1B,CACiB,CACP,CACF,CACD,CACD,CAAC;AAEf"}
package/build/editor.js CHANGED
@@ -11,7 +11,6 @@ var _data = require("@wordpress/data");
11
11
  var _editor = require("@wordpress/editor");
12
12
  var _components = require("@wordpress/components");
13
13
  var _coreData = require("@wordpress/core-data");
14
- var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
15
14
  var _preferences = require("@wordpress/preferences");
16
15
  var _commands = require("@wordpress/commands");
17
16
  var _coreCommands = require("@wordpress/core-commands");
@@ -142,7 +141,7 @@ function Editor({
142
141
  if (!post) {
143
142
  return null;
144
143
  }
145
- return (0, _element.createElement)(_keyboardShortcuts.ShortcutProvider, null, (0, _element.createElement)(_components.SlotFillProvider, null, (0, _element.createElement)(ExperimentalEditorProvider, {
144
+ return (0, _element.createElement)(_components.SlotFillProvider, null, (0, _element.createElement)(ExperimentalEditorProvider, {
146
145
  settings: editorSettings,
147
146
  post: post,
148
147
  initialEdits: initialEdits,
@@ -151,7 +150,7 @@ function Editor({
151
150
  ...props
152
151
  }, (0, _element.createElement)(_editor.ErrorBoundary, null, (0, _element.createElement)(_commands.CommandMenu, null), (0, _element.createElement)(_editorInitialization.default, {
153
152
  postId: postId
154
- }), (0, _element.createElement)(_layout.default, null)), (0, _element.createElement)(_editor.PostLockedModal, null))));
153
+ }), (0, _element.createElement)(_layout.default, null)), (0, _element.createElement)(_editor.PostLockedModal, null)));
155
154
  }
156
155
  var _default = Editor;
157
156
  exports.default = _default;