@wordpress/edit-post 8.2.0 → 8.4.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 (49) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/back-button/fullscreen-mode-close.js +2 -13
  3. package/build/components/back-button/fullscreen-mode-close.js.map +1 -1
  4. package/build/components/init-pattern-modal/index.js +2 -11
  5. package/build/components/init-pattern-modal/index.js.map +1 -1
  6. package/build/components/layout/index.js +12 -5
  7. package/build/components/layout/index.js.map +1 -1
  8. package/build/components/more-menu/manage-patterns-menu-item.js +4 -1
  9. package/build/components/more-menu/manage-patterns-menu-item.js.map +1 -1
  10. package/build/components/preferences-modal/enable-custom-fields.js +1 -1
  11. package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
  12. package/build/editor.native.js +0 -7
  13. package/build/editor.native.js.map +1 -1
  14. package/build/index.js +7 -1
  15. package/build/index.js.map +1 -1
  16. package/build/store/private-selectors.js +6 -2
  17. package/build/store/private-selectors.js.map +1 -1
  18. package/build-module/components/back-button/fullscreen-mode-close.js +2 -13
  19. package/build-module/components/back-button/fullscreen-mode-close.js.map +1 -1
  20. package/build-module/components/init-pattern-modal/index.js +2 -12
  21. package/build-module/components/init-pattern-modal/index.js.map +1 -1
  22. package/build-module/components/layout/index.js +12 -5
  23. package/build-module/components/layout/index.js.map +1 -1
  24. package/build-module/components/more-menu/manage-patterns-menu-item.js +4 -1
  25. package/build-module/components/more-menu/manage-patterns-menu-item.js.map +1 -1
  26. package/build-module/components/preferences-modal/enable-custom-fields.js +1 -1
  27. package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
  28. package/build-module/editor.native.js +0 -7
  29. package/build-module/editor.native.js.map +1 -1
  30. package/build-module/index.js +7 -1
  31. package/build-module/index.js.map +1 -1
  32. package/build-module/store/private-selectors.js +6 -2
  33. package/build-module/store/private-selectors.js.map +1 -1
  34. package/build-style/style-rtl.css +6 -10
  35. package/build-style/style.css +6 -10
  36. package/package.json +31 -31
  37. package/src/components/back-button/fullscreen-mode-close.js +3 -11
  38. package/src/components/back-button/style.scss +0 -4
  39. package/src/components/init-pattern-modal/index.js +1 -11
  40. package/src/components/layout/index.js +15 -3
  41. package/src/components/layout/style.scss +0 -5
  42. package/src/components/more-menu/manage-patterns-menu-item.js +6 -1
  43. package/src/components/preferences-modal/enable-custom-fields.js +1 -1
  44. package/src/components/preferences-modal/test/__snapshots__/enable-custom-fields.js.snap +4 -4
  45. package/src/components/preferences-modal/test/__snapshots__/meta-boxes-section.js.snap +3 -3
  46. package/src/editor.native.js +0 -5
  47. package/src/index.js +9 -2
  48. package/src/store/private-selectors.js +7 -2
  49. package/src/style.scss +4 -2
@@ -17,7 +17,10 @@ import Layout from './components/layout';
17
17
  import { unlock } from './lock-unlock';
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
19
  const {
20
- BackButton: __experimentalMainDashboardButton
20
+ BackButton: __experimentalMainDashboardButton,
21
+ registerDefaultActions,
22
+ registerCoreBlockBindingsSources,
23
+ bootstrapBlockBindingsSourcesFromServer
21
24
  } = unlock(editorPrivateApis);
22
25
 
23
26
  /**
@@ -62,6 +65,8 @@ export function initializeEditor(id, postType, postId, settings, initialEdits) {
62
65
  dispatch(editorStore).setIsListViewOpened(true);
63
66
  }
64
67
  registerCoreBlocks();
68
+ bootstrapBlockBindingsSourcesFromServer(settings?.blockBindingsSources);
69
+ registerCoreBlockBindingsSources();
65
70
  registerLegacyWidgetBlock({
66
71
  inserter: false
67
72
  });
@@ -73,6 +78,7 @@ export function initializeEditor(id, postType, postId, settings, initialEdits) {
73
78
  enableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks
74
79
  });
75
80
  }
81
+ registerDefaultActions();
76
82
 
77
83
  // Show a console log warning if the browser is not in Standards rendering mode.
78
84
  const documentMode = document.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';
@@ -1 +1 @@
1
- {"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","deprecated","createRoot","StrictMode","dispatch","select","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editorStore","privateApis","editorPrivateApis","Layout","unlock","jsx","_jsx","BackButton","__experimentalMainDashboardButton","initializeEditor","id","postType","postId","settings","initialEdits","isMediumOrBigger","window","matchMedia","matches","target","document","getElementById","root","setDefaults","fullscreenMode","themeStyles","welcomeGuide","welcomeGuideTemplate","allowRightClickOverrides","editorMode","fixedToolbar","hiddenBlockTypes","inactivePanels","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","isPublishSidebarEnabled","reapplyBlockTypeFilters","get","setIsListViewOpened","inserter","globalThis","IS_GUTENBERG_PLUGIN","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","documentMode","compatMode","console","warn","isIphone","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","children","reinitializeEditor","since","version","default","__experimentalFullscreenModeClose"],"sources":["@wordpress/edit-post/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport { unlock } from './lock-unlock';\n\nconst { BackButton: __experimentalMainDashboardButton } =\n\tunlock( editorPrivateApis );\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tisPublishSidebarEnabled: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<Layout\n\t\t\t\tsettings={ settings }\n\t\t\t\tpostId={ postId }\n\t\t\t\tpostType={ postType }\n\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t/>\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as __experimentalFullscreenModeClose } from './components/back-button/fullscreen-mode-close';\nexport { __experimentalMainDashboardButton };\nexport { store } from './store';\nexport * from './deprecated';\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SACCC,kBAAkB,EAClBC,4CAA4C,QACtC,0BAA0B;AACjC,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SAASC,QAAQ,EAAEC,MAAM,QAAQ,iBAAiB;AAClD,SAASR,KAAK,IAAIS,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,yBAAyB,EACzBC,wBAAwB,QAClB,oBAAoB;AAC3B,SACCX,KAAK,IAAIY,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;;AAE1B;AACA;AACA;AACA,OAAOC,MAAM,MAAM,qBAAqB;AACxC,SAASC,MAAM,QAAQ,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEvC,MAAM;EAAEC,UAAU,EAAEC;AAAkC,CAAC,GACtDJ,MAAM,CAAEF,iBAAkB,CAAC;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,gBAAgBA,CAC/BC,EAAE,EACFC,QAAQ,EACRC,MAAM,EACNC,QAAQ,EACRC,YAAY,EACX;EACD,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AAc,CAAC,CAAC,EAAE,KAAM,CAAC;EAErExC,IAAI,CAACyC,MAAM,eACVzD,IAAA,CAACZ,UAAU;IAAAsE,QAAA,eACV1D,IAAA,CAACH,MAAM;MACNU,QAAQ,EAAGA,QAAU;MACrBD,MAAM,EAAGA,MAAQ;MACjBD,QAAQ,EAAGA,QAAU;MACrBG,YAAY,EAAGA;IAAc,CAC7B;EAAC,CACS,CACb,CAAC;EAED,OAAOQ,IAAI;AACZ;;AAEA;AACA;AACA;AACA,OAAO,SAAS2C,kBAAkBA,CAAA,EAAG;EACpCzE,UAAU,CAAE,gCAAgC,EAAE;IAC7C0E,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;AAEA,SAASC,OAAO,IAAIC,iCAAiC,QAAQ,gDAAgD;AAC7G,SAAS7D,iCAAiC;AAC1C,SAASpB,KAAK,QAAQ,SAAS;AAC/B,cAAc,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","deprecated","createRoot","StrictMode","dispatch","select","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editorStore","privateApis","editorPrivateApis","Layout","unlock","jsx","_jsx","BackButton","__experimentalMainDashboardButton","registerDefaultActions","registerCoreBlockBindingsSources","bootstrapBlockBindingsSourcesFromServer","initializeEditor","id","postType","postId","settings","initialEdits","isMediumOrBigger","window","matchMedia","matches","target","document","getElementById","root","setDefaults","fullscreenMode","themeStyles","welcomeGuide","welcomeGuideTemplate","allowRightClickOverrides","editorMode","fixedToolbar","hiddenBlockTypes","inactivePanels","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","isPublishSidebarEnabled","reapplyBlockTypeFilters","get","setIsListViewOpened","blockBindingsSources","inserter","globalThis","IS_GUTENBERG_PLUGIN","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","documentMode","compatMode","console","warn","isIphone","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","children","reinitializeEditor","since","version","default","__experimentalFullscreenModeClose"],"sources":["@wordpress/edit-post/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport { unlock } from './lock-unlock';\n\nconst {\n\tBackButton: __experimentalMainDashboardButton,\n\tregisterDefaultActions,\n\tregisterCoreBlockBindingsSources,\n\tbootstrapBlockBindingsSourcesFromServer,\n} = unlock( editorPrivateApis );\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tisPublishSidebarEnabled: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tbootstrapBlockBindingsSourcesFromServer( settings?.blockBindingsSources );\n\tregisterCoreBlockBindingsSources();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\tregisterDefaultActions();\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<Layout\n\t\t\t\tsettings={ settings }\n\t\t\t\tpostId={ postId }\n\t\t\t\tpostType={ postType }\n\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t/>\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as __experimentalFullscreenModeClose } from './components/back-button/fullscreen-mode-close';\nexport { __experimentalMainDashboardButton };\nexport { store } from './store';\nexport * from './deprecated';\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SACCC,kBAAkB,EAClBC,4CAA4C,QACtC,0BAA0B;AACjC,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SAASC,QAAQ,EAAEC,MAAM,QAAQ,iBAAiB;AAClD,SAASR,KAAK,IAAIS,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,yBAAyB,EACzBC,wBAAwB,QAClB,oBAAoB;AAC3B,SACCX,KAAK,IAAIY,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;;AAE1B;AACA;AACA;AACA,OAAOC,MAAM,MAAM,qBAAqB;AACxC,SAASC,MAAM,QAAQ,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEvC,MAAM;EACLC,UAAU,EAAEC,iCAAiC;EAC7CC,sBAAsB;EACtBC,gCAAgC;EAChCC;AACD,CAAC,GAAGP,MAAM,CAAEF,iBAAkB,CAAC;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASU,gBAAgBA,CAC/BC,EAAE,EACFC,QAAQ,EACRC,MAAM,EACNC,QAAQ,EACRC,YAAY,EACX;EACD,MAAMC,gBAAgB,GAAGC,MAAM,CAACC,UAAU,CAAE,oBAAqB,CAAC,CAACC,OAAO;EAC1E,MAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAc,CAAEX,EAAG,CAAC;EAC5C,MAAMY,IAAI,GAAGhC,UAAU,CAAE6B,MAAO,CAAC;EAEjC3B,QAAQ,CAAEE,gBAAiB,CAAC,CAAC6B,WAAW,CAAE,gBAAgB,EAAE;IAC3DC,cAAc,EAAE,IAAI;IACpBC,WAAW,EAAE,IAAI;IACjBC,YAAY,EAA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EAAGA;IAAc,CAC7B;EAAC,CACS,CACb,CAAC;EAED,OAAOQ,IAAI;AACZ;;AAEA;AACA;AACA;AACA,OAAO,SAAS4C,kBAAkBA,CAAA,EAAG;EACpC7E,UAAU,CAAE,gCAAgC,EAAE;IAC7C8E,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;AAEA,SAASC,OAAO,IAAIC,iCAAiC,QAAQ,gDAAgD;AAC7G,SAASjE,iCAAiC;AAC1C,SAASpB,KAAK,QAAQ,SAAS;AAC/B,cAAc,cAAc","ignoreList":[]}
@@ -12,9 +12,13 @@ export const getEditedPostTemplateId = createRegistrySelector(select => () => {
12
12
  } = select(editorStore).getCurrentPost();
13
13
  const {
14
14
  getSite,
15
- getEntityRecords
15
+ getEntityRecords,
16
+ canUser
16
17
  } = select(coreStore);
17
- const siteSettings = getSite();
18
+ const siteSettings = canUser('read', {
19
+ kind: 'root',
20
+ name: 'site'
21
+ }) ? getSite() : undefined;
18
22
  // First check if the current page is set as the posts page.
19
23
  const isPostsPage = +postId === siteSettings?.page_for_posts;
20
24
  if (isPostsPage) {
@@ -1 +1 @@
1
- {"version":3,"names":["createRegistrySelector","store","coreStore","editorStore","getEditedPostTemplateId","select","id","postId","type","postType","slug","getCurrentPost","getSite","getEntityRecords","siteSettings","isPostsPage","page_for_posts","getDefaultTemplateId","currentTemplate","getEditedPostAttribute","templateWithSameSlug","per_page","find","template","slugToCheck"],"sources":["@wordpress/edit-post/src/store/private-selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport const getEditedPostTemplateId = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst {\n\t\t\tid: postId,\n\t\t\ttype: postType,\n\t\t\tslug,\n\t\t} = select( editorStore ).getCurrentPost();\n\t\tconst { getSite, getEntityRecords } = select( coreStore );\n\t\tconst siteSettings = getSite();\n\t\t// First check if the current page is set as the posts page.\n\t\tconst isPostsPage = +postId === siteSettings?.page_for_posts;\n\t\tif ( isPostsPage ) {\n\t\t\treturn select( coreStore ).getDefaultTemplateId( { slug: 'home' } );\n\t\t}\n\t\tconst currentTemplate =\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' );\n\t\tif ( currentTemplate ) {\n\t\t\tconst templateWithSameSlug = getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\t{ per_page: -1 }\n\t\t\t)?.find( ( template ) => template.slug === currentTemplate );\n\t\t\tif ( ! templateWithSameSlug ) {\n\t\t\t\treturn templateWithSameSlug;\n\t\t\t}\n\t\t\treturn templateWithSameSlug.id;\n\t\t}\n\t\tlet slugToCheck;\n\t\t// In `draft` status we might not have a slug available, so we use the `single`\n\t\t// post type templates slug(ex page, single-post, single-product etc..).\n\t\t// Pages do not need the `single` prefix in the slug to be prioritized\n\t\t// through template hierarchy.\n\t\tif ( slug ) {\n\t\t\tslugToCheck =\n\t\t\t\tpostType === 'page'\n\t\t\t\t\t? `${ postType }-${ slug }`\n\t\t\t\t\t: `single-${ postType }-${ slug }`;\n\t\t} else {\n\t\t\tslugToCheck = postType === 'page' ? 'page' : `single-${ postType }`;\n\t\t}\n\t\treturn select( coreStore ).getDefaultTemplateId( {\n\t\t\tslug: slugToCheck,\n\t\t} );\n\t}\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAsB,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,WAAW,QAAQ,mBAAmB;AAExD,OAAO,MAAMC,uBAAuB,GAAGJ,sBAAsB,CAC1DK,MAAM,IAAM,MAAM;EACnB,MAAM;IACLC,EAAE,EAAEC,MAAM;IACVC,IAAI,EAAEC,QAAQ;IACdC;EACD,CAAC,GAAGL,MAAM,CAAEF,WAAY,CAAC,CAACQ,cAAc,CAAC,CAAC;EAC1C,MAAM;IAAEC,OAAO;IAAEC;EAAiB,CAAC,GAAGR,MAAM,CAAEH,SAAU,CAAC;EACzD,MAAMY,YAAY,GAAGF,OAAO,CAAC,CAAC;EAC9B;EACA,MAAMG,WAAW,GAAG,CAACR,MAAM,KAAKO,YAAY,EAAEE,cAAc;EAC5D,IAAKD,WAAW,EAAG;IAClB,OAAOV,MAAM,CAAEH,SAAU,CAAC,CAACe,oBAAoB,CAAE;MAAEP,IAAI,EAAE;IAAO,CAAE,CAAC;EACpE;EACA,MAAMQ,eAAe,GACpBb,MAAM,CAAEF,WAAY,CAAC,CAACgB,sBAAsB,CAAE,UAAW,CAAC;EAC3D,IAAKD,eAAe,EAAG;IACtB,MAAME,oBAAoB,GAAGP,gBAAgB,CAC5C,UAAU,EACV,aAAa,EACb;MAAEQ,QAAQ,EAAE,CAAC;IAAE,CAChB,CAAC,EAAEC,IAAI,CAAIC,QAAQ,IAAMA,QAAQ,CAACb,IAAI,KAAKQ,eAAgB,CAAC;IAC5D,IAAK,CAAEE,oBAAoB,EAAG;MAC7B,OAAOA,oBAAoB;IAC5B;IACA,OAAOA,oBAAoB,CAACd,EAAE;EAC/B;EACA,IAAIkB,WAAW;EACf;EACA;EACA;EACA;EACA,IAAKd,IAAI,EAAG;IACXc,WAAW,GACVf,QAAQ,KAAK,MAAM,GACf,GAAGA,QAAU,IAAIC,IAAM,EAAC,GACxB,UAAUD,QAAU,IAAIC,IAAM,EAAC;EACrC,CAAC,MAAM;IACNc,WAAW,GAAGf,QAAQ,KAAK,MAAM,GAAG,MAAM,GAAI,UAAUA,QAAU,EAAC;EACpE;EACA,OAAOJ,MAAM,CAAEH,SAAU,CAAC,CAACe,oBAAoB,CAAE;IAChDP,IAAI,EAAEc;EACP,CAAE,CAAC;AACJ,CACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createRegistrySelector","store","coreStore","editorStore","getEditedPostTemplateId","select","id","postId","type","postType","slug","getCurrentPost","getSite","getEntityRecords","canUser","siteSettings","kind","name","undefined","isPostsPage","page_for_posts","getDefaultTemplateId","currentTemplate","getEditedPostAttribute","templateWithSameSlug","per_page","find","template","slugToCheck"],"sources":["@wordpress/edit-post/src/store/private-selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport const getEditedPostTemplateId = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst {\n\t\t\tid: postId,\n\t\t\ttype: postType,\n\t\t\tslug,\n\t\t} = select( editorStore ).getCurrentPost();\n\t\tconst { getSite, getEntityRecords, canUser } = select( coreStore );\n\t\tconst siteSettings = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? getSite()\n\t\t\t: undefined;\n\t\t// First check if the current page is set as the posts page.\n\t\tconst isPostsPage = +postId === siteSettings?.page_for_posts;\n\t\tif ( isPostsPage ) {\n\t\t\treturn select( coreStore ).getDefaultTemplateId( { slug: 'home' } );\n\t\t}\n\t\tconst currentTemplate =\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' );\n\t\tif ( currentTemplate ) {\n\t\t\tconst templateWithSameSlug = getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\t{ per_page: -1 }\n\t\t\t)?.find( ( template ) => template.slug === currentTemplate );\n\t\t\tif ( ! templateWithSameSlug ) {\n\t\t\t\treturn templateWithSameSlug;\n\t\t\t}\n\t\t\treturn templateWithSameSlug.id;\n\t\t}\n\t\tlet slugToCheck;\n\t\t// In `draft` status we might not have a slug available, so we use the `single`\n\t\t// post type templates slug(ex page, single-post, single-product etc..).\n\t\t// Pages do not need the `single` prefix in the slug to be prioritized\n\t\t// through template hierarchy.\n\t\tif ( slug ) {\n\t\t\tslugToCheck =\n\t\t\t\tpostType === 'page'\n\t\t\t\t\t? `${ postType }-${ slug }`\n\t\t\t\t\t: `single-${ postType }-${ slug }`;\n\t\t} else {\n\t\t\tslugToCheck = postType === 'page' ? 'page' : `single-${ postType }`;\n\t\t}\n\t\treturn select( coreStore ).getDefaultTemplateId( {\n\t\t\tslug: slugToCheck,\n\t\t} );\n\t}\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAsB,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,WAAW,QAAQ,mBAAmB;AAExD,OAAO,MAAMC,uBAAuB,GAAGJ,sBAAsB,CAC1DK,MAAM,IAAM,MAAM;EACnB,MAAM;IACLC,EAAE,EAAEC,MAAM;IACVC,IAAI,EAAEC,QAAQ;IACdC;EACD,CAAC,GAAGL,MAAM,CAAEF,WAAY,CAAC,CAACQ,cAAc,CAAC,CAAC;EAC1C,MAAM;IAAEC,OAAO;IAAEC,gBAAgB;IAAEC;EAAQ,CAAC,GAAGT,MAAM,CAAEH,SAAU,CAAC;EAClE,MAAMa,YAAY,GAAGD,OAAO,CAAE,MAAM,EAAE;IACrCE,IAAI,EAAE,MAAM;IACZC,IAAI,EAAE;EACP,CAAE,CAAC,GACAL,OAAO,CAAC,CAAC,GACTM,SAAS;EACZ;EACA,MAAMC,WAAW,GAAG,CAACZ,MAAM,KAAKQ,YAAY,EAAEK,cAAc;EAC5D,IAAKD,WAAW,EAAG;IAClB,OAAOd,MAAM,CAAEH,SAAU,CAAC,CAACmB,oBAAoB,CAAE;MAAEX,IAAI,EAAE;IAAO,CAAE,CAAC;EACpE;EACA,MAAMY,eAAe,GACpBjB,MAAM,CAAEF,WAAY,CAAC,CAACoB,sBAAsB,CAAE,UAAW,CAAC;EAC3D,IAAKD,eAAe,EAAG;IACtB,MAAME,oBAAoB,GAAGX,gBAAgB,CAC5C,UAAU,EACV,aAAa,EACb;MAAEY,QAAQ,EAAE,CAAC;IAAE,CAChB,CAAC,EAAEC,IAAI,CAAIC,QAAQ,IAAMA,QAAQ,CAACjB,IAAI,KAAKY,eAAgB,CAAC;IAC5D,IAAK,CAAEE,oBAAoB,EAAG;MAC7B,OAAOA,oBAAoB;IAC5B;IACA,OAAOA,oBAAoB,CAAClB,EAAE;EAC/B;EACA,IAAIsB,WAAW;EACf;EACA;EACA;EACA;EACA,IAAKlB,IAAI,EAAG;IACXkB,WAAW,GACVnB,QAAQ,KAAK,MAAM,GACf,GAAGA,QAAU,IAAIC,IAAM,EAAC,GACxB,UAAUD,QAAU,IAAIC,IAAM,EAAC;EACrC,CAAC,MAAM;IACNkB,WAAW,GAAGnB,QAAQ,KAAK,MAAM,GAAG,MAAM,GAAI,UAAUA,QAAU,EAAC;EACpE;EACA,OAAOJ,MAAM,CAAEH,SAAU,CAAC,CAACmB,oBAAoB,CAAE;IAChDX,IAAI,EAAEkB;EACP,CAAE,CAAC;AACJ,CACD,CAAC","ignoreList":[]}
@@ -104,9 +104,6 @@
104
104
  }
105
105
  }
106
106
 
107
- .edit-post-fullscreen-mode-close.components-button {
108
- display: none;
109
- }
110
107
  @media (min-width: 782px) {
111
108
  .edit-post-fullscreen-mode-close.components-button {
112
109
  display: flex;
@@ -181,11 +178,6 @@
181
178
  content: none;
182
179
  }
183
180
 
184
- .editor-visual-editor {
185
- flex: 1 0 auto;
186
- height: auto;
187
- }
188
-
189
181
  .edit-post-layout__metaboxes {
190
182
  flex-shrink: 0;
191
183
  clear: both;
@@ -419,7 +411,8 @@ body.js.block-editor-page .media-frame select.attachment-filters:last-of-type {
419
411
  .editor-header,
420
412
  .editor-text-editor,
421
413
  .editor-sidebar,
422
- .editor-post-publish-panel {
414
+ .editor-post-publish-panel,
415
+ .edit-post-visual-editor.is-iframed {
423
416
  box-sizing: border-box;
424
417
  }
425
418
  .editor-header *,
@@ -433,7 +426,10 @@ body.js.block-editor-page .media-frame select.attachment-filters:last-of-type {
433
426
  .editor-sidebar *::after,
434
427
  .editor-post-publish-panel *,
435
428
  .editor-post-publish-panel *::before,
436
- .editor-post-publish-panel *::after {
429
+ .editor-post-publish-panel *::after,
430
+ .edit-post-visual-editor.is-iframed *,
431
+ .edit-post-visual-editor.is-iframed *::before,
432
+ .edit-post-visual-editor.is-iframed *::after {
437
433
  box-sizing: inherit;
438
434
  }
439
435
 
@@ -104,9 +104,6 @@
104
104
  }
105
105
  }
106
106
 
107
- .edit-post-fullscreen-mode-close.components-button {
108
- display: none;
109
- }
110
107
  @media (min-width: 782px) {
111
108
  .edit-post-fullscreen-mode-close.components-button {
112
109
  display: flex;
@@ -181,11 +178,6 @@
181
178
  content: none;
182
179
  }
183
180
 
184
- .editor-visual-editor {
185
- flex: 1 0 auto;
186
- height: auto;
187
- }
188
-
189
181
  .edit-post-layout__metaboxes {
190
182
  flex-shrink: 0;
191
183
  clear: both;
@@ -419,7 +411,8 @@ body.js.block-editor-page .media-frame select.attachment-filters:last-of-type {
419
411
  .editor-header,
420
412
  .editor-text-editor,
421
413
  .editor-sidebar,
422
- .editor-post-publish-panel {
414
+ .editor-post-publish-panel,
415
+ .edit-post-visual-editor.is-iframed {
423
416
  box-sizing: border-box;
424
417
  }
425
418
  .editor-header *,
@@ -433,7 +426,10 @@ body.js.block-editor-page .media-frame select.attachment-filters:last-of-type {
433
426
  .editor-sidebar *::after,
434
427
  .editor-post-publish-panel *,
435
428
  .editor-post-publish-panel *::before,
436
- .editor-post-publish-panel *::after {
429
+ .editor-post-publish-panel *::after,
430
+ .edit-post-visual-editor.is-iframed *,
431
+ .edit-post-visual-editor.is-iframed *::before,
432
+ .edit-post-visual-editor.is-iframed *::after {
437
433
  box-sizing: inherit;
438
434
  }
439
435
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-post",
3
- "version": "8.2.0",
3
+ "version": "8.4.0",
4
4
  "description": "Edit Post module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -28,35 +28,35 @@
28
28
  "react-native": "src/index",
29
29
  "dependencies": {
30
30
  "@babel/runtime": "^7.16.0",
31
- "@wordpress/a11y": "^4.2.0",
32
- "@wordpress/api-fetch": "^7.2.0",
33
- "@wordpress/block-editor": "^13.2.0",
34
- "@wordpress/block-library": "^9.2.0",
35
- "@wordpress/blocks": "^13.2.0",
36
- "@wordpress/commands": "^1.2.0",
37
- "@wordpress/components": "^28.2.0",
38
- "@wordpress/compose": "^7.2.0",
39
- "@wordpress/core-commands": "^1.2.0",
40
- "@wordpress/core-data": "^7.2.0",
41
- "@wordpress/data": "^10.2.0",
42
- "@wordpress/deprecated": "^4.2.0",
43
- "@wordpress/dom": "^4.2.0",
44
- "@wordpress/editor": "^14.2.0",
45
- "@wordpress/element": "^6.2.0",
46
- "@wordpress/hooks": "^4.2.0",
47
- "@wordpress/html-entities": "^4.2.0",
48
- "@wordpress/i18n": "^5.2.0",
49
- "@wordpress/icons": "^10.2.0",
50
- "@wordpress/keyboard-shortcuts": "^5.2.0",
51
- "@wordpress/keycodes": "^4.2.0",
52
- "@wordpress/notices": "^5.2.0",
53
- "@wordpress/plugins": "^7.2.0",
54
- "@wordpress/preferences": "^4.2.0",
55
- "@wordpress/private-apis": "^1.2.0",
56
- "@wordpress/url": "^4.2.0",
57
- "@wordpress/viewport": "^6.2.0",
58
- "@wordpress/warning": "^3.2.0",
59
- "@wordpress/widgets": "^4.2.0",
31
+ "@wordpress/a11y": "^4.4.0",
32
+ "@wordpress/api-fetch": "^7.4.0",
33
+ "@wordpress/block-editor": "^13.4.0",
34
+ "@wordpress/block-library": "^9.4.0",
35
+ "@wordpress/blocks": "^13.4.0",
36
+ "@wordpress/commands": "^1.4.0",
37
+ "@wordpress/components": "^28.4.0",
38
+ "@wordpress/compose": "^7.4.0",
39
+ "@wordpress/core-commands": "^1.4.0",
40
+ "@wordpress/core-data": "^7.4.0",
41
+ "@wordpress/data": "^10.4.0",
42
+ "@wordpress/deprecated": "^4.4.0",
43
+ "@wordpress/dom": "^4.4.0",
44
+ "@wordpress/editor": "^14.4.0",
45
+ "@wordpress/element": "^6.4.0",
46
+ "@wordpress/hooks": "^4.4.0",
47
+ "@wordpress/html-entities": "^4.4.0",
48
+ "@wordpress/i18n": "^5.4.0",
49
+ "@wordpress/icons": "^10.4.0",
50
+ "@wordpress/keyboard-shortcuts": "^5.4.0",
51
+ "@wordpress/keycodes": "^4.4.0",
52
+ "@wordpress/notices": "^5.4.0",
53
+ "@wordpress/plugins": "^7.4.0",
54
+ "@wordpress/preferences": "^4.4.0",
55
+ "@wordpress/private-apis": "^1.4.0",
56
+ "@wordpress/url": "^4.4.0",
57
+ "@wordpress/viewport": "^6.4.0",
58
+ "@wordpress/warning": "^3.4.0",
59
+ "@wordpress/widgets": "^4.4.0",
60
60
  "clsx": "^2.1.1",
61
61
  "memize": "^2.1.0"
62
62
  },
@@ -67,5 +67,5 @@
67
67
  "publishConfig": {
68
68
  "access": "public"
69
69
  },
70
- "gitHead": "aa5b14bb5bdbb8d8a02914e154c3bc1c2f18ace6"
70
+ "gitHead": "363edb39b8dda8727f652e42cbb8497732693ed2"
71
71
  }
@@ -19,23 +19,16 @@ import { store as editorStore } from '@wordpress/editor';
19
19
  import { store as coreStore } from '@wordpress/core-data';
20
20
  import { useReducedMotion } from '@wordpress/compose';
21
21
 
22
- /**
23
- * Internal dependencies
24
- */
25
- import { store as editPostStore } from '../../store';
26
-
27
22
  function FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {
28
- const { isActive, isRequestingSiteIcon, postType, siteIconUrl } = useSelect(
23
+ const { isRequestingSiteIcon, postType, siteIconUrl } = useSelect(
29
24
  ( select ) => {
30
25
  const { getCurrentPostType } = select( editorStore );
31
- const { isFeatureActive } = select( editPostStore );
32
26
  const { getEntityRecord, getPostType, isResolving } =
33
27
  select( coreStore );
34
28
  const siteData =
35
29
  getEntityRecord( 'root', '__unstableBase', undefined ) || {};
36
30
  const _postType = initialPost?.type || getCurrentPostType();
37
31
  return {
38
- isActive: isFeatureActive( 'fullscreenMode' ),
39
32
  isRequestingSiteIcon: isResolving( 'getEntityRecord', [
40
33
  'root',
41
34
  '__unstableBase',
@@ -50,7 +43,7 @@ function FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {
50
43
 
51
44
  const disableMotion = useReducedMotion();
52
45
 
53
- if ( ! isActive || ! postType ) {
46
+ if ( ! postType ) {
54
47
  return null;
55
48
  }
56
49
 
@@ -83,8 +76,7 @@ function FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {
83
76
  buttonIcon = <Icon size="36px" icon={ icon } />;
84
77
  }
85
78
 
86
- const classes = clsx( {
87
- 'edit-post-fullscreen-mode-close': true,
79
+ const classes = clsx( 'edit-post-fullscreen-mode-close', {
88
80
  'has-icon': siteIconUrl,
89
81
  } );
90
82
 
@@ -2,10 +2,6 @@
2
2
  // They need to be updated in both places.
3
3
 
4
4
  .edit-post-fullscreen-mode-close.components-button {
5
- // Do not show the toolbar icon on small screens,
6
- // when Fullscreen Mode is not an option in the "More" menu.
7
- display: none;
8
-
9
5
  @include break-medium() {
10
6
  display: flex;
11
7
  align-items: center;
@@ -13,15 +13,6 @@ import {
13
13
  } from '@wordpress/components';
14
14
  import { useEffect, useState } from '@wordpress/element';
15
15
  import { store as editorStore } from '@wordpress/editor';
16
- import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
17
-
18
- /**
19
- * Internal dependencies
20
- */
21
-
22
- import { unlock } from '../../lock-unlock';
23
-
24
- const { ReusableBlocksRenameHint } = unlock( blockEditorPrivateApis );
25
16
 
26
17
  export default function InitPatternModal() {
27
18
  const { editPost } = useDispatch( editorStore );
@@ -82,7 +73,6 @@ export default function InitPatternModal() {
82
73
  __nextHasNoMarginBottom
83
74
  __next40pxDefaultSize
84
75
  />
85
- <ReusableBlocksRenameHint />
86
76
  <ToggleControl
87
77
  label={ _x( 'Synced', 'pattern (singular)' ) }
88
78
  help={ __(
@@ -100,7 +90,7 @@ export default function InitPatternModal() {
100
90
  variant="primary"
101
91
  type="submit"
102
92
  disabled={ ! title }
103
- __experimentalIsFocusable
93
+ accessibleWhenDisabled
104
94
  >
105
95
  { __( 'Create' ) }
106
96
  </Button>
@@ -37,6 +37,7 @@ import { addQueryArgs } from '@wordpress/url';
37
37
  import { decodeEntities } from '@wordpress/html-entities';
38
38
  import { store as coreStore } from '@wordpress/core-data';
39
39
  import { SlotFillProvider } from '@wordpress/components';
40
+ import { useViewportMatch } from '@wordpress/compose';
40
41
 
41
42
  /**
42
43
  * Internal dependencies
@@ -138,7 +139,9 @@ function useEditorStyles() {
138
139
  return [
139
140
  ...baseStyles,
140
141
  {
141
- css: 'body{padding-bottom: 40vh}',
142
+ // Should override global styles padding, so ensure 0-1-0
143
+ // specificity.
144
+ css: ':root :where(body){padding-bottom: 40vh}',
142
145
  },
143
146
  ];
144
147
  }
@@ -196,7 +199,10 @@ function Layout( {
196
199
  const supportsTemplateMode = settings.supportsTemplateMode;
197
200
  const isViewable =
198
201
  getPostType( currentPost.postType )?.viewable ?? false;
199
- const canViewTemplate = canUser( 'read', 'templates' );
202
+ const canViewTemplate = canUser( 'read', {
203
+ kind: 'postType',
204
+ name: 'wp_template',
205
+ } );
200
206
 
201
207
  return {
202
208
  mode: select( editorStore ).getEditorMode(),
@@ -322,6 +328,12 @@ function Layout( {
322
328
  id: initialPostId,
323
329
  };
324
330
  }, [ initialPostType, initialPostId ] );
331
+
332
+ const backButton =
333
+ useViewportMatch( 'medium' ) && isFullscreenActive ? (
334
+ <BackButton initialPost={ initialPost } />
335
+ ) : null;
336
+
325
337
  return (
326
338
  <SlotFillProvider>
327
339
  <ErrorBoundary>
@@ -368,7 +380,7 @@ function Layout( {
368
380
  <InitPatternModal />
369
381
  <PluginArea onError={ onPluginAreaError } />
370
382
  <PostEditorMoreMenu />
371
- <BackButton initialPost={ initialPost } />
383
+ { backButton }
372
384
  <EditorSnackbars />
373
385
  </Editor>
374
386
  </ErrorBoundary>
@@ -1,8 +1,3 @@
1
- .editor-visual-editor {
2
- flex: 1 0 auto;
3
- height: auto;
4
- }
5
-
6
1
  .edit-post-layout__metaboxes {
7
2
  flex-shrink: 0;
8
3
  clear: both;
@@ -20,7 +20,12 @@ function ManagePatternsMenuItem() {
20
20
  // The site editor and templates both check whether the user has
21
21
  // edit_theme_options capabilities. We can leverage that here and not
22
22
  // display the manage patterns link if the user can't access it.
23
- return canUser( 'create', 'templates' ) ? patternsUrl : defaultUrl;
23
+ return canUser( 'create', {
24
+ kind: 'postType',
25
+ name: 'wp_template',
26
+ } )
27
+ ? patternsUrl
28
+ : defaultUrl;
24
29
  }, [] );
25
30
 
26
31
  return (
@@ -42,7 +42,7 @@ export function CustomFieldsConfirmation( { willEnable } ) {
42
42
  className="edit-post-preferences-modal__custom-fields-confirmation-button"
43
43
  variant="secondary"
44
44
  isBusy={ isReloading }
45
- __experimentalIsFocusable
45
+ accessibleWhenDisabled
46
46
  disabled={ isReloading }
47
47
  onClick={ () => {
48
48
  setIsReloading( true );
@@ -29,7 +29,7 @@ exports[`EnableCustomFieldsOption renders a checked checkbox and a confirmation
29
29
  -webkit-flex-direction: row;
30
30
  -ms-flex-direction: row;
31
31
  flex-direction: row;
32
- gap: calc(4px * 3);
32
+ gap: calc(4px * 2);
33
33
  -webkit-box-pack: start;
34
34
  -ms-flex-pack: start;
35
35
  -webkit-justify-content: flex-start;
@@ -135,7 +135,7 @@ exports[`EnableCustomFieldsOption renders a checked checkbox when custom fields
135
135
  -webkit-flex-direction: row;
136
136
  -ms-flex-direction: row;
137
137
  flex-direction: row;
138
- gap: calc(4px * 3);
138
+ gap: calc(4px * 2);
139
139
  -webkit-box-pack: start;
140
140
  -ms-flex-pack: start;
141
141
  -webkit-justify-content: flex-start;
@@ -231,7 +231,7 @@ exports[`EnableCustomFieldsOption renders an unchecked checkbox and a confirmati
231
231
  -webkit-flex-direction: row;
232
232
  -ms-flex-direction: row;
233
233
  flex-direction: row;
234
- gap: calc(4px * 3);
234
+ gap: calc(4px * 2);
235
235
  -webkit-box-pack: start;
236
236
  -ms-flex-pack: start;
237
237
  -webkit-justify-content: flex-start;
@@ -338,7 +338,7 @@ exports[`EnableCustomFieldsOption renders an unchecked checkbox when custom fiel
338
338
  -webkit-flex-direction: row;
339
339
  -ms-flex-direction: row;
340
340
  flex-direction: row;
341
- gap: calc(4px * 3);
341
+ gap: calc(4px * 2);
342
342
  -webkit-box-pack: start;
343
343
  -ms-flex-pack: start;
344
344
  -webkit-justify-content: flex-start;
@@ -29,7 +29,7 @@ exports[`MetaBoxesSection renders a Custom Fields option 1`] = `
29
29
  -webkit-flex-direction: row;
30
30
  -ms-flex-direction: row;
31
31
  flex-direction: row;
32
- gap: calc(4px * 3);
32
+ gap: calc(4px * 2);
33
33
  -webkit-box-pack: start;
34
34
  -ms-flex-pack: start;
35
35
  -webkit-justify-content: flex-start;
@@ -141,7 +141,7 @@ exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`
141
141
  -webkit-flex-direction: row;
142
142
  -ms-flex-direction: row;
143
143
  flex-direction: row;
144
- gap: calc(4px * 3);
144
+ gap: calc(4px * 2);
145
145
  -webkit-box-pack: start;
146
146
  -ms-flex-pack: start;
147
147
  -webkit-justify-content: flex-start;
@@ -337,7 +337,7 @@ exports[`MetaBoxesSection renders meta box options 1`] = `
337
337
  -webkit-flex-direction: row;
338
338
  -ms-flex-direction: row;
339
339
  flex-direction: row;
340
- gap: calc(4px * 3);
340
+ gap: calc(4px * 2);
341
341
  -webkit-box-pack: start;
342
342
  -ms-flex-pack: start;
343
343
  -webkit-justify-content: flex-start;
@@ -33,11 +33,6 @@ class Editor extends Component {
33
33
  constructor( props ) {
34
34
  super( ...arguments );
35
35
 
36
- // need to set this globally to avoid race with deprecations
37
- // defaulting to true to avoid issues with a not-yet-cached value
38
- const { galleryWithImageBlocks = true } = props;
39
- window.wp.galleryBlockV2Enabled = galleryWithImageBlocks;
40
-
41
36
  if ( props.initialHtmlModeEnabled && props.mode === 'visual' ) {
42
37
  // Enable html mode if the initial mode the parent wants it but we're not already in it.
43
38
  this.props.switchEditorMode( 'text' );
package/src/index.js CHANGED
@@ -25,8 +25,12 @@ import {
25
25
  import Layout from './components/layout';
26
26
  import { unlock } from './lock-unlock';
27
27
 
28
- const { BackButton: __experimentalMainDashboardButton } =
29
- unlock( editorPrivateApis );
28
+ const {
29
+ BackButton: __experimentalMainDashboardButton,
30
+ registerDefaultActions,
31
+ registerCoreBlockBindingsSources,
32
+ bootstrapBlockBindingsSourcesFromServer,
33
+ } = unlock( editorPrivateApis );
30
34
 
31
35
  /**
32
36
  * Initializes and returns an instance of Editor.
@@ -84,6 +88,8 @@ export function initializeEditor(
84
88
  }
85
89
 
86
90
  registerCoreBlocks();
91
+ bootstrapBlockBindingsSourcesFromServer( settings?.blockBindingsSources );
92
+ registerCoreBlockBindingsSources();
87
93
  registerLegacyWidgetBlock( { inserter: false } );
88
94
  registerWidgetGroupBlock( { inserter: false } );
89
95
  if ( globalThis.IS_GUTENBERG_PLUGIN ) {
@@ -91,6 +97,7 @@ export function initializeEditor(
91
97
  enableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,
92
98
  } );
93
99
  }
100
+ registerDefaultActions();
94
101
 
95
102
  // Show a console log warning if the browser is not in Standards rendering mode.
96
103
  const documentMode =
@@ -12,8 +12,13 @@ export const getEditedPostTemplateId = createRegistrySelector(
12
12
  type: postType,
13
13
  slug,
14
14
  } = select( editorStore ).getCurrentPost();
15
- const { getSite, getEntityRecords } = select( coreStore );
16
- const siteSettings = getSite();
15
+ const { getSite, getEntityRecords, canUser } = select( coreStore );
16
+ const siteSettings = canUser( 'read', {
17
+ kind: 'root',
18
+ name: 'site',
19
+ } )
20
+ ? getSite()
21
+ : undefined;
17
22
  // First check if the current page is set as the posts page.
18
23
  const isPostsPage = +postId === siteSettings?.page_for_posts;
19
24
  if ( isPostsPage ) {
package/src/style.scss CHANGED
@@ -31,11 +31,13 @@ body.js.block-editor-page {
31
31
  }
32
32
  }
33
33
 
34
- // Target the editor UI excluding the visual editor contents, metaboxes and custom fields areas.
34
+ // Target the editor UI excluding the non-iframed visual editor contents, metaboxes
35
+ // and custom fields areas.
35
36
  .editor-header,
36
37
  .editor-text-editor,
37
38
  .editor-sidebar,
38
- .editor-post-publish-panel {
39
+ .editor-post-publish-panel,
40
+ .edit-post-visual-editor.is-iframed {
39
41
  @include reset;
40
42
  }
41
43