@wordpress/edit-post 6.17.0 → 6.18.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 (82) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-manager/category.js +1 -1
  3. package/build/components/block-manager/category.js.map +1 -1
  4. package/build/components/block-manager/index.js +1 -1
  5. package/build/components/block-manager/index.js.map +1 -1
  6. package/build/components/header/header-toolbar/index.js +0 -6
  7. package/build/components/header/header-toolbar/index.js.map +1 -1
  8. package/build/components/header/index.js +5 -4
  9. package/build/components/header/index.js.map +1 -1
  10. package/build/components/header/more-menu/index.js +1 -3
  11. package/build/components/header/more-menu/index.js.map +1 -1
  12. package/build/components/header/writing-menu/index.js +13 -14
  13. package/build/components/header/writing-menu/index.js.map +1 -1
  14. package/build/components/keyboard-shortcut-help-modal/shortcut.js +1 -7
  15. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  16. package/build/components/keyboard-shortcuts/index.js +3 -5
  17. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  18. package/build/components/layout/index.js +1 -6
  19. package/build/components/layout/index.js.map +1 -1
  20. package/build/components/secondary-sidebar/list-view-outline.js +119 -0
  21. package/build/components/secondary-sidebar/list-view-outline.js.map +1 -0
  22. package/build/components/secondary-sidebar/list-view-sidebar.js +36 -11
  23. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  24. package/build/components/visual-editor/index.js +4 -1
  25. package/build/components/visual-editor/index.js.map +1 -1
  26. package/build/store/actions.js +23 -34
  27. package/build/store/actions.js.map +1 -1
  28. package/build/store/reducer.js +29 -8
  29. package/build/store/reducer.js.map +1 -1
  30. package/build-module/components/block-manager/category.js +2 -2
  31. package/build-module/components/block-manager/category.js.map +1 -1
  32. package/build-module/components/block-manager/index.js +2 -2
  33. package/build-module/components/block-manager/index.js.map +1 -1
  34. package/build-module/components/header/header-toolbar/index.js +1 -7
  35. package/build-module/components/header/header-toolbar/index.js.map +1 -1
  36. package/build-module/components/header/index.js +5 -4
  37. package/build-module/components/header/index.js.map +1 -1
  38. package/build-module/components/header/more-menu/index.js +1 -3
  39. package/build-module/components/header/more-menu/index.js.map +1 -1
  40. package/build-module/components/header/writing-menu/index.js +13 -14
  41. package/build-module/components/header/writing-menu/index.js.map +1 -1
  42. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -6
  43. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  44. package/build-module/components/keyboard-shortcuts/index.js +4 -6
  45. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  46. package/build-module/components/layout/index.js +1 -6
  47. package/build-module/components/layout/index.js.map +1 -1
  48. package/build-module/components/secondary-sidebar/list-view-outline.js +108 -0
  49. package/build-module/components/secondary-sidebar/list-view-outline.js.map +1 -0
  50. package/build-module/components/secondary-sidebar/list-view-sidebar.js +34 -12
  51. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  52. package/build-module/components/visual-editor/index.js +3 -1
  53. package/build-module/components/visual-editor/index.js.map +1 -1
  54. package/build-module/store/actions.js +22 -32
  55. package/build-module/store/actions.js.map +1 -1
  56. package/build-module/store/reducer.js +30 -7
  57. package/build-module/store/reducer.js.map +1 -1
  58. package/build-style/style-rtl.css +60 -6
  59. package/build-style/style.css +60 -6
  60. package/package.json +27 -27
  61. package/src/components/block-manager/category.js +2 -2
  62. package/src/components/block-manager/index.js +2 -2
  63. package/src/components/header/fullscreen-mode-close/test/__snapshots__/index.js.snap +26 -0
  64. package/src/components/header/fullscreen-mode-close/test/index.js +10 -12
  65. package/src/components/header/header-toolbar/index.js +0 -8
  66. package/src/components/header/index.js +4 -1
  67. package/src/components/header/more-menu/index.js +1 -1
  68. package/src/components/header/style.scss +0 -1
  69. package/src/components/header/writing-menu/index.js +13 -11
  70. package/src/components/keyboard-shortcut-help-modal/shortcut.js +15 -18
  71. package/src/components/keyboard-shortcuts/index.js +6 -8
  72. package/src/components/layout/index.js +1 -8
  73. package/src/components/preferences-modal/test/__snapshots__/index.js.snap +48 -43
  74. package/src/components/secondary-sidebar/list-view-outline.js +98 -0
  75. package/src/components/secondary-sidebar/list-view-sidebar.js +47 -8
  76. package/src/components/secondary-sidebar/style.scss +64 -8
  77. package/src/components/sidebar/plugin-post-status-info/test/__snapshots__/index.js.snap +6 -4
  78. package/src/components/sidebar/plugin-post-status-info/test/index.js +1 -1
  79. package/src/components/visual-editor/index.js +9 -3
  80. package/src/store/actions.js +16 -21
  81. package/src/store/reducer.js +28 -8
  82. package/src/store/test/reducer.js +32 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/store/reducer.js"],"names":["includes","combineReducers","removedPanels","state","action","type","panelName","activeModal","name","publishSidebarActive","isSavingMetaBoxes","metaBoxLocations","metaBoxesPerLocation","deviceType","blockInserterPanel","isOpen","value","listViewPanel","isEditingTemplate","metaBoxesInitialized","metaBoxes","isSaving","locations","initialized"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,QAAzB;AAEA;AACA;AACA;;AACA,SAASC,eAAT,QAAgC,iBAAhC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,aAAT,GAA6C;AAAA,MAArBC,KAAqB,uEAAb,EAAa;AAAA,MAATC,MAAS;;AACnD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,cAAL;AACC,UAAK,CAAEL,QAAQ,CAAEG,KAAF,EAASC,MAAM,CAACE,SAAhB,CAAf,EAA6C;AAC5C,eAAO,CAAE,GAAGH,KAAL,EAAYC,MAAM,CAACE,SAAnB,CAAP;AACA;;AAJH;;AAOA,SAAOH,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASI,WAAT,GAA6C;AAAA,MAAvBJ,KAAuB,uEAAf,IAAe;AAAA,MAATC,MAAS;;AACnD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,YAAL;AACC,aA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oBAH+B;AAI/BP,EAAAA,aAJ+B;AAK/BW,EAAAA,UAL+B;AAM/BC,EAAAA,kBAN+B;AAO/BG,EAAAA,aAP+B;AAQ/BC,EAAAA;AAR+B,CAAF,CAA9B","sourcesContent":["/**\n * External dependencies\n */\nimport { includes } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer storing the list of all programmatically removed panels.\n *\n * @param {Array} state Current state.\n * @param {Object} action Action object.\n *\n * @return {Array} Updated state.\n */\nexport function removedPanels( state = [], action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REMOVE_PANEL':\n\t\t\tif ( ! includes( state, action.panelName ) ) {\n\t\t\t\treturn [ ...state, action.panelName ];\n\t\t\t}\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer for storing the name of the open modal, or null if no modal is open.\n *\n * @param {Object} state Previous state.\n * @param {Object} action Action object containing the `name` of the modal\n *\n * @return {Object} Updated state\n */\nexport function activeModal( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_MODAL':\n\t\t\treturn action.name;\n\t\tcase 'CLOSE_MODAL':\n\t\t\treturn null;\n\t}\n\n\treturn state;\n}\n\nexport function publishSidebarActive( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_PUBLISH_SIDEBAR':\n\t\t\treturn true;\n\t\tcase 'CLOSE_PUBLISH_SIDEBAR':\n\t\t\treturn false;\n\t\tcase 'TOGGLE_PUBLISH_SIDEBAR':\n\t\t\treturn ! state;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the meta boxes isSaving state.\n * A \"true\" value means the meta boxes saving request is in-flight.\n *\n *\n * @param {boolean} state Previous state.\n * @param {Object} action Action Object.\n *\n * @return {Object} Updated state.\n */\nexport function isSavingMetaBoxes( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REQUEST_META_BOX_UPDATES':\n\t\t\treturn true;\n\t\tcase 'META_BOX_UPDATES_SUCCESS':\n\t\tcase 'META_BOX_UPDATES_FAILURE':\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n}\n\n/**\n * Reducer keeping track of the meta boxes per location.\n *\n * @param {boolean} state Previous state.\n * @param {Object} action Action Object.\n *\n * @return {Object} Updated state.\n */\nexport function metaBoxLocations( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_META_BOXES_PER_LOCATIONS':\n\t\t\treturn action.metaBoxesPerLocation;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the editing canvas device type.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function deviceType( state = 'Desktop', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_PREVIEW_DEVICE_TYPE':\n\t\t\treturn action.deviceType;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the list view panel reducer\n * to make sure that only one of the two panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the inserter panel reducer\n * to make sure that only one of the two panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer tracking whether template editing is on or off.\n *\n * @param {boolean} state\n * @param {Object} action\n */\nfunction isEditingTemplate( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_EDITING_TEMPLATE':\n\t\t\treturn action.value;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer tracking whether meta boxes are initialized.\n *\n * @param {boolean} state\n * @param {Object} action\n *\n * @return {boolean} Updated state.\n */\nfunction metaBoxesInitialized( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'META_BOXES_INITIALIZED':\n\t\t\treturn true;\n\t}\n\treturn state;\n}\n\nconst metaBoxes = combineReducers( {\n\tisSaving: isSavingMetaBoxes,\n\tlocations: metaBoxLocations,\n\tinitialized: metaBoxesInitialized,\n} );\n\nexport default combineReducers( {\n\tactiveModal,\n\tmetaBoxes,\n\tpublishSidebarActive,\n\tremovedPanels,\n\tdeviceType,\n\tblockInserterPanel,\n\tlistViewPanel,\n\tisEditingTemplate,\n} );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/store/reducer.js"],"names":["combineReducers","removedPanels","state","action","type","includes","panelName","activeModal","name","publishSidebarActive","isSavingMetaBoxes","mergeMetaboxes","metaboxes","newMetaboxes","mergedMetaboxes","metabox","existing","findIndex","box","id","push","metaBoxLocations","newState","location","Object","entries","metaBoxesPerLocation","deviceType","blockInserterPanel","isOpen","value","listViewPanel","isEditingTemplate","metaBoxesInitialized","metaBoxes","isSaving","locations","initialized"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAT,QAAgC,iBAAhC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,aAAT,GAA6C;AAAA,MAArBC,KAAqB,uEAAb,EAAa;AAAA,MAATC,MAAS;;AACnD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,cAAL;AACC,UAAK,CAAEF,KAAK,CAACG,QAAN,CAAgBF,MAAM,CAACG,SAAvB,CAAP,EAA4C;AAC3C,eAAO,CAAE,GAAGJ,KAAL,EAAYC,MAAM,CAACG,SAAnB,CAAP;AACA;;AAJH;;AAOA,SAAOJ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ACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAAS6B,aAAT,GAAgD;AAAA,MAAxB7B,KAAwB,uEAAhB,KAAgB;AAAA,MAATC,MAAS;;AACtD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,wBAAL;AACC,aAAOD,MAAM,CAAC2B,KAAP,GAAe,KAAf,GAAuB5B,KAA9B;;AACD,SAAK,yBAAL;AACC,aAAOC,MAAM,CAAC0B,MAAd;AAJF;;AAMA,SAAO3B,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;AACA,SAAS8B,iBAAT,GAAoD;AAAA,MAAxB9B,KAAwB,uEAAhB,KAAgB;AAAA,MAATC,MAAS;;AACnD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,yBAAL;AACC,aAAOD,MAAM,CAAC2B,KAAd;AAFF;;AAIA,SAAO5B,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS+B,oBAAT,GAAuD;AAAA,MAAxB/B,KAAwB,uEAAhB,KAAgB;AAAA,MAATC,MAAS;;AACtD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,wBAAL;AACC,aAAO,IAAP;AAFF;;AAIA,SAAOF,KAAP;AACA;;AAED,MAAMgC,SAAS,GAAGlC,eAAe,CAAE;AAClCmC,EAAAA,QAAQ,EAAEzB,iBADwB;AAElC0B,EAAAA,SAAS,EAAEf,gBAFuB;AAGlCgB,EAAAA,WAAW,EAAEJ;AAHqB,CAAF,CAAjC;AAMA,eAAejC,eAAe,CAAE;AAC/BO,EAAAA,WAD+B;AAE/B2B,EAAAA,SAF+B;AAG/BzB,EAAAA,oBAH+B;AAI/BR,EAAAA,aAJ+B;AAK/B0B,EAAAA,UAL+B;AAM/BC,EAAAA,kBAN+B;AAO/BG,EAAAA,aAP+B;AAQ/BC,EAAAA;AAR+B,CAAF,CAA9B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer storing the list of all programmatically removed panels.\n *\n * @param {Array} state Current state.\n * @param {Object} action Action object.\n *\n * @return {Array} Updated state.\n */\nexport function removedPanels( state = [], action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REMOVE_PANEL':\n\t\t\tif ( ! state.includes( action.panelName ) ) {\n\t\t\t\treturn [ ...state, action.panelName ];\n\t\t\t}\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer for storing the name of the open modal, or null if no modal is open.\n *\n * @param {Object} state Previous state.\n * @param {Object} action Action object containing the `name` of the modal\n *\n * @return {Object} Updated state\n */\nexport function activeModal( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_MODAL':\n\t\t\treturn action.name;\n\t\tcase 'CLOSE_MODAL':\n\t\t\treturn null;\n\t}\n\n\treturn state;\n}\n\nexport function publishSidebarActive( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_PUBLISH_SIDEBAR':\n\t\t\treturn true;\n\t\tcase 'CLOSE_PUBLISH_SIDEBAR':\n\t\t\treturn false;\n\t\tcase 'TOGGLE_PUBLISH_SIDEBAR':\n\t\t\treturn ! state;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the meta boxes isSaving state.\n * A \"true\" value means the meta boxes saving request is in-flight.\n *\n *\n * @param {boolean} state Previous state.\n * @param {Object} action Action Object.\n *\n * @return {Object} Updated state.\n */\nexport function isSavingMetaBoxes( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REQUEST_META_BOX_UPDATES':\n\t\t\treturn true;\n\t\tcase 'META_BOX_UPDATES_SUCCESS':\n\t\tcase 'META_BOX_UPDATES_FAILURE':\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n}\n\nfunction mergeMetaboxes( metaboxes = [], newMetaboxes ) {\n\tconst mergedMetaboxes = [ ...metaboxes ];\n\tfor ( const metabox of newMetaboxes ) {\n\t\tconst existing = mergedMetaboxes.findIndex(\n\t\t\t( box ) => box.id === metabox.id\n\t\t);\n\t\tif ( existing !== -1 ) {\n\t\t\tmergedMetaboxes[ existing ] = metabox;\n\t\t} else {\n\t\t\tmergedMetaboxes.push( metabox );\n\t\t}\n\t}\n\treturn mergedMetaboxes;\n}\n\n/**\n * Reducer keeping track of the meta boxes per location.\n *\n * @param {boolean} state Previous state.\n * @param {Object} action Action Object.\n *\n * @return {Object} Updated state.\n */\nexport function metaBoxLocations( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_META_BOXES_PER_LOCATIONS': {\n\t\t\tconst newState = { ...state };\n\t\t\tfor ( const [ location, metaboxes ] of Object.entries(\n\t\t\t\taction.metaBoxesPerLocation\n\t\t\t) ) {\n\t\t\t\tnewState[ location ] = mergeMetaboxes(\n\t\t\t\t\tnewState[ location ],\n\t\t\t\t\tmetaboxes\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn newState;\n\t\t}\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the editing canvas device type.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function deviceType( state = 'Desktop', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_PREVIEW_DEVICE_TYPE':\n\t\t\treturn action.deviceType;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the list view panel reducer\n * to make sure that only one of the two panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the inserter panel reducer\n * to make sure that only one of the two panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer tracking whether template editing is on or off.\n *\n * @param {boolean} state\n * @param {Object} action\n */\nfunction isEditingTemplate( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_EDITING_TEMPLATE':\n\t\t\treturn action.value;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer tracking whether meta boxes are initialized.\n *\n * @param {boolean} state\n * @param {Object} action\n *\n * @return {boolean} Updated state.\n */\nfunction metaBoxesInitialized( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'META_BOXES_INITIALIZED':\n\t\t\treturn true;\n\t}\n\treturn state;\n}\n\nconst metaBoxes = combineReducers( {\n\tisSaving: isSavingMetaBoxes,\n\tlocations: metaBoxLocations,\n\tinitialized: metaBoxesInitialized,\n} );\n\nexport default combineReducers( {\n\tactiveModal,\n\tmetaBoxes,\n\tpublishSidebarActive,\n\tremovedPanels,\n\tdeviceType,\n\tblockInserterPanel,\n\tlistViewPanel,\n\tisEditingTemplate,\n} );\n"]}
@@ -1373,7 +1373,10 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
1373
1373
  }
1374
1374
 
1375
1375
  .edit-post-editor__list-view-panel {
1376
- min-width: 350px;
1376
+ width: 350px;
1377
+ }
1378
+ .edit-post-editor__list-view-panel .edit-post-sidebar__panel-tabs {
1379
+ flex-direction: row-reverse;
1377
1380
  }
1378
1381
 
1379
1382
  .edit-post-editor__inserter-panel-header {
@@ -1383,11 +1386,9 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
1383
1386
  justify-content: flex-end;
1384
1387
  }
1385
1388
 
1386
- .edit-post-editor__inserter-panel-content,
1387
- .edit-post-editor__list-view-panel-content {
1389
+ .edit-post-editor__inserter-panel-content {
1388
1390
  height: calc(100% - 36px - 8px);
1389
1391
  }
1390
-
1391
1392
  @media (min-width: 782px) {
1392
1393
  .edit-post-editor__inserter-panel-content {
1393
1394
  height: 100%;
@@ -1395,7 +1396,6 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
1395
1396
  }
1396
1397
 
1397
1398
  .edit-post-editor__list-view-panel-header {
1398
- align-items: center;
1399
1399
  border-bottom: 1px solid #ddd;
1400
1400
  display: flex;
1401
1401
  justify-content: space-between;
@@ -1403,12 +1403,66 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
1403
1403
  padding-right: 16px;
1404
1404
  padding-left: 4px;
1405
1405
  }
1406
+ .edit-post-editor__list-view-panel-header ul {
1407
+ width: calc(100% - 40px);
1408
+ }
1409
+ .edit-post-editor__list-view-panel-header li {
1410
+ width: 50%;
1411
+ }
1412
+ .edit-post-editor__list-view-panel-header li button {
1413
+ width: 100%;
1414
+ text-align: initial;
1415
+ }
1416
+ .edit-post-editor__list-view-panel-header li:only-child {
1417
+ width: 100%;
1418
+ }
1406
1419
 
1407
- .edit-post-editor__list-view-panel-content {
1420
+ .edit-post-editor__list-view-panel-content,
1421
+ .edit-post-editor__list-view-container > .document-outline,
1422
+ .edit-post-editor__list-view-empty-headings {
1423
+ overflow-x: hidden;
1408
1424
  overflow-y: auto;
1425
+ height: 100%;
1409
1426
  padding: 8px 6px;
1410
1427
  }
1411
1428
 
1429
+ .edit-post-editor__list-view-empty-headings {
1430
+ text-align: center;
1431
+ color: #757575;
1432
+ }
1433
+ .edit-post-editor__list-view-empty-headings > svg {
1434
+ margin-top: 28px;
1435
+ }
1436
+ .edit-post-editor__list-view-empty-headings > p {
1437
+ padding-right: 32px;
1438
+ padding-left: 32px;
1439
+ }
1440
+
1441
+ .edit-post-editor__list-view-overview {
1442
+ border-top: 1px solid #ddd;
1443
+ width: calc(100% - 32px);
1444
+ padding: 16px;
1445
+ height: 72px;
1446
+ }
1447
+ .edit-post-editor__list-view-overview > div > span:first-child {
1448
+ width: 90px;
1449
+ display: inline-block;
1450
+ }
1451
+ .edit-post-editor__list-view-overview > div {
1452
+ padding: 0 0 8px;
1453
+ }
1454
+ .edit-post-editor__list-view-overview > div > span {
1455
+ font-size: 12px;
1456
+ line-height: 1.4;
1457
+ color: #757575;
1458
+ }
1459
+
1460
+ .edit-post-editor__list-view-container {
1461
+ display: flex;
1462
+ flex-direction: column;
1463
+ height: calc(100% - 48px);
1464
+ }
1465
+
1412
1466
  .components-panel__header.edit-post-sidebar__panel-tabs {
1413
1467
  justify-content: flex-start;
1414
1468
  padding-right: 0;
@@ -1373,7 +1373,10 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
1373
1373
  }
1374
1374
 
1375
1375
  .edit-post-editor__list-view-panel {
1376
- min-width: 350px;
1376
+ width: 350px;
1377
+ }
1378
+ .edit-post-editor__list-view-panel .edit-post-sidebar__panel-tabs {
1379
+ flex-direction: row-reverse;
1377
1380
  }
1378
1381
 
1379
1382
  .edit-post-editor__inserter-panel-header {
@@ -1383,11 +1386,9 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
1383
1386
  justify-content: flex-end;
1384
1387
  }
1385
1388
 
1386
- .edit-post-editor__inserter-panel-content,
1387
- .edit-post-editor__list-view-panel-content {
1389
+ .edit-post-editor__inserter-panel-content {
1388
1390
  height: calc(100% - 36px - 8px);
1389
1391
  }
1390
-
1391
1392
  @media (min-width: 782px) {
1392
1393
  .edit-post-editor__inserter-panel-content {
1393
1394
  height: 100%;
@@ -1395,7 +1396,6 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
1395
1396
  }
1396
1397
 
1397
1398
  .edit-post-editor__list-view-panel-header {
1398
- align-items: center;
1399
1399
  border-bottom: 1px solid #ddd;
1400
1400
  display: flex;
1401
1401
  justify-content: space-between;
@@ -1403,12 +1403,66 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
1403
1403
  padding-left: 16px;
1404
1404
  padding-right: 4px;
1405
1405
  }
1406
+ .edit-post-editor__list-view-panel-header ul {
1407
+ width: calc(100% - 40px);
1408
+ }
1409
+ .edit-post-editor__list-view-panel-header li {
1410
+ width: 50%;
1411
+ }
1412
+ .edit-post-editor__list-view-panel-header li button {
1413
+ width: 100%;
1414
+ text-align: initial;
1415
+ }
1416
+ .edit-post-editor__list-view-panel-header li:only-child {
1417
+ width: 100%;
1418
+ }
1406
1419
 
1407
- .edit-post-editor__list-view-panel-content {
1420
+ .edit-post-editor__list-view-panel-content,
1421
+ .edit-post-editor__list-view-container > .document-outline,
1422
+ .edit-post-editor__list-view-empty-headings {
1423
+ overflow-x: hidden;
1408
1424
  overflow-y: auto;
1425
+ height: 100%;
1409
1426
  padding: 8px 6px;
1410
1427
  }
1411
1428
 
1429
+ .edit-post-editor__list-view-empty-headings {
1430
+ text-align: center;
1431
+ color: #757575;
1432
+ }
1433
+ .edit-post-editor__list-view-empty-headings > svg {
1434
+ margin-top: 28px;
1435
+ }
1436
+ .edit-post-editor__list-view-empty-headings > p {
1437
+ padding-left: 32px;
1438
+ padding-right: 32px;
1439
+ }
1440
+
1441
+ .edit-post-editor__list-view-overview {
1442
+ border-top: 1px solid #ddd;
1443
+ width: calc(100% - 32px);
1444
+ padding: 16px;
1445
+ height: 72px;
1446
+ }
1447
+ .edit-post-editor__list-view-overview > div > span:first-child {
1448
+ width: 90px;
1449
+ display: inline-block;
1450
+ }
1451
+ .edit-post-editor__list-view-overview > div {
1452
+ padding: 0 0 8px;
1453
+ }
1454
+ .edit-post-editor__list-view-overview > div > span {
1455
+ font-size: 12px;
1456
+ line-height: 1.4;
1457
+ color: #757575;
1458
+ }
1459
+
1460
+ .edit-post-editor__list-view-container {
1461
+ display: flex;
1462
+ flex-direction: column;
1463
+ height: calc(100% - 48px);
1464
+ }
1465
+
1412
1466
  .components-panel__header.edit-post-sidebar__panel-tabs {
1413
1467
  justify-content: flex-start;
1414
1468
  padding-left: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-post",
3
- "version": "6.17.0",
3
+ "version": "6.18.0",
4
4
  "description": "Edit Post module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,31 +27,31 @@
27
27
  "react-native": "src/index",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/a11y": "^3.20.0",
31
- "@wordpress/api-fetch": "^6.17.0",
32
- "@wordpress/block-editor": "^10.3.0",
33
- "@wordpress/block-library": "^7.17.0",
34
- "@wordpress/blocks": "^11.19.0",
35
- "@wordpress/components": "^21.3.0",
36
- "@wordpress/compose": "^5.18.0",
37
- "@wordpress/core-data": "^5.3.0",
38
- "@wordpress/data": "^7.4.0",
39
- "@wordpress/deprecated": "^3.20.0",
40
- "@wordpress/editor": "^12.19.0",
41
- "@wordpress/element": "^4.18.0",
42
- "@wordpress/hooks": "^3.20.0",
43
- "@wordpress/i18n": "^4.20.0",
44
- "@wordpress/icons": "^9.11.0",
45
- "@wordpress/interface": "^4.19.0",
46
- "@wordpress/keyboard-shortcuts": "^3.18.0",
47
- "@wordpress/keycodes": "^3.20.0",
48
- "@wordpress/media-utils": "^4.11.0",
49
- "@wordpress/notices": "^3.20.0",
50
- "@wordpress/plugins": "^4.18.0",
51
- "@wordpress/preferences": "^2.12.0",
52
- "@wordpress/url": "^3.21.0",
53
- "@wordpress/viewport": "^4.18.0",
54
- "@wordpress/warning": "^2.20.0",
30
+ "@wordpress/a11y": "^3.21.0",
31
+ "@wordpress/api-fetch": "^6.18.0",
32
+ "@wordpress/block-editor": "^10.4.0",
33
+ "@wordpress/block-library": "^7.18.0",
34
+ "@wordpress/blocks": "^11.20.0",
35
+ "@wordpress/components": "^22.0.0",
36
+ "@wordpress/compose": "^5.19.0",
37
+ "@wordpress/core-data": "^5.4.0",
38
+ "@wordpress/data": "^7.5.0",
39
+ "@wordpress/deprecated": "^3.21.0",
40
+ "@wordpress/editor": "^12.20.0",
41
+ "@wordpress/element": "^4.19.0",
42
+ "@wordpress/hooks": "^3.21.0",
43
+ "@wordpress/i18n": "^4.21.0",
44
+ "@wordpress/icons": "^9.12.0",
45
+ "@wordpress/interface": "^4.20.0",
46
+ "@wordpress/keyboard-shortcuts": "^3.19.0",
47
+ "@wordpress/keycodes": "^3.21.0",
48
+ "@wordpress/media-utils": "^4.12.0",
49
+ "@wordpress/notices": "^3.21.0",
50
+ "@wordpress/plugins": "^4.19.0",
51
+ "@wordpress/preferences": "^2.13.0",
52
+ "@wordpress/url": "^3.22.0",
53
+ "@wordpress/viewport": "^4.19.0",
54
+ "@wordpress/warning": "^2.21.0",
55
55
  "classnames": "^2.3.1",
56
56
  "lodash": "^4.17.21",
57
57
  "memize": "^1.1.0",
@@ -64,5 +64,5 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "a2ff0e6471c88436dad0287beb88d1729aa6f5dd"
67
+ "gitHead": "511f4cc1f0138641bc4394bc1cf36e833109c791"
68
68
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { includes, map } from 'lodash';
4
+ import { map } from 'lodash';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -37,7 +37,7 @@ function BlockManagerCategory( { title, blockTypes } ) {
37
37
  return blockTypes;
38
38
  }
39
39
  return blockTypes.filter( ( { name } ) => {
40
- return includes( defaultAllowedBlockTypes || [], name );
40
+ return defaultAllowedBlockTypes?.includes( name );
41
41
  } );
42
42
  }, [ defaultAllowedBlockTypes, blockTypes ] );
43
43
  const { showBlockTypes, hideBlockTypes } = useDispatch( editPostStore );
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { filter, includes } from 'lodash';
4
+ import { filter } from 'lodash';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -38,7 +38,7 @@ function BlockManager( {
38
38
  hasBlockSupport( blockType, 'inserter', true ) &&
39
39
  ( ! search || isMatchingSearchTerm( blockType, search ) ) &&
40
40
  ( ! blockType.parent ||
41
- includes( blockType.parent, 'core/post-content' ) )
41
+ blockType.parent.includes( 'core/post-content' ) )
42
42
  );
43
43
 
44
44
  // Announce search results on change
@@ -0,0 +1,26 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`FullscreenModeClose when in full screen mode should display a default site icon if no user uploaded site icon exists 1`] = `
4
+ <div>
5
+ <div>
6
+ <a
7
+ aria-label="Back"
8
+ class="components-button edit-post-fullscreen-mode-close"
9
+ href="edit.php?"
10
+ >
11
+ <svg
12
+ aria-hidden="true"
13
+ focusable="false"
14
+ height="36px"
15
+ viewBox="-2 -2 24 24"
16
+ width="36px"
17
+ xmlns="http://www.w3.org/2000/svg"
18
+ >
19
+ <path
20
+ d="M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"
21
+ />
22
+ </svg>
23
+ </a>
24
+ </div>
25
+ </div>
26
+ `;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { render } from '@testing-library/react';
4
+ import { render, screen } from '@testing-library/react';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -36,12 +36,11 @@ describe( 'FullscreenModeClose', () => {
36
36
  } ) );
37
37
  } );
38
38
 
39
- const { container } = render( <FullscreenModeClose /> );
40
- const siteIcon = container.querySelector(
41
- '.edit-post-fullscreen-mode-close_site-icon'
42
- );
39
+ render( <FullscreenModeClose /> );
40
+
41
+ const siteIcon = screen.getByAltText( 'Site Icon' );
43
42
 
44
- expect( siteIcon ).toBeTruthy();
43
+ expect( siteIcon ).toBeVisible();
45
44
  } );
46
45
 
47
46
  it( 'should display a default site icon if no user uploaded site icon exists', () => {
@@ -58,13 +57,12 @@ describe( 'FullscreenModeClose', () => {
58
57
  } );
59
58
 
60
59
  const { container } = render( <FullscreenModeClose /> );
61
- const siteIcon = container.querySelector(
62
- '.edit-post-fullscreen-mode-close_site-icon'
63
- );
64
- const defaultIcon = container.querySelector( 'svg' );
65
60
 
66
- expect( siteIcon ).toBeFalsy();
67
- expect( defaultIcon ).toBeTruthy();
61
+ expect(
62
+ screen.queryByAltText( 'Site Icon' )
63
+ ).not.toBeInTheDocument();
64
+
65
+ expect( container ).toMatchSnapshot();
68
66
  } );
69
67
  } );
70
68
  } );
@@ -10,7 +10,6 @@ import {
10
10
  store as blockEditorStore,
11
11
  } from '@wordpress/block-editor';
12
12
  import {
13
- TableOfContents,
14
13
  EditorHistoryRedo,
15
14
  EditorHistoryUndo,
16
15
  store as editorStore,
@@ -77,13 +76,6 @@ function HeaderToolbar() {
77
76
  );
78
77
  const overflowItems = (
79
78
  <>
80
- <ToolbarItem
81
- as={ TableOfContents }
82
- hasOutlineItemsDisabled={ isTextModeEnabled }
83
- repositionDropdown={ showIconLabels && ! isWideViewport }
84
- showTooltip={ ! showIconLabels }
85
- variant={ showIconLabels ? 'tertiary' : undefined }
86
- />
87
79
  <ToolbarItem
88
80
  as={ Button }
89
81
  className="edit-post-header-toolbar__list-view-toggle"
@@ -24,12 +24,13 @@ import MainDashboardButton from './main-dashboard-button';
24
24
  import { store as editPostStore } from '../../store';
25
25
  import TemplateTitle from './template-title';
26
26
 
27
- function Header( { setEntitiesSavedStatesCallback, isDistractionFree } ) {
27
+ function Header( { setEntitiesSavedStatesCallback } ) {
28
28
  const {
29
29
  hasActiveMetaboxes,
30
30
  isPublishSidebarOpened,
31
31
  isSaving,
32
32
  showIconLabels,
33
+ isDistractionFree,
33
34
  } = useSelect(
34
35
  ( select ) => ( {
35
36
  hasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),
@@ -38,6 +39,8 @@ function Header( { setEntitiesSavedStatesCallback, isDistractionFree } ) {
38
39
  isSaving: select( editPostStore ).isSavingMetaBoxes(),
39
40
  showIconLabels:
40
41
  select( editPostStore ).isFeatureActive( 'showIconLabels' ),
42
+ isDistractionFree:
43
+ select( editPostStore ).isFeatureActive( 'distractionFree' ),
41
44
  } ),
42
45
  []
43
46
  );
@@ -36,7 +36,7 @@ const MoreMenu = ( { showIconLabels } ) => {
36
36
  scope="core/edit-post"
37
37
  />
38
38
  ) }
39
- <WritingMenu onClose={ onClose } />
39
+ <WritingMenu />
40
40
  <ModeSwitcher />
41
41
  <ActionItem.Slot
42
42
  name="core/edit-post/plugin-more-menu"
@@ -242,5 +242,4 @@
242
242
  position: absolute;
243
243
  z-index: 35;
244
244
  }
245
-
246
245
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { useSelect, useDispatch } from '@wordpress/data';
4
+ import { useSelect, useDispatch, useRegistry } from '@wordpress/data';
5
5
  import { MenuGroup } from '@wordpress/components';
6
6
  import { __, _x } from '@wordpress/i18n';
7
7
  import { useViewportMatch } from '@wordpress/compose';
@@ -17,7 +17,8 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
17
17
  */
18
18
  import { store as postEditorStore } from '../../../store';
19
19
 
20
- function WritingMenu( { onClose } ) {
20
+ function WritingMenu() {
21
+ const registry = useRegistry();
21
22
  const isDistractionFree = useSelect(
22
23
  ( select ) =>
23
24
  select( blockEditorStore ).getSettings().isDistractionFree,
@@ -36,14 +37,15 @@ function WritingMenu( { onClose } ) {
36
37
  const { selectBlock } = useDispatch( blockEditorStore );
37
38
 
38
39
  const toggleDistractionFree = () => {
39
- setPreference( 'core/edit-post', 'fixedToolbar', false );
40
- setIsInserterOpened( false );
41
- setIsListViewOpened( false );
42
- closeGeneralSidebar();
43
- onClose();
44
- if ( ! isDistractionFree ) {
45
- selectBlock( blocks[ 0 ].clientId );
46
- }
40
+ registry.batch( () => {
41
+ setPreference( 'core/edit-post', 'fixedToolbar', false );
42
+ setIsInserterOpened( false );
43
+ setIsListViewOpened( false );
44
+ closeGeneralSidebar();
45
+ if ( ! isDistractionFree && !! blocks.length ) {
46
+ selectBlock( blocks[ 0 ].clientId );
47
+ }
48
+ } );
47
49
  };
48
50
 
49
51
  const isLargeViewport = useViewportMatch( 'medium' );
@@ -84,7 +86,7 @@ function WritingMenu( { onClose } ) {
84
86
  <PreferenceToggleMenuItem
85
87
  scope="core/edit-post"
86
88
  name="distractionFree"
87
- toggleHandler={ toggleDistractionFree }
89
+ onToggle={ toggleDistractionFree }
88
90
  label={ __( 'Distraction free' ) }
89
91
  info={ __( 'Write with calmness' ) }
90
92
  messageActivated={ __( 'Distraction free mode activated' ) }
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { castArray } from 'lodash';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
@@ -26,20 +21,22 @@ function KeyCombination( { keyCombination, forceAriaLabel } ) {
26
21
  className="edit-post-keyboard-shortcut-help-modal__shortcut-key-combination"
27
22
  aria-label={ forceAriaLabel || ariaLabel }
28
23
  >
29
- { castArray( shortcut ).map( ( character, index ) => {
30
- if ( character === '+' ) {
31
- return <Fragment key={ index }>{ character }</Fragment>;
32
- }
24
+ { ( Array.isArray( shortcut ) ? shortcut : [ shortcut ] ).map(
25
+ ( character, index ) => {
26
+ if ( character === '+' ) {
27
+ return <Fragment key={ index }>{ character }</Fragment>;
28
+ }
33
29
 
34
- return (
35
- <kbd
36
- key={ index }
37
- className="edit-post-keyboard-shortcut-help-modal__shortcut-key"
38
- >
39
- { character }
40
- </kbd>
41
- );
42
- } ) }
30
+ return (
31
+ <kbd
32
+ key={ index }
33
+ className="edit-post-keyboard-shortcut-help-modal__shortcut-key"
34
+ >
35
+ { character }
36
+ </kbd>
37
+ );
38
+ }
39
+ ) }
43
40
  </kbd>
44
41
  );
45
42
  }
@@ -7,7 +7,7 @@ import {
7
7
  useShortcut,
8
8
  store as keyboardShortcutsStore,
9
9
  } from '@wordpress/keyboard-shortcuts';
10
- import { __, sprintf } from '@wordpress/i18n';
10
+ import { __ } from '@wordpress/i18n';
11
11
  import { store as editorStore } from '@wordpress/editor';
12
12
  import { store as blockEditorStore } from '@wordpress/block-editor';
13
13
  import { store as noticesStore } from '@wordpress/notices';
@@ -67,7 +67,7 @@ function KeyboardShortcuts() {
67
67
  registerShortcut( {
68
68
  name: 'core/edit-post/toggle-distraction-free',
69
69
  category: 'global',
70
- description: __( 'Toggle disrtaction free mode.' ),
70
+ description: __( 'Toggle distraction free mode.' ),
71
71
  keyCombination: {
72
72
  modifier: 'primaryShift',
73
73
  character: '\\',
@@ -168,14 +168,12 @@ function KeyboardShortcuts() {
168
168
  setIsListViewOpened( false );
169
169
  toggleDistractionFree();
170
170
  toggleFeature( 'distractionFree' );
171
- const modeState = isFeatureActive( 'distractionFree' )
172
- ? __( 'on' )
173
- : __( 'off' );
174
171
  createInfoNotice(
175
- // translators: Mode of distraction free can be 'on' or 'off';
176
- sprintf( __( 'Distraction free mode turned %s.' ), modeState ),
172
+ isFeatureActive( 'distractionFree' )
173
+ ? __( 'Distraction free mode turned on.' )
174
+ : __( 'Distraction free mode turned off.' ),
177
175
  {
178
- speak: true,
176
+ id: 'core/edit-post/distraction-free-mode/notice',
179
177
  type: 'snackbar',
180
178
  }
181
179
  );
@@ -124,12 +124,6 @@ function Layout( { styles } ) {
124
124
  documentLabel: postTypeLabel || _x( 'Document', 'noun' ),
125
125
  };
126
126
  }, [] );
127
- const [ distractionFree, setDistractionFree ] =
128
- useState( isDistractionFree );
129
-
130
- useEffect( () => {
131
- setDistractionFree( isDistractionFree );
132
- }, [ isDistractionFree ] );
133
127
 
134
128
  const className = classnames( 'edit-post-layout', 'is-mode-' + mode, {
135
129
  'is-sidebar-opened': sidebarIsOpened,
@@ -207,7 +201,7 @@ function Layout( { styles } ) {
207
201
  <EditorKeyboardShortcutsRegister />
208
202
  <SettingsSidebar />
209
203
  <InterfaceSkeleton
210
- isDistractionFree={ distractionFree }
204
+ isDistractionFree={ isDistractionFree }
211
205
  className={ className }
212
206
  labels={ {
213
207
  ...interfaceLabels,
@@ -215,7 +209,6 @@ function Layout( { styles } ) {
215
209
  } }
216
210
  header={
217
211
  <Header
218
- isDistractionFree={ distractionFree }
219
212
  setEntitiesSavedStatesCallback={
220
213
  setEntitiesSavedStatesCallback
221
214
  }