@wordpress/edit-post 6.0.1 → 6.1.0-next.e230fbab09.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 (171) hide show
  1. package/build/components/block-manager/category.js +2 -2
  2. package/build/components/block-manager/category.js.map +1 -1
  3. package/build/components/block-manager/index.js +2 -2
  4. package/build/components/block-manager/index.js.map +1 -1
  5. package/build/components/header/fullscreen-mode-close/index.js +11 -4
  6. package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
  7. package/build/components/header/header-toolbar/index.js +1 -1
  8. package/build/components/header/header-toolbar/index.js.map +1 -1
  9. package/build/components/header/header-toolbar/index.native.js +1 -1
  10. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  11. package/build/components/header/index.js +3 -1
  12. package/build/components/header/index.js.map +1 -1
  13. package/build/components/header/more-menu/index.js +0 -6
  14. package/build/components/header/more-menu/index.js.map +1 -1
  15. package/build/components/header/template-title/delete-template.js +29 -20
  16. package/build/components/header/template-title/delete-template.js.map +1 -1
  17. package/build/components/header/writing-menu/index.js +7 -7
  18. package/build/components/header/writing-menu/index.js.map +1 -1
  19. package/build/components/keyboard-shortcut-help-modal/config.js +5 -0
  20. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  21. package/build/components/layout/index.js.map +1 -1
  22. package/build/components/layout/index.native.js +1 -1
  23. package/build/components/layout/index.native.js.map +1 -1
  24. package/build/components/preferences-modal/index.js +14 -136
  25. package/build/components/preferences-modal/index.js.map +1 -1
  26. package/build/components/preferences-modal/meta-boxes-section.js +2 -4
  27. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  28. package/build/components/preferences-modal/options/enable-custom-fields.js +2 -8
  29. package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  30. package/build/components/preferences-modal/options/enable-feature.js +2 -4
  31. package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
  32. package/build/components/preferences-modal/options/enable-panel.js +2 -4
  33. package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
  34. package/build/components/preferences-modal/options/enable-publish-sidebar.js +2 -8
  35. package/build/components/preferences-modal/options/enable-publish-sidebar.js.map +1 -1
  36. package/build/components/secondary-sidebar/list-view-sidebar.js +0 -11
  37. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  38. package/build/components/sidebar/post-link/index.js +1 -1
  39. package/build/components/sidebar/post-link/index.js.map +1 -1
  40. package/build/editor.js +4 -3
  41. package/build/editor.js.map +1 -1
  42. package/build/editor.native.js +8 -8
  43. package/build/editor.native.js.map +1 -1
  44. package/build/hooks/validate-multiple-use/index.js +1 -1
  45. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  46. package/build/index.js +5 -4
  47. package/build/index.js.map +1 -1
  48. package/build/plugins/welcome-guide-menu-item/index.js +3 -3
  49. package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
  50. package/build/store/actions.js +173 -113
  51. package/build/store/actions.js.map +1 -1
  52. package/build/store/index.js +0 -3
  53. package/build/store/index.js.map +1 -1
  54. package/build/store/reducer.js +0 -12
  55. package/build/store/reducer.js.map +1 -1
  56. package/build/store/selectors.js +44 -10
  57. package/build/store/selectors.js.map +1 -1
  58. package/build-module/components/block-manager/category.js +2 -2
  59. package/build-module/components/block-manager/category.js.map +1 -1
  60. package/build-module/components/block-manager/index.js +2 -2
  61. package/build-module/components/block-manager/index.js.map +1 -1
  62. package/build-module/components/header/fullscreen-mode-close/index.js +8 -4
  63. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  64. package/build-module/components/header/header-toolbar/index.js +1 -1
  65. package/build-module/components/header/header-toolbar/index.js.map +1 -1
  66. package/build-module/components/header/header-toolbar/index.native.js +1 -1
  67. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  68. package/build-module/components/header/index.js +3 -1
  69. package/build-module/components/header/index.js.map +1 -1
  70. package/build-module/components/header/more-menu/index.js +0 -5
  71. package/build-module/components/header/more-menu/index.js.map +1 -1
  72. package/build-module/components/header/template-title/delete-template.js +32 -22
  73. package/build-module/components/header/template-title/delete-template.js.map +1 -1
  74. package/build-module/components/header/writing-menu/index.js +7 -7
  75. package/build-module/components/header/writing-menu/index.js.map +1 -1
  76. package/build-module/components/keyboard-shortcut-help-modal/config.js +5 -0
  77. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  78. package/build-module/components/layout/index.js +2 -2
  79. package/build-module/components/layout/index.js.map +1 -1
  80. package/build-module/components/layout/index.native.js +1 -1
  81. package/build-module/components/layout/index.native.js.map +1 -1
  82. package/build-module/components/preferences-modal/index.js +15 -135
  83. package/build-module/components/preferences-modal/index.js.map +1 -1
  84. package/build-module/components/preferences-modal/meta-boxes-section.js +2 -2
  85. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  86. package/build-module/components/preferences-modal/options/enable-custom-fields.js +1 -5
  87. package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  88. package/build-module/components/preferences-modal/options/enable-feature.js +1 -1
  89. package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
  90. package/build-module/components/preferences-modal/options/enable-panel.js +1 -1
  91. package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
  92. package/build-module/components/preferences-modal/options/enable-publish-sidebar.js +1 -5
  93. package/build-module/components/preferences-modal/options/enable-publish-sidebar.js.map +1 -1
  94. package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -12
  95. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  96. package/build-module/components/sidebar/post-link/index.js +2 -2
  97. package/build-module/components/sidebar/post-link/index.js.map +1 -1
  98. package/build-module/editor.js +5 -4
  99. package/build-module/editor.js.map +1 -1
  100. package/build-module/editor.native.js +8 -8
  101. package/build-module/editor.native.js.map +1 -1
  102. package/build-module/hooks/validate-multiple-use/index.js +1 -1
  103. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  104. package/build-module/index.js +5 -4
  105. package/build-module/index.js.map +1 -1
  106. package/build-module/plugins/welcome-guide-menu-item/index.js +3 -3
  107. package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
  108. package/build-module/store/actions.js +143 -102
  109. package/build-module/store/actions.js.map +1 -1
  110. package/build-module/store/index.js +0 -2
  111. package/build-module/store/index.js.map +1 -1
  112. package/build-module/store/reducer.js +1 -13
  113. package/build-module/store/reducer.js.map +1 -1
  114. package/build-module/store/selectors.js +36 -6
  115. package/build-module/store/selectors.js.map +1 -1
  116. package/build-style/style-rtl.css +105 -139
  117. package/build-style/style.css +105 -139
  118. package/package.json +30 -25
  119. package/src/components/block-manager/category.js +2 -2
  120. package/src/components/block-manager/index.js +2 -2
  121. package/src/components/header/fullscreen-mode-close/index.js +9 -4
  122. package/src/components/header/fullscreen-mode-close/style.scss +5 -1
  123. package/src/components/header/fullscreen-mode-close/test/index.js +1 -1
  124. package/src/components/header/header-toolbar/index.js +1 -1
  125. package/src/components/header/header-toolbar/index.native.js +1 -1
  126. package/src/components/header/index.js +1 -1
  127. package/src/components/header/more-menu/index.js +0 -6
  128. package/src/components/header/style.scss +1 -1
  129. package/src/components/header/template-title/delete-template.js +57 -46
  130. package/src/components/header/writing-menu/index.js +7 -7
  131. package/src/components/keyboard-shortcut-help-modal/config.js +4 -0
  132. package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +6 -0
  133. package/src/components/layout/index.js +2 -2
  134. package/src/components/layout/index.native.js +1 -1
  135. package/src/components/preferences-modal/index.js +24 -178
  136. package/src/components/preferences-modal/meta-boxes-section.js +3 -3
  137. package/src/components/preferences-modal/options/enable-custom-fields.js +1 -5
  138. package/src/components/preferences-modal/options/enable-feature.js +1 -1
  139. package/src/components/preferences-modal/options/enable-panel.js +1 -1
  140. package/src/components/preferences-modal/options/enable-publish-sidebar.js +1 -5
  141. package/src/components/preferences-modal/options/test/__snapshots__/enable-custom-fields.js.snap +4 -4
  142. package/src/components/preferences-modal/options/test/enable-custom-fields.js +1 -1
  143. package/src/components/preferences-modal/test/__snapshots__/index.js.snap +235 -357
  144. package/src/components/preferences-modal/test/index.js +6 -6
  145. package/src/components/secondary-sidebar/list-view-sidebar.js +1 -11
  146. package/src/components/sidebar/post-link/index.js +2 -2
  147. package/src/editor.js +4 -3
  148. package/src/editor.native.js +7 -7
  149. package/src/hooks/validate-multiple-use/index.js +1 -1
  150. package/src/index.js +5 -4
  151. package/src/plugins/welcome-guide-menu-item/index.js +3 -3
  152. package/src/store/actions.js +129 -149
  153. package/src/store/index.js +0 -2
  154. package/src/store/reducer.js +1 -12
  155. package/src/store/selectors.js +56 -8
  156. package/src/store/test/actions.js +252 -79
  157. package/src/store/test/reducer.js +0 -28
  158. package/src/style.scss +0 -2
  159. package/src/test/editor.native.js +2 -2
  160. package/build/components/preferences-modal/options/base.js +0 -35
  161. package/build/components/preferences-modal/options/base.js.map +0 -1
  162. package/build/components/preferences-modal/section.js +0 -27
  163. package/build/components/preferences-modal/section.js.map +0 -1
  164. package/build-module/components/preferences-modal/options/base.js +0 -27
  165. package/build-module/components/preferences-modal/options/base.js.map +0 -1
  166. package/build-module/components/preferences-modal/section.js +0 -19
  167. package/build-module/components/preferences-modal/section.js.map +0 -1
  168. package/src/components/header/more-menu/style.scss +0 -35
  169. package/src/components/preferences-modal/options/base.js +0 -20
  170. package/src/components/preferences-modal/section.js +0 -15
  171. package/src/components/preferences-modal/style.scss +0 -112
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/store/reducer.js"],"names":["flow","get","includes","omit","union","without","combineReducers","PREFERENCES_DEFAULTS","createWithInitialState","initialState","reducer","state","action","preferences","panels","type","panelName","enabled","isOpen","opened","editorMode","mode","hiddenBlockTypes","blockNames","preferredStyleVariations","blockName","blockStyle","localAutosaveInterval","interval","removedPanels","activeModal","name","publishSidebarActive","isSavingMetaBoxes","metaBoxLocations","metaBoxesPerLocation","deviceType","blockInserterPanel","value","listViewPanel","isEditingTemplate","metaBoxesInitialized","metaBoxes","isSaving","locations","initialized"],"mappings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;AACA;AACA;AACA;;AACA,SAAS6B,iBAAT,GAAoD;AAAA,MAAxB7B,KAAwB,uEAAhB,KAAgB;AAAA,MAATC,MAAS;;AACnD,UAASA,MAAM,CAACG,IAAhB;AACC,SAAK,yBAAL;AACC,aAAOH,MAAM,CAAC0B,KAAd;AAFF;;AAIA,SAAO3B,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS8B,oBAAT,GAAuD;AAAA,MAAxB9B,KAAwB,uEAAhB,KAAgB;AAAA,MAATC,MAAS;;AACtD,UAASA,MAAM,CAACG,IAAhB;AACC,SAAK,wBAAL;AACC,aAAO,IAAP;AAFF;;AAIA,SAAOJ,KAAP;AACA;;AAED,MAAM+B,SAAS,GAAGpC,eAAe,CAAE;AAClCqC,EAAAA,QAAQ,EAAEV,iBADwB;AAElCW,EAAAA,SAAS,EAAEV,gBAFuB;AAGlCW,EAAAA,WAAW,EAAEJ;AAHqB,CAAF,CAAjC;AAMA,eAAenC,eAAe,CAAE;AAC/BwB,EAAAA,WAD+B;AAE/BY,EAAAA,SAF+B;AAG/B7B,EAAAA,WAH+B;AAI/BmB,EAAAA,oBAJ+B;AAK/BH,EAAAA,aAL+B;AAM/BO,EAAAA,UAN+B;AAO/BC,EAAAA,kBAP+B;AAQ/BE,EAAAA,aAR+B;AAS/BC,EAAAA;AAT+B,CAAF,CAA9B","sourcesContent":["/**\n * External dependencies\n */\nimport { flow, get, includes, omit, union, without } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { PREFERENCES_DEFAULTS } from './defaults';\n\n/**\n * Higher-order reducer creator which provides the given initial state for the\n * original reducer.\n *\n * @param {*} initialState Initial state to provide to reducer.\n *\n * @return {Function} Higher-order reducer.\n */\nconst createWithInitialState = ( initialState ) => ( reducer ) => {\n\treturn ( state = initialState, action ) => reducer( state, action );\n};\n\n/**\n * Reducer returning the user preferences.\n *\n * @param {Object} state Current state.\n * @param {string} state.mode Current editor mode, either\n * \"visual\" or \"text\".\n * @param {boolean} state.isGeneralSidebarDismissed Whether general sidebar is\n * dismissed. False by default\n * or when closing general\n * sidebar, true when opening\n * sidebar.\n * @param {boolean} state.isSidebarOpened Whether the sidebar is\n * opened or closed.\n * @param {Object} state.panels The state of the different\n * sidebar panels.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const preferences = flow( [\n\tcombineReducers,\n\tcreateWithInitialState( PREFERENCES_DEFAULTS ),\n] )( {\n\tpanels( state, action ) {\n\t\tswitch ( action.type ) {\n\t\t\tcase 'TOGGLE_PANEL_ENABLED': {\n\t\t\t\tconst { panelName } = action;\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\t[ panelName ]: {\n\t\t\t\t\t\t...state[ panelName ],\n\t\t\t\t\t\tenabled: ! get( state, [ panelName, 'enabled' ], true ),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tcase 'TOGGLE_PANEL_OPENED': {\n\t\t\t\tconst { panelName } = action;\n\t\t\t\tconst isOpen =\n\t\t\t\t\tstate[ panelName ] === true ||\n\t\t\t\t\tget( state, [ panelName, 'opened' ], false );\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\t[ panelName ]: {\n\t\t\t\t\t\t...state[ panelName ],\n\t\t\t\t\t\topened: ! isOpen,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn state;\n\t},\n\teditorMode( state, action ) {\n\t\tif ( action.type === 'SWITCH_MODE' ) {\n\t\t\treturn action.mode;\n\t\t}\n\n\t\treturn state;\n\t},\n\thiddenBlockTypes( state, action ) {\n\t\tswitch ( action.type ) {\n\t\t\tcase 'SHOW_BLOCK_TYPES':\n\t\t\t\treturn without( state, ...action.blockNames );\n\n\t\t\tcase 'HIDE_BLOCK_TYPES':\n\t\t\t\treturn union( state, action.blockNames );\n\t\t}\n\n\t\treturn state;\n\t},\n\tpreferredStyleVariations( state, action ) {\n\t\tswitch ( action.type ) {\n\t\t\tcase 'UPDATE_PREFERRED_STYLE_VARIATIONS': {\n\t\t\t\tif ( ! action.blockName ) {\n\t\t\t\t\treturn state;\n\t\t\t\t}\n\t\t\t\tif ( ! action.blockStyle ) {\n\t\t\t\t\treturn omit( state, [ action.blockName ] );\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\t[ action.blockName ]: action.blockStyle,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn state;\n\t},\n\tlocalAutosaveInterval( state, action ) {\n\t\tswitch ( action.type ) {\n\t\t\tcase 'UPDATE_LOCAL_AUTOSAVE_INTERVAL':\n\t\t\t\treturn action.interval;\n\t\t}\n\n\t\treturn state;\n\t},\n} );\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 the inserter is open.\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\tpreferences,\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":["flow","get","includes","omit","combineReducers","PREFERENCES_DEFAULTS","createWithInitialState","initialState","reducer","state","action","preferences","panels","type","panelName","enabled","isOpen","opened","editorMode","mode","preferredStyleVariations","blockName","blockStyle","localAutosaveInterval","interval","removedPanels","activeModal","name","publishSidebarActive","isSavingMetaBoxes","metaBoxLocations","metaBoxesPerLocation","deviceType","blockInserterPanel","value","listViewPanel","isEditingTemplate","metaBoxesInitialized","metaBoxes","isSaving","locations","initialized"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,GAAf,EAAoBC,QAApB,E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AO,IAAP;AAFF;;AAIA,SAAOJ,KAAP;AACA;;AAED,MAAM6B,SAAS,GAAGlC,eAAe,CAAE;AAClCmC,EAAAA,QAAQ,EAAEV,iBADwB;AAElCW,EAAAA,SAAS,EAAEV,gBAFuB;AAGlCW,EAAAA,WAAW,EAAEJ;AAHqB,CAAF,CAAjC;AAMA,eAAejC,eAAe,CAAE;AAC/BsB,EAAAA,WAD+B;AAE/BY,EAAAA,SAF+B;AAG/B3B,EAAAA,WAH+B;AAI/BiB,EAAAA,oBAJ+B;AAK/BH,EAAAA,aAL+B;AAM/BO,EAAAA,UAN+B;AAO/BC,EAAAA,kBAP+B;AAQ/BE,EAAAA,aAR+B;AAS/BC,EAAAA;AAT+B,CAAF,CAA9B","sourcesContent":["/**\n * External dependencies\n */\nimport { flow, get, includes, omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { PREFERENCES_DEFAULTS } from './defaults';\n\n/**\n * Higher-order reducer creator which provides the given initial state for the\n * original reducer.\n *\n * @param {*} initialState Initial state to provide to reducer.\n *\n * @return {Function} Higher-order reducer.\n */\nconst createWithInitialState = ( initialState ) => ( reducer ) => {\n\treturn ( state = initialState, action ) => reducer( state, action );\n};\n\n/**\n * Reducer returning the user preferences.\n *\n * @param {Object} state Current state.\n * @param {string} state.mode Current editor mode, either\n * \"visual\" or \"text\".\n * @param {boolean} state.isGeneralSidebarDismissed Whether general sidebar is\n * dismissed. False by default\n * or when closing general\n * sidebar, true when opening\n * sidebar.\n * @param {boolean} state.isSidebarOpened Whether the sidebar is\n * opened or closed.\n * @param {Object} state.panels The state of the different\n * sidebar panels.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const preferences = flow( [\n\tcombineReducers,\n\tcreateWithInitialState( PREFERENCES_DEFAULTS ),\n] )( {\n\tpanels( state, action ) {\n\t\tswitch ( action.type ) {\n\t\t\tcase 'TOGGLE_PANEL_ENABLED': {\n\t\t\t\tconst { panelName } = action;\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\t[ panelName ]: {\n\t\t\t\t\t\t...state[ panelName ],\n\t\t\t\t\t\tenabled: ! get( state, [ panelName, 'enabled' ], true ),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tcase 'TOGGLE_PANEL_OPENED': {\n\t\t\t\tconst { panelName } = action;\n\t\t\t\tconst isOpen =\n\t\t\t\t\tstate[ panelName ] === true ||\n\t\t\t\t\tget( state, [ panelName, 'opened' ], false );\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\t[ panelName ]: {\n\t\t\t\t\t\t...state[ panelName ],\n\t\t\t\t\t\topened: ! isOpen,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn state;\n\t},\n\teditorMode( state, action ) {\n\t\tif ( action.type === 'SWITCH_MODE' ) {\n\t\t\treturn action.mode;\n\t\t}\n\n\t\treturn state;\n\t},\n\tpreferredStyleVariations( state, action ) {\n\t\tswitch ( action.type ) {\n\t\t\tcase 'UPDATE_PREFERRED_STYLE_VARIATIONS': {\n\t\t\t\tif ( ! action.blockName ) {\n\t\t\t\t\treturn state;\n\t\t\t\t}\n\t\t\t\tif ( ! action.blockStyle ) {\n\t\t\t\t\treturn omit( state, [ action.blockName ] );\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\t[ action.blockName ]: action.blockStyle,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn state;\n\t},\n\tlocalAutosaveInterval( state, action ) {\n\t\tswitch ( action.type ) {\n\t\t\tcase 'UPDATE_LOCAL_AUTOSAVE_INTERVAL':\n\t\t\t\treturn action.interval;\n\t\t}\n\n\t\treturn state;\n\t},\n} );\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 the inserter is open.\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\tpreferences,\n\tpublishSidebarActive,\n\tremovedPanels,\n\tdeviceType,\n\tblockInserterPanel,\n\tlistViewPanel,\n\tisEditingTemplate,\n} );\n"]}
@@ -9,8 +9,10 @@ import { get, includes, some, flatten, values } from 'lodash';
9
9
 
10
10
  import { createRegistrySelector } from '@wordpress/data';
11
11
  import { store as interfaceStore } from '@wordpress/interface';
12
+ import { store as preferencesStore } from '@wordpress/preferences';
12
13
  import { store as coreStore } from '@wordpress/core-data';
13
14
  import { store as editorStore } from '@wordpress/editor';
15
+ const EMPTY_ARRAY = [];
14
16
  /**
15
17
  * Returns the current editing mode.
16
18
  *
@@ -63,7 +65,10 @@ export const isPluginSidebarOpened = createRegistrySelector(select => () => {
63
65
 
64
66
  export const getActiveGeneralSidebarName = createRegistrySelector(select => () => {
65
67
  return select(interfaceStore).getActiveComplementaryArea('core/edit-post');
66
- });
68
+ }); // The current list of preference keys that have been migrated to the
69
+ // preferences package.
70
+
71
+ const MIGRATED_KEYS = ['hiddenBlockTypes'];
67
72
  /**
68
73
  * Returns the preferences (these preferences are persisted locally).
69
74
  *
@@ -72,9 +77,21 @@ export const getActiveGeneralSidebarName = createRegistrySelector(select => () =
72
77
  * @return {Object} Preferences Object.
73
78
  */
74
79
 
75
- export function getPreferences(state) {
76
- return state.preferences;
77
- }
80
+ export const getPreferences = createRegistrySelector(select => state => {
81
+ const editPostPreferences = state.preferences; // Some preferences now exist in the preferences store.
82
+ // Fetch them so that they can be merged into the post
83
+ // editor preferences.
84
+
85
+ const preferenceStorePreferences = MIGRATED_KEYS.reduce((accumulatedPrefs, preferenceKey) => {
86
+ const value = select(preferencesStore).get('core/edit-post', preferenceKey);
87
+ return { ...accumulatedPrefs,
88
+ [preferenceKey]: value
89
+ };
90
+ }, {});
91
+ return { ...editPostPreferences,
92
+ ...preferenceStorePreferences
93
+ };
94
+ });
78
95
  /**
79
96
  *
80
97
  * @param {Object} state Global application state.
@@ -85,10 +102,23 @@ export function getPreferences(state) {
85
102
  */
86
103
 
87
104
  export function getPreference(state, preferenceKey, defaultValue) {
88
- const preferences = getPreferences(state);
105
+ // Avoid using the `getPreferences` registry selector where possible.
106
+ const isMigratedKey = MIGRATED_KEYS.includes(preferenceKey);
107
+ const preferences = isMigratedKey ? getPreferences(state) : state.preferences;
89
108
  const value = preferences[preferenceKey];
90
109
  return value === undefined ? defaultValue : value;
91
110
  }
111
+ /**
112
+ * Returns an array of blocks that are hidden.
113
+ *
114
+ * @return {Array} A list of the hidden block types
115
+ */
116
+
117
+ export const getHiddenBlockTypes = createRegistrySelector(select => () => {
118
+ var _select$get;
119
+
120
+ return (_select$get = select(preferencesStore).get('core/edit-post', 'hiddenBlockTypes')) !== null && _select$get !== void 0 ? _select$get : EMPTY_ARRAY;
121
+ });
92
122
  /**
93
123
  * Returns true if the publish sidebar is opened.
94
124
  *
@@ -163,7 +193,7 @@ export function isModalActive(state, modalName) {
163
193
  */
164
194
 
165
195
  export const isFeatureActive = createRegistrySelector(select => (state, feature) => {
166
- return select(interfaceStore).isFeatureActive('core/edit-post', feature);
196
+ return !!select(preferencesStore).get('core/edit-post', feature);
167
197
  });
168
198
  /**
169
199
  * Returns true if the plugin item is pinned to the header.
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/store/selectors.js"],"names":["createSelector","get","includes","some","flatten","values","createRegistrySelector","store","interfaceStore","coreStore","editorStore","getEditorMode","state","getPreference","isEditorSidebarOpened","select","activeGeneralSidebar","getActiveComplementaryArea","isPluginSidebarOpened","getActiveGeneralSidebarName","getPreferences","preferences","preferenceKey","defaultValue","value","undefined","isPublishSidebarOpened","publishSidebarActive","isEditorPanelRemoved","panelName","removedPanels","isEditorPanelEnabled","panels","isEditorPanelOpened","isModalActive","modalName","activeModal","isFeatureActive","feature","isPluginItemPinned","pluginName","isItemPinned","getActiveMetaBoxLocations","Object","keys","metaBoxes","locations","filter","location","isMetaBoxLocationActive","isMetaBoxLocationVisible","getMetaBoxesPerLocation","id","length","getAllMetaBoxes","hasMetaBoxes","isSavingMetaBoxes","isSaving","__experimentalGetPreviewDeviceType","deviceType","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","isListViewOpened","listViewPanel","isEditingTemplate","areMetaBoxesInitialized","initialized","getEditedPostTemplate","currentTemplate","getEditedPostAttribute","templateWithSameSlug","getEntityRecords","per_page","find","template","slug","getEditedEntityRecord","post","getCurrentPost","link","__experimentalGetTemplateForLink"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAP,MAA2B,QAA3B;AACA,SAASC,GAAT,EAAcC,QAAd,EAAwBC,IAAxB,EAA8BC,OAA9B,EAAuCC,MAAvC,QAAqD,QAArD;AAEA;AACA;AACA;;AACA,SAASC,sBAAT,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,sBAAxC;AACA,SAASD,KAAK,IAAIE,SAAlB,QAAmC,sBAAnC;AACA,SAASF,KAAK,IAAIG,WAAlB,QAAqC,mBAArC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,aAAT,CAAwBC,KAAxB,EAAgC;AACtC,SAAOC,aAAa,CAAED,KAAF,EAAS,YAAT,EAAuB,QAAvB,CAApB;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAME,qBAAqB,GAAGR,sBAAsB,CACxDS,MAAF,IAAc,MAAM;AACnB,QAAMC,oBAAoB,GAAGD,MAAM,CAClCP,cADkC,CAAN,CAE3BS,0BAF2B,CAEC,gBAFD,CAA7B;AAGA,SAAOf,QAAQ,CACd,CAAE,oBAAF,EAAwB,iBAAxB,CADc,EAEdc,oBAFc,CAAf;AAIA,CATyD,CAApD;AAYP;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAME,qBAAq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AACA,OAAO,SAASC,iBAAT,CAA4BxD,KAA5B,EAAoC;AAC1C,SAAOA,KAAK,CAACwD,iBAAb;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,uBAAT,CAAkCzD,KAAlC,EAA0C;AAChD,SAAOA,KAAK,CAACiC,SAAN,CAAgByB,WAAvB;AACA;AAED;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,qBAAqB,GAAGjE,sBAAsB,CACxDS,MAAF,IAAc,MAAM;AACnB,QAAMyD,eAAe,GAAGzD,MAAM,CAAEL,WAAF,CAAN,CAAsB+D,sBAAtB,CACvB,UADuB,CAAxB;;AAGA,MAAKD,eAAL,EAAuB;AAAA;;AACtB,UAAME,oBAAoB,4BAAG3D,MAAM,CAAEN,SAAF,CAAN,CAC3BkE,gBAD2B,CACT,UADS,EACG,aADH,EACkB;AAAEC,MAAAA,QAAQ,EAAE,CAAC;AAAb,KADlB,CAAH,0DAAG,sBAE1BC,IAF0B,CAElBC,QAAF,IAAgBA,QAAQ,CAACC,IAAT,KAAkBP,eAFd,CAA7B;;AAGA,QAAK,CAAEE,oBAAP,EAA8B;AAC7B,aAAOA,oBAAP;AACA;;AACD,WAAO3D,MAAM,CAAEN,SAAF,CAAN,CAAoBuE,qBAApB,CACN,UADM,EAEN,aAFM,EAGNN,oBAAoB,CAACtB,EAHf,CAAP;AAKA;;AAED,QAAM6B,IAAI,GAAGlE,MAAM,CAAEL,WAAF,CAAN,CAAsBwE,cAAtB,EAAb;;AACA,MAAKD,IAAI,CAACE,IAAV,EAAiB;AAChB,WAAOpE,MAAM,CAAEN,SAAF,CAAN,CAAoB2E,gCAApB,CACNH,IAAI,CAACE,IADC,CAAP;AAGA;;AAED,SAAO,IAAP;AACA,CA3ByD,CAApD","sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\nimport { get, includes, some, flatten, values } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport function getEditorMode( state ) {\n\treturn getPreference( state, 'editorMode', 'visual' );\n}\n\n/**\n * Returns true if the editor sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the editor sidebar is opened.\n */\nexport const isEditorSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar = select(\n\t\t\tinterfaceStore\n\t\t).getActiveComplementaryArea( 'core/edit-post' );\n\t\treturn includes(\n\t\t\t[ 'edit-post/document', 'edit-post/block' ],\n\t\t\tactiveGeneralSidebar\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the plugin sidebar is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the plugin sidebar is opened.\n */\nexport const isPluginSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar = select(\n\t\t\tinterfaceStore\n\t\t).getActiveComplementaryArea( 'core/edit-post' );\n\t\treturn (\n\t\t\t!! activeGeneralSidebar &&\n\t\t\t! includes(\n\t\t\t\t[ 'edit-post/document', 'edit-post/block' ],\n\t\t\t\tactiveGeneralSidebar\n\t\t\t)\n\t\t);\n\t}\n);\n\n/**\n * Returns the current active general sidebar name, or null if there is no\n * general sidebar active. The active general sidebar is a unique name to\n * identify either an editor or plugin sidebar.\n *\n * Examples:\n *\n * - `edit-post/document`\n * - `my-plugin/insert-image-sidebar`\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Active general sidebar name.\n */\nexport const getActiveGeneralSidebarName = createRegistrySelector(\n\t( select ) => () => {\n\t\treturn select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t'core/edit-post'\n\t\t);\n\t}\n);\n\n/**\n * Returns the preferences (these preferences are persisted locally).\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Preferences Object.\n */\nexport function getPreferences( state ) {\n\treturn state.preferences;\n}\n\n/**\n *\n * @param {Object} state Global application state.\n * @param {string} preferenceKey Preference Key.\n * @param {*} defaultValue Default Value.\n *\n * @return {*} Preference Value.\n */\nexport function getPreference( state, preferenceKey, defaultValue ) {\n\tconst preferences = getPreferences( state );\n\tconst value = preferences[ preferenceKey ];\n\treturn value === undefined ? defaultValue : value;\n}\n\n/**\n * Returns true if the publish sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the publish sidebar is open.\n */\nexport function isPublishSidebarOpened( state ) {\n\treturn state.publishSidebarActive;\n}\n\n/**\n * Returns true if the given panel was programmatically removed, or false otherwise.\n * All panels are not removed by default.\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is removed.\n */\nexport function isEditorPanelRemoved( state, panelName ) {\n\treturn includes( state.removedPanels, panelName );\n}\n\n/**\n * Returns true if the given panel is enabled, or false otherwise. Panels are\n * enabled by default.\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is enabled.\n */\nexport function isEditorPanelEnabled( state, panelName ) {\n\tconst panels = getPreference( state, 'panels' );\n\n\treturn (\n\t\t! isEditorPanelRemoved( state, panelName ) &&\n\t\tget( panels, [ panelName, 'enabled' ], true )\n\t);\n}\n\n/**\n * Returns true if the given panel is open, or false otherwise. Panels are\n * closed by default.\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is open.\n */\nexport function isEditorPanelOpened( state, panelName ) {\n\tconst panels = getPreference( state, 'panels' );\n\treturn (\n\t\tget( panels, [ panelName ] ) === true ||\n\t\tget( panels, [ panelName, 'opened' ] ) === true\n\t);\n}\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport function isModalActive( state, modalName ) {\n\treturn state.activeModal === modalName;\n}\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, feature ) => {\n\t\treturn select( interfaceStore ).isFeatureActive(\n\t\t\t'core/edit-post',\n\t\t\tfeature\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the plugin item is pinned to the header.\n * When the value is not set it defaults to true.\n *\n * @param {Object} state Global application state.\n * @param {string} pluginName Plugin item name.\n *\n * @return {boolean} Whether the plugin item is pinned.\n */\nexport const isPluginItemPinned = createRegistrySelector(\n\t( select ) => ( state, pluginName ) => {\n\t\treturn select( interfaceStore ).isItemPinned(\n\t\t\t'core/edit-post',\n\t\t\tpluginName\n\t\t);\n\t}\n);\n\n/**\n * Returns an array of active meta box locations.\n *\n * @param {Object} state Post editor state.\n *\n * @return {string[]} Active meta box locations.\n */\nexport const getActiveMetaBoxLocations = createSelector(\n\t( state ) => {\n\t\treturn Object.keys( state.metaBoxes.locations ).filter( ( location ) =>\n\t\t\tisMetaBoxLocationActive( state, location )\n\t\t);\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if a metabox location is active and visible\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active and visible.\n */\nexport function isMetaBoxLocationVisible( state, location ) {\n\treturn (\n\t\tisMetaBoxLocationActive( state, location ) &&\n\t\tsome( getMetaBoxesPerLocation( state, location ), ( { id } ) => {\n\t\t\treturn isEditorPanelEnabled( state, `meta-box-${ id }` );\n\t\t} )\n\t);\n}\n\n/**\n * Returns true if there is an active meta box in the given location, or false\n * otherwise.\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active.\n */\nexport function isMetaBoxLocationActive( state, location ) {\n\tconst metaBoxes = getMetaBoxesPerLocation( state, location );\n\treturn !! metaBoxes && metaBoxes.length !== 0;\n}\n\n/**\n * Returns the list of all the available meta boxes for a given location.\n *\n * @param {Object} state Global application state.\n * @param {string} location Meta box location to test.\n *\n * @return {?Array} List of meta boxes.\n */\nexport function getMetaBoxesPerLocation( state, location ) {\n\treturn state.metaBoxes.locations[ location ];\n}\n\n/**\n * Returns the list of all the available meta boxes.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} List of meta boxes.\n */\nexport const getAllMetaBoxes = createSelector(\n\t( state ) => {\n\t\treturn flatten( values( state.metaBoxes.locations ) );\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if the post is using Meta Boxes\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether there are metaboxes or not.\n */\nexport function hasMetaBoxes( state ) {\n\treturn getActiveMetaBoxLocations( state ).length > 0;\n}\n\n/**\n * Returns true if the Meta Boxes are being saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the metaboxes are being saved.\n */\nexport function isSavingMetaBoxes( state ) {\n\treturn state.metaBoxes.isSaving;\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns true if the inserter is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport function __experimentalGetInsertionPoint( state ) {\n\tconst {\n\t\trootClientId,\n\t\tinsertionIndex,\n\t\tfilterValue,\n\t} = state.blockInserterPanel;\n\treturn { rootClientId, insertionIndex, filterValue };\n}\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns true if the template editing mode is enabled.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether we're editing the template.\n */\nexport function isEditingTemplate( state ) {\n\treturn state.isEditingTemplate;\n}\n\n/**\n * Returns true if meta boxes are initialized.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether meta boxes are initialized.\n */\nexport function areMetaBoxesInitialized( state ) {\n\treturn state.metaBoxes.initialized;\n}\n\n/**\n * Retrieves the template of the currently edited post.\n *\n * @return {Object?} Post Template.\n */\nexport const getEditedPostTemplate = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst currentTemplate = select( editorStore ).getEditedPostAttribute(\n\t\t\t'template'\n\t\t);\n\t\tif ( currentTemplate ) {\n\t\t\tconst templateWithSameSlug = select( coreStore )\n\t\t\t\t.getEntityRecords( 'postType', 'wp_template', { per_page: -1 } )\n\t\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 select( coreStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\ttemplateWithSameSlug.id\n\t\t\t);\n\t\t}\n\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\tif ( post.link ) {\n\t\t\treturn select( coreStore ).__experimentalGetTemplateForLink(\n\t\t\t\tpost.link\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/store/selectors.js"],"names":["createSelector","get","includes","some","flatten","values","createRegistrySelector","store","interfaceStore","preferencesStore","coreStore","editorStore","EMPTY_ARRAY","getEditorMode","state","getPreference","isEditorSidebarOpened","select","activeGeneralSidebar","getActiveComplementaryArea","isPluginSidebarOpened","getActiveGeneralSidebarName","MIGRATED_KEYS","getPreferences","editPostPreferences","preferences","preferenceStorePreferences","reduce","accumulatedPrefs","preferenceKey","value","defaultValue","isMigratedKey","undefined","getHiddenBlockTypes","isPublishSidebarOpened","publishSidebarActive","isEditorPanelRemoved","panelName","removedPanels","isEditorPanelEnabled","panels","isEditorPanelOpened","isModalActive","modalName","activeModal","isFeatureActive","feature","isPluginItemPinned","pluginName","isItemPinned","getActiveMetaBoxLocations","Object","keys","metaBoxes","locations","filter","location","isMetaBoxLocationActive","isMetaBoxLocationVisible","getMetaBoxesPerLocation","id","length","getAllMetaBoxes","hasMetaBoxes","isSavingMetaBoxes","isSaving","__experimentalGetPreviewDeviceType","deviceType","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","isListViewOpened","listViewPanel","isEditingTemplate","areMetaBoxesInitialized","initialized","getEditedPostTemplate","currentTemplate","getEditedPostAttribute","templateWithSameSlug","getEntityRecords","per_page","find","template","slug","getEditedEntityRecord","post","getCurrentPost","link","__experimentalGetTemplateForLink"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAP,MAA2B,QAA3B;AACA,SAASC,GAAT,EAAcC,QAAd,EAAwBC,IAAxB,EAA8BC,OAA9B,EAAuCC,MAAvC,QAAqD,QAArD;AAEA;AACA;AACA;;AACA,SAASC,sBAAT,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,sBAAxC;AACA,SAASD,KAAK,IAAIE,gBAAlB,QAA0C,wBAA1C;AACA,SAASF,KAAK,IAAIG,SAAlB,QAAmC,sBAAnC;AACA,SAASH,KAAK,IAAII,WAAlB,QAAqC,mBAArC;AAEA,MAAMC,WAAW,GAAG,EAApB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,aAAT,CAAwBC,KAAxB,EAAgC;AACtC,SAAOC,aAAa,CAAED,KAAF,EAAS,YAAT,EAAuB,QAAvB,CAApB;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AAC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AOA,KAAK,CAAC+D,iBAAb;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,uBAAT,CAAkChE,KAAlC,EAA0C;AAChD,SAAOA,KAAK,CAACwC,SAAN,CAAgByB,WAAvB;AACA;AAED;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,qBAAqB,GAAG1E,sBAAsB,CACxDW,MAAF,IAAc,MAAM;AACnB,QAAMgE,eAAe,GAAGhE,MAAM,CAAEN,WAAF,CAAN,CAAsBuE,sBAAtB,CACvB,UADuB,CAAxB;;AAGA,MAAKD,eAAL,EAAuB;AAAA;;AACtB,UAAME,oBAAoB,4BAAGlE,MAAM,CAAEP,SAAF,CAAN,CAC3B0E,gBAD2B,CACT,UADS,EACG,aADH,EACkB;AAAEC,MAAAA,QAAQ,EAAE,CAAC;AAAb,KADlB,CAAH,0DAAG,sBAE1BC,IAF0B,CAElBC,QAAF,IAAgBA,QAAQ,CAACC,IAAT,KAAkBP,eAFd,CAA7B;;AAGA,QAAK,CAAEE,oBAAP,EAA8B;AAC7B,aAAOA,oBAAP;AACA;;AACD,WAAOlE,MAAM,CAAEP,SAAF,CAAN,CAAoB+E,qBAApB,CACN,UADM,EAEN,aAFM,EAGNN,oBAAoB,CAACtB,EAHf,CAAP;AAKA;;AAED,QAAM6B,IAAI,GAAGzE,MAAM,CAAEN,WAAF,CAAN,CAAsBgF,cAAtB,EAAb;;AACA,MAAKD,IAAI,CAACE,IAAV,EAAiB;AAChB,WAAO3E,MAAM,CAAEP,SAAF,CAAN,CAAoBmF,gCAApB,CACNH,IAAI,CAACE,IADC,CAAP;AAGA;;AAED,SAAO,IAAP;AACA,CA3ByD,CAApD","sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\nimport { get, includes, some, flatten, values } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\n\nconst EMPTY_ARRAY = [];\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport function getEditorMode( state ) {\n\treturn getPreference( state, 'editorMode', 'visual' );\n}\n\n/**\n * Returns true if the editor sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the editor sidebar is opened.\n */\nexport const isEditorSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar = select(\n\t\t\tinterfaceStore\n\t\t).getActiveComplementaryArea( 'core/edit-post' );\n\t\treturn includes(\n\t\t\t[ 'edit-post/document', 'edit-post/block' ],\n\t\t\tactiveGeneralSidebar\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the plugin sidebar is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the plugin sidebar is opened.\n */\nexport const isPluginSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar = select(\n\t\t\tinterfaceStore\n\t\t).getActiveComplementaryArea( 'core/edit-post' );\n\t\treturn (\n\t\t\t!! activeGeneralSidebar &&\n\t\t\t! includes(\n\t\t\t\t[ 'edit-post/document', 'edit-post/block' ],\n\t\t\t\tactiveGeneralSidebar\n\t\t\t)\n\t\t);\n\t}\n);\n\n/**\n * Returns the current active general sidebar name, or null if there is no\n * general sidebar active. The active general sidebar is a unique name to\n * identify either an editor or plugin sidebar.\n *\n * Examples:\n *\n * - `edit-post/document`\n * - `my-plugin/insert-image-sidebar`\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Active general sidebar name.\n */\nexport const getActiveGeneralSidebarName = createRegistrySelector(\n\t( select ) => () => {\n\t\treturn select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t'core/edit-post'\n\t\t);\n\t}\n);\n\n// The current list of preference keys that have been migrated to the\n// preferences package.\nconst MIGRATED_KEYS = [ 'hiddenBlockTypes' ];\n\n/**\n * Returns the preferences (these preferences are persisted locally).\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Preferences Object.\n */\nexport const getPreferences = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst editPostPreferences = state.preferences;\n\n\t\t// Some preferences now exist in the preferences store.\n\t\t// Fetch them so that they can be merged into the post\n\t\t// editor preferences.\n\t\tconst preferenceStorePreferences = MIGRATED_KEYS.reduce(\n\t\t\t( accumulatedPrefs, preferenceKey ) => {\n\t\t\t\tconst value = select( preferencesStore ).get(\n\t\t\t\t\t'core/edit-post',\n\t\t\t\t\tpreferenceKey\n\t\t\t\t);\n\n\t\t\t\treturn {\n\t\t\t\t\t...accumulatedPrefs,\n\t\t\t\t\t[ preferenceKey ]: value,\n\t\t\t\t};\n\t\t\t},\n\t\t\t{}\n\t\t);\n\n\t\treturn {\n\t\t\t...editPostPreferences,\n\t\t\t...preferenceStorePreferences,\n\t\t};\n\t}\n);\n\n/**\n *\n * @param {Object} state Global application state.\n * @param {string} preferenceKey Preference Key.\n * @param {*} defaultValue Default Value.\n *\n * @return {*} Preference Value.\n */\nexport function getPreference( state, preferenceKey, defaultValue ) {\n\t// Avoid using the `getPreferences` registry selector where possible.\n\tconst isMigratedKey = MIGRATED_KEYS.includes( preferenceKey );\n\tconst preferences = isMigratedKey\n\t\t? getPreferences( state )\n\t\t: state.preferences;\n\tconst value = preferences[ preferenceKey ];\n\treturn value === undefined ? defaultValue : value;\n}\n\n/**\n * Returns an array of blocks that are hidden.\n *\n * @return {Array} A list of the hidden block types\n */\nexport const getHiddenBlockTypes = createRegistrySelector( ( select ) => () => {\n\treturn (\n\t\tselect( preferencesStore ).get(\n\t\t\t'core/edit-post',\n\t\t\t'hiddenBlockTypes'\n\t\t) ?? EMPTY_ARRAY\n\t);\n} );\n\n/**\n * Returns true if the publish sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the publish sidebar is open.\n */\nexport function isPublishSidebarOpened( state ) {\n\treturn state.publishSidebarActive;\n}\n\n/**\n * Returns true if the given panel was programmatically removed, or false otherwise.\n * All panels are not removed by default.\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is removed.\n */\nexport function isEditorPanelRemoved( state, panelName ) {\n\treturn includes( state.removedPanels, panelName );\n}\n\n/**\n * Returns true if the given panel is enabled, or false otherwise. Panels are\n * enabled by default.\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is enabled.\n */\nexport function isEditorPanelEnabled( state, panelName ) {\n\tconst panels = getPreference( state, 'panels' );\n\n\treturn (\n\t\t! isEditorPanelRemoved( state, panelName ) &&\n\t\tget( panels, [ panelName, 'enabled' ], true )\n\t);\n}\n\n/**\n * Returns true if the given panel is open, or false otherwise. Panels are\n * closed by default.\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is open.\n */\nexport function isEditorPanelOpened( state, panelName ) {\n\tconst panels = getPreference( state, 'panels' );\n\treturn (\n\t\tget( panels, [ panelName ] ) === true ||\n\t\tget( panels, [ panelName, 'opened' ] ) === true\n\t);\n}\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport function isModalActive( state, modalName ) {\n\treturn state.activeModal === modalName;\n}\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, feature ) => {\n\t\treturn !! select( preferencesStore ).get( 'core/edit-post', feature );\n\t}\n);\n\n/**\n * Returns true if the plugin item is pinned to the header.\n * When the value is not set it defaults to true.\n *\n * @param {Object} state Global application state.\n * @param {string} pluginName Plugin item name.\n *\n * @return {boolean} Whether the plugin item is pinned.\n */\nexport const isPluginItemPinned = createRegistrySelector(\n\t( select ) => ( state, pluginName ) => {\n\t\treturn select( interfaceStore ).isItemPinned(\n\t\t\t'core/edit-post',\n\t\t\tpluginName\n\t\t);\n\t}\n);\n\n/**\n * Returns an array of active meta box locations.\n *\n * @param {Object} state Post editor state.\n *\n * @return {string[]} Active meta box locations.\n */\nexport const getActiveMetaBoxLocations = createSelector(\n\t( state ) => {\n\t\treturn Object.keys( state.metaBoxes.locations ).filter( ( location ) =>\n\t\t\tisMetaBoxLocationActive( state, location )\n\t\t);\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if a metabox location is active and visible\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active and visible.\n */\nexport function isMetaBoxLocationVisible( state, location ) {\n\treturn (\n\t\tisMetaBoxLocationActive( state, location ) &&\n\t\tsome( getMetaBoxesPerLocation( state, location ), ( { id } ) => {\n\t\t\treturn isEditorPanelEnabled( state, `meta-box-${ id }` );\n\t\t} )\n\t);\n}\n\n/**\n * Returns true if there is an active meta box in the given location, or false\n * otherwise.\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active.\n */\nexport function isMetaBoxLocationActive( state, location ) {\n\tconst metaBoxes = getMetaBoxesPerLocation( state, location );\n\treturn !! metaBoxes && metaBoxes.length !== 0;\n}\n\n/**\n * Returns the list of all the available meta boxes for a given location.\n *\n * @param {Object} state Global application state.\n * @param {string} location Meta box location to test.\n *\n * @return {?Array} List of meta boxes.\n */\nexport function getMetaBoxesPerLocation( state, location ) {\n\treturn state.metaBoxes.locations[ location ];\n}\n\n/**\n * Returns the list of all the available meta boxes.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} List of meta boxes.\n */\nexport const getAllMetaBoxes = createSelector(\n\t( state ) => {\n\t\treturn flatten( values( state.metaBoxes.locations ) );\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if the post is using Meta Boxes\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether there are metaboxes or not.\n */\nexport function hasMetaBoxes( state ) {\n\treturn getActiveMetaBoxLocations( state ).length > 0;\n}\n\n/**\n * Returns true if the Meta Boxes are being saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the metaboxes are being saved.\n */\nexport function isSavingMetaBoxes( state ) {\n\treturn state.metaBoxes.isSaving;\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns true if the inserter is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport function __experimentalGetInsertionPoint( state ) {\n\tconst {\n\t\trootClientId,\n\t\tinsertionIndex,\n\t\tfilterValue,\n\t} = state.blockInserterPanel;\n\treturn { rootClientId, insertionIndex, filterValue };\n}\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns true if the template editing mode is enabled.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether we're editing the template.\n */\nexport function isEditingTemplate( state ) {\n\treturn state.isEditingTemplate;\n}\n\n/**\n * Returns true if meta boxes are initialized.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether meta boxes are initialized.\n */\nexport function areMetaBoxesInitialized( state ) {\n\treturn state.metaBoxes.initialized;\n}\n\n/**\n * Retrieves the template of the currently edited post.\n *\n * @return {Object?} Post Template.\n */\nexport const getEditedPostTemplate = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst currentTemplate = select( editorStore ).getEditedPostAttribute(\n\t\t\t'template'\n\t\t);\n\t\tif ( currentTemplate ) {\n\t\t\tconst templateWithSameSlug = select( coreStore )\n\t\t\t\t.getEntityRecords( 'postType', 'wp_template', { per_page: -1 } )\n\t\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 select( coreStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\ttemplateWithSameSlug.id\n\t\t\t);\n\t\t}\n\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\tif ( post.link ) {\n\t\t\treturn select( coreStore ).__experimentalGetTemplateForLink(\n\t\t\t\tpost.link\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n);\n"]}
@@ -304,7 +304,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
304
304
  display: flex;
305
305
  flex-direction: column;
306
306
  overflow: auto;
307
- z-index: 20;
307
+ z-index: 91;
308
308
  }
309
309
 
310
310
  .interface-interface-skeleton__secondary-sidebar,
@@ -447,6 +447,95 @@ body.is-fullscreen-mode .interface-interface-skeleton {
447
447
  max-height: 24px;
448
448
  }
449
449
 
450
+ @media (min-width: 600px) {
451
+ .interface-preferences-modal {
452
+ width: calc(100% - 32px);
453
+ height: calc(100% - 120px);
454
+ }
455
+ }
456
+ @media (min-width: 782px) {
457
+ .interface-preferences-modal {
458
+ width: 750px;
459
+ }
460
+ }
461
+ @media (min-width: 960px) {
462
+ .interface-preferences-modal {
463
+ height: 70%;
464
+ }
465
+ }
466
+ @media (max-width: 781px) {
467
+ .interface-preferences-modal .components-modal__content {
468
+ padding: 0;
469
+ }
470
+ .interface-preferences-modal .components-modal__content::before {
471
+ content: none;
472
+ }
473
+ }
474
+
475
+ .interface-preferences__tabs .components-tab-panel__tabs {
476
+ position: absolute;
477
+ top: 84px;
478
+ right: 16px;
479
+ width: 160px;
480
+ }
481
+ .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item {
482
+ border-radius: 2px;
483
+ font-weight: 400;
484
+ }
485
+ .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item.is-active {
486
+ background: #f0f0f0;
487
+ box-shadow: none;
488
+ font-weight: 500;
489
+ }
490
+ .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus:not(:disabled) {
491
+ box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
492
+ }
493
+ .interface-preferences__tabs .components-tab-panel__tab-content {
494
+ padding-right: 24px;
495
+ margin-right: 160px;
496
+ }
497
+
498
+ @media (max-width: 781px) {
499
+ .interface-preferences__provider {
500
+ height: 100%;
501
+ }
502
+ }
503
+ .interface-preferences-modal__section {
504
+ margin: 0 0 2.5rem 0;
505
+ }
506
+ .interface-preferences-modal__section:last-child {
507
+ margin: 0;
508
+ }
509
+
510
+ .interface-preferences-modal__section-title {
511
+ font-size: 0.9rem;
512
+ font-weight: 600;
513
+ margin-top: 0;
514
+ }
515
+
516
+ .interface-preferences-modal__section-description {
517
+ margin: -8px 0 8px 0;
518
+ font-size: 12px;
519
+ font-style: normal;
520
+ color: #757575;
521
+ }
522
+
523
+ .interface-preferences-modal__option .components-base-control .components-base-control__field {
524
+ align-items: center;
525
+ display: flex;
526
+ margin-bottom: 0;
527
+ }
528
+ .interface-preferences-modal__option .components-base-control .components-base-control__field > label {
529
+ flex-grow: 1;
530
+ padding: 0.6rem 10px 0.6rem 0;
531
+ }
532
+ .interface-preferences-modal__option .components-base-control__help {
533
+ margin: -8px 58px 8px 0;
534
+ font-size: 12px;
535
+ font-style: normal;
536
+ color: #757575;
537
+ }
538
+
450
539
  .edit-post-header {
451
540
  height: 60px;
452
541
  background: #fff;
@@ -510,7 +599,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
510
599
  .edit-post-header__settings .components-button.is-tertiary {
511
600
  padding: 0 6px;
512
601
  }
513
- .edit-post-header__settings .edit-post-more-menu .components-button,
602
+ .edit-post-header__settings .interface-more-menu-dropdown .components-button,
514
603
  .edit-post-header__settings .interface-pinned-items .components-button {
515
604
  margin-left: 0;
516
605
  }
@@ -680,11 +769,11 @@ body.is-fullscreen-mode .interface-interface-skeleton {
680
769
  margin-left: 8px;
681
770
  }
682
771
 
683
- .edit-post-fullscreen-mode-close.has-icon {
772
+ .edit-post-fullscreen-mode-close.components-button {
684
773
  display: none;
685
774
  }
686
775
  @media (min-width: 782px) {
687
- .edit-post-fullscreen-mode-close.has-icon {
776
+ .edit-post-fullscreen-mode-close.components-button {
688
777
  display: flex;
689
778
  align-items: center;
690
779
  align-self: stretch;
@@ -697,13 +786,13 @@ body.is-fullscreen-mode .interface-interface-skeleton {
697
786
  position: relative;
698
787
  margin-bottom: -1px;
699
788
  }
700
- .edit-post-fullscreen-mode-close.has-icon:active {
789
+ .edit-post-fullscreen-mode-close.components-button:active {
701
790
  color: #fff;
702
791
  }
703
- .edit-post-fullscreen-mode-close.has-icon:focus {
792
+ .edit-post-fullscreen-mode-close.components-button:focus {
704
793
  box-shadow: none;
705
794
  }
706
- .edit-post-fullscreen-mode-close.has-icon::before {
795
+ .edit-post-fullscreen-mode-close.components-button::before {
707
796
  transition: box-shadow 0.1s ease;
708
797
  content: "";
709
798
  display: block;
@@ -717,22 +806,27 @@ body.is-fullscreen-mode .interface-interface-skeleton {
717
806
  }
718
807
  }
719
808
  @media (min-width: 782px) and (prefers-reduced-motion: reduce) {
720
- .edit-post-fullscreen-mode-close.has-icon::before {
809
+ .edit-post-fullscreen-mode-close.components-button::before {
721
810
  transition-duration: 0s;
722
811
  transition-delay: 0s;
723
812
  }
724
813
  }
725
814
  @media (min-width: 782px) {
726
- .edit-post-fullscreen-mode-close.has-icon:hover::before {
815
+ .edit-post-fullscreen-mode-close.components-button:hover::before {
727
816
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) #757575;
728
817
  }
729
818
  }
730
819
  @media (min-width: 782px) {
731
- .edit-post-fullscreen-mode-close.has-icon:focus::before {
820
+ .edit-post-fullscreen-mode-close.components-button.has-icon:hover::before {
821
+ box-shadow: none;
822
+ }
823
+ }
824
+ @media (min-width: 782px) {
825
+ .edit-post-fullscreen-mode-close.components-button:focus::before {
732
826
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) rgba(255, 255, 255, 0.1), inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
733
827
  }
734
828
  }
735
- .edit-post-fullscreen-mode-close.has-icon .edit-post-fullscreen-mode-close_site-icon {
829
+ .edit-post-fullscreen-mode-close.components-button .edit-post-fullscreen-mode-close_site-icon {
736
830
  width: 36px;
737
831
  height: 36px;
738
832
  border-radius: 2px;
@@ -853,39 +947,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
853
947
  margin-right: 8px;
854
948
  }
855
949
 
856
- .edit-post-more-menu {
857
- margin-right: -4px;
858
- }
859
- .edit-post-more-menu .components-button {
860
- width: auto;
861
- padding: 0 2px;
862
- }
863
- @media (min-width: 600px) {
864
- .edit-post-more-menu {
865
- margin-right: 0;
866
- }
867
- .edit-post-more-menu .components-button {
868
- padding: 0 4px;
869
- }
870
- }
871
-
872
- .edit-post-more-menu__content .components-popover__content {
873
- min-width: 280px;
874
- }
875
- @media (min-width: 480px) {
876
- .edit-post-more-menu__content .components-popover__content {
877
- width: auto;
878
- max-width: 480px;
879
- }
880
- }
881
- .edit-post-more-menu__content .components-popover__content .components-dropdown-menu__menu {
882
- padding: 0;
883
- }
884
-
885
- .components-popover.edit-post-more-menu__content {
886
- z-index: 99998;
887
- }
888
-
889
950
  .edit-post-template-top-area {
890
951
  display: flex;
891
952
  flex-direction: column;
@@ -1303,101 +1364,6 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
1303
1364
  clear: both;
1304
1365
  }
1305
1366
 
1306
- @media (min-width: 600px) {
1307
- .edit-post-preferences-modal {
1308
- width: calc(100% - 32px);
1309
- height: calc(100% - 120px);
1310
- }
1311
- }
1312
- @media (min-width: 782px) {
1313
- .edit-post-preferences-modal {
1314
- width: 750px;
1315
- }
1316
- }
1317
- @media (min-width: 960px) {
1318
- .edit-post-preferences-modal {
1319
- height: 70%;
1320
- }
1321
- }
1322
- @media (max-width: 781px) {
1323
- .edit-post-preferences-modal .components-modal__content {
1324
- padding: 0;
1325
- }
1326
- .edit-post-preferences-modal .components-modal__content::before {
1327
- content: none;
1328
- }
1329
- .edit-post-preferences-modal .components-navigator-provider {
1330
- height: 100%;
1331
- }
1332
- }
1333
- .edit-post-preferences-modal .edit-post-preferences__tabs .components-tab-panel__tabs {
1334
- position: absolute;
1335
- top: 84px;
1336
- right: 16px;
1337
- width: 160px;
1338
- }
1339
- .edit-post-preferences-modal .edit-post-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item {
1340
- border-radius: 2px;
1341
- font-weight: 400;
1342
- }
1343
- .edit-post-preferences-modal .edit-post-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item.is-active {
1344
- background: #f0f0f0;
1345
- box-shadow: none;
1346
- font-weight: 500;
1347
- }
1348
- .edit-post-preferences-modal .edit-post-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus:not(:disabled) {
1349
- box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
1350
- }
1351
- .edit-post-preferences-modal .edit-post-preferences__tabs .components-tab-panel__tab-content {
1352
- padding-right: 24px;
1353
- margin-right: 160px;
1354
- }
1355
- .edit-post-preferences-modal__section {
1356
- margin: 0 0 2.5rem 0;
1357
- }
1358
- .edit-post-preferences-modal__section:last-child {
1359
- margin: 0;
1360
- }
1361
- .edit-post-preferences-modal__section-title {
1362
- font-size: 0.9rem;
1363
- font-weight: 600;
1364
- margin-top: 0;
1365
- }
1366
- .edit-post-preferences-modal__option .components-base-control .components-base-control__field {
1367
- align-items: center;
1368
- display: flex;
1369
- margin-bottom: 0;
1370
- }
1371
- .edit-post-preferences-modal__option .components-base-control .components-base-control__field > label {
1372
- flex-grow: 1;
1373
- padding: 0.6rem 10px 0.6rem 0;
1374
- }
1375
- .edit-post-preferences-modal__custom-fields-confirmation-message, .edit-post-preferences-modal__custom-fields-confirmation-button {
1376
- margin: 0 48px 0.6rem 0;
1377
- }
1378
- @media (min-width: 782px) {
1379
- .edit-post-preferences-modal__custom-fields-confirmation-message, .edit-post-preferences-modal__custom-fields-confirmation-button {
1380
- margin-right: 38px;
1381
- }
1382
- }
1383
- @media (min-width: 600px) {
1384
- .edit-post-preferences-modal__custom-fields-confirmation-message, .edit-post-preferences-modal__custom-fields-confirmation-button {
1385
- max-width: 300px;
1386
- }
1387
- }
1388
- .edit-post-preferences-modal .components-base-control__help {
1389
- margin: -8px 58px 8px 0;
1390
- font-size: 12px;
1391
- font-style: normal;
1392
- color: #757575;
1393
- }
1394
- .edit-post-preferences-modal .edit-post-preferences-modal__section-description {
1395
- margin: -8px 0 8px 0;
1396
- font-size: 12px;
1397
- font-style: normal;
1398
- color: #757575;
1399
- }
1400
-
1401
1367
  .edit-post-editor__inserter-panel,
1402
1368
  .edit-post-editor__list-view-panel {
1403
1369
  height: 100%;