@wordpress/edit-post 5.0.7 → 5.0.8

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 (242) hide show
  1. package/build/components/block-manager/category.js +13 -11
  2. package/build/components/block-manager/category.js.map +1 -1
  3. package/build/components/block-manager/checklist.js +6 -5
  4. package/build/components/block-manager/checklist.js.map +1 -1
  5. package/build/components/block-manager/index.js +14 -10
  6. package/build/components/block-manager/index.js.map +1 -1
  7. package/build/components/block-manager/show-all.js +5 -4
  8. package/build/components/block-manager/show-all.js.map +1 -1
  9. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +26 -21
  10. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  11. package/build/components/browser-url/index.js +1 -1
  12. package/build/components/editor-initialization/index.js +4 -3
  13. package/build/components/editor-initialization/index.js.map +1 -1
  14. package/build/components/editor-initialization/utils.js +2 -1
  15. package/build/components/editor-initialization/utils.js.map +1 -1
  16. package/build/components/header/fullscreen-mode-close/index.js +6 -5
  17. package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
  18. package/build/components/header/header-toolbar/index.native.js +12 -11
  19. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  20. package/build/components/header/index.js +4 -3
  21. package/build/components/header/index.js.map +1 -1
  22. package/build/components/header/main-dashboard-button/index.js +4 -3
  23. package/build/components/header/main-dashboard-button/index.js.map +1 -1
  24. package/build/components/header/more-menu/index.js +23 -19
  25. package/build/components/header/more-menu/index.js.map +1 -1
  26. package/build/components/header/post-publish-button-or-toggle.js +14 -13
  27. package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
  28. package/build/components/header/template-title/index.js +13 -10
  29. package/build/components/header/template-title/index.js.map +1 -1
  30. package/build/components/header/tools-more-menu-group/index.js +10 -7
  31. package/build/components/header/tools-more-menu-group/index.js.map +1 -1
  32. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +4 -3
  33. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  34. package/build/components/keyboard-shortcut-help-modal/index.js +54 -44
  35. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  36. package/build/components/keyboard-shortcut-help-modal/shortcut.js +12 -10
  37. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  38. package/build/components/layout/actions-panel.js +7 -6
  39. package/build/components/layout/actions-panel.js.map +1 -1
  40. package/build/components/layout/index.js +4 -3
  41. package/build/components/layout/index.js.map +1 -1
  42. package/build/components/meta-boxes/index.js +13 -9
  43. package/build/components/meta-boxes/index.js.map +1 -1
  44. package/build/components/meta-boxes/meta-box-visibility.js +8 -5
  45. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  46. package/build/components/meta-boxes/meta-boxes-area/index.js +4 -3
  47. package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  48. package/build/components/preferences-modal/index.js +13 -11
  49. package/build/components/preferences-modal/index.js.map +1 -1
  50. package/build/components/preferences-modal/meta-boxes-section.js +23 -16
  51. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  52. package/build/components/preferences-modal/options/base.js +8 -7
  53. package/build/components/preferences-modal/options/base.js.map +1 -1
  54. package/build/components/preferences-modal/options/enable-custom-fields.js +9 -7
  55. package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  56. package/build/components/preferences-modal/options/enable-feature.js +12 -8
  57. package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
  58. package/build/components/preferences-modal/options/enable-panel.js +17 -10
  59. package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
  60. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +10 -7
  61. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  62. package/build/components/preferences-modal/options/index.js +6 -6
  63. package/build/components/preferences-modal/section.js +14 -11
  64. package/build/components/preferences-modal/section.js.map +1 -1
  65. package/build/components/sidebar/discussion-panel/index.js +7 -5
  66. package/build/components/sidebar/discussion-panel/index.js.map +1 -1
  67. package/build/components/sidebar/featured-image/index.js +8 -6
  68. package/build/components/sidebar/featured-image/index.js.map +1 -1
  69. package/build/components/sidebar/plugin-document-setting-panel/index.js +25 -20
  70. package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  71. package/build/components/sidebar/plugin-post-publish-panel/index.js +15 -12
  72. package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  73. package/build/components/sidebar/plugin-post-status-info/index.js +9 -6
  74. package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  75. package/build/components/sidebar/plugin-pre-publish-panel/index.js +15 -12
  76. package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  77. package/build/components/sidebar/plugin-sidebar/index.js +5 -4
  78. package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
  79. package/build/components/sidebar/post-excerpt/index.js +7 -5
  80. package/build/components/sidebar/post-excerpt/index.js.map +1 -1
  81. package/build/components/sidebar/post-link/index.js +19 -17
  82. package/build/components/sidebar/post-link/index.js.map +1 -1
  83. package/build/components/sidebar/post-schedule/index.js +12 -9
  84. package/build/components/sidebar/post-schedule/index.js.map +1 -1
  85. package/build/components/sidebar/post-status/index.js +11 -7
  86. package/build/components/sidebar/post-status/index.js.map +1 -1
  87. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -7
  88. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  89. package/build/components/sidebar/post-visibility/index.js +24 -18
  90. package/build/components/sidebar/post-visibility/index.js.map +1 -1
  91. package/build/components/sidebar/settings-header/index.js +4 -3
  92. package/build/components/sidebar/settings-header/index.js.map +1 -1
  93. package/build/components/sidebar/template/index.js +7 -4
  94. package/build/components/sidebar/template/index.js.map +1 -1
  95. package/build/components/text-editor/index.js +5 -4
  96. package/build/components/text-editor/index.js.map +1 -1
  97. package/build/components/visual-editor/block-inspector-button.js +5 -4
  98. package/build/components/visual-editor/block-inspector-button.js.map +1 -1
  99. package/build/components/visual-editor/header.native.js +7 -6
  100. package/build/components/visual-editor/header.native.js.map +1 -1
  101. package/build/components/visual-editor/index.js +20 -15
  102. package/build/components/visual-editor/index.js.map +1 -1
  103. package/build/components/welcome-guide/image.js +5 -4
  104. package/build/components/welcome-guide/image.js.map +1 -1
  105. package/build/editor.js +9 -8
  106. package/build/editor.js.map +1 -1
  107. package/build/hooks/validate-multiple-use/index.js +28 -17
  108. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  109. package/build/index.js +2 -2
  110. package/build/plugins/index.js +23 -20
  111. package/build/plugins/index.js.map +1 -1
  112. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +4 -3
  113. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  114. package/build/store/actions.js +26 -22
  115. package/build/store/actions.js.map +1 -1
  116. package/build/store/index.js +4 -2
  117. package/build/store/index.js.map +1 -1
  118. package/build/store/reducer.js +52 -17
  119. package/build/store/reducer.js.map +1 -1
  120. package/build/store/selectors.js +20 -17
  121. package/build/store/selectors.js.map +1 -1
  122. package/build-module/components/block-manager/category.js +13 -11
  123. package/build-module/components/block-manager/category.js.map +1 -1
  124. package/build-module/components/block-manager/checklist.js +6 -5
  125. package/build-module/components/block-manager/checklist.js.map +1 -1
  126. package/build-module/components/block-manager/index.js +14 -10
  127. package/build-module/components/block-manager/index.js.map +1 -1
  128. package/build-module/components/block-manager/show-all.js +5 -4
  129. package/build-module/components/block-manager/show-all.js.map +1 -1
  130. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +26 -21
  131. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  132. package/build-module/components/editor-initialization/index.js +4 -3
  133. package/build-module/components/editor-initialization/index.js.map +1 -1
  134. package/build-module/components/editor-initialization/utils.js +2 -1
  135. package/build-module/components/editor-initialization/utils.js.map +1 -1
  136. package/build-module/components/header/fullscreen-mode-close/index.js +6 -5
  137. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  138. package/build-module/components/header/header-toolbar/index.native.js +12 -11
  139. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  140. package/build-module/components/header/index.js +4 -3
  141. package/build-module/components/header/index.js.map +1 -1
  142. package/build-module/components/header/main-dashboard-button/index.js +4 -3
  143. package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
  144. package/build-module/components/header/more-menu/index.js +23 -19
  145. package/build-module/components/header/more-menu/index.js.map +1 -1
  146. package/build-module/components/header/post-publish-button-or-toggle.js +14 -13
  147. package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
  148. package/build-module/components/header/template-title/index.js +13 -10
  149. package/build-module/components/header/template-title/index.js.map +1 -1
  150. package/build-module/components/header/tools-more-menu-group/index.js +10 -7
  151. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  152. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +4 -3
  153. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  154. package/build-module/components/keyboard-shortcut-help-modal/index.js +52 -42
  155. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  156. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +12 -10
  157. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  158. package/build-module/components/layout/actions-panel.js +6 -5
  159. package/build-module/components/layout/actions-panel.js.map +1 -1
  160. package/build-module/components/layout/index.js +4 -3
  161. package/build-module/components/layout/index.js.map +1 -1
  162. package/build-module/components/meta-boxes/index.js +13 -9
  163. package/build-module/components/meta-boxes/index.js.map +1 -1
  164. package/build-module/components/meta-boxes/meta-box-visibility.js +8 -5
  165. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  166. package/build-module/components/meta-boxes/meta-boxes-area/index.js +4 -3
  167. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  168. package/build-module/components/preferences-modal/index.js +13 -11
  169. package/build-module/components/preferences-modal/index.js.map +1 -1
  170. package/build-module/components/preferences-modal/meta-boxes-section.js +23 -16
  171. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  172. package/build-module/components/preferences-modal/options/base.js +8 -7
  173. package/build-module/components/preferences-modal/options/base.js.map +1 -1
  174. package/build-module/components/preferences-modal/options/enable-custom-fields.js +9 -7
  175. package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  176. package/build-module/components/preferences-modal/options/enable-feature.js +12 -8
  177. package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
  178. package/build-module/components/preferences-modal/options/enable-panel.js +17 -10
  179. package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
  180. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +10 -7
  181. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  182. package/build-module/components/preferences-modal/section.js +14 -11
  183. package/build-module/components/preferences-modal/section.js.map +1 -1
  184. package/build-module/components/sidebar/discussion-panel/index.js +7 -5
  185. package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
  186. package/build-module/components/sidebar/featured-image/index.js +8 -6
  187. package/build-module/components/sidebar/featured-image/index.js.map +1 -1
  188. package/build-module/components/sidebar/plugin-document-setting-panel/index.js +25 -20
  189. package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  190. package/build-module/components/sidebar/plugin-post-publish-panel/index.js +15 -12
  191. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  192. package/build-module/components/sidebar/plugin-post-status-info/index.js +9 -6
  193. package/build-module/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  194. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +15 -12
  195. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  196. package/build-module/components/sidebar/plugin-sidebar/index.js +5 -4
  197. package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
  198. package/build-module/components/sidebar/post-excerpt/index.js +7 -5
  199. package/build-module/components/sidebar/post-excerpt/index.js.map +1 -1
  200. package/build-module/components/sidebar/post-link/index.js +19 -17
  201. package/build-module/components/sidebar/post-link/index.js.map +1 -1
  202. package/build-module/components/sidebar/post-schedule/index.js +12 -9
  203. package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
  204. package/build-module/components/sidebar/post-status/index.js +11 -7
  205. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  206. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -7
  207. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  208. package/build-module/components/sidebar/post-visibility/index.js +24 -18
  209. package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
  210. package/build-module/components/sidebar/settings-header/index.js +4 -3
  211. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  212. package/build-module/components/sidebar/template/index.js +7 -4
  213. package/build-module/components/sidebar/template/index.js.map +1 -1
  214. package/build-module/components/text-editor/index.js +5 -4
  215. package/build-module/components/text-editor/index.js.map +1 -1
  216. package/build-module/components/visual-editor/block-inspector-button.js +5 -4
  217. package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
  218. package/build-module/components/visual-editor/header.native.js +7 -6
  219. package/build-module/components/visual-editor/header.native.js.map +1 -1
  220. package/build-module/components/visual-editor/index.js +20 -15
  221. package/build-module/components/visual-editor/index.js.map +1 -1
  222. package/build-module/components/welcome-guide/image.js +5 -4
  223. package/build-module/components/welcome-guide/image.js.map +1 -1
  224. package/build-module/editor.js +9 -8
  225. package/build-module/editor.js.map +1 -1
  226. package/build-module/hooks/validate-multiple-use/index.js +28 -17
  227. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  228. package/build-module/plugins/index.js +23 -20
  229. package/build-module/plugins/index.js.map +1 -1
  230. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +4 -3
  231. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  232. package/build-module/store/actions.js +6 -2
  233. package/build-module/store/actions.js.map +1 -1
  234. package/build-module/store/reducer.js +45 -11
  235. package/build-module/store/reducer.js.map +1 -1
  236. package/build-module/store/selectors.js +4 -3
  237. package/build-module/store/selectors.js.map +1 -1
  238. package/build-style/style-rtl.css +6 -11
  239. package/build-style/style.css +6 -11
  240. package/package.json +27 -27
  241. package/src/components/layout/style.scss +0 -8
  242. package/src/components/meta-boxes/meta-boxes-area/style.scss +7 -3
@@ -34,14 +34,15 @@ var _store = require("../../store");
34
34
  /**
35
35
  * Internal dependencies
36
36
  */
37
- function BlockManagerCategory({
38
- instanceId,
39
- title,
40
- blockTypes,
41
- hiddenBlockTypes,
42
- toggleVisible,
43
- toggleAllVisible
44
- }) {
37
+ function BlockManagerCategory(_ref) {
38
+ let {
39
+ instanceId,
40
+ title,
41
+ blockTypes,
42
+ hiddenBlockTypes,
43
+ toggleVisible,
44
+ toggleAllVisible
45
+ } = _ref;
45
46
  const settings = (0, _element.useContext)(_editPostSettings.default);
46
47
  const {
47
48
  allowedBlockTypes
@@ -51,9 +52,10 @@ function BlockManagerCategory({
51
52
  return blockTypes;
52
53
  }
53
54
 
54
- return blockTypes.filter(({
55
- name
56
- }) => {
55
+ return blockTypes.filter(_ref2 => {
56
+ let {
57
+ name
58
+ } = _ref2;
57
59
  return (0, _lodash.includes)(allowedBlockTypes || [], name);
58
60
  });
59
61
  }, [allowedBlockTypes, blockTypes]);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/block-manager/category.js"],"names":["BlockManagerCategory","instanceId","title","blockTypes","hiddenBlockTypes","toggleVisible","toggleAllVisible","settings","EditPostSettings","allowedBlockTypes","filteredBlockTypes","filter","name","length","checkedBlockNames","titleId","isAllChecked","ariaChecked","withInstanceId","select","getPreference","editPostStore","dispatch","ownProps","showBlockTypes","hideBlockTypes","blockName","nextIsChecked","blockNames"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAGA;AAC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BU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { includes, map, without } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, useMemo } from '@wordpress/element';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose, withInstanceId } from '@wordpress/compose';\nimport { CheckboxControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesChecklist from './checklist';\nimport EditPostSettings from '../edit-post-settings';\nimport { store as editPostStore } from '../../store';\n\nfunction BlockManagerCategory( {\n\tinstanceId,\n\ttitle,\n\tblockTypes,\n\thiddenBlockTypes,\n\ttoggleVisible,\n\ttoggleAllVisible,\n} ) {\n\tconst settings = useContext( EditPostSettings );\n\tconst { allowedBlockTypes } = settings;\n\tconst filteredBlockTypes = useMemo( () => {\n\t\tif ( allowedBlockTypes === true ) {\n\t\t\treturn blockTypes;\n\t\t}\n\t\treturn blockTypes.filter( ( { name } ) => {\n\t\t\treturn includes( allowedBlockTypes || [], name );\n\t\t} );\n\t}, [ allowedBlockTypes, blockTypes ] );\n\n\tif ( ! filteredBlockTypes.length ) {\n\t\treturn null;\n\t}\n\n\tconst checkedBlockNames = without(\n\t\tmap( filteredBlockTypes, 'name' ),\n\t\t...hiddenBlockTypes\n\t);\n\n\tconst titleId = 'edit-post-block-manager__category-title-' + instanceId;\n\n\tconst isAllChecked = checkedBlockNames.length === filteredBlockTypes.length;\n\n\tlet ariaChecked;\n\tif ( isAllChecked ) {\n\t\tariaChecked = 'true';\n\t} else if ( checkedBlockNames.length > 0 ) {\n\t\tariaChecked = 'mixed';\n\t} else {\n\t\tariaChecked = 'false';\n\t}\n\n\treturn (\n\t\t<div\n\t\t\trole=\"group\"\n\t\t\taria-labelledby={ titleId }\n\t\t\tclassName=\"edit-post-block-manager__category\"\n\t\t>\n\t\t\t<CheckboxControl\n\t\t\t\tchecked={ isAllChecked }\n\t\t\t\tonChange={ toggleAllVisible }\n\t\t\t\tclassName=\"edit-post-block-manager__category-title\"\n\t\t\t\taria-checked={ ariaChecked }\n\t\t\t\tlabel={ <span id={ titleId }>{ title }</span> }\n\t\t\t/>\n\t\t\t<BlockTypesChecklist\n\t\t\t\tblockTypes={ filteredBlockTypes }\n\t\t\t\tvalue={ checkedBlockNames }\n\t\t\t\tonItemChange={ toggleVisible }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport default compose( [\n\twithInstanceId,\n\twithSelect( ( select ) => {\n\t\tconst { getPreference } = select( editPostStore );\n\n\t\treturn {\n\t\t\thiddenBlockTypes: getPreference( 'hiddenBlockTypes' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, ownProps ) => {\n\t\tconst { showBlockTypes, hideBlockTypes } = dispatch( editPostStore );\n\n\t\treturn {\n\t\t\ttoggleVisible( blockName, nextIsChecked ) {\n\t\t\t\tif ( nextIsChecked ) {\n\t\t\t\t\tshowBlockTypes( blockName );\n\t\t\t\t} else {\n\t\t\t\t\thideBlockTypes( blockName );\n\t\t\t\t}\n\t\t\t},\n\t\t\ttoggleAllVisible( nextIsChecked ) {\n\t\t\t\tconst blockNames = map( ownProps.blockTypes, 'name' );\n\t\t\t\tif ( nextIsChecked ) {\n\t\t\t\t\tshowBlockTypes( blockNames );\n\t\t\t\t} else {\n\t\t\t\t\thideBlockTypes( blockNames );\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t} ),\n] )( BlockManagerCategory );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/block-manager/category.js"],"names":["BlockManagerCategory","instanceId","title","blockTypes","hiddenBlockTypes","toggleVisible","toggleAllVisible","settings","EditPostSettings","allowedBlockTypes","filteredBlockTypes","filter","name","length","checkedBlockNames","titleId","isAllChecked","ariaChecked","withInstanceId","select","getPreference","editPostStore","dispatch","ownProps","showBlockTypes","hideBlockTypes","blockName","nextIsChecked","blockNames"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;A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A9BU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { includes, map, without } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, useMemo } from '@wordpress/element';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose, withInstanceId } from '@wordpress/compose';\nimport { CheckboxControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesChecklist from './checklist';\nimport EditPostSettings from '../edit-post-settings';\nimport { store as editPostStore } from '../../store';\n\nfunction BlockManagerCategory( {\n\tinstanceId,\n\ttitle,\n\tblockTypes,\n\thiddenBlockTypes,\n\ttoggleVisible,\n\ttoggleAllVisible,\n} ) {\n\tconst settings = useContext( EditPostSettings );\n\tconst { allowedBlockTypes } = settings;\n\tconst filteredBlockTypes = useMemo( () => {\n\t\tif ( allowedBlockTypes === true ) {\n\t\t\treturn blockTypes;\n\t\t}\n\t\treturn blockTypes.filter( ( { name } ) => {\n\t\t\treturn includes( allowedBlockTypes || [], name );\n\t\t} );\n\t}, [ allowedBlockTypes, blockTypes ] );\n\n\tif ( ! filteredBlockTypes.length ) {\n\t\treturn null;\n\t}\n\n\tconst checkedBlockNames = without(\n\t\tmap( filteredBlockTypes, 'name' ),\n\t\t...hiddenBlockTypes\n\t);\n\n\tconst titleId = 'edit-post-block-manager__category-title-' + instanceId;\n\n\tconst isAllChecked = checkedBlockNames.length === filteredBlockTypes.length;\n\n\tlet ariaChecked;\n\tif ( isAllChecked ) {\n\t\tariaChecked = 'true';\n\t} else if ( checkedBlockNames.length > 0 ) {\n\t\tariaChecked = 'mixed';\n\t} else {\n\t\tariaChecked = 'false';\n\t}\n\n\treturn (\n\t\t<div\n\t\t\trole=\"group\"\n\t\t\taria-labelledby={ titleId }\n\t\t\tclassName=\"edit-post-block-manager__category\"\n\t\t>\n\t\t\t<CheckboxControl\n\t\t\t\tchecked={ isAllChecked }\n\t\t\t\tonChange={ toggleAllVisible }\n\t\t\t\tclassName=\"edit-post-block-manager__category-title\"\n\t\t\t\taria-checked={ ariaChecked }\n\t\t\t\tlabel={ <span id={ titleId }>{ title }</span> }\n\t\t\t/>\n\t\t\t<BlockTypesChecklist\n\t\t\t\tblockTypes={ filteredBlockTypes }\n\t\t\t\tvalue={ checkedBlockNames }\n\t\t\t\tonItemChange={ toggleVisible }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport default compose( [\n\twithInstanceId,\n\twithSelect( ( select ) => {\n\t\tconst { getPreference } = select( editPostStore );\n\n\t\treturn {\n\t\t\thiddenBlockTypes: getPreference( 'hiddenBlockTypes' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, ownProps ) => {\n\t\tconst { showBlockTypes, hideBlockTypes } = dispatch( editPostStore );\n\n\t\treturn {\n\t\t\ttoggleVisible( blockName, nextIsChecked ) {\n\t\t\t\tif ( nextIsChecked ) {\n\t\t\t\t\tshowBlockTypes( blockName );\n\t\t\t\t} else {\n\t\t\t\t\thideBlockTypes( blockName );\n\t\t\t\t}\n\t\t\t},\n\t\t\ttoggleAllVisible( nextIsChecked ) {\n\t\t\t\tconst blockNames = map( ownProps.blockTypes, 'name' );\n\t\t\t\tif ( nextIsChecked ) {\n\t\t\t\t\tshowBlockTypes( blockNames );\n\t\t\t\t} else {\n\t\t\t\t\thideBlockTypes( blockNames );\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t} ),\n] )( BlockManagerCategory );\n"]}
@@ -20,11 +20,12 @@ var _components = require("@wordpress/components");
20
20
  /**
21
21
  * WordPress dependencies
22
22
  */
23
- function BlockTypesChecklist({
24
- blockTypes,
25
- value,
26
- onItemChange
27
- }) {
23
+ function BlockTypesChecklist(_ref) {
24
+ let {
25
+ blockTypes,
26
+ value,
27
+ onItemChange
28
+ } = _ref;
28
29
  return (0, _element.createElement)("ul", {
29
30
  className: "edit-post-block-manager__checklist"
30
31
  }, blockTypes.map(blockType => (0, _element.createElement)("li", {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/block-manager/checklist.js"],"names":["BlockTypesChecklist","blockTypes","value","onItemChange","map","blockType","name","title","icon","includes"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,SAASA,mBAAT,CAA8B;AAAEC,EAAAA,UAAF;AAAcC,EAAAA,KAAd;AAAqBC,EAAAA;AAArB,CAA9B,EAAoE;AACnE,SACC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGF,UAAU,CAACG,GAAX,CAAkBC,SAAF,IACjB;AACC,IAAA,GAAG,EAAGA,SAAS,CAACC,IADjB;AAEC,IAAA,SAAS,EAAC;AAFX,KAIC,4BAAC,2BAAD;AACC,IAAA,KAAK,EACJ,qDACGD,SAAS,CAACE,KADb,EAEC,4BAAC,sBAAD;AAAW,MAAA,IAAI,EAAGF,SAAS,CAACG;AAA5B,MAFD,CAFF;AAOC,IAAA,OAAO,EAAGN,KAAK,CAACO,QAAN,CAAgBJ,SAAS,CAACC,IAA1B,CAPX;AAQC,IAAA,QAAQ,EAAG,qBAASH,YAAT,EAAuBE,SAAS,CAACC,IAAjC;AARZ,IAJD,CADC,CADH,CADD;AAqBA;;eAEcN,mB","sourcesContent":["/**\n * External dependencies\n */\nimport { partial } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { CheckboxControl } from '@wordpress/components';\n\nfunction BlockTypesChecklist( { blockTypes, value, onItemChange } ) {\n\treturn (\n\t\t<ul className=\"edit-post-block-manager__checklist\">\n\t\t\t{ blockTypes.map( ( blockType ) => (\n\t\t\t\t<li\n\t\t\t\t\tkey={ blockType.name }\n\t\t\t\t\tclassName=\"edit-post-block-manager__checklist-item\"\n\t\t\t\t>\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{ blockType.title }\n\t\t\t\t\t\t\t\t<BlockIcon icon={ blockType.icon } />\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tchecked={ value.includes( blockType.name ) }\n\t\t\t\t\t\tonChange={ partial( onItemChange, blockType.name ) }\n\t\t\t\t\t/>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n\nexport default BlockTypesChecklist;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/block-manager/checklist.js"],"names":["BlockTypesChecklist","blockTypes","value","onItemChange","map","blockType","name","title","icon","includes"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,SAASA,mBAAT,OAAoE;AAAA,MAAtC;AAAEC,IAAAA,UAAF;AAAcC,IAAAA,KAAd;AAAqBC,IAAAA;AAArB,GAAsC;AACnE,SACC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGF,UAAU,CAACG,GAAX,CAAkBC,SAAF,IACjB;AACC,IAAA,GAAG,EAAGA,SAAS,CAACC,IADjB;AAEC,IAAA,SAAS,EAAC;AAFX,KAIC,4BAAC,2BAAD;AACC,IAAA,KAAK,EACJ,qDACGD,SAAS,CAACE,KADb,EAEC,4BAAC,sBAAD;AAAW,MAAA,IAAI,EAAGF,SAAS,CAACG;AAA5B,MAFD,CAFF;AAOC,IAAA,OAAO,EAAGN,KAAK,CAACO,QAAN,CAAgBJ,SAAS,CAACC,IAA1B,CAPX;AAQC,IAAA,QAAQ,EAAG,qBAASH,YAAT,EAAuBE,SAAS,CAACC,IAAjC;AARZ,IAJD,CADC,CADH,CADD;AAqBA;;eAEcN,mB","sourcesContent":["/**\n * External dependencies\n */\nimport { partial } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { CheckboxControl } from '@wordpress/components';\n\nfunction BlockTypesChecklist( { blockTypes, value, onItemChange } ) {\n\treturn (\n\t\t<ul className=\"edit-post-block-manager__checklist\">\n\t\t\t{ blockTypes.map( ( blockType ) => (\n\t\t\t\t<li\n\t\t\t\t\tkey={ blockType.name }\n\t\t\t\t\tclassName=\"edit-post-block-manager__checklist-item\"\n\t\t\t\t>\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{ blockType.title }\n\t\t\t\t\t\t\t\t<BlockIcon icon={ blockType.icon } />\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tchecked={ value.includes( blockType.name ) }\n\t\t\t\t\t\tonChange={ partial( onItemChange, blockType.name ) }\n\t\t\t\t\t/>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n\nexport default BlockTypesChecklist;\n"]}
@@ -34,13 +34,14 @@ var _store = require("../../store");
34
34
  /**
35
35
  * Internal dependencies
36
36
  */
37
- function BlockManager({
38
- blockTypes,
39
- categories,
40
- hasBlockSupport,
41
- isMatchingSearchTerm,
42
- numberOfHiddenBlocks
43
- }) {
37
+ function BlockManager(_ref) {
38
+ let {
39
+ blockTypes,
40
+ categories,
41
+ hasBlockSupport,
42
+ isMatchingSearchTerm,
43
+ numberOfHiddenBlocks
44
+ } = _ref;
44
45
  const [search, setSearch] = (0, _element.useState)(''); // Filtering occurs here (as opposed to `withSelect`) to avoid
45
46
  // wasted renders by consequence of `Array#filter` producing
46
47
  // a new value reference on each call.
@@ -73,9 +74,12 @@ function BlockManager({
73
74
  })
74
75
  })), (0, _element.createElement)(_category.default, {
75
76
  title: (0, _i18n.__)('Uncategorized'),
76
- blockTypes: (0, _lodash.filter)(blockTypes, ({
77
- category
78
- }) => !category)
77
+ blockTypes: (0, _lodash.filter)(blockTypes, _ref2 => {
78
+ let {
79
+ category
80
+ } = _ref2;
81
+ return !category;
82
+ })
79
83
  })));
80
84
  }
81
85
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/block-manager/index.js"],"names":["BlockManager","blockTypes","categories","hasBlockSupport","isMatchingSearchTerm","numberOfHiddenBlocks","search","setSearch","filter","blockType","parent","nextSearch","length","map","category","slug","title","select","getBlockTypes","getCategories","blocksStore","getPreference","editPostStore","hiddenBlockTypes"],"mappings":";;;;;;;;;AAYA;;AATA;;AAKA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AAIA,SAASA,YAAT,CAAuB;AACtBC,EAAAA,UADsB;AAEtBC,EAAAA,UAFsB;AAGtBC,EAAAA,eAHsB;AAItBC,EAAAA,oBAJsB;AAKtBC,EAAAA;AALsB,CAAvB,EAMI;AACH,QAAM,CAAEC,MAAF,EAAUC,SAAV,IAAwB,uBAAU,EAAV,CAA9B,CADG,CAGH;AACA;AACA;;AACAN,EAAAA,UAAU,GAAGA,UAAU,CAACO,MAAX,CACVC,SAAF,IACCN,eAAe,CAAEM,SAAF,EAAa,UAAb,EAAyB,IAAzB,CAAf,KACE,CAAEH,MAAF,IAAYF,oBAAoB,CAAEK,SAAF,EAAaH,MAAb,CADlC,MAEE,CAAEG,SAAS,CAACC,MAAZ,IACD,sBAAUD,SAAS,CAACC,MAApB,EAA4B,mBAA5B,CAHD,CAFW,CAAb;AAQA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACG,CAAC,CAAEL,oBAAH,IACD;AAAK,IAAA,SAAS,EAAC;AAAf,KACG;AACD;AACA,gBACC,qBADD,EAEC,uBAFD,EAGCA,oBAHD,CAFC,EAODA,oBAPC,CADH,CAFF,EAcC,4BAAC,yBAAD;AACC,IAAA,KAAK,EAAG,cAAI,oBAAJ,CADT;AAEC,IAAA,WAAW,EAAG,cAAI,oBAAJ,CAFf;AAGC,IAAA,KAAK,EAAGC,MAHT;AAIC,IAAA,QAAQ,EAAKK,UAAF,IAAkBJ,SAAS,CAAEI,UAAF,CAJvC;AAKC,IAAA,SAAS,EAAC;AALX,IAdD,EAqBC;AACC,IAAA,QAAQ,EAAC,GADV;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,kBAAa,cAAI,uBAAJ,CAHd;AAIC,IAAA,SAAS,EAAC;AAJX,KAMGV,UAAU,CAACW,MAAX,KAAsB,CAAtB,IACD;AAAG,IAAA,SAAS,EAAC;AAAb,KACG,cAAI,kBAAJ,CADH,CAPF,EAWGV,UAAU,CAACW,GAAX,CAAkBC,QAAF,IACjB,4BAAC,iBAAD;AACC,IAAA,GAAG,EAAGA,QAAQ,CAACC,IADhB;AAEC,IAAA,KAAK,EAAGD,QAAQ,CAACE,KAFlB;AAGC,IAAA,UAAU,EAAG,oBAAQf,UAAR,EAAoB;AAChCa,MAAAA,QAAQ,EAAEA,QAAQ,CAACC;AADa,KAApB;AAHd,IADC,CAXH,EAoBC,4BAAC,iBAAD;AACC,IAAA,KAAK,EAAG,cAAI,eAAJ,CADT;AAEC,IAAA,UAAU,EAAG,oBACZd,UADY,EAEZ,CAAE;AAAEa,MAAAA;AAAF,KAAF,KAAoB,CAAEA,QAFV;AAFd,IApBD,CArBD,CADD;AAoDA;;eAEc,sBAAcG,MAAF,IAAc;AACxC,QAAM;AACLC,IAAAA,aADK;AAELC,IAAAA,aAFK;AAGLhB,IAAAA,eAHK;AAILC,IAAAA;AAJK,MAKFa,MAAM,CAAEG,aAAF,CALV;AAMA,QAAM;AAAEC,IAAAA;AAAF,MAAoBJ,MAAM,CAAEK,YAAF,CAAhC;AACA,QAAMC,gBAAgB,GAAGF,aAAa,CAAE,kBAAF,CAAtC;AACA,QAAMhB,oBAAoB,GACzB,qBAASkB,gBAAT,KAA+BA,gBAAgB,CAACX,MADjD;AAGA,SAAO;AACNX,IAAAA,UAAU,EAAEiB,aAAa,EADnB;AAENhB,IAAAA,UAAU,EAAEiB,aAAa,EAFnB;AAGNhB,IAAAA,eAHM;AAINC,IAAAA,oBAJM;AAKNC,IAAAA;AALM,GAAP;AAOA,CAnBc,EAmBVL,YAnBU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { filter, includes, isArray } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { withSelect } from '@wordpress/data';\nimport { SearchControl } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockManagerCategory from './category';\nimport { store as editPostStore } from '../../store';\n\nfunction BlockManager( {\n\tblockTypes,\n\tcategories,\n\thasBlockSupport,\n\tisMatchingSearchTerm,\n\tnumberOfHiddenBlocks,\n} ) {\n\tconst [ search, setSearch ] = useState( '' );\n\n\t// Filtering occurs here (as opposed to `withSelect`) to avoid\n\t// wasted renders by consequence of `Array#filter` producing\n\t// a new value reference on each call.\n\tblockTypes = blockTypes.filter(\n\t\t( blockType ) =>\n\t\t\thasBlockSupport( blockType, 'inserter', true ) &&\n\t\t\t( ! search || isMatchingSearchTerm( blockType, search ) ) &&\n\t\t\t( ! blockType.parent ||\n\t\t\t\tincludes( blockType.parent, 'core/post-content' ) )\n\t);\n\n\treturn (\n\t\t<div className=\"edit-post-block-manager__content\">\n\t\t\t{ !! numberOfHiddenBlocks && (\n\t\t\t\t<div className=\"edit-post-block-manager__disabled-blocks-count\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %d: number of blocks. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'%d block is hidden.',\n\t\t\t\t\t\t\t'%d blocks are hidden.',\n\t\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<SearchControl\n\t\t\t\tlabel={ __( 'Search for a block' ) }\n\t\t\t\tplaceholder={ __( 'Search for a block' ) }\n\t\t\t\tvalue={ search }\n\t\t\t\tonChange={ ( nextSearch ) => setSearch( nextSearch ) }\n\t\t\t\tclassName=\"edit-post-block-manager__search\"\n\t\t\t/>\n\t\t\t<div\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\trole=\"region\"\n\t\t\t\taria-label={ __( 'Available block types' ) }\n\t\t\t\tclassName=\"edit-post-block-manager__results\"\n\t\t\t>\n\t\t\t\t{ blockTypes.length === 0 && (\n\t\t\t\t\t<p className=\"edit-post-block-manager__no-results\">\n\t\t\t\t\t\t{ __( 'No blocks found.' ) }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t\t{ categories.map( ( category ) => (\n\t\t\t\t\t<BlockManagerCategory\n\t\t\t\t\t\tkey={ category.slug }\n\t\t\t\t\t\ttitle={ category.title }\n\t\t\t\t\t\tblockTypes={ filter( blockTypes, {\n\t\t\t\t\t\t\tcategory: category.slug,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t\t<BlockManagerCategory\n\t\t\t\t\ttitle={ __( 'Uncategorized' ) }\n\t\t\t\t\tblockTypes={ filter(\n\t\t\t\t\t\tblockTypes,\n\t\t\t\t\t\t( { category } ) => ! category\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\tconst {\n\t\tgetBlockTypes,\n\t\tgetCategories,\n\t\thasBlockSupport,\n\t\tisMatchingSearchTerm,\n\t} = select( blocksStore );\n\tconst { getPreference } = select( editPostStore );\n\tconst hiddenBlockTypes = getPreference( 'hiddenBlockTypes' );\n\tconst numberOfHiddenBlocks =\n\t\tisArray( hiddenBlockTypes ) && hiddenBlockTypes.length;\n\n\treturn {\n\t\tblockTypes: getBlockTypes(),\n\t\tcategories: getCategories(),\n\t\thasBlockSupport,\n\t\tisMatchingSearchTerm,\n\t\tnumberOfHiddenBlocks,\n\t};\n} )( BlockManager );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/block-manager/index.js"],"names":["BlockManager","blockTypes","categories","hasBlockSupport","isMatchingSearchTerm","numberOfHiddenBlocks","search","setSearch","filter","blockType","parent","nextSearch","length","map","category","slug","title","select","getBlockTypes","getCategories","bl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GV,UAAU,CAACW,MAAX,KAAsB,CAAtB,IACD;AAAG,IAAA,SAAS,EAAC;AAAb,KACG,cAAI,kBAAJ,CADH,CAPF,EAWGV,UAAU,CAACW,GAAX,CAAkBC,QAAF,IACjB,4BAAC,iBAAD;AACC,IAAA,GAAG,EAAGA,QAAQ,CAACC,IADhB;AAEC,IAAA,KAAK,EAAGD,QAAQ,CAACE,KAFlB;AAGC,IAAA,UAAU,EAAG,oBAAQf,UAAR,EAAoB;AAChCa,MAAAA,QAAQ,EAAEA,QAAQ,CAACC;AADa,KAApB;AAHd,IADC,CAXH,EAoBC,4BAAC,iBAAD;AACC,IAAA,KAAK,EAAG,cAAI,eAAJ,CADT;AAEC,IAAA,UAAU,EAAG,oBACZd,UADY,EAEZ;AAAA,UAAE;AAAEa,QAAAA;AAAF,OAAF;AAAA,aAAoB,CAAEA,QAAtB;AAAA,KAFY;AAFd,IApBD,CArBD,CADD;AAoDA;;eAEc,sBAAcG,MAAF,IAAc;AACxC,QAAM;AACLC,IAAAA,aADK;AAELC,IAAAA,aAFK;AAGLhB,IAAAA,eAHK;AAILC,IAAAA;AAJK,MAKFa,MAAM,CAAEG,aAAF,CALV;AAMA,QAAM;AAAEC,IAAAA;AAAF,MAAoBJ,MAAM,CAAEK,YAAF,CAAhC;AACA,QAAMC,gBAAgB,GAAGF,aAAa,CAAE,kBAAF,CAAtC;AACA,QAAMhB,oBAAoB,GACzB,qBAASkB,gBAAT,KAA+BA,gBAAgB,CAACX,MADjD;AAGA,SAAO;AACNX,IAAAA,UAAU,EAAEiB,aAAa,EADnB;AAENhB,IAAAA,UAAU,EAAEiB,aAAa,EAFnB;AAGNhB,IAAAA,eAHM;AAINC,IAAAA,oBAJM;AAKNC,IAAAA;AALM,GAAP;AAOA,CAnBc,EAmBVL,YAnBU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { filter, includes, isArray } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { withSelect } from '@wordpress/data';\nimport { SearchControl } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockManagerCategory from './category';\nimport { store as editPostStore } from '../../store';\n\nfunction BlockManager( {\n\tblockTypes,\n\tcategories,\n\thasBlockSupport,\n\tisMatchingSearchTerm,\n\tnumberOfHiddenBlocks,\n} ) {\n\tconst [ search, setSearch ] = useState( '' );\n\n\t// Filtering occurs here (as opposed to `withSelect`) to avoid\n\t// wasted renders by consequence of `Array#filter` producing\n\t// a new value reference on each call.\n\tblockTypes = blockTypes.filter(\n\t\t( blockType ) =>\n\t\t\thasBlockSupport( blockType, 'inserter', true ) &&\n\t\t\t( ! search || isMatchingSearchTerm( blockType, search ) ) &&\n\t\t\t( ! blockType.parent ||\n\t\t\t\tincludes( blockType.parent, 'core/post-content' ) )\n\t);\n\n\treturn (\n\t\t<div className=\"edit-post-block-manager__content\">\n\t\t\t{ !! numberOfHiddenBlocks && (\n\t\t\t\t<div className=\"edit-post-block-manager__disabled-blocks-count\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %d: number of blocks. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'%d block is hidden.',\n\t\t\t\t\t\t\t'%d blocks are hidden.',\n\t\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<SearchControl\n\t\t\t\tlabel={ __( 'Search for a block' ) }\n\t\t\t\tplaceholder={ __( 'Search for a block' ) }\n\t\t\t\tvalue={ search }\n\t\t\t\tonChange={ ( nextSearch ) => setSearch( nextSearch ) }\n\t\t\t\tclassName=\"edit-post-block-manager__search\"\n\t\t\t/>\n\t\t\t<div\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\trole=\"region\"\n\t\t\t\taria-label={ __( 'Available block types' ) }\n\t\t\t\tclassName=\"edit-post-block-manager__results\"\n\t\t\t>\n\t\t\t\t{ blockTypes.length === 0 && (\n\t\t\t\t\t<p className=\"edit-post-block-manager__no-results\">\n\t\t\t\t\t\t{ __( 'No blocks found.' ) }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t\t{ categories.map( ( category ) => (\n\t\t\t\t\t<BlockManagerCategory\n\t\t\t\t\t\tkey={ category.slug }\n\t\t\t\t\t\ttitle={ category.title }\n\t\t\t\t\t\tblockTypes={ filter( blockTypes, {\n\t\t\t\t\t\t\tcategory: category.slug,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t\t<BlockManagerCategory\n\t\t\t\t\ttitle={ __( 'Uncategorized' ) }\n\t\t\t\t\tblockTypes={ filter(\n\t\t\t\t\t\tblockTypes,\n\t\t\t\t\t\t( { category } ) => ! category\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\tconst {\n\t\tgetBlockTypes,\n\t\tgetCategories,\n\t\thasBlockSupport,\n\t\tisMatchingSearchTerm,\n\t} = select( blocksStore );\n\tconst { getPreference } = select( editPostStore );\n\tconst hiddenBlockTypes = getPreference( 'hiddenBlockTypes' );\n\tconst numberOfHiddenBlocks =\n\t\tisArray( hiddenBlockTypes ) && hiddenBlockTypes.length;\n\n\treturn {\n\t\tblockTypes: getBlockTypes(),\n\t\tcategories: getCategories(),\n\t\thasBlockSupport,\n\t\tisMatchingSearchTerm,\n\t\tnumberOfHiddenBlocks,\n\t};\n} )( BlockManager );\n"]}
@@ -16,10 +16,11 @@ var _i18n = require("@wordpress/i18n");
16
16
  /**
17
17
  * WordPress dependencies
18
18
  */
19
- function BlockManagerShowAll({
20
- checked,
21
- onChange
22
- }) {
19
+ function BlockManagerShowAll(_ref) {
20
+ let {
21
+ checked,
22
+ onChange
23
+ } = _ref;
23
24
  const instanceId = (0, _compose.useInstanceId)(BlockManagerShowAll);
24
25
  const id = 'edit-post-block-manager__show-all-' + instanceId;
25
26
  return (0, _element.createElement)("div", {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/block-manager/show-all.js"],"names":["BlockManagerShowAll","checked","onChange","instanceId","id","event","target"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;AAKe,SAASA,mBAAT,CAA8B;AAAEC,EAAAA,OAAF;AAAWC,EAAAA;AAAX,CAA9B,EAAsD;AACpE,QAAMC,UAAU,GAAG,4BAAeH,mBAAf,CAAnB;AACA,QAAMI,EAAE,GAAG,uCAAuCD,UAAlD;AAEA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AACC,IAAA,OAAO,EAAGC,EADX;AAEC,IAAA,SAAS,EAAC;AAFX;AAKE;AACA,gBAAI,cAAJ,CANF,CADD,EAUC,4BAAC,sBAAD;AACC,IAAA,EAAE,EAAGA,EADN;AAEC,IAAA,OAAO,EAAGH,OAFX;AAGC,IAAA,QAAQ,EAAKI,KAAF,IAAaH,QAAQ,CAAEG,KAAK,CAACC,MAAN,CAAaL,OAAf;AAHjC,IAVD,CADD;AAkBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { FormToggle } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport default function BlockManagerShowAll( { checked, onChange } ) {\n\tconst instanceId = useInstanceId( BlockManagerShowAll );\n\tconst id = 'edit-post-block-manager__show-all-' + instanceId;\n\n\treturn (\n\t\t<div className=\"edit-post-block-manager__show-all\">\n\t\t\t<label\n\t\t\t\thtmlFor={ id }\n\t\t\t\tclassName=\"edit-post-block-manager__show-all-label\"\n\t\t\t>\n\t\t\t\t{\n\t\t\t\t\t/* translators: Checkbox toggle label */\n\t\t\t\t\t__( 'Show section' )\n\t\t\t\t}\n\t\t\t</label>\n\t\t\t<FormToggle\n\t\t\t\tid={ id }\n\t\t\t\tchecked={ checked }\n\t\t\t\tonChange={ ( event ) => onChange( event.target.checked ) }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/block-manager/show-all.js"],"names":["BlockManagerShowAll","checked","onChange","instanceId","id","event","target"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;AAKe,SAASA,mBAAT,OAAsD;AAAA,MAAxB;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,GAAwB;AACpE,QAAMC,UAAU,GAAG,4BAAeH,mBAAf,CAAnB;AACA,QAAMI,EAAE,GAAG,uCAAuCD,UAAlD;AAEA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AACC,IAAA,OAAO,EAAGC,EADX;AAEC,IAAA,SAAS,EAAC;AAFX;AAKE;AACA,gBAAI,cAAJ,CANF,CADD,EAUC,4BAAC,sBAAD;AACC,IAAA,EAAE,EAAGA,EADN;AAEC,IAAA,OAAO,EAAGH,OAFX;AAGC,IAAA,QAAQ,EAAKI,KAAF,IAAaH,QAAQ,CAAEG,KAAK,CAACC,MAAN,CAAaL,OAAf;AAHjC,IAVD,CADD;AAkBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { FormToggle } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport default function BlockManagerShowAll( { checked, onChange } ) {\n\tconst instanceId = useInstanceId( BlockManagerShowAll );\n\tconst id = 'edit-post-block-manager__show-all-' + instanceId;\n\n\treturn (\n\t\t<div className=\"edit-post-block-manager__show-all\">\n\t\t\t<label\n\t\t\t\thtmlFor={ id }\n\t\t\t\tclassName=\"edit-post-block-manager__show-all-label\"\n\t\t\t>\n\t\t\t\t{\n\t\t\t\t\t/* translators: Checkbox toggle label */\n\t\t\t\t\t__( 'Show section' )\n\t\t\t\t}\n\t\t\t</label>\n\t\t\t<FormToggle\n\t\t\t\tid={ id }\n\t\t\t\tchecked={ checked }\n\t\t\t\tonChange={ ( event ) => onChange( event.target.checked ) }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"]}
@@ -94,28 +94,33 @@ const shouldRenderItem = (selectedBlocks, allowedBlocks) => !Array.isArray(allow
94
94
  */
95
95
 
96
96
 
97
- const PluginBlockSettingsMenuItem = ({
98
- allowedBlocks,
99
- icon,
100
- label,
101
- onClick,
102
- small,
103
- role
104
- }) => (0, _element.createElement)(_blockEditor.BlockSettingsMenuControls, null, ({
105
- selectedBlocks,
106
- onClose
107
- }) => {
108
- if (!shouldRenderItem(selectedBlocks, allowedBlocks)) {
109
- return null;
110
- }
97
+ const PluginBlockSettingsMenuItem = _ref => {
98
+ let {
99
+ allowedBlocks,
100
+ icon,
101
+ label,
102
+ onClick,
103
+ small,
104
+ role
105
+ } = _ref;
106
+ return (0, _element.createElement)(_blockEditor.BlockSettingsMenuControls, null, _ref2 => {
107
+ let {
108
+ selectedBlocks,
109
+ onClose
110
+ } = _ref2;
111
111
 
112
- return (0, _element.createElement)(_components.MenuItem, {
113
- onClick: (0, _compose.compose)(onClick, onClose),
114
- icon: icon,
115
- label: small ? label : undefined,
116
- role: role
117
- }, !small && label);
118
- });
112
+ if (!shouldRenderItem(selectedBlocks, allowedBlocks)) {
113
+ return null;
114
+ }
115
+
116
+ return (0, _element.createElement)(_components.MenuItem, {
117
+ onClick: (0, _compose.compose)(onClick, onClose),
118
+ icon: icon,
119
+ label: small ? label : undefined,
120
+ role: role
121
+ }, !small && label);
122
+ });
123
+ };
119
124
 
120
125
  var _default = PluginBlockSettingsMenuItem;
121
126
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/block-settings-menu/plugin-block-settings-menu-item.js"],"names":["isEverySelectedBlockAllowed","selected","allowed","length","shouldRenderItem","selectedBlocks","allowedBlocks","Array","isArray","PluginBlockSettingsMenuItem","icon","label","onClick","small","role","onClose","undefined"],"mappings":";;;;;;;;;AAGA;;AAKA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KANd,CADD;AAUA,CAfF,CARD;;eA2BeF,2B","sourcesContent":["/**\n * External dependencies\n */\nimport { difference } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { BlockSettingsMenuControls } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\n\nconst isEverySelectedBlockAllowed = ( selected, allowed ) =>\n\tdifference( selected, allowed ).length === 0;\n\n/**\n * Plugins may want to add an item to the menu either for every block\n * or only for the specific ones provided in the `allowedBlocks` component property.\n *\n * If there are multiple blocks selected the item will be rendered if every block\n * is of one allowed type (not necessarily the same).\n *\n * @param {string[]} selectedBlocks Array containing the names of the blocks selected\n * @param {string[]} allowedBlocks Array containing the names of the blocks allowed\n * @return {boolean} Whether the item will be rendered or not.\n */\nconst shouldRenderItem = ( selectedBlocks, allowedBlocks ) =>\n\t! Array.isArray( allowedBlocks ) ||\n\tisEverySelectedBlockAllowed( selectedBlocks, allowedBlocks );\n\n/**\n * Renders a new item in the block settings menu.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.\n * @param {WPBlockTypeIconRender} [props.icon] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.\n * @param {string} props.label The menu item text.\n * @param {Function} props.onClick Callback function to be executed when the user click the menu item.\n * @param {boolean} [props.small] Whether to render the label or not.\n * @param {string} [props.role] The ARIA role for the menu item.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginBlockSettingsMenuItem = wp.editPost.PluginBlockSettingsMenuItem;\n *\n * function doOnClick(){\n * \t// To be called when the user clicks the menu item.\n * }\n *\n * function MyPluginBlockSettingsMenuItem() {\n * \treturn wp.element.createElement(\n * \t\tPluginBlockSettingsMenuItem,\n * \t\t{\n * \t\t\tallowedBlocks: [ 'core/paragraph' ],\n * \t\t\ticon: 'dashicon-name',\n * \t\t\tlabel: __( 'Menu item text' ),\n * \t\t\tonClick: doOnClick,\n * \t\t}\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginBlockSettingsMenuItem } from '@wordpress/edit-post';\n *\n * const doOnClick = ( ) => {\n * // To be called when the user clicks the menu item.\n * };\n *\n * const MyPluginBlockSettingsMenuItem = () => (\n * <PluginBlockSettingsMenuItem\n * \t\tallowedBlocks={ [ 'core/paragraph' ] }\n * \t\ticon='dashicon-name'\n * \t\tlabel={ __( 'Menu item text' ) }\n * \t\tonClick={ doOnClick } />\n * );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\nconst PluginBlockSettingsMenuItem = ( {\n\tallowedBlocks,\n\ticon,\n\tlabel,\n\tonClick,\n\tsmall,\n\trole,\n} ) => (\n\t<BlockSettingsMenuControls>\n\t\t{ ( { selectedBlocks, onClose } ) => {\n\t\t\tif ( ! shouldRenderItem( selectedBlocks, allowedBlocks ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ compose( onClick, onClose ) }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ small ? label : undefined }\n\t\t\t\t\trole={ role }\n\t\t\t\t>\n\t\t\t\t\t{ ! small && label }\n\t\t\t\t</MenuItem>\n\t\t\t);\n\t\t} }\n\t</BlockSettingsMenuControls>\n);\n\nexport default PluginBlockSettingsMenuItem;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/block-settings-menu/plugin-block-settings-menu-item.js"],"names":["isEverySelectedBlockAllowed","selected","allowed","length","shouldRenderItem","selectedBlocks","allowedBlocks","Array","isArray","PluginBlockSettingsMenuItem","icon","label","onClick","small","role","onClose","undefined"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKA,MAAM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ApC;;eA2BeF,2B","sourcesContent":["/**\n * External dependencies\n */\nimport { difference } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { BlockSettingsMenuControls } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\n\nconst isEverySelectedBlockAllowed = ( selected, allowed ) =>\n\tdifference( selected, allowed ).length === 0;\n\n/**\n * Plugins may want to add an item to the menu either for every block\n * or only for the specific ones provided in the `allowedBlocks` component property.\n *\n * If there are multiple blocks selected the item will be rendered if every block\n * is of one allowed type (not necessarily the same).\n *\n * @param {string[]} selectedBlocks Array containing the names of the blocks selected\n * @param {string[]} allowedBlocks Array containing the names of the blocks allowed\n * @return {boolean} Whether the item will be rendered or not.\n */\nconst shouldRenderItem = ( selectedBlocks, allowedBlocks ) =>\n\t! Array.isArray( allowedBlocks ) ||\n\tisEverySelectedBlockAllowed( selectedBlocks, allowedBlocks );\n\n/**\n * Renders a new item in the block settings menu.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.\n * @param {WPBlockTypeIconRender} [props.icon] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.\n * @param {string} props.label The menu item text.\n * @param {Function} props.onClick Callback function to be executed when the user click the menu item.\n * @param {boolean} [props.small] Whether to render the label or not.\n * @param {string} [props.role] The ARIA role for the menu item.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginBlockSettingsMenuItem = wp.editPost.PluginBlockSettingsMenuItem;\n *\n * function doOnClick(){\n * \t// To be called when the user clicks the menu item.\n * }\n *\n * function MyPluginBlockSettingsMenuItem() {\n * \treturn wp.element.createElement(\n * \t\tPluginBlockSettingsMenuItem,\n * \t\t{\n * \t\t\tallowedBlocks: [ 'core/paragraph' ],\n * \t\t\ticon: 'dashicon-name',\n * \t\t\tlabel: __( 'Menu item text' ),\n * \t\t\tonClick: doOnClick,\n * \t\t}\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginBlockSettingsMenuItem } from '@wordpress/edit-post';\n *\n * const doOnClick = ( ) => {\n * // To be called when the user clicks the menu item.\n * };\n *\n * const MyPluginBlockSettingsMenuItem = () => (\n * <PluginBlockSettingsMenuItem\n * \t\tallowedBlocks={ [ 'core/paragraph' ] }\n * \t\ticon='dashicon-name'\n * \t\tlabel={ __( 'Menu item text' ) }\n * \t\tonClick={ doOnClick } />\n * );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\nconst PluginBlockSettingsMenuItem = ( {\n\tallowedBlocks,\n\ticon,\n\tlabel,\n\tonClick,\n\tsmall,\n\trole,\n} ) => (\n\t<BlockSettingsMenuControls>\n\t\t{ ( { selectedBlocks, onClose } ) => {\n\t\t\tif ( ! shouldRenderItem( selectedBlocks, allowedBlocks ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ compose( onClick, onClose ) }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ small ? label : undefined }\n\t\t\t\t\trole={ role }\n\t\t\t\t>\n\t\t\t\t\t{ ! small && label }\n\t\t\t\t</MenuItem>\n\t\t\t);\n\t\t} }\n\t</BlockSettingsMenuControls>\n);\n\nexport default PluginBlockSettingsMenuItem;\n"]}
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.default = exports.BrowserURL = void 0;
6
7
  exports.getPostEditURL = getPostEditURL;
7
8
  exports.getPostTrashedURL = getPostTrashedURL;
8
- exports.default = exports.BrowserURL = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
@@ -18,9 +18,10 @@ var _listenerHooks = require("./listener-hooks");
18
18
  * @param {number} postId The id of the post.
19
19
  * @return {null} This is a data component so does not render any ui.
20
20
  */
21
- function EditorInitialization({
22
- postId
23
- }) {
21
+ function EditorInitialization(_ref) {
22
+ let {
23
+ postId
24
+ } = _ref;
24
25
  (0, _listenerHooks.useBlockSelectionListener)(postId);
25
26
  (0, _listenerHooks.useUpdatePostLinkListener)(postId);
26
27
  return null;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/editor-initialization/index.js"],"names":["EditorInitialization","postId"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,oBAAT,CAA+B;AAAEC,EAAAA;AAAF,CAA/B,EAA4C;AAC1D,gDAA2BA,MAA3B;AACA,gDAA2BA,MAA3B;AACA,SAAO,IAAP;AACA","sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tuseBlockSelectionListener,\n\tuseUpdatePostLinkListener,\n} from './listener-hooks';\n\n/**\n * Data component used for initializing the editor and re-initializes\n * when postId changes or on unmount.\n *\n * @param {number} postId The id of the post.\n * @return {null} This is a data component so does not render any ui.\n */\nexport default function EditorInitialization( { postId } ) {\n\tuseBlockSelectionListener( postId );\n\tuseUpdatePostLinkListener( postId );\n\treturn null;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/editor-initialization/index.js"],"names":["EditorInitialization","postId"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,oBAAT,OAA4C;AAAA,MAAb;AAAEC,IAAAA;AAAF,GAAa;AAC1D,gDAA2BA,MAA3B;AACA,gDAA2BA,MAA3B;AACA,SAAO,IAAP;AACA","sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tuseBlockSelectionListener,\n\tuseUpdatePostLinkListener,\n} from './listener-hooks';\n\n/**\n * Data component used for initializing the editor and re-initializes\n * when postId changes or on unmount.\n *\n * @param {number} postId The id of the post.\n * @return {null} This is a data component so does not render any ui.\n */\nexport default function EditorInitialization( { postId } ) {\n\tuseBlockSelectionListener( postId );\n\tuseUpdatePostLinkListener( postId );\n\treturn null;\n}\n"]}
@@ -16,7 +16,8 @@ exports.onChangeListener = void 0;
16
16
  *
17
17
  * @return {Function} Listener creator.
18
18
  */
19
- const onChangeListener = (selector, listener, initial = false) => {
19
+ const onChangeListener = function (selector, listener) {
20
+ let initial = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
20
21
  let previousValue = selector();
21
22
 
22
23
  if (initial) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/editor-initialization/utils.js"],"names":["onChangeListener","selector","listener","initial","previousValue","selectedValue"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAG,CAAEC,QAAF,EAAYC,QAAZ,EAAsBC,OAAO,GAAG,KAAhC,KAA2C;AAC1E,MAAIC,aAAa,GAAGH,QAAQ,EAA5B;;AACA,MAAKE,OAAL,EAAe;AACdD,IAAAA,QAAQ,CAAED,QAAQ,EAAV,CAAR;AACA;;AACD,SAAO,MAAM;AACZ,UAAMI,aAAa,GAAGJ,QAAQ,EAA9B;;AACA,QAAKI,aAAa,KAAKD,aAAvB,EAAuC;AACtCA,MAAAA,aAAa,GAAGC,aAAhB;AACAH,MAAAA,QAAQ,CAAEG,aAAF,CAAR;AACA;AACD,GAND;AAOA,CAZM","sourcesContent":["/**\n * Given a selector returns a functions that returns the listener only\n * if the returned value from the selector changes.\n *\n * @param {Function} selector Selector.\n * @param {Function} listener Listener.\n * @param {boolean} initial Flags whether listener should be invoked on\n * initial call.\n *\n * @return {Function} Listener creator.\n */\nexport const onChangeListener = ( selector, listener, initial = false ) => {\n\tlet previousValue = selector();\n\tif ( initial ) {\n\t\tlistener( selector() );\n\t}\n\treturn () => {\n\t\tconst selectedValue = selector();\n\t\tif ( selectedValue !== previousValue ) {\n\t\t\tpreviousValue = selectedValue;\n\t\t\tlistener( selectedValue );\n\t\t}\n\t};\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/editor-initialization/utils.js"],"names":["onChangeListener","selector","listener","initial","previousValue","selectedValue"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAG,UAAEC,QAAF,EAAYC,QAAZ,EAA2C;AAAA,MAArBC,OAAqB,uEAAX,KAAW;AAC1E,MAAIC,aAAa,GAAGH,QAAQ,EAA5B;;AACA,MAAKE,OAAL,EAAe;AACdD,IAAAA,QAAQ,CAAED,QAAQ,EAAV,CAAR;AACA;;AACD,SAAO,MAAM;AACZ,UAAMI,aAAa,GAAGJ,QAAQ,EAA9B;;AACA,QAAKI,aAAa,KAAKD,aAAvB,EAAuC;AACtCA,MAAAA,aAAa,GAAGC,aAAhB;AACAH,MAAAA,QAAQ,CAAEG,aAAF,CAAR;AACA;AACD,GAND;AAOA,CAZM","sourcesContent":["/**\n * Given a selector returns a functions that returns the listener only\n * if the returned value from the selector changes.\n *\n * @param {Function} selector Selector.\n * @param {Function} listener Listener.\n * @param {boolean} initial Flags whether listener should be invoked on\n * initial call.\n *\n * @return {Function} Listener creator.\n */\nexport const onChangeListener = ( selector, listener, initial = false ) => {\n\tlet previousValue = selector();\n\tif ( initial ) {\n\t\tlistener( selector() );\n\t}\n\treturn () => {\n\t\tconst selectedValue = selector();\n\t\tif ( selectedValue !== previousValue ) {\n\t\t\tpreviousValue = selectedValue;\n\t\t\tlistener( selectedValue );\n\t\t}\n\t};\n};\n"]}
@@ -38,11 +38,12 @@ var _store = require("../../../store");
38
38
  /**
39
39
  * Internal dependencies
40
40
  */
41
- function FullscreenModeClose({
42
- showTooltip,
43
- icon,
44
- href
45
- }) {
41
+ function FullscreenModeClose(_ref) {
42
+ let {
43
+ showTooltip,
44
+ icon,
45
+ href
46
+ } = _ref;
46
47
  const {
47
48
  isActive,
48
49
  isRequestingSiteIcon,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/header/fullscreen-mode-close/index.js"],"names":["FullscreenModeClose","showTooltip","icon","href","isActive","isRequestingSiteIcon","postType","siteIconUrl","select","getCurrentPostType","editorStore","isFeatureActive","editPostStore","getEntityRecord","getPostType","isResolving","coreStore","siteData","undefined","site_icon_url","disableMotion","buttonIcon","wordpress","effect","expand","scale","borderRadius","transition","type","duration","post_type","slug"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAxBA;AACA;AACA;;AAGA;AACA;AACA;;AAcA;AACA;AACA;AAGA,SAASA,mBAAT,CAA8B;AAAEC,EAAAA,WAAF;AAAeC,EAAAA,IAAf;AAAqBC,EAAAA;AAArB,CAA9B,EAA4D;AAC3D,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,oBAAZ;AAAkCC,IAAAA,QAAlC;AAA4CC,IAAAA;AAA5C,MAA4D,qBAC/DC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAyBD,MAAM,CAAEE,aAAF,CAArC;AACA,UAAM;AAAEC,MAAAA;AAAF,QAAsBH,MAAM,CAAEI,YAAF,CAAlC;AACA,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA,WAAnB;AAAgCC,MAAAA;AAAhC,QAAgDP,MAAM,CAC3DQ,eAD2D,CAA5D;AAGA,UAAMC,QAAQ,GACbJ,eAAe,CAAE,MAAF,EAAU,gBAAV,EAA4BK,SAA5B,CAAf,IAA0D,EAD3D;AAGA,WAAO;AACNd,MAAAA,QAAQ,EAAEO,eAAe,CAAE,gBAAF,CADnB;AAENN,MAAAA,oBAAoB,EAAEU,WAAW,CAAE,iBAAF,EAAqB,CACrD,MADqD,EAErD,gBAFqD,EAGrDG,SAHqD,CAArB,CAF3B;AAONZ,MAAAA,QAAQ,EAAEQ,WAAW,CAAEL,kBAAkB,EAApB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AA,SAAS,EAAExB,QAAQ,CAACyB;AADK,KAA1B,CAJF;AAQC,IAAA,KAAK,EAAG,iBACPzB,QADO,EAEP,CAAE,QAAF,EAAY,YAAZ,CAFO,EAGP,cAAI,MAAJ,CAHO,CART;AAaC,IAAA,WAAW,EAAGL;AAbf,KAeGoB,UAfH,CADD,CADD;AAqBA;;eAEcrB,mB","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction FullscreenModeClose( { showTooltip, icon, href } ) {\n\tconst { isActive, isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { isFeatureActive } = select( editPostStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } = select(\n\t\t\t\tcoreStore\n\t\t\t);\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\t\treturn {\n\t\t\t\tisActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( getCurrentPostType() ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! isActive || ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.7,\n\t\t\tborderRadius: 0,\n\t\t\ttransition: { type: 'tween', duration: '0.2' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close has-icon\"\n\t\t\t\thref={\n\t\t\t\t\thref ??\n\t\t\t\t\taddQueryArgs( 'edit.php', {\n\t\t\t\t\t\tpost_type: postType.slug,\n\t\t\t\t\t} )\n\t\t\t\t}\n\t\t\t\tlabel={ get(\n\t\t\t\t\tpostType,\n\t\t\t\t\t[ 'labels', 'view_items' ],\n\t\t\t\t\t__( 'Back' )\n\t\t\t\t) }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/header/fullscreen-mode-close/index.js"],"names":["FullscreenModeClose","showTooltip","icon","href","isActive","isRequestingSiteIcon","postType","siteIconUrl","select","getCurrentPostType","editorStore","isFeatureActive","editPostStore","getEntityRecord","getPostType","isResolving","coreStore","siteData","undefined","site_icon_url","disableMotion","buttonIcon","wordpress","effect","expand","scale","border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} from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction FullscreenModeClose( { showTooltip, icon, href } ) {\n\tconst { isActive, isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { isFeatureActive } = select( editPostStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } = select(\n\t\t\t\tcoreStore\n\t\t\t);\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\t\treturn {\n\t\t\t\tisActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( getCurrentPostType() ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! isActive || ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.7,\n\t\t\tborderRadius: 0,\n\t\t\ttransition: { type: 'tween', duration: '0.2' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close has-icon\"\n\t\t\t\thref={\n\t\t\t\t\thref ??\n\t\t\t\t\taddQueryArgs( 'edit.php', {\n\t\t\t\t\t\tpost_type: postType.slug,\n\t\t\t\t\t} )\n\t\t\t\t}\n\t\t\t\tlabel={ get(\n\t\t\t\t\tpostType,\n\t\t\t\t\t[ 'labels', 'view_items' ],\n\t\t\t\t\t__( 'Back' )\n\t\t\t\t) }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"]}
@@ -42,17 +42,18 @@ var _store = require("../../../store");
42
42
  /**
43
43
  * Internal dependencies
44
44
  */
45
- function HeaderToolbar({
46
- hasRedo,
47
- hasUndo,
48
- redo,
49
- undo,
50
- showInserter,
51
- showKeyboardHideButton,
52
- getStylesFromColorScheme,
53
- onHideKeyboard,
54
- isRTL
55
- }) {
45
+ function HeaderToolbar(_ref) {
46
+ let {
47
+ hasRedo,
48
+ hasUndo,
49
+ redo,
50
+ undo,
51
+ showInserter,
52
+ showKeyboardHideButton,
53
+ getStylesFromColorScheme,
54
+ onHideKeyboard,
55
+ isRTL
56
+ } = _ref;
56
57
  const scrollViewRef = (0, _element.useRef)(null);
57
58
 
58
59
  const scrollToStart = () => {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.native.js"],"names":["HeaderToolbar","hasRedo","hasUndo","redo","undo","showInserter","showKeyboardHideButton","getStylesFromColorScheme","onHideKeyboard","isRTL","scrollViewRef","scrollToStart","isAndroid","Platform","OS","current","scrollToEnd","scrollTo","x","renderHistoryButtons","buttons","undoIcon","redoIcon","hint","reverse","styles","container","containerDark","scrollableContent","keyboardHideContainer","keyboardClose","select","getBlockRootClientId","getBlockSelectionEnd","hasInserterItems","blockEditorStore","getEditorSettings","editorStore","hasEditorRedo","hasEditorUndo","editPostStore","getEditorMode","richEditingEnabled","isTextModeEnabled","getSettings","dispatch","clearSelectedBlock","togglePostTitleSelection","isLargeViewport","withPreferredColorScheme"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAKA;;AAKA;;AACA;;AA9BA;AACA;AACA;;AAGA;AACA;AACA;;AAmBA;AACA;AACA;AAIA,SAASA,aAAT,CAAwB;AACvBC,EAAAA,OADuB;AAEvBC,EAAAA,OAFuB;AAGvBC,EAAAA,IAHuB;AAIvBC,EAAAA,IAJuB;AAKvBC,EAAAA,YALuB;AAMvBC,EAAAA,sBANuB;AAOvBC,EAAAA,wBAPuB;AAQvBC,EAAAA,cARuB;AASvBC,EAAAA;AATuB,CAAxB,EAUI;AACH,QAAMC,aAAa,GAAG,qBAAQ,IAAR,CAAtB;;AACA,QAAMC,aAAa,GAAG,MAAM;AAC3B;AACA,UAAMC,SAAS,GAAGC,sBAASC,EAAT,KAAgB,SAAlC;;AACA,QAAKF,SAAS,IAAIH,KAAlB,EAA0B;AACzBC,MAAAA,aAAa,CAACK,OAAd,CAAsBC,WAAtB;AACA,KAFD,MAEO;AACNN,MAAAA,aAAa,CAACK,OAAd,CAAsBE,QAAtB,CAAgC;AAAEC,QAAAA,CAAC,EAAE;AAAL,OAAhC;AACA;AACD,GARD;;AASA,QAAMC,oBAAoB,GAAG,MAAM;AAClC,UAAMC,OAAO,GAAG;AACf;AACA,gCAAC,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F,CAAR,CAAwBlC,IADxB;AAENC,IAAAA,IAAI,EAAEyC,QAAQ,CAAER,aAAF,CAAR,CAAwBjC,IAFxB;;AAGNI,IAAAA,cAAc,GAAG;AAChBsC,MAAAA,kBAAkB;AAClBC,MAAAA,wBAAwB,CAAE,KAAF,CAAxB;AACA;;AANK,GAAP;AAQA,CAZD,CAvBuB,EAoCvB,iCAAmB;AAAEC,EAAAA,eAAe,EAAE;AAAnB,CAAnB,CApCuB,EAqCvBC,iCArCuB,CAAT,EAsCVjD,aAtCU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, ScrollView, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useRef } from '@wordpress/element';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { withViewportMatch } from '@wordpress/viewport';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInserter,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ToolbarGroup, ToolbarButton } from '@wordpress/components';\nimport {\n\tkeyboardClose,\n\tundo as undoIcon,\n\tredo as redoIcon,\n} from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { store as editPostStore } from '../../../store';\n\nfunction HeaderToolbar( {\n\thasRedo,\n\thasUndo,\n\tredo,\n\tundo,\n\tshowInserter,\n\tshowKeyboardHideButton,\n\tgetStylesFromColorScheme,\n\tonHideKeyboard,\n\tisRTL,\n} ) {\n\tconst scrollViewRef = useRef( null );\n\tconst scrollToStart = () => {\n\t\t// scrollview doesn't seem to automatically adjust to RTL on Android so, scroll to end when Android\n\t\tconst isAndroid = Platform.OS === 'android';\n\t\tif ( isAndroid && isRTL ) {\n\t\t\tscrollViewRef.current.scrollToEnd();\n\t\t} else {\n\t\t\tscrollViewRef.current.scrollTo( { x: 0 } );\n\t\t}\n\t};\n\tconst renderHistoryButtons = () => {\n\t\tconst buttons = [\n\t\t\t/* TODO: replace with EditorHistoryRedo and EditorHistoryUndo */\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"undoButton\"\n\t\t\t\ttitle={ __( 'Undo' ) }\n\t\t\t\ticon={ ! isRTL ? undoIcon : redoIcon }\n\t\t\t\tisDisabled={ ! hasUndo }\n\t\t\t\tonClick={ undo }\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Double tap to undo last change' ),\n\t\t\t\t} }\n\t\t\t/>,\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"redoButton\"\n\t\t\t\ttitle={ __( 'Redo' ) }\n\t\t\t\ticon={ ! isRTL ? redoIcon : undoIcon }\n\t\t\t\tisDisabled={ ! hasRedo }\n\t\t\t\tonClick={ redo }\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Double tap to redo last change' ),\n\t\t\t\t} }\n\t\t\t/>,\n\t\t];\n\n\t\treturn isRTL ? buttons.reverse() : buttons;\n\t};\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ getStylesFromColorScheme(\n\t\t\t\tstyles.container,\n\t\t\t\tstyles.containerDark\n\t\t\t) }\n\t\t>\n\t\t\t<ScrollView\n\t\t\t\tref={ scrollViewRef }\n\t\t\t\tonContentSizeChange={ scrollToStart }\n\t\t\t\thorizontal={ true }\n\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\talwaysBounceHorizontal={ false }\n\t\t\t\tcontentContainerStyle={ styles.scrollableContent }\n\t\t\t>\n\t\t\t\t<Inserter disabled={ ! showInserter } />\n\t\t\t\t{ renderHistoryButtons() }\n\t\t\t\t<BlockToolbar />\n\t\t\t</ScrollView>\n\t\t\t{ showKeyboardHideButton && (\n\t\t\t\t<ToolbarGroup passedStyle={ styles.keyboardHideContainer }>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Hide keyboard' ) }\n\t\t\t\t\t\ticon={ keyboardClose }\n\t\t\t\t\t\tonClick={ onHideKeyboard }\n\t\t\t\t\t\textraProps={ {\n\t\t\t\t\t\t\thint: __( 'Tap to hide the keyboard' ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockSelectionEnd,\n\t\t\thasInserterItems,\n\t\t} = select( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\treturn {\n\t\t\thasRedo: select( editorStore ).hasEditorRedo(),\n\t\t\thasUndo: select( editorStore ).hasEditorUndo(),\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tshowInserter:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'visual' &&\n\t\t\t\tgetEditorSettings().richEditingEnabled &&\n\t\t\t\thasInserterItems(\n\t\t\t\t\tgetBlockRootClientId( getBlockSelectionEnd() )\n\t\t\t\t),\n\t\t\tisTextModeEnabled:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'text',\n\t\t\tisRTL: select( blockEditorStore ).getSettings().isRTL,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { clearSelectedBlock } = dispatch( blockEditorStore );\n\t\tconst { togglePostTitleSelection } = dispatch( editorStore );\n\n\t\treturn {\n\t\t\tredo: dispatch( editorStore ).redo,\n\t\t\tundo: dispatch( editorStore ).undo,\n\t\t\tonHideKeyboard() {\n\t\t\t\tclearSelectedBlock();\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t};\n\t} ),\n\twithViewportMatch( { isLargeViewport: 'medium' } ),\n\twithPreferredColorScheme,\n] )( HeaderToolbar );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.native.js"],"names":["HeaderToolbar","hasRedo","hasUndo","redo","undo","showInserter","showKeyboardHideButton","getStylesFromColorScheme","onHideKeyboard","isRTL","scrollViewRef","scrollToStart","isAndroid","Platform","OS","current","scrollToEnd","scrollTo","x","renderHistoryButtons","buttons","undoIcon","redoIcon","hint","reverse","styles","container","containerDark","scrollableContent","keyboardHideContainer","keyboardClose","select","getBlockRootClientId","getBlockSelectionEnd","hasInserterItems","blockEditorStore","getEditorSettings","editorStore","hasEditorRedo","hasEditorUndo","editPostStore","getEditorMode","richEditingEnabled","isTextModeEnabled","getSettings","dispatch","clearSelectedBlock","togglePostTitleSelection","isLargeViewport","withPreferredColorScheme"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAKA;;AAKA;;AACA;;AA9BA;AACA;AACA;;AAGA;AACA;AACA;;AAmBA;AACA;AACA;AAIA,SAASA,aAAT,OAUI;AAAA,MAVoB;AACvBC,IAAAA,OADuB;AAEvBC,IAAAA,OAFuB;AAGvBC,IAAAA,IAHuB;AAIvBC,IAAAA,IAJuB;AAKvBC,IAAAA,YALuB;AAMvBC,IAAAA,sBANuB;AAOvBC,IAAAA,wBAPuB;AAQvBC,IAAAA,cARuB;AASvBC,IAAAA;AATuB,GAUpB;AACH,QAAMC,aAAa,GAAG,qBAAQ,IAAR,CAAtB;;AACA,QAAMC,aAAa,GAAG,MAAM;AAC3B;AACA,UAAMC,SAAS,GAAGC,sBAASC,EAAT,KAAgB,SAAlC;;AACA,QAAKF,SAAS,IAAIH,KAAlB,EAA0B;AACzBC,MAAAA,aAAa,CAACK,OAAd,CAAsBC,WAAtB;AACA,KAFD,MAEO;AACNN,MAAAA,aAAa,CAACK,OAAd,CAAsBE,QAAtB,CAAgC;AAAEC,QAAAA,CAAC,EAAE;AAAL,OAAhC;AACA;AACD,GARD;;AASA,QAAMC,oBAAoB,GAAG,MAAM;AAClC,UAAMC,OAAO,GAAG;AACf;AACA,gCAAC,yBAAD;AACC,MAAA,GAAG,EAAC,YADL;AAEC,MAAA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AEyC,QAAQ,CAAER,aAAF,CAAR,CAAwBjC,IAFxB;;AAGNI,IAAAA,cAAc,GAAG;AAChBsC,MAAAA,kBAAkB;AAClBC,MAAAA,wBAAwB,CAAE,KAAF,CAAxB;AACA;;AANK,GAAP;AAQA,CAZD,CAvBuB,EAoCvB,iCAAmB;AAAEC,EAAAA,eAAe,EAAE;AAAnB,CAAnB,CApCuB,EAqCvBC,iCArCuB,CAAT,EAsCVjD,aAtCU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, ScrollView, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useRef } from '@wordpress/element';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { withViewportMatch } from '@wordpress/viewport';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInserter,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ToolbarGroup, ToolbarButton } from '@wordpress/components';\nimport {\n\tkeyboardClose,\n\tundo as undoIcon,\n\tredo as redoIcon,\n} from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { store as editPostStore } from '../../../store';\n\nfunction HeaderToolbar( {\n\thasRedo,\n\thasUndo,\n\tredo,\n\tundo,\n\tshowInserter,\n\tshowKeyboardHideButton,\n\tgetStylesFromColorScheme,\n\tonHideKeyboard,\n\tisRTL,\n} ) {\n\tconst scrollViewRef = useRef( null );\n\tconst scrollToStart = () => {\n\t\t// scrollview doesn't seem to automatically adjust to RTL on Android so, scroll to end when Android\n\t\tconst isAndroid = Platform.OS === 'android';\n\t\tif ( isAndroid && isRTL ) {\n\t\t\tscrollViewRef.current.scrollToEnd();\n\t\t} else {\n\t\t\tscrollViewRef.current.scrollTo( { x: 0 } );\n\t\t}\n\t};\n\tconst renderHistoryButtons = () => {\n\t\tconst buttons = [\n\t\t\t/* TODO: replace with EditorHistoryRedo and EditorHistoryUndo */\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"undoButton\"\n\t\t\t\ttitle={ __( 'Undo' ) }\n\t\t\t\ticon={ ! isRTL ? undoIcon : redoIcon }\n\t\t\t\tisDisabled={ ! hasUndo }\n\t\t\t\tonClick={ undo }\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Double tap to undo last change' ),\n\t\t\t\t} }\n\t\t\t/>,\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"redoButton\"\n\t\t\t\ttitle={ __( 'Redo' ) }\n\t\t\t\ticon={ ! isRTL ? redoIcon : undoIcon }\n\t\t\t\tisDisabled={ ! hasRedo }\n\t\t\t\tonClick={ redo }\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Double tap to redo last change' ),\n\t\t\t\t} }\n\t\t\t/>,\n\t\t];\n\n\t\treturn isRTL ? buttons.reverse() : buttons;\n\t};\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ getStylesFromColorScheme(\n\t\t\t\tstyles.container,\n\t\t\t\tstyles.containerDark\n\t\t\t) }\n\t\t>\n\t\t\t<ScrollView\n\t\t\t\tref={ scrollViewRef }\n\t\t\t\tonContentSizeChange={ scrollToStart }\n\t\t\t\thorizontal={ true }\n\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\talwaysBounceHorizontal={ false }\n\t\t\t\tcontentContainerStyle={ styles.scrollableContent }\n\t\t\t>\n\t\t\t\t<Inserter disabled={ ! showInserter } />\n\t\t\t\t{ renderHistoryButtons() }\n\t\t\t\t<BlockToolbar />\n\t\t\t</ScrollView>\n\t\t\t{ showKeyboardHideButton && (\n\t\t\t\t<ToolbarGroup passedStyle={ styles.keyboardHideContainer }>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Hide keyboard' ) }\n\t\t\t\t\t\ticon={ keyboardClose }\n\t\t\t\t\t\tonClick={ onHideKeyboard }\n\t\t\t\t\t\textraProps={ {\n\t\t\t\t\t\t\thint: __( 'Tap to hide the keyboard' ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockSelectionEnd,\n\t\t\thasInserterItems,\n\t\t} = select( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\treturn {\n\t\t\thasRedo: select( editorStore ).hasEditorRedo(),\n\t\t\thasUndo: select( editorStore ).hasEditorUndo(),\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tshowInserter:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'visual' &&\n\t\t\t\tgetEditorSettings().richEditingEnabled &&\n\t\t\t\thasInserterItems(\n\t\t\t\t\tgetBlockRootClientId( getBlockSelectionEnd() )\n\t\t\t\t),\n\t\t\tisTextModeEnabled:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'text',\n\t\t\tisRTL: select( blockEditorStore ).getSettings().isRTL,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { clearSelectedBlock } = dispatch( blockEditorStore );\n\t\tconst { togglePostTitleSelection } = dispatch( editorStore );\n\n\t\treturn {\n\t\t\tredo: dispatch( editorStore ).redo,\n\t\t\tundo: dispatch( editorStore ).undo,\n\t\t\tonHideKeyboard() {\n\t\t\t\tclearSelectedBlock();\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t};\n\t} ),\n\twithViewportMatch( { isLargeViewport: 'medium' } ),\n\twithPreferredColorScheme,\n] )( HeaderToolbar );\n"]}
@@ -46,9 +46,10 @@ var _templateTitle = _interopRequireDefault(require("./template-title"));
46
46
  /**
47
47
  * Internal dependencies
48
48
  */
49
- function Header({
50
- setEntitiesSavedStatesCallback
51
- }) {
49
+ function Header(_ref) {
50
+ let {
51
+ setEntitiesSavedStatesCallback
52
+ } = _ref;
52
53
  const {
53
54
  hasActiveMetaboxes,
54
55
  isPublishSidebarOpened,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/header/index.js"],"names":["Header","setEntitiesSavedStatesCallback","hasActiveMetaboxes","isPublishSidebarOpened","isSaving","showIconLabels","hasReducedUI","select","editPostStore","hasMetaBoxes","isSavingMetaBoxes","isFeatureActive","isLargeViewport","classes","undefined"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAUA,SAASA,MAAT,CAAiB;AAAEC,EAAAA;AAAF,CAAjB,EAAsD;AACrD,QAAM;AACLC,IAAAA,kBADK;AAELC,IAAAA,sBAFK;AAGLC,IAAAA,QAHK;AAILC,IAAAA,cAJK;AAKLC,IAAAA;AALK,MAMF,qBACDC,MAAF,KAAgB;AACfL,IAAAA,kBAAkB,EAAEK,MAAM,CAAEC,YAAF,CAAN,CAAwBC,YAAxB,EADL;AAEfN,IAAAA,sBAAsB,EAAEI,MAAM,CAC7BC,YAD6B,CAAN,CAEtBL,sBAFsB,EAFT;AAKfC,IAAAA,QAAQ,EAAEG,MAAM,CAAEC,YAAF,CAAN,CAAwBE,iBAAxB,EALK;AAMfL,IAAAA,cAAc,EAAEE,MAAM,CAAEC,YAAF,CAAN,CAAwBG,eAAxB,CACf,gBADe,CAND;AASfL,IAAAA,YAAY,EAAEC,MAAM,CAAEC,YAAF,CAAN,CAAwBG,eAAxB,CACb,WADa;AATC,GAAhB,CADG,EAcH,EAdG,CANJ;AAuBA,QAAMC,eAAe,GAAG,+BAAkB,OAAlB,CAAxB;AAEA,QAAMC,OAAO,GAAG,yBAAY,kBAAZ,EAAgC;AAC/C,sBAAkBP;AAD6B,GAAhC,CAAhB;AAIA,SACC;AAAK,IAAA,SAAS,EAAGO;AAAjB,KACC,4BAAC,4BAAD,CAAqB,IAArB,QACC,4BAAC,4BAAD,OADD,CADD,EAIC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,sBAAD,OADD,EAEC,4BAAC,sBAAD,OAFD,CAJD,EAQC;AAAK,IAAA,SAAS,EAAC;AAAf,KACG,CAAEV,sBAAF,IACD;AACA;AACA;AACA;AACA;AACA,8BAAC,sBAAD;AACC,IAAA,YAAY,EAAGD,kBADhB;AAEC,IAAA,aAAa,EAAGE,QAFjB;AAGC,IAAA,cAAc,EAAGC;AAHlB,IAPF,EAaC,4BAAC,sBAAD,OAbD,EAcC,4BAAC,yBAAD;AACC,IAAA,mBAAmB,EAAGH,kBADvB;AAEC,IAAA,gBAAgB,EAAGE,QAAQ,GAAG,IAAH,GAAUU;AAFtC,IAdD,EAkBC,4BAAC,kCAAD;AACC,IAAA,YAAY,EAAGZ,kBADhB;AAEC,IAAA,aAAa,EAAGE,QAFjB;AAGC,IAAA,8BAA8B,EAC7BH;AAJF,IAlBD,EAyBG,CAAEW,eAAe,IAAI,CAAEP,cAAvB,KACD,qDACC,4BAAC,sBAAD,CAAa,IAAb;AAAkB,IAAA,KAAK,EAAC;AAAxB,IADD,EAEC,4BAAC,iBAAD;AAAU,IAAA,cAAc,EAAGA;AAA3B,IAFD,CA1BF,EA+BGA,cAAc,IAAI,CAAEO,eAApB,IACD,4BAAC,iBAAD;AAAU,IAAA,cAAc,EAAGP;AAA3B,IAhCF,CARD,CADD;AA8CA;;eAEcL,M","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { PostSavedState, PostPreviewButton } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport HeaderToolbar from './header-toolbar';\nimport MoreMenu from './more-menu';\nimport PostPublishButtonOrToggle from './post-publish-button-or-toggle';\nimport { default as DevicePreview } from '../device-preview';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport TemplateTitle from './template-title';\n\nfunction Header( { setEntitiesSavedStatesCallback } ) {\n\tconst {\n\t\thasActiveMetaboxes,\n\t\tisPublishSidebarOpened,\n\t\tisSaving,\n\t\tshowIconLabels,\n\t\thasReducedUI,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tisPublishSidebarOpened: select(\n\t\t\t\teditPostStore\n\t\t\t).isPublishSidebarOpened(),\n\t\t\tisSaving: select( editPostStore ).isSavingMetaBoxes(),\n\t\t\tshowIconLabels: select( editPostStore ).isFeatureActive(\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t\thasReducedUI: select( editPostStore ).isFeatureActive(\n\t\t\t\t'reducedUI'\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\tconst classes = classnames( 'edit-post-header', {\n\t\t'has-reduced-ui': hasReducedUI,\n\t} );\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t<FullscreenModeClose />\n\t\t\t</MainDashboardButton.Slot>\n\t\t\t<div className=\"edit-post-header__toolbar\">\n\t\t\t\t<HeaderToolbar />\n\t\t\t\t<TemplateTitle />\n\t\t\t</div>\n\t\t\t<div className=\"edit-post-header__settings\">\n\t\t\t\t{ ! isPublishSidebarOpened && (\n\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t<PostSavedState\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tforceIsSaving={ isSaving }\n\t\t\t\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<DevicePreview />\n\t\t\t\t<PostPreviewButton\n\t\t\t\t\tforceIsAutosaveable={ hasActiveMetaboxes }\n\t\t\t\t\tforcePreviewLink={ isSaving ? null : undefined }\n\t\t\t\t/>\n\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tforceIsSaving={ isSaving }\n\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isLargeViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ showIconLabels && ! isLargeViewport && (\n\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport default Header;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/header/index.js"],"names":["Header","setEntitiesSavedStatesCallback","hasActiveMetaboxes","isPublishSidebarOpened","isSaving","showIconLabels","hasReducedUI","select","editPostStore","hasMetaBoxes","isSavingMetaBoxes","isFeatureActive","isLargeViewport","classes","undefined"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAUA,SAASA,MAAT,OAAsD;AAAA,MAArC;AAAEC,IAAAA;AAAF,GAAqC;A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AAFtC,IAdD,EAkBC,4BAAC,kCAAD;AACC,IAAA,YAAY,EAAGZ,kBADhB;AAEC,IAAA,aAAa,EAAGE,QAFjB;AAGC,IAAA,8BAA8B,EAC7BH;AAJF,IAlBD,EAyBG,CAAEW,eAAe,IAAI,CAAEP,cAAvB,KACD,qDACC,4BAAC,sBAAD,CAAa,IAAb;AAAkB,IAAA,KAAK,EAAC;AAAxB,IADD,EAEC,4BAAC,iBAAD;AAAU,IAAA,cAAc,EAAGA;AAA3B,IAFD,CA1BF,EA+BGA,cAAc,IAAI,CAAEO,eAApB,IACD,4BAAC,iBAAD;AAAU,IAAA,cAAc,EAAGP;AAA3B,IAhCF,CARD,CADD;AA8CA;;eAEcL,M","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { PostSavedState, PostPreviewButton } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport HeaderToolbar from './header-toolbar';\nimport MoreMenu from './more-menu';\nimport PostPublishButtonOrToggle from './post-publish-button-or-toggle';\nimport { default as DevicePreview } from '../device-preview';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport TemplateTitle from './template-title';\n\nfunction Header( { setEntitiesSavedStatesCallback } ) {\n\tconst {\n\t\thasActiveMetaboxes,\n\t\tisPublishSidebarOpened,\n\t\tisSaving,\n\t\tshowIconLabels,\n\t\thasReducedUI,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tisPublishSidebarOpened: select(\n\t\t\t\teditPostStore\n\t\t\t).isPublishSidebarOpened(),\n\t\t\tisSaving: select( editPostStore ).isSavingMetaBoxes(),\n\t\t\tshowIconLabels: select( editPostStore ).isFeatureActive(\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t\thasReducedUI: select( editPostStore ).isFeatureActive(\n\t\t\t\t'reducedUI'\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\tconst classes = classnames( 'edit-post-header', {\n\t\t'has-reduced-ui': hasReducedUI,\n\t} );\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t<FullscreenModeClose />\n\t\t\t</MainDashboardButton.Slot>\n\t\t\t<div className=\"edit-post-header__toolbar\">\n\t\t\t\t<HeaderToolbar />\n\t\t\t\t<TemplateTitle />\n\t\t\t</div>\n\t\t\t<div className=\"edit-post-header__settings\">\n\t\t\t\t{ ! isPublishSidebarOpened && (\n\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t<PostSavedState\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tforceIsSaving={ isSaving }\n\t\t\t\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<DevicePreview />\n\t\t\t\t<PostPreviewButton\n\t\t\t\t\tforceIsAutosaveable={ hasActiveMetaboxes }\n\t\t\t\t\tforcePreviewLink={ isSaving ? null : undefined }\n\t\t\t\t/>\n\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tforceIsSaving={ isSaving }\n\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isLargeViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ showIconLabels && ! isLargeViewport && (\n\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport default Header;\n"]}
@@ -19,9 +19,10 @@ const {
19
19
  } = (0, _components.createSlotFill)(slotName);
20
20
  const MainDashboardButton = Fill;
21
21
 
22
- const Slot = ({
23
- children
24
- }) => {
22
+ const Slot = _ref => {
23
+ let {
24
+ children
25
+ } = _ref;
25
26
  const slot = (0, _components.__experimentalUseSlot)(slotName);
26
27
  const hasFills = Boolean(slot.fills && slot.fills.length);
27
28
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/header/main-dashboard-button/index.js"],"names":["slotName","Fill","Slot","MainDashboardButtonSlot","MainDashboardButton","children","slot","hasFills","Boolean","fills","length"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAMA,MAAMA,QAAQ,GAAG,mCAAjB;AAEA,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA,IAAI,EAAEC;AAAd,IAA0C,gCAAgBH,QAAhB,CAAhD;AAEA,MAAMI,mBAAmB,GAAGH,IAA5B;;AAEA,MAAMC,IAAI,GAAG,CAAE;AAAEG,EAAAA;AAAF,CAAF,KAAoB;AAChC,QAAMC,IAAI,GAAG,uCAASN,QAAT,CAAb;AACA,QAAMO,QAAQ,GAAGC,OAAO,CAAEF,IAAI,CAACG,KAAL,IAAcH,IAAI,CAACG,KAAL,CAAWC,MAA3B,CAAxB;;AAEA,MAAK,CAAEH,QAAP,EAAkB;AACjB,WAAOF,QAAP;AACA;;AAED,SAAO,4BAAC,uBAAD;AAAyB,IAAA,gBAAgB;AAAzC,IAAP;AACA,CATD;;AAWAD,mBAAmB,CAACF,IAApB,GAA2BA,IAA3B;eAEeE,mB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalUseSlot as useSlot,\n\tcreateSlotFill,\n} from '@wordpress/components';\n\nconst slotName = '__experimentalMainDashboardButton';\n\nconst { Fill, Slot: MainDashboardButtonSlot } = createSlotFill( slotName );\n\nconst MainDashboardButton = Fill;\n\nconst Slot = ( { children } ) => {\n\tconst slot = useSlot( slotName );\n\tconst hasFills = Boolean( slot.fills && slot.fills.length );\n\n\tif ( ! hasFills ) {\n\t\treturn children;\n\t}\n\n\treturn <MainDashboardButtonSlot bubblesVirtually />;\n};\n\nMainDashboardButton.Slot = Slot;\n\nexport default MainDashboardButton;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/header/main-dashboard-button/index.js"],"names":["slotName","Fill","Slot","MainDashboardButtonSlot","MainDashboardButton","children","slot","hasFills","Boolean","fills","length"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAMA,MAAMA,QAAQ,GAAG,mCAAjB;AAEA,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA,IAAI,EAAEC;AAAd,IAA0C,gCAAgBH,QAAhB,CAAhD;AAEA,MAAMI,mBAAmB,GAAGH,IAA5B;;AAEA,MAAMC,IAAI,GAAG,QAAoB;AAAA,MAAlB;AAAEG,IAAAA;AAAF,GAAkB;AAChC,QAAMC,IAAI,GAAG,uCAASN,QAAT,CAAb;AACA,QAAMO,QAAQ,GAAGC,OAAO,CAAEF,IAAI,CAACG,KAAL,IAAcH,IAAI,CAACG,KAAL,CAAWC,MAA3B,CAAxB;;AAEA,MAAK,CAAEH,QAAP,EAAkB;AACjB,WAAOF,QAAP;AACA;;AAED,SAAO,4BAAC,uBAAD;AAAyB,IAAA,gBAAgB;AAAzC,IAAP;AACA,CATD;;AAWAD,mBAAmB,CAACF,IAApB,GAA2BA,IAA3B;eAEeE,mB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalUseSlot as useSlot,\n\tcreateSlotFill,\n} from '@wordpress/components';\n\nconst slotName = '__experimentalMainDashboardButton';\n\nconst { Fill, Slot: MainDashboardButtonSlot } = createSlotFill( slotName );\n\nconst MainDashboardButton = Fill;\n\nconst Slot = ( { children } ) => {\n\tconst slot = useSlot( slotName );\n\tconst hasFills = Boolean( slot.fills && slot.fills.length );\n\n\tif ( ! hasFills ) {\n\t\treturn children;\n\t}\n\n\treturn <MainDashboardButtonSlot bubblesVirtually />;\n};\n\nMainDashboardButton.Slot = Slot;\n\nexport default MainDashboardButton;\n"]}
@@ -36,9 +36,10 @@ const POPOVER_PROPS = {
36
36
  className: 'edit-post-more-menu__content'
37
37
  };
38
38
 
39
- const MoreMenu = ({
40
- showIconLabels
41
- }) => {
39
+ const MoreMenu = _ref => {
40
+ let {
41
+ showIconLabels
42
+ } = _ref;
42
43
  const isLargeViewport = (0, _compose.useViewportMatch)('large');
43
44
  return (0, _element.createElement)(_interface.MoreMenuDropdown, {
44
45
  className: "edit-post-more-menu",
@@ -49,23 +50,26 @@ const MoreMenu = ({
49
50
  variant: 'tertiary'
50
51
  })
51
52
  }
52
- }, ({
53
- onClose
54
- }) => (0, _element.createElement)(_element.Fragment, null, showIconLabels && !isLargeViewport && (0, _element.createElement)(_interface.PinnedItems.Slot, {
55
- className: showIconLabels && 'show-icon-labels',
56
- scope: "core/edit-post"
57
- }), (0, _element.createElement)(_writingMenu.default, null), (0, _element.createElement)(_modeSwitcher.default, null), (0, _element.createElement)(_interface.ActionItem.Slot, {
58
- name: "core/edit-post/plugin-more-menu",
59
- label: (0, _i18n.__)('Plugins'),
60
- as: _components.MenuGroup,
61
- fillProps: {
62
- onClick: onClose
63
- }
64
- }), (0, _element.createElement)(_toolsMoreMenuGroup.default.Slot, {
65
- fillProps: {
53
+ }, _ref2 => {
54
+ let {
66
55
  onClose
67
- }
68
- }), (0, _element.createElement)(_components.MenuGroup, null, (0, _element.createElement)(_preferencesMenuItem.default, null))));
56
+ } = _ref2;
57
+ return (0, _element.createElement)(_element.Fragment, null, showIconLabels && !isLargeViewport && (0, _element.createElement)(_interface.PinnedItems.Slot, {
58
+ className: showIconLabels && 'show-icon-labels',
59
+ scope: "core/edit-post"
60
+ }), (0, _element.createElement)(_writingMenu.default, null), (0, _element.createElement)(_modeSwitcher.default, null), (0, _element.createElement)(_interface.ActionItem.Slot, {
61
+ name: "core/edit-post/plugin-more-menu",
62
+ label: (0, _i18n.__)('Plugins'),
63
+ as: _components.MenuGroup,
64
+ fillProps: {
65
+ onClick: onClose
66
+ }
67
+ }), (0, _element.createElement)(_toolsMoreMenuGroup.default.Slot, {
68
+ fillProps: {
69
+ onClose
70
+ }
71
+ }), (0, _element.createElement)(_components.MenuGroup, null, (0, _element.createElement)(_preferencesMenuItem.default, null)));
72
+ });
69
73
  };
70
74
 
71
75
  var _default = MoreMenu;