@wordpress/edit-post 5.0.7 → 5.0.11

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 (247) 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/actions.js +3 -1
  94. package/build/components/sidebar/template/actions.js.map +1 -1
  95. package/build/components/sidebar/template/index.js +7 -4
  96. package/build/components/sidebar/template/index.js.map +1 -1
  97. package/build/components/text-editor/index.js +5 -4
  98. package/build/components/text-editor/index.js.map +1 -1
  99. package/build/components/visual-editor/block-inspector-button.js +5 -4
  100. package/build/components/visual-editor/block-inspector-button.js.map +1 -1
  101. package/build/components/visual-editor/header.native.js +7 -6
  102. package/build/components/visual-editor/header.native.js.map +1 -1
  103. package/build/components/visual-editor/index.js +20 -15
  104. package/build/components/visual-editor/index.js.map +1 -1
  105. package/build/components/welcome-guide/image.js +5 -4
  106. package/build/components/welcome-guide/image.js.map +1 -1
  107. package/build/editor.js +9 -8
  108. package/build/editor.js.map +1 -1
  109. package/build/hooks/validate-multiple-use/index.js +28 -17
  110. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  111. package/build/index.js +2 -2
  112. package/build/plugins/index.js +23 -20
  113. package/build/plugins/index.js.map +1 -1
  114. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +4 -3
  115. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  116. package/build/store/actions.js +26 -22
  117. package/build/store/actions.js.map +1 -1
  118. package/build/store/index.js +4 -2
  119. package/build/store/index.js.map +1 -1
  120. package/build/store/reducer.js +52 -17
  121. package/build/store/reducer.js.map +1 -1
  122. package/build/store/selectors.js +20 -17
  123. package/build/store/selectors.js.map +1 -1
  124. package/build-module/components/block-manager/category.js +13 -11
  125. package/build-module/components/block-manager/category.js.map +1 -1
  126. package/build-module/components/block-manager/checklist.js +6 -5
  127. package/build-module/components/block-manager/checklist.js.map +1 -1
  128. package/build-module/components/block-manager/index.js +14 -10
  129. package/build-module/components/block-manager/index.js.map +1 -1
  130. package/build-module/components/block-manager/show-all.js +5 -4
  131. package/build-module/components/block-manager/show-all.js.map +1 -1
  132. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +26 -21
  133. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  134. package/build-module/components/editor-initialization/index.js +4 -3
  135. package/build-module/components/editor-initialization/index.js.map +1 -1
  136. package/build-module/components/editor-initialization/utils.js +2 -1
  137. package/build-module/components/editor-initialization/utils.js.map +1 -1
  138. package/build-module/components/header/fullscreen-mode-close/index.js +6 -5
  139. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  140. package/build-module/components/header/header-toolbar/index.native.js +12 -11
  141. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  142. package/build-module/components/header/index.js +4 -3
  143. package/build-module/components/header/index.js.map +1 -1
  144. package/build-module/components/header/main-dashboard-button/index.js +4 -3
  145. package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
  146. package/build-module/components/header/more-menu/index.js +23 -19
  147. package/build-module/components/header/more-menu/index.js.map +1 -1
  148. package/build-module/components/header/post-publish-button-or-toggle.js +14 -13
  149. package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
  150. package/build-module/components/header/template-title/index.js +13 -10
  151. package/build-module/components/header/template-title/index.js.map +1 -1
  152. package/build-module/components/header/tools-more-menu-group/index.js +10 -7
  153. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  154. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +4 -3
  155. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  156. package/build-module/components/keyboard-shortcut-help-modal/index.js +52 -42
  157. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  158. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +12 -10
  159. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  160. package/build-module/components/layout/actions-panel.js +6 -5
  161. package/build-module/components/layout/actions-panel.js.map +1 -1
  162. package/build-module/components/layout/index.js +4 -3
  163. package/build-module/components/layout/index.js.map +1 -1
  164. package/build-module/components/meta-boxes/index.js +13 -9
  165. package/build-module/components/meta-boxes/index.js.map +1 -1
  166. package/build-module/components/meta-boxes/meta-box-visibility.js +8 -5
  167. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  168. package/build-module/components/meta-boxes/meta-boxes-area/index.js +4 -3
  169. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  170. package/build-module/components/preferences-modal/index.js +13 -11
  171. package/build-module/components/preferences-modal/index.js.map +1 -1
  172. package/build-module/components/preferences-modal/meta-boxes-section.js +23 -16
  173. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  174. package/build-module/components/preferences-modal/options/base.js +8 -7
  175. package/build-module/components/preferences-modal/options/base.js.map +1 -1
  176. package/build-module/components/preferences-modal/options/enable-custom-fields.js +9 -7
  177. package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  178. package/build-module/components/preferences-modal/options/enable-feature.js +12 -8
  179. package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
  180. package/build-module/components/preferences-modal/options/enable-panel.js +17 -10
  181. package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
  182. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +10 -7
  183. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  184. package/build-module/components/preferences-modal/section.js +14 -11
  185. package/build-module/components/preferences-modal/section.js.map +1 -1
  186. package/build-module/components/sidebar/discussion-panel/index.js +7 -5
  187. package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
  188. package/build-module/components/sidebar/featured-image/index.js +8 -6
  189. package/build-module/components/sidebar/featured-image/index.js.map +1 -1
  190. package/build-module/components/sidebar/plugin-document-setting-panel/index.js +25 -20
  191. package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  192. package/build-module/components/sidebar/plugin-post-publish-panel/index.js +15 -12
  193. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  194. package/build-module/components/sidebar/plugin-post-status-info/index.js +9 -6
  195. package/build-module/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  196. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +15 -12
  197. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  198. package/build-module/components/sidebar/plugin-sidebar/index.js +5 -4
  199. package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
  200. package/build-module/components/sidebar/post-excerpt/index.js +7 -5
  201. package/build-module/components/sidebar/post-excerpt/index.js.map +1 -1
  202. package/build-module/components/sidebar/post-link/index.js +19 -17
  203. package/build-module/components/sidebar/post-link/index.js.map +1 -1
  204. package/build-module/components/sidebar/post-schedule/index.js +12 -9
  205. package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
  206. package/build-module/components/sidebar/post-status/index.js +11 -7
  207. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  208. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -7
  209. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  210. package/build-module/components/sidebar/post-visibility/index.js +24 -18
  211. package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
  212. package/build-module/components/sidebar/settings-header/index.js +4 -3
  213. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  214. package/build-module/components/sidebar/template/actions.js +4 -2
  215. package/build-module/components/sidebar/template/actions.js.map +1 -1
  216. package/build-module/components/sidebar/template/index.js +7 -4
  217. package/build-module/components/sidebar/template/index.js.map +1 -1
  218. package/build-module/components/text-editor/index.js +5 -4
  219. package/build-module/components/text-editor/index.js.map +1 -1
  220. package/build-module/components/visual-editor/block-inspector-button.js +5 -4
  221. package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
  222. package/build-module/components/visual-editor/header.native.js +7 -6
  223. package/build-module/components/visual-editor/header.native.js.map +1 -1
  224. package/build-module/components/visual-editor/index.js +20 -15
  225. package/build-module/components/visual-editor/index.js.map +1 -1
  226. package/build-module/components/welcome-guide/image.js +5 -4
  227. package/build-module/components/welcome-guide/image.js.map +1 -1
  228. package/build-module/editor.js +9 -8
  229. package/build-module/editor.js.map +1 -1
  230. package/build-module/hooks/validate-multiple-use/index.js +28 -17
  231. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  232. package/build-module/plugins/index.js +23 -20
  233. package/build-module/plugins/index.js.map +1 -1
  234. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +4 -3
  235. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  236. package/build-module/store/actions.js +6 -2
  237. package/build-module/store/actions.js.map +1 -1
  238. package/build-module/store/reducer.js +45 -11
  239. package/build-module/store/reducer.js.map +1 -1
  240. package/build-module/store/selectors.js +4 -3
  241. package/build-module/store/selectors.js.map +1 -1
  242. package/build-style/style-rtl.css +6 -11
  243. package/build-style/style.css +6 -11
  244. package/package.json +27 -27
  245. package/src/components/layout/style.scss +0 -8
  246. package/src/components/meta-boxes/meta-boxes-area/style.scss +7 -3
  247. package/src/components/sidebar/template/actions.js +5 -2
@@ -32,9 +32,10 @@ var _store = require("../../store");
32
32
  /**
33
33
  * Internal dependencies
34
34
  */
35
- function MetaBoxes({
36
- location
37
- }) {
35
+ function MetaBoxes(_ref) {
36
+ let {
37
+ location
38
+ } = _ref;
38
39
  const registry = (0, _data.useRegistry)();
39
40
  const {
40
41
  metaBoxes,
@@ -67,12 +68,15 @@ function MetaBoxes({
67
68
  return null;
68
69
  }
69
70
 
70
- return (0, _element.createElement)(_element.Fragment, null, (0, _lodash.map)(metaBoxes, ({
71
- id
72
- }) => (0, _element.createElement)(_metaBoxVisibility.default, {
73
- key: id,
74
- id: id
75
- })), (0, _element.createElement)(_metaBoxesArea.default, {
71
+ return (0, _element.createElement)(_element.Fragment, null, (0, _lodash.map)(metaBoxes, _ref2 => {
72
+ let {
73
+ id
74
+ } = _ref2;
75
+ return (0, _element.createElement)(_metaBoxVisibility.default, {
76
+ key: id,
77
+ id: id
78
+ });
79
+ }), (0, _element.createElement)(_metaBoxesArea.default, {
76
80
  location: location
77
81
  }));
78
82
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/meta-boxes/index.js"],"names":["MetaBoxes","location","registry","metaBoxes","areMetaBoxesInitialized","isEditorReady","select","__unstableIsEditorReady","editorStore","getMetaBoxesPerLocation","_areMetaBoxesInitialized","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esContent":["/**\n * External dependencies\n */\nimport { map } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useRegistry } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport MetaBoxesArea from './meta-boxes-area';\nimport MetaBoxVisibility from './meta-box-visibility';\nimport { store as editPostStore } from '../../store';\n\nexport default function MetaBoxes( { location } ) {\n\tconst registry = useRegistry();\n\tconst { metaBoxes, areMetaBoxesInitialized, isEditorReady } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { __unstableIsEditorReady } = select( editorStore );\n\t\t\tconst {\n\t\t\t\tgetMetaBoxesPerLocation,\n\t\t\t\tareMetaBoxesInitialized: _areMetaBoxesInitialized,\n\t\t\t} = select( editPostStore );\n\t\t\treturn {\n\t\t\t\tmetaBoxes: getMetaBoxesPerLocation( location ),\n\t\t\t\tareMetaBoxesInitialized: _areMetaBoxesInitialized(),\n\t\t\t\tisEditorReady: __unstableIsEditorReady(),\n\t\t\t};\n\t\t},\n\t\t[ location ]\n\t);\n\n\t// When editor is ready, initialize postboxes (wp core script) and metabox\n\t// saving. This initializes all meta box locations, not just this specific\n\t// one.\n\tuseEffect( () => {\n\t\tif ( isEditorReady && ! areMetaBoxesInitialized ) {\n\t\t\tregistry.dispatch( editPostStore ).initializeMetaBoxes();\n\t\t}\n\t}, [ isEditorReady, areMetaBoxesInitialized ] );\n\n\tif ( ! areMetaBoxesInitialized ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ map( metaBoxes, ( { id } ) => (\n\t\t\t\t<MetaBoxVisibility key={ id } id={ id } />\n\t\t\t) ) }\n\t\t\t<MetaBoxesArea location={ location } />\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/meta-boxes/index.js"],"names":["MetaBoxes","location","registry","metaBoxes","areMetaBoxesInitialized","isEditorReady","select","__unstableIsEditorReady","editorSt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BAAC,sBAAD;AAAe,IAAA,QAAQ,EAAGb;AAA1B,IAJD,CADD;AAQA","sourcesContent":["/**\n * External dependencies\n */\nimport { map } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useRegistry } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport MetaBoxesArea from './meta-boxes-area';\nimport MetaBoxVisibility from './meta-box-visibility';\nimport { store as editPostStore } from '../../store';\n\nexport default function MetaBoxes( { location } ) {\n\tconst registry = useRegistry();\n\tconst { metaBoxes, areMetaBoxesInitialized, isEditorReady } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { __unstableIsEditorReady } = select( editorStore );\n\t\t\tconst {\n\t\t\t\tgetMetaBoxesPerLocation,\n\t\t\t\tareMetaBoxesInitialized: _areMetaBoxesInitialized,\n\t\t\t} = select( editPostStore );\n\t\t\treturn {\n\t\t\t\tmetaBoxes: getMetaBoxesPerLocation( location ),\n\t\t\t\tareMetaBoxesInitialized: _areMetaBoxesInitialized(),\n\t\t\t\tisEditorReady: __unstableIsEditorReady(),\n\t\t\t};\n\t\t},\n\t\t[ location ]\n\t);\n\n\t// When editor is ready, initialize postboxes (wp core script) and metabox\n\t// saving. This initializes all meta box locations, not just this specific\n\t// one.\n\tuseEffect( () => {\n\t\tif ( isEditorReady && ! areMetaBoxesInitialized ) {\n\t\t\tregistry.dispatch( editPostStore ).initializeMetaBoxes();\n\t\t}\n\t}, [ isEditorReady, areMetaBoxesInitialized ] );\n\n\tif ( ! areMetaBoxesInitialized ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ map( metaBoxes, ( { id } ) => (\n\t\t\t\t<MetaBoxVisibility key={ id } id={ id } />\n\t\t\t) ) }\n\t\t\t<MetaBoxesArea location={ location } />\n\t\t</>\n\t);\n}\n"]}
@@ -53,11 +53,14 @@ class MetaBoxVisibility extends _element.Component {
53
53
 
54
54
  }
55
55
 
56
- var _default = (0, _data.withSelect)((select, {
57
- id
58
- }) => ({
59
- isVisible: select(_store.store).isEditorPanelEnabled(`meta-box-${id}`)
60
- }))(MetaBoxVisibility);
56
+ var _default = (0, _data.withSelect)((select, _ref) => {
57
+ let {
58
+ id
59
+ } = _ref;
60
+ return {
61
+ isVisible: select(_store.store).isEditorPanelEnabled(`meta-box-${id}`)
62
+ };
63
+ })(MetaBoxVisibility);
61
64
 
62
65
  exports.default = _default;
63
66
  //# sourceMappingURL=meta-box-visibility.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/meta-boxes/meta-box-visibility.js"],"names":["MetaBoxVisibility","Component","componentDidMount","updateDOM","componentDidUpdate","prevProps","props","isVisible","id","element","document","getElementById","classList","remove","add","render","select","editPostStore","isEditorPanelEnabled"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,MAAMA,iBAAN,SAAgCC,kBAAhC,CAA0C;AACzCC,EAAAA,iBAAiB,GAAG;AACnB,SAAKC,SAAL;AACA;;AAEDC,EAAAA,kBAAkB,CAAEC,SAAF,EAAc;AAC/B,QAAK,KAAKC,KAAL,CAAWC,SAAX,KAAyBF,SAAS,CAACE,SAAxC,EAAoD;AACnD,WAAKJ,SAAL;AACA;AACD;;AAEDA,EAAAA,SAAS,GAAG;AACX,UAAM;AAAEK,MAAAA,EAAF;AAAMD,MAAAA;AAAN,QAAoB,KAAKD,KAA/B;AAEA,UAAMG,OAAO,GAAGC,QAAQ,CAACC,cAAT,CAAyBH,EAAzB,CAAhB;;AACA,QAAK,CAAEC,OAAP,EAAiB;AAChB;AACA;;AAED,QAAKF,SAAL,EAAiB;AAChBE,MAAAA,OAAO,CAACG,SAAR,CAAkBC,MAAlB,CAA0B,WAA1B;AACA,KAFD,MAEO;AACNJ,MAAAA,OAAO,CAACG,SAAR,CAAkBE,GAAlB,CAAuB,WAAvB;AACA;AACD;;AAEDC,EAAAA,MAAM,GAAG;AACR,WAAO,IAAP;AACA;;AA5BwC;;eA+B3B,sBAAY,CAAEC,MAAF,EAAU;AAAER,EAAAA;AAAF,CAAV,MAAwB;AAClDD,EAAAA,SAAS,EAAES,MAAM,CAAEC,YAAF,CAAN,CAAwBC,oBAAxB,CACT,YAAYV,EAAI,EADP;AADuC,CAAxB,CAAZ,EAIRR,iBAJQ,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nclass MetaBoxVisibility extends Component {\n\tcomponentDidMount() {\n\t\tthis.updateDOM();\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.isVisible !== prevProps.isVisible ) {\n\t\t\tthis.updateDOM();\n\t\t}\n\t}\n\n\tupdateDOM() {\n\t\tconst { id, isVisible } = this.props;\n\n\t\tconst element = document.getElementById( id );\n\t\tif ( ! element ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isVisible ) {\n\t\t\telement.classList.remove( 'is-hidden' );\n\t\t} else {\n\t\t\telement.classList.add( 'is-hidden' );\n\t\t}\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\nexport default withSelect( ( select, { id } ) => ( {\n\tisVisible: select( editPostStore ).isEditorPanelEnabled(\n\t\t`meta-box-${ id }`\n\t),\n} ) )( MetaBoxVisibility );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/meta-boxes/meta-box-visibility.js"],"names":["MetaBoxVisibility","Component","componentDidMount","updateDOM","componentDidUpdate","prevProps","props","isVisible","id","element","document","getElementById","classList","remove","add","render","select","editPostStore","isEditorPanelEnabled"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,MAAMA,iBAAN,SAAgCC,kBAAhC,CAA0C;AACzCC,EAAAA,iBAAiB,GAAG;AACnB,SAAKC,SAAL;AACA;;AAEDC,EAAAA,kBAAkB,CAAEC,SAAF,EAAc;AAC/B,QAAK,KAAKC,KAAL,CAAWC,SAAX,KAAyBF,SAAS,CAACE,SAAxC,EAAoD;AACnD,WAAKJ,SAAL;AACA;AACD;;AAEDA,EAAAA,SAAS,GAAG;AACX,UAAM;AAAEK,MAAAA,EAAF;AAAMD,MAAAA;AAAN,QAAoB,KAAKD,KAA/B;AAEA,UAAMG,OAAO,GAAGC,QAAQ,CAACC,cAAT,CAAyBH,EAAzB,CAAhB;;AACA,QAAK,CAAEC,OAAP,EAAiB;AAChB;AACA;;AAED,QAAKF,SAAL,EAAiB;AAChBE,MAAAA,OAAO,CAACG,SAAR,CAAkBC,MAAlB,CAA0B,WAA1B;AACA,KAFD,MAEO;AACNJ,MAAAA,OAAO,CAACG,SAAR,CAAkBE,GAAlB,CAAuB,WAAvB;AACA;AACD;;AAEDC,EAAAA,MAAM,GAAG;AACR,WAAO,IAAP;AACA;;AA5BwC;;eA+B3B,sBAAY,CAAEC,MAAF;AAAA,MAAU;AAAER,IAAAA;AAAF,GAAV;AAAA,SAAwB;AAClDD,IAAAA,SAAS,EAAES,MAAM,CAAEC,YAAF,CAAN,CAAwBC,oBAAxB,CACT,YAAYV,EAAI,EADP;AADuC,GAAxB;AAAA,CAAZ,EAIRR,iBAJQ,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nclass MetaBoxVisibility extends Component {\n\tcomponentDidMount() {\n\t\tthis.updateDOM();\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.isVisible !== prevProps.isVisible ) {\n\t\t\tthis.updateDOM();\n\t\t}\n\t}\n\n\tupdateDOM() {\n\t\tconst { id, isVisible } = this.props;\n\n\t\tconst element = document.getElementById( id );\n\t\tif ( ! element ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isVisible ) {\n\t\t\telement.classList.remove( 'is-hidden' );\n\t\t} else {\n\t\t\telement.classList.add( 'is-hidden' );\n\t\t}\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\nexport default withSelect( ( select, { id } ) => ( {\n\tisVisible: select( editPostStore ).isEditorPanelEnabled(\n\t\t`meta-box-${ id }`\n\t),\n} ) )( MetaBoxVisibility );\n"]}
@@ -36,9 +36,10 @@ var _store = require("../../../store");
36
36
  * @param {string} props.location metabox location.
37
37
  * @return {WPComponent} The component to be rendered.
38
38
  */
39
- function MetaBoxesArea({
40
- location
41
- }) {
39
+ function MetaBoxesArea(_ref) {
40
+ let {
41
+ location
42
+ } = _ref;
42
43
  const container = (0, _element.useRef)(null);
43
44
  const formRef = (0, _element.useRef)(null);
44
45
  (0, _element.useEffect)(() => {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/meta-boxes/meta-boxes-area/index.js"],"names":["MetaBoxesArea","location","container","formRef","current","document","querySelector","appendChild","isSaving","select","editPostStore","isSavingMetaBoxes","classes"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AAKA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAT,CAAwB;AAAEC,EAAAA;AAAF,CAAxB,EAAuC;AACtC,QAAMC,SAAS,GAAG,qBAAQ,IAAR,CAAlB;AACA,QAAMC,OAAO,GAAG,qBAAQ,IAAR,CAAhB;AAEA,0BAAW,MAAM;AAChBA,IAAAA,OAAO,CAACC,OAAR,GAAkBC,QAAQ,CAACC,aAAT,CACjB,uBAAuBL,QADN,CAAlB;;AAIA,QAAKE,OAAO,CAACC,OAAb,EAAuB;AACtBF,MAAAA,SAAS,CAACE,OAAV,CAAkBG,WAAlB,CAA+BJ,OAAO,CAACC,OAAvC;AACA;;AAED,WAAO,MAAM;AACZ,UAAKD,OAAO,CAACC,OAAb,EAAuB;AACtBC,QAAAA,QAAQ,CACNC,aADF,CACiB,YADjB,EAEEC,WAFF,CAEeJ,OAAO,CAACC,OAFvB;AAGA;AACD,KAND;AAOA,GAhBD,EAgBG,CAAEH,QAAF,CAhBH;AAkBA,QAAMO,QAAQ,GAAG,qBAAaC,MAAF,IAAc;AACzC,WAAOA,MAAM,CAAEC,YAAF,CAAN,CAAwBC,iBAAxB,EAAP;AACA,GAFgB,EAEd,EAFc,CAAjB;AAIA,QAAMC,OAAO,GAAG,yBACf,2BADe,EAEd,MAAMX,QAAU,EAFF,EAGf;AACC,kBAAcO;AADf,GAHe,CAAhB;AAQA,SACC;AAAK,IAAA,SAAS,EAAGI;AAAjB,KACGJ,QAAQ,IAAI,4BAAC,mBAAD,OADf,EAEC;AACC,IAAA,SAAS,EAAC,sCADX;AAEC,IAAA,GAAG,EAAGN;AAFP,IAFD,EAMC;AAAK,IAAA,SAAS,EAAC;AAAf,IAND,CADD;AAUA;;eAEcF,a","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { Spinner } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Render metabox area.\n *\n * @param {Object} props Component props.\n * @param {string} props.location metabox location.\n * @return {WPComponent} The component to be rendered.\n */\nfunction MetaBoxesArea( { location } ) {\n\tconst container = useRef( null );\n\tconst formRef = useRef( null );\n\n\tuseEffect( () => {\n\t\tformRef.current = document.querySelector(\n\t\t\t'.metabox-location-' + location\n\t\t);\n\n\t\tif ( formRef.current ) {\n\t\t\tcontainer.current.appendChild( formRef.current );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( formRef.current ) {\n\t\t\t\tdocument\n\t\t\t\t\t.querySelector( '#metaboxes' )\n\t\t\t\t\t.appendChild( formRef.current );\n\t\t\t}\n\t\t};\n\t}, [ location ] );\n\n\tconst isSaving = useSelect( ( select ) => {\n\t\treturn select( editPostStore ).isSavingMetaBoxes();\n\t}, [] );\n\n\tconst classes = classnames(\n\t\t'edit-post-meta-boxes-area',\n\t\t`is-${ location }`,\n\t\t{\n\t\t\t'is-loading': isSaving,\n\t\t}\n\t);\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t{ isSaving && <Spinner /> }\n\t\t\t<div\n\t\t\t\tclassName=\"edit-post-meta-boxes-area__container\"\n\t\t\t\tref={ container }\n\t\t\t/>\n\t\t\t<div className=\"edit-post-meta-boxes-area__clear\" />\n\t\t</div>\n\t);\n}\n\nexport default MetaBoxesArea;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/meta-boxes/meta-boxes-area/index.js"],"names":["MetaBoxesArea","location","container","formRef","current","document","querySelector","appendChild","isSaving","select","editPostStore","isSavingMetaBoxes","classes"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AAKA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAT,OAAuC;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AACtC,QAAMC,SAAS,GAAG,qBAAQ,IAAR,CAAlB;AACA,QAAMC,OAAO,GAAG,qBAAQ,IAAR,CAAhB;AAEA,0BAAW,MAAM;AAChBA,IAAAA,OAAO,CAACC,OAAR,GAAkBC,QAAQ,CAACC,aAAT,CACjB,uBAAuBL,QADN,CAAlB;;AAIA,QAAKE,OAAO,CAACC,OAAb,EAAuB;AACtBF,MAAAA,SAAS,CAACE,OAAV,CAAkBG,WAAlB,CAA+BJ,OAAO,CAACC,OAAvC;AACA;;AAED,WAAO,MAAM;AACZ,UAAKD,OAAO,CAACC,OAAb,EAAuB;AACtBC,QAAAA,QAAQ,CACNC,aADF,CACiB,YADjB,EAEEC,WAFF,CAEeJ,OAAO,CAACC,OAFvB;AAGA;AACD,KAND;AAOA,GAhBD,EAgBG,CAAEH,QAAF,CAhBH;AAkBA,QAAMO,QAAQ,GAAG,qBAAaC,MAAF,IAAc;AACzC,WAAOA,MAAM,CAAEC,YAAF,CAAN,CAAwBC,iBAAxB,EAAP;AACA,GAFgB,EAEd,EAFc,CAAjB;AAIA,QAAMC,OAAO,GAAG,yBACf,2BADe,EAEd,MAAMX,QAAU,EAFF,EAGf;AACC,kBAAcO;AADf,GAHe,CAAhB;AAQA,SACC;AAAK,IAAA,SAAS,EAAGI;AAAjB,KACGJ,QAAQ,IAAI,4BAAC,mBAAD,OADf,EAEC;AACC,IAAA,SAAS,EAAC,sCADX;AAEC,IAAA,GAAG,EAAGN;AAFP,IAFD,EAMC;AAAK,IAAA,SAAS,EAAC;AAAf,IAND,CADD;AAUA;;eAEcF,a","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { Spinner } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Render metabox area.\n *\n * @param {Object} props Component props.\n * @param {string} props.location metabox location.\n * @return {WPComponent} The component to be rendered.\n */\nfunction MetaBoxesArea( { location } ) {\n\tconst container = useRef( null );\n\tconst formRef = useRef( null );\n\n\tuseEffect( () => {\n\t\tformRef.current = document.querySelector(\n\t\t\t'.metabox-location-' + location\n\t\t);\n\n\t\tif ( formRef.current ) {\n\t\t\tcontainer.current.appendChild( formRef.current );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( formRef.current ) {\n\t\t\t\tdocument\n\t\t\t\t\t.querySelector( '#metaboxes' )\n\t\t\t\t\t.appendChild( formRef.current );\n\t\t\t}\n\t\t};\n\t}, [ location ] );\n\n\tconst isSaving = useSelect( ( select ) => {\n\t\treturn select( editPostStore ).isSavingMetaBoxes();\n\t}, [] );\n\n\tconst classes = classnames(\n\t\t'edit-post-meta-boxes-area',\n\t\t`is-${ location }`,\n\t\t{\n\t\t\t'is-loading': isSaving,\n\t\t}\n\t);\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t{ isSaving && <Spinner /> }\n\t\t\t<div\n\t\t\t\tclassName=\"edit-post-meta-boxes-area__container\"\n\t\t\t\tref={ container }\n\t\t\t/>\n\t\t\t<div className=\"edit-post-meta-boxes-area__clear\" />\n\t\t</div>\n\t);\n}\n\nexport default MetaBoxesArea;\n"]}
@@ -51,12 +51,13 @@ var _blockManager = _interopRequireDefault(require("../block-manager"));
51
51
  const MODAL_NAME = 'edit-post/preferences';
52
52
  const PREFERENCES_MENU = 'preferences-menu';
53
53
 
54
- function NavigationButton({
55
- as: Tag = _components.Button,
56
- path,
57
- isBack = false,
58
- ...props
59
- }) {
54
+ function NavigationButton(_ref) {
55
+ let {
56
+ as: Tag = _components.Button,
57
+ path,
58
+ isBack = false,
59
+ ...props
60
+ } = _ref;
60
61
  const navigator = (0, _components.__experimentalUseNavigator)();
61
62
  return (0, _element.createElement)(Tag, (0, _extends2.default)({
62
63
  onClick: () => navigator.push(path, {
@@ -198,11 +199,12 @@ function PreferencesModal() {
198
199
  const {
199
200
  tabs,
200
201
  sectionsContentMap
201
- } = (0, _element.useMemo)(() => sections.reduce((accumulator, {
202
- name,
203
- tabLabel: title,
204
- content
205
- }) => {
202
+ } = (0, _element.useMemo)(() => sections.reduce((accumulator, _ref2) => {
203
+ let {
204
+ name,
205
+ tabLabel: title,
206
+ content
207
+ } = _ref2;
206
208
  accumulator.tabs.push({
207
209
  name,
208
210
  title
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"names":["MODAL_NAME","PREFERENCES_MENU","NavigationButton","as","Tag","Button","path","isBack","props","navigator","push","PreferencesModal","isLargeViewport","closeModal","editPostStore","isModalActive","isViewable","select","getEditedPostAttribute","editorStore","getPostType","coreStore","postType","showBlockBreadcrumbsOption","getEditorSettings","getEditorMode","isFeatureActive","mode","isRichEditingEnabled","richEditingEnabled","hasReducedUI","sections","name","tabLabel","content","taxonomy","slug","activeMenu","setActiveMenu","tabs","sectionsContentMap","reduce","accumulator","title","getCurrentTab","tab","modalContent","undefined","map","Item","chevronLeft","chevronRight","section"],"mappings":";;;;;;;;;AA4BA;;;;AAzBA;;AAKA;;AAiBA;;AACA;;AACA;;AAEA;;AAQA;;AACA;;AAKA;;AACA;;AAMA;;AACA;;AACA;;AApDA;AACA;AACA;;AAGA;AACA;AACA;;AAiCA;AACA;AACA;AAYA,MAAMA,UAAU,GAAG,uBAAnB;AACA,MAAMC,gBAAgB,GAAG,kBAAzB;;AAEA,SAASC,gBAAT,CAA2B;AAC1BC,EAAAA,EAAE,EAAEC,GAAG,GAAGC,kBADgB;AAE1BC,EAAAA,IAF0B;AAG1BC,EAAAA,MAAM,GAAG,KAHiB;AAI1B,KAAGC;AAJuB,CAA3B,EAKI;AACH,QAAMC,SAAS,GAAG,6CAAlB;AACA,SACC,4BAAC,GAAD;AACC,IAAA,OAAO,EAAG,MAAMA,SAAS,CAACC,IAAV,CAAgBJ,IAAhB,EAAsB;AAAEC,MAAAA;AAAF,KAAtB;AADjB,KAEMC,KAFN,EADD;AAMA;;AAEc,SAASG,gBAAT,GAA4B;AAC1C,QAAMC,eAAe,GAAG,+BAAkB,QAAlB,CAAxB;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAiB,uBAAaC,YAAb,CAAvB;AACA,QAAM;AAAEC,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,MAAgC,qBAAaC,MAAF,IAAc;AAC9D,UAAM;AAAEC,MAAAA;AAAF,QAA6BD,MAAM,CAAEE,aAAF,CAAzC;AACA,UAAM;AAAEC,MAAAA;AAAF,QAAkBH,MAAM,CAAEI,eAAF,CAA9B;AACA,UAAMC,QAAQ,GAAGF,WAAW,CAAEF,sBAAsB,CAAE,MAAF,CAAxB,CAA5B;AACA,WAAO;AACNH,MAAAA,aAAa,EAAEE,MAAM,CAAEH,YAAF,CAAN,CAAwBC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C,QAAA,OAAO,EAAC,MAFT;AAGC,QAAA,IAAI,EAAC,OAHN;AAIC,QAAA,GAAG,EAAC;AAJL,SAMC,4BAAC,gBAAD;AACC,QAAA,IAAI,EAAC,GADN;AAEC,QAAA,IAAI,EACH,qBAAUmB,mBAAV,GAAyBD,kBAH3B;AAKC,QAAA,MAAM,MALP;AAMC,sBAAa,cACZ,+BADY;AANd,QAND,EAgBC,4BAAC,8BAAD;AAAM,QAAA,IAAI,EAAC;AAAX,SAAkBE,OAAO,CAACnB,QAA1B,CAhBD,CADD,EAmBC,4BAAC,oBAAD,QAAYmB,OAAO,CAAClB,OAApB,CAnBD,CAJD,CADD;AA4BA,KA7BC,CApCH,CADD;AAqEA;;AACD,SACC,4BAAC,iBAAD;AACC,IAAA,SAAS,EAAC,6BADX;AAEC,IAAA,KAAK,EAAG,cAAI,aAAJ,CAFT;AAGC,IAAA,UAAU,EAAG,cAAI,OAAJ,CAHd;AAIC,IAAA,cAAc,EAAGrB;AAJlB,KAMGiC,YANH,CADD;AAUA","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n\t__experimentalTruncate as Truncate,\n\tFlexItem,\n\tModal,\n\tTabPanel,\n\tButton,\n\tCard,\n\tCardHeader,\n\tCardBody,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo, useCallback, useState } from '@wordpress/element';\nimport {\n\tPostTaxonomies,\n\tPostExcerptCheck,\n\tPageAttributesCheck,\n\tPostFeaturedImageCheck,\n\tPostTypeSupportCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { chevronLeft, chevronRight, Icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Section from './section';\nimport {\n\tEnablePluginDocumentSettingPanelOption,\n\tEnablePublishSidebarOption,\n\tEnablePanelOption,\n\tEnableFeature,\n} from './options';\nimport MetaBoxesSection from './meta-boxes-section';\nimport { store as editPostStore } from '../../store';\nimport BlockManager from '../block-manager';\n\nconst MODAL_NAME = 'edit-post/preferences';\nconst PREFERENCES_MENU = 'preferences-menu';\n\nfunction NavigationButton( {\n\tas: Tag = Button,\n\tpath,\n\tisBack = false,\n\t...props\n} ) {\n\tconst navigator = useNavigator();\n\treturn (\n\t\t<Tag\n\t\t\tonClick={ () => navigator.push( path, { isBack } ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default function PreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( editPostStore );\n\tconst { isModalActive, isViewable } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\t\treturn {\n\t\t\tisModalActive: select( editPostStore ).isModalActive( MODAL_NAME ),\n\t\t\tisViewable: get( postType, [ 'viewable' ], false ),\n\t\t};\n\t}, [] );\n\tconst showBlockBreadcrumbsOption = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getEditorMode, isFeatureActive } = select( editPostStore );\n\t\t\tconst mode = getEditorMode();\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst hasReducedUI = isFeatureActive( 'reducedUI' );\n\t\t\treturn (\n\t\t\t\t! hasReducedUI &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tisRichEditingEnabled &&\n\t\t\t\tmode === 'visual'\n\t\t\t);\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<Section\n\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Change options related to publishing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Include pre-publish checklist'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Section>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<Section\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize options related to the block editor interface and editing flow.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"reducedUI\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Compacts options and outlines in the toolbar.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Reduce the interface' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\thelp={ __( 'Shows text instead of icons.' ) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Display button labels' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Section>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Section\n\t\t\t\t\t\t\ttitle={ __( 'Block interactions' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize how you interact with blocks in the block library and editing canvas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Places the most frequent blocks in the block library.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Section>\n\t\t\t\t\t\t<Section\n\t\t\t\t\t\t\ttitle={ __( 'Visible blocks' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</Section>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'panels',\n\t\t\t\ttabLabel: __( 'Panels' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Section\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Choose what displays in the panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t{ isViewable && (\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Permalink' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-link\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ isViewable && (\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Template' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"template\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ get( taxonomy, [\n\t\t\t\t\t\t\t\t\t\t\t'labels',\n\t\t\t\t\t\t\t\t\t\t\t'menu_name',\n\t\t\t\t\t\t\t\t\t\t] ) }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</Section>\n\t\t\t\t\t\t<MetaBoxesSection\n\t\t\t\t\t\t\ttitle={ __( 'Additional' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Add extra areas to the editor.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[ isViewable, isLargeViewport, showBlockBreadcrumbsOption ]\n\t);\n\n\t// This is also used to sync the two different rendered components\n\t// between small and large viewports.\n\tconst [ activeMenu, setActiveMenu ] = useState( PREFERENCES_MENU );\n\t/**\n\t * Create helper objects from `sections` for easier data handling.\n\t * `tabs` is used for creating the `TabPanel` and `sectionsContentMap`\n\t * is used for easier access to active tab's content.\n\t */\n\tconst { tabs, sectionsContentMap } = useMemo(\n\t\t() =>\n\t\t\tsections.reduce(\n\t\t\t\t( accumulator, { name, tabLabel: title, content } ) => {\n\t\t\t\t\taccumulator.tabs.push( { name, title } );\n\t\t\t\t\taccumulator.sectionsContentMap[ name ] = content;\n\t\t\t\t\treturn accumulator;\n\t\t\t\t},\n\t\t\t\t{ tabs: [], sectionsContentMap: {} }\n\t\t\t),\n\t\t[ sections ]\n\t);\n\tconst getCurrentTab = useCallback(\n\t\t( tab ) => sectionsContentMap[ tab.name ] || null,\n\t\t[ sectionsContentMap ]\n\t);\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\tlet modalContent;\n\t// We render different components based on the viewport size.\n\tif ( isLargeViewport ) {\n\t\tmodalContent = (\n\t\t\t<TabPanel\n\t\t\t\tclassName=\"edit-post-preferences__tabs\"\n\t\t\t\ttabs={ tabs }\n\t\t\t\tinitialTabName={\n\t\t\t\t\tactiveMenu !== PREFERENCES_MENU ? activeMenu : undefined\n\t\t\t\t}\n\t\t\t\tonSelect={ setActiveMenu }\n\t\t\t\torientation=\"vertical\"\n\t\t\t>\n\t\t\t\t{ getCurrentTab }\n\t\t\t</TabPanel>\n\t\t);\n\t} else {\n\t\tmodalContent = (\n\t\t\t<NavigatorProvider initialPath=\"/\">\n\t\t\t\t<NavigatorScreen path=\"/\">\n\t\t\t\t\t<Card isBorderless size=\"small\">\n\t\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => {\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<NavigationButton\n\t\t\t\t\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\t\t\t\t\tpath={ tab.name }\n\t\t\t\t\t\t\t\t\t\t\tas={ Item }\n\t\t\t\t\t\t\t\t\t\t\tisAction\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Truncate>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisRTL()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? chevronLeft\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: chevronRight\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t\t\t</NavigationButton>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t</CardBody>\n\t\t\t\t\t</Card>\n\t\t\t\t</NavigatorScreen>\n\t\t\t\t{ sections.map( ( section ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<NavigatorScreen\n\t\t\t\t\t\t\tkey={ `${ section.name }-menu` }\n\t\t\t\t\t\t\tpath={ section.name }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Card isBorderless size=\"large\">\n\t\t\t\t\t\t\t\t<CardHeader\n\t\t\t\t\t\t\t\t\tisBorderless={ false }\n\t\t\t\t\t\t\t\t\tjustify=\"left\"\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tgap=\"6\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<NavigationButton\n\t\t\t\t\t\t\t\t\t\tpath=\"/\"\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronRight : chevronLeft\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisBack\n\t\t\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Navigate to the previous view'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<Text size=\"16\">{ section.tabLabel }</Text>\n\t\t\t\t\t\t\t\t</CardHeader>\n\t\t\t\t\t\t\t\t<CardBody>{ section.content }</CardBody>\n\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t</NavigatorScreen>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</NavigatorProvider>\n\t\t);\n\t}\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-post-preferences-modal\"\n\t\t\ttitle={ __( 'Preferences' ) }\n\t\t\tcloseLabel={ __( 'Close' ) }\n\t\t\tonRequestClose={ closeModal }\n\t\t>\n\t\t\t{ modalContent }\n\t\t</Modal>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"names":["MODAL_NAME","PREFERENCES_MENU","NavigationButton","as","Tag","Button","path","isBack","props","navigator","push","PreferencesModal","isLargeViewport","closeModal","editPostStore","isModalActive","isViewable","select","getEditedPostAttribute","editorStore","getPostType","coreStore","postType","showBlockBreadcrumbsOption","getEditorSettings","getEditorMode","isFeatureActive","mode","isRichEditingEnabled","richEditingEnabled","hasReducedUI","sections","name","tabLabel","content","taxonomy","slug","activeMenu","setActiveMenu","tabs","sectionsContentMap","reduce","accumulator","title","getCurrentTab","tab","modalContent","undefined","map","Item","chevronLeft","chevronRight","section"],"mappings":";;;;;;;;;AA4BA;;;;AAzBA;;AAKA;;AAiBA;;AACA;;AACA;;AAEA;;AAQA;;AACA;;AAKA;;AACA;;AAMA;;AACA;;AACA;;AApDA;AACA;AACA;;AAGA;AACA;AACA;;AAiCA;AACA;AACA;AAYA,MAAMA,UAAU,GAAG,uBAAnB;AACA,MAAMC,gBAAgB,GAAG,kBAAzB;;AAEA,SAASC,gBAAT,OAKI;AAAA,MALuB;AAC1BC,IAAAA,EAAE,EAAEC,GAAG,GAAGC,kBADgB;AAE1BC,IAAAA,IAF0B;AAG1BC,IAAAA,MAAM,GAAG,KAHiB;AAI1B,OAAGC;AAJuB,GAKvB;AACH,QAAMC,SAAS,GAAG,6CAAlB;AACA,SACC,4BAAC,GAAD;AACC,IAAA,OAAO,EAAG,MAAMA,SAAS,CAACC,IAAV,CAAgBJ,IAAhB,EAAsB;AAAEC,MA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lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n\t__experimentalTruncate as Truncate,\n\tFlexItem,\n\tModal,\n\tTabPanel,\n\tButton,\n\tCard,\n\tCardHeader,\n\tCardBody,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo, useCallback, useState } from '@wordpress/element';\nimport {\n\tPostTaxonomies,\n\tPostExcerptCheck,\n\tPageAttributesCheck,\n\tPostFeaturedImageCheck,\n\tPostTypeSupportCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { chevronLeft, chevronRight, Icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Section from './section';\nimport {\n\tEnablePluginDocumentSettingPanelOption,\n\tEnablePublishSidebarOption,\n\tEnablePanelOption,\n\tEnableFeature,\n} from './options';\nimport MetaBoxesSection from './meta-boxes-section';\nimport { store as editPostStore } from '../../store';\nimport BlockManager from '../block-manager';\n\nconst MODAL_NAME = 'edit-post/preferences';\nconst PREFERENCES_MENU = 'preferences-menu';\n\nfunction NavigationButton( {\n\tas: Tag = Button,\n\tpath,\n\tisBack = false,\n\t...props\n} ) {\n\tconst navigator = useNavigator();\n\treturn (\n\t\t<Tag\n\t\t\tonClick={ () => navigator.push( path, { isBack } ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default function PreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( editPostStore );\n\tconst { isModalActive, isViewable } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\t\treturn {\n\t\t\tisModalActive: select( editPostStore ).isModalActive( MODAL_NAME ),\n\t\t\tisViewable: get( postType, [ 'viewable' ], false ),\n\t\t};\n\t}, [] );\n\tconst showBlockBreadcrumbsOption = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getEditorMode, isFeatureActive } = select( editPostStore );\n\t\t\tconst mode = getEditorMode();\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst hasReducedUI = isFeatureActive( 'reducedUI' );\n\t\t\treturn (\n\t\t\t\t! hasReducedUI &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tisRichEditingEnabled &&\n\t\t\t\tmode === 'visual'\n\t\t\t);\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<Section\n\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Change options related to publishing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Include pre-publish checklist'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Section>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<Section\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize options related to the block editor interface and editing flow.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"reducedUI\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Compacts options and outlines in the toolbar.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Reduce the interface' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\thelp={ __( 'Shows text instead of icons.' ) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Display button labels' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Section>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Section\n\t\t\t\t\t\t\ttitle={ __( 'Block interactions' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize how you interact with blocks in the block library and editing canvas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Places the most frequent blocks in the block library.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Section>\n\t\t\t\t\t\t<Section\n\t\t\t\t\t\t\ttitle={ __( 'Visible blocks' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</Section>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'panels',\n\t\t\t\ttabLabel: __( 'Panels' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Section\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Choose what displays in the panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t{ isViewable && (\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Permalink' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-link\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ isViewable && (\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Template' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"template\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ get( taxonomy, [\n\t\t\t\t\t\t\t\t\t\t\t'labels',\n\t\t\t\t\t\t\t\t\t\t\t'menu_name',\n\t\t\t\t\t\t\t\t\t\t] ) }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</Section>\n\t\t\t\t\t\t<MetaBoxesSection\n\t\t\t\t\t\t\ttitle={ __( 'Additional' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Add extra areas to the editor.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[ isViewable, isLargeViewport, showBlockBreadcrumbsOption ]\n\t);\n\n\t// This is also used to sync the two different rendered components\n\t// between small and large viewports.\n\tconst [ activeMenu, setActiveMenu ] = useState( PREFERENCES_MENU );\n\t/**\n\t * Create helper objects from `sections` for easier data handling.\n\t * `tabs` is used for creating the `TabPanel` and `sectionsContentMap`\n\t * is used for easier access to active tab's content.\n\t */\n\tconst { tabs, sectionsContentMap } = useMemo(\n\t\t() =>\n\t\t\tsections.reduce(\n\t\t\t\t( accumulator, { name, tabLabel: title, content } ) => {\n\t\t\t\t\taccumulator.tabs.push( { name, title } );\n\t\t\t\t\taccumulator.sectionsContentMap[ name ] = content;\n\t\t\t\t\treturn accumulator;\n\t\t\t\t},\n\t\t\t\t{ tabs: [], sectionsContentMap: {} }\n\t\t\t),\n\t\t[ sections ]\n\t);\n\tconst getCurrentTab = useCallback(\n\t\t( tab ) => sectionsContentMap[ tab.name ] || null,\n\t\t[ sectionsContentMap ]\n\t);\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\tlet modalContent;\n\t// We render different components based on the viewport size.\n\tif ( isLargeViewport ) {\n\t\tmodalContent = (\n\t\t\t<TabPanel\n\t\t\t\tclassName=\"edit-post-preferences__tabs\"\n\t\t\t\ttabs={ tabs }\n\t\t\t\tinitialTabName={\n\t\t\t\t\tactiveMenu !== PREFERENCES_MENU ? activeMenu : undefined\n\t\t\t\t}\n\t\t\t\tonSelect={ setActiveMenu }\n\t\t\t\torientation=\"vertical\"\n\t\t\t>\n\t\t\t\t{ getCurrentTab }\n\t\t\t</TabPanel>\n\t\t);\n\t} else {\n\t\tmodalContent = (\n\t\t\t<NavigatorProvider initialPath=\"/\">\n\t\t\t\t<NavigatorScreen path=\"/\">\n\t\t\t\t\t<Card isBorderless size=\"small\">\n\t\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => {\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<NavigationButton\n\t\t\t\t\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\t\t\t\t\tpath={ tab.name }\n\t\t\t\t\t\t\t\t\t\t\tas={ Item }\n\t\t\t\t\t\t\t\t\t\t\tisAction\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Truncate>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisRTL()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? chevronLeft\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: chevronRight\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t\t\t</NavigationButton>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t</CardBody>\n\t\t\t\t\t</Card>\n\t\t\t\t</NavigatorScreen>\n\t\t\t\t{ sections.map( ( section ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<NavigatorScreen\n\t\t\t\t\t\t\tkey={ `${ section.name }-menu` }\n\t\t\t\t\t\t\tpath={ section.name }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Card isBorderless size=\"large\">\n\t\t\t\t\t\t\t\t<CardHeader\n\t\t\t\t\t\t\t\t\tisBorderless={ false }\n\t\t\t\t\t\t\t\t\tjustify=\"left\"\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tgap=\"6\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<NavigationButton\n\t\t\t\t\t\t\t\t\t\tpath=\"/\"\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronRight : chevronLeft\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisBack\n\t\t\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Navigate to the previous view'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<Text size=\"16\">{ section.tabLabel }</Text>\n\t\t\t\t\t\t\t\t</CardHeader>\n\t\t\t\t\t\t\t\t<CardBody>{ section.content }</CardBody>\n\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t</NavigatorScreen>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</NavigatorProvider>\n\t\t);\n\t}\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-post-preferences-modal\"\n\t\t\ttitle={ __( 'Preferences' ) }\n\t\t\tcloseLabel={ __( 'Close' ) }\n\t\t\tonRequestClose={ closeModal }\n\t\t>\n\t\t\t{ modalContent }\n\t\t</Modal>\n\t);\n}\n"]}
@@ -35,15 +35,19 @@ var _store = require("../../store");
35
35
  /**
36
36
  * Internal dependencies
37
37
  */
38
- function MetaBoxesSection({
39
- areCustomFieldsRegistered,
40
- metaBoxes,
41
- ...sectionProps
42
- }) {
38
+ function MetaBoxesSection(_ref) {
39
+ let {
40
+ areCustomFieldsRegistered,
41
+ metaBoxes,
42
+ ...sectionProps
43
+ } = _ref;
43
44
  // The 'Custom Fields' meta box is a special case that we handle separately.
44
- const thirdPartyMetaBoxes = (0, _lodash.filter)(metaBoxes, ({
45
- id
46
- }) => id !== 'postcustom');
45
+ const thirdPartyMetaBoxes = (0, _lodash.filter)(metaBoxes, _ref2 => {
46
+ let {
47
+ id
48
+ } = _ref2;
49
+ return id !== 'postcustom';
50
+ });
47
51
 
48
52
  if (!areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0) {
49
53
  return null;
@@ -51,14 +55,17 @@ function MetaBoxesSection({
51
55
 
52
56
  return (0, _element.createElement)(_section.default, sectionProps, areCustomFieldsRegistered && (0, _element.createElement)(_options.EnableCustomFieldsOption, {
53
57
  label: (0, _i18n.__)('Custom fields')
54
- }), (0, _lodash.map)(thirdPartyMetaBoxes, ({
55
- id,
56
- title
57
- }) => (0, _element.createElement)(_options.EnablePanelOption, {
58
- key: id,
59
- label: title,
60
- panelName: `meta-box-${id}`
61
- })));
58
+ }), (0, _lodash.map)(thirdPartyMetaBoxes, _ref3 => {
59
+ let {
60
+ id,
61
+ title
62
+ } = _ref3;
63
+ return (0, _element.createElement)(_options.EnablePanelOption, {
64
+ key: id,
65
+ label: title,
66
+ panelName: `meta-box-${id}`
67
+ });
68
+ }));
62
69
  }
63
70
 
64
71
  var _default = (0, _data.withSelect)(select => {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/meta-boxes-section.js"],"names":["MetaBoxesSection","areCustomFieldsRegistered","metaBoxes","sectionProps","thirdPartyMetaBoxes","id","length","title","select","getEditorSettings","editorStore","getAllMetaBoxes","editPostStore","enableCustomFields","undefined"],"mappings":";;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AAKO,SAASA,gBAAT,CAA2B;AACjCC,EAAAA,yBADiC;AAEjCC,EAAAA,SAFiC;AAGjC,KAAGC;AAH8B,CAA3B,EAIH;AACH;AACA,QAAMC,mBAAmB,GAAG,oBAC3BF,SAD2B,EAE3B,CAAE;AAAEG,IAAAA;AAAF,GAAF,KAAcA,EAAE,KAAK,YAFM,CAA5B;;AAKA,MAAK,CAAEJ,yBAAF,IAA+BG,mBAAmB,CAACE,MAApB,KAA+B,CAAnE,EAAuE;AACtE,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,gBAAD,EAAcH,YAAd,EACGF,yBAAyB,IAC1B,4BAAC,iCAAD;AAA0B,IAAA,KAAK,EAAG,cAAI,eAAJ;AAAlC,IAFF,EAIG,iBAAKG,mBAAL,EAA0B,CAAE;AAAEC,IAAAA,EAAF;AAAME,IAAAA;AAAN,GAAF,KAC3B,4BAAC,0BAAD;AACC,IAAA,GAAG,EAAGF,EADP;AAEC,IAAA,KAAK,EAAGE,KAFT;AAGC,IAAA,SAAS,EAAI,YAAYF,EAAI;AAH9B,IADC,CAJH,CADD;AAcA;;eAEc,sBAAcG,MAAF,IAAc;AACxC,QAAM;AAAEC,IAAAA;AAAF,MAAwBD,MAAM,CAAEE,aAAF,CAApC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAsBH,MAAM,CAAEI,YAAF,CAAlC;AAEA,SAAO;AACN;AACAX,IAAAA,yBAAyB,EACxBQ,iBAAiB,GAAGI,kBAApB,KAA2CC,SAHtC;AAINZ,IAAAA,SAAS,EAAES,eAAe;AAJpB,GAAP;AAMA,CAVc,EAUVX,gBAVU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { filter, map } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport Section from './section';\nimport { EnableCustomFieldsOption, EnablePanelOption } from './options';\nimport { store as editPostStore } from '../../store';\n\nexport function MetaBoxesSection( {\n\tareCustomFieldsRegistered,\n\tmetaBoxes,\n\t...sectionProps\n} ) {\n\t// The 'Custom Fields' meta box is a special case that we handle separately.\n\tconst thirdPartyMetaBoxes = filter(\n\t\tmetaBoxes,\n\t\t( { id } ) => id !== 'postcustom'\n\t);\n\n\tif ( ! areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Section { ...sectionProps }>\n\t\t\t{ areCustomFieldsRegistered && (\n\t\t\t\t<EnableCustomFieldsOption label={ __( 'Custom fields' ) } />\n\t\t\t) }\n\t\t\t{ map( thirdPartyMetaBoxes, ( { id, title } ) => (\n\t\t\t\t<EnablePanelOption\n\t\t\t\t\tkey={ id }\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tpanelName={ `meta-box-${ id }` }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</Section>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditorSettings } = select( editorStore );\n\tconst { getAllMetaBoxes } = select( editPostStore );\n\n\treturn {\n\t\t// This setting should not live in the block editor's store.\n\t\tareCustomFieldsRegistered:\n\t\t\tgetEditorSettings().enableCustomFields !== undefined,\n\t\tmetaBoxes: getAllMetaBoxes(),\n\t};\n} )( MetaBoxesSection );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/meta-boxes-section.js"],"names":["MetaBoxesSection","areCustomFieldsRegistered","metaBoxes","sectionProps","thirdPartyMetaBoxes","id","length","title","select","getEditorSettings","editorStore","getAllMetaBoxes","editPostStore","enableCustomFields","undefined"],"mappings":";;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AAKO,SAASA,gBAAT,OAIH;AAAA,MAJ8B;AACjCC,IAAAA,yBADiC;AAEjCC,IAAAA,SAFiC;AAGjC,OAAGC;AAH8B,GAI9B;AACH;AACA,QAAMC,mBAAmB,GAAG,oBAC3BF,SAD2B,EAE3B;AAAA,QAAE;AAAEG,MAAAA;AAAF,KAAF;AAAA,WAAcA,EAAE,KAAK,YAArB;AAAA,GAF2B,CAA5B;;AAKA,MAAK,CAAEJ,yBAAF,IAA+BG,mBAAmB,CAACE,MAApB,KAA+B,CAAnE,EAAuE;AACtE,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,gBAAD,EAAcH,YAAd,EACGF,yBAAyB,IAC1B,4BAAC,iCAAD;AAA0B,IAAA,KAAK,EAAG,cAAI,eAAJ;AAAlC,IAFF,EAIG,iBAAKG,mBAAL,EAA0B;AAAA,QAAE;AAAEC,MAAAA,EAAF;AAAME,MAAAA;AAAN,KAAF;AAAA,WAC3B,4BAAC,0BAAD;AACC,MAAA,GAAG,EAAGF,EADP;AAEC,MAAA,KAAK,EAAGE,KAFT;AAGC,MAAA,SAAS,EAAI,YAAYF,EAAI;AAH9B,MAD2B;AAAA,GAA1B,CAJH,CADD;AAcA;;eAEc,sBAAcG,MAAF,IAAc;AACxC,QAAM;AAAEC,IAAAA;AAAF,MAAwBD,MAAM,CAAEE,aAAF,CAApC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAsBH,MAAM,CAAEI,YAAF,CAAlC;AAEA,SAAO;AACN;AACAX,IAAAA,yBAAyB,EACxBQ,iBAAiB,GAAGI,kBAApB,KAA2CC,SAHtC;AAINZ,IAAAA,SAAS,EAAES,eAAe;AAJpB,GAAP;AAMA,CAVc,EAUVX,gBAVU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { filter, map } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport Section from './section';\nimport { EnableCustomFieldsOption, EnablePanelOption } from './options';\nimport { store as editPostStore } from '../../store';\n\nexport function MetaBoxesSection( {\n\tareCustomFieldsRegistered,\n\tmetaBoxes,\n\t...sectionProps\n} ) {\n\t// The 'Custom Fields' meta box is a special case that we handle separately.\n\tconst thirdPartyMetaBoxes = filter(\n\t\tmetaBoxes,\n\t\t( { id } ) => id !== 'postcustom'\n\t);\n\n\tif ( ! areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Section { ...sectionProps }>\n\t\t\t{ areCustomFieldsRegistered && (\n\t\t\t\t<EnableCustomFieldsOption label={ __( 'Custom fields' ) } />\n\t\t\t) }\n\t\t\t{ map( thirdPartyMetaBoxes, ( { id, title } ) => (\n\t\t\t\t<EnablePanelOption\n\t\t\t\t\tkey={ id }\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tpanelName={ `meta-box-${ id }` }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</Section>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditorSettings } = select( editorStore );\n\tconst { getAllMetaBoxes } = select( editPostStore );\n\n\treturn {\n\t\t// This setting should not live in the block editor's store.\n\t\tareCustomFieldsRegistered:\n\t\t\tgetEditorSettings().enableCustomFields !== undefined,\n\t\tmetaBoxes: getAllMetaBoxes(),\n\t};\n} )( MetaBoxesSection );\n"]}
@@ -12,13 +12,14 @@ var _components = require("@wordpress/components");
12
12
  /**
13
13
  * WordPress dependencies
14
14
  */
15
- function BaseOption({
16
- help,
17
- label,
18
- isChecked,
19
- onChange,
20
- children
21
- }) {
15
+ function BaseOption(_ref) {
16
+ let {
17
+ help,
18
+ label,
19
+ isChecked,
20
+ onChange,
21
+ children
22
+ } = _ref;
22
23
  return (0, _element.createElement)("div", {
23
24
  className: "edit-post-preferences-modal__option"
24
25
  }, (0, _element.createElement)(_components.ToggleControl, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/base.js"],"names":["BaseOption","help","label","isChecked","onChange","children"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,SAASA,UAAT,CAAqB;AAAEC,EAAAA,IAAF;AAAQC,EAAAA,KAAR;AAAeC,EAAAA,SAAf;AAA0BC,EAAAA,QAA1B;AAAoCC,EAAAA;AAApC,CAArB,EAAsE;AACrE,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,yBAAD;AACC,IAAA,IAAI,EAAGJ,IADR;AAEC,IAAA,KAAK,EAAGC,KAFT;AAGC,IAAA,OAAO,EAAGC,SAHX;AAIC,IAAA,QAAQ,EAAGC;AAJZ,IADD,EAOGC,QAPH,CADD;AAWA;;eAEcL,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToggleControl } from '@wordpress/components';\n\nfunction BaseOption( { help, label, isChecked, onChange, children } ) {\n\treturn (\n\t\t<div className=\"edit-post-preferences-modal__option\">\n\t\t\t<ToggleControl\n\t\t\t\thelp={ help }\n\t\t\t\tlabel={ label }\n\t\t\t\tchecked={ isChecked }\n\t\t\t\tonChange={ onChange }\n\t\t\t/>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default BaseOption;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/base.js"],"names":["BaseOption","help","label","isChecked","onChange","children"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,SAASA,UAAT,OAAsE;AAAA,MAAjD;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,KAAR;AAAeC,IAAAA,SAAf;AAA0BC,IAAAA,QAA1B;AAAoCC,IAAAA;AAApC,GAAiD;AACrE,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,yBAAD;AACC,IAAA,IAAI,EAAGJ,IADR;AAEC,IAAA,KAAK,EAAGC,KAFT;AAGC,IAAA,OAAO,EAAGC,SAHX;AAIC,IAAA,QAAQ,EAAGC;AAJZ,IADD,EAOGC,QAPH,CADD;AAWA;;eAEcL,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToggleControl } from '@wordpress/components';\n\nfunction BaseOption( { help, label, isChecked, onChange, children } ) {\n\treturn (\n\t\t<div className=\"edit-post-preferences-modal__option\">\n\t\t\t<ToggleControl\n\t\t\t\thelp={ help }\n\t\t\t\tlabel={ label }\n\t\t\t\tchecked={ isChecked }\n\t\t\t\tonChange={ onChange }\n\t\t\t/>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default BaseOption;\n"]}
@@ -28,9 +28,10 @@ var _base = _interopRequireDefault(require("./base"));
28
28
  /**
29
29
  * Internal dependencies
30
30
  */
31
- function CustomFieldsConfirmation({
32
- willEnable
33
- }) {
31
+ function CustomFieldsConfirmation(_ref) {
32
+ let {
33
+ willEnable
34
+ } = _ref;
34
35
  const [isReloading, setIsReloading] = (0, _element.useState)(false);
35
36
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("p", {
36
37
  className: "edit-post-preferences-modal__custom-fields-confirmation-message"
@@ -46,10 +47,11 @@ function CustomFieldsConfirmation({
46
47
  }, willEnable ? (0, _i18n.__)('Enable & Reload') : (0, _i18n.__)('Disable & Reload')));
47
48
  }
48
49
 
49
- function EnableCustomFieldsOption({
50
- label,
51
- areCustomFieldsEnabled
52
- }) {
50
+ function EnableCustomFieldsOption(_ref2) {
51
+ let {
52
+ label,
53
+ areCustomFieldsEnabled
54
+ } = _ref2;
53
55
  const [isChecked, setIsChecked] = (0, _element.useState)(areCustomFieldsEnabled);
54
56
  return (0, _element.createElement)(_base.default, {
55
57
  label: label,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-custom-fields.js"],"names":["CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","document","getElementById","submit","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","select","editorStore","getEditorSettings","enableCustomFields"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGO,SAASA,wBAAT,CAAmC;AAAEC,EAAAA;AAAF,CAAnC,EAAoD;AAC1D,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkC,uBAAU,KAAV,CAAxC;AAEA,SACC,qDACC;AAAG,IAAA,SAAS,EAAC;AAAb,KACG,cACD,8FADC,CADH,CADD,EAMC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,gEADX;AAEC,IAAA,OAAO,EAAC,WAFT;AAGC,IAAA,MAAM,EAAGD,WAHV;AAIC,IAAA,QAAQ,EAAGA,WAJZ;AAKC,IAAA,OAAO,EAAG,MAAM;AACfC,MAAAA,cAAc,CAAE,IAAF,CAAd;AACAC,MAAAA,QAAQ,CACNC,cADF,CACkB,2BADlB,EAEEC,MAFF;AAGA;AAVF,KAYGL,UAAU,GACT,cAAI,iBAAJ,CADS,GAET,cAAI,kBAAJ,CAdJ,CAND,CADD;AAyBA;;AAEM,SAASM,wBAAT,CAAmC;AAAEC,EAAAA,KAAF;AAASC,EAAAA;AAAT,CAAnC,EAAuE;AAC7E,QAAM,CAAEC,SAAF,EAAaC,YAAb,IAA8B,uBAAUF,sBAAV,CAApC;AAEA,SACC,4BAAC,aAAD;AACC,IAAA,KAAK,EAAGD,KADT;AAEC,IAAA,SAAS,EAAGE,SAFb;AAGC,IAAA,QAAQ,EAAGC;AAHZ,KAKGD,SAAS,KAAKD,sBAAd,IACD,4BAAC,wBAAD;AAA0B,IAAA,UAAU,EAAGC;AAAvC,IANF,CADD;AAWA;;eAEc,sBAAcE,MAAF,KAAgB;AAC1CH,EAAAA,sBAAsB,EAAE,CAAC,CAAEG,MAAM,CAAEC,aAAF,CAAN,CAAsBC,iBAAtB,GACzBC;AAFwC,CAAhB,CAAZ,EAGRR,wBAHQ,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport BaseOption from './base';\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-preferences-modal__custom-fields-confirmation-button\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isReloading }\n\t\t\t\tdisabled={ isReloading }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsReloading( true );\n\t\t\t\t\tdocument\n\t\t\t\t\t\t.getElementById( 'toggle-custom-fields-form' )\n\t\t\t\t\t\t.submit();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ willEnable\n\t\t\t\t\t? __( 'Enable & Reload' )\n\t\t\t\t\t: __( 'Disable & Reload' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) {\n\tconst [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled );\n\n\treturn (\n\t\t<BaseOption\n\t\t\tlabel={ label }\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ setIsChecked }\n\t\t>\n\t\t\t{ isChecked !== areCustomFieldsEnabled && (\n\t\t\t\t<CustomFieldsConfirmation willEnable={ isChecked } />\n\t\t\t) }\n\t\t</BaseOption>\n\t);\n}\n\nexport default withSelect( ( select ) => ( {\n\tareCustomFieldsEnabled: !! select( editorStore ).getEditorSettings()\n\t\t.enableCustomFields,\n} ) )( EnableCustomFieldsOption );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-custom-fields.js"],"names":["CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","document","getElementById","submit","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","select","editorStore","getEditorSettings","enableCustomFields"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGO,SAASA,wBAAT,OAAoD;AAAA,MAAjB;AAAEC,IAAAA;AAAF,GAAiB;AAC1D,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkC,uBAAU,KAAV,CAAxC;AAEA,SACC,qDACC;AAAG,IAAA,SAAS,EAAC;AAAb,KACG,cACD,8FADC,CADH,CADD,EAMC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,gEADX;AAEC,IAAA,OAAO,EAAC,WAFT;AAGC,IAAA,MAAM,EAAGD,WAHV;AAIC,IAAA,QAAQ,EAAGA,WAJZ;AAKC,IAAA,OAAO,EAAG,MAAM;AACfC,MAAAA,cAAc,CAAE,IAAF,CAAd;AACAC,MAAAA,QAAQ,CACNC,cADF,CACkB,2BADlB,EAEEC,MAFF;AAGA;AAVF,KAYGL,UAAU,GACT,cAAI,iBAAJ,CADS,GAET,cAAI,kBAAJ,CAdJ,CAND,CADD;AAyBA;;AAEM,SAASM,wBAAT,QAAuE;AAAA,MAApC;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAoC;AAC7E,QAAM,CAAEC,SAAF,EAAaC,YAAb,IAA8B,uBAAUF,sBAAV,CAApC;AAEA,SACC,4BAAC,aAAD;AACC,IAAA,KAAK,EAAGD,KADT;AAEC,IAAA,SAAS,EAAGE,SAFb;AAGC,IAAA,QAAQ,EAAGC;AAHZ,KAKGD,SAAS,KAAKD,sBAAd,IACD,4BAAC,wBAAD;AAA0B,IAAA,UAAU,EAAGC;AAAvC,IANF,CADD;AAWA;;eAEc,sBAAcE,MAAF,KAAgB;AAC1CH,EAAAA,sBAAsB,EAAE,CAAC,CAAEG,MAAM,CAAEC,aAAF,CAAN,CAAsBC,iBAAtB,GACzBC;AAFwC,CAAhB,CAAZ,EAGRR,wBAHQ,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport BaseOption from './base';\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-preferences-modal__custom-fields-confirmation-button\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isReloading }\n\t\t\t\tdisabled={ isReloading }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsReloading( true );\n\t\t\t\t\tdocument\n\t\t\t\t\t\t.getElementById( 'toggle-custom-fields-form' )\n\t\t\t\t\t\t.submit();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ willEnable\n\t\t\t\t\t? __( 'Enable & Reload' )\n\t\t\t\t\t: __( 'Disable & Reload' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) {\n\tconst [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled );\n\n\treturn (\n\t\t<BaseOption\n\t\t\tlabel={ label }\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ setIsChecked }\n\t\t>\n\t\t\t{ isChecked !== areCustomFieldsEnabled && (\n\t\t\t\t<CustomFieldsConfirmation willEnable={ isChecked } />\n\t\t\t) }\n\t\t</BaseOption>\n\t);\n}\n\nexport default withSelect( ( select ) => ( {\n\tareCustomFieldsEnabled: !! select( editorStore ).getEditorSettings()\n\t\t.enableCustomFields,\n} ) )( EnableCustomFieldsOption );\n"]}
@@ -22,20 +22,24 @@ var _store = require("../../../store");
22
22
  /**
23
23
  * Internal dependencies
24
24
  */
25
- var _default = (0, _compose.compose)((0, _data.withSelect)((select, {
26
- featureName
27
- }) => {
25
+ var _default = (0, _compose.compose)((0, _data.withSelect)((select, _ref) => {
26
+ let {
27
+ featureName
28
+ } = _ref;
28
29
  const {
29
30
  isFeatureActive
30
31
  } = select(_store.store);
31
32
  return {
32
33
  isChecked: isFeatureActive(featureName)
33
34
  };
34
- }), (0, _data.withDispatch)((dispatch, {
35
- featureName
36
- }) => ({
37
- onChange: () => dispatch(_store.store).toggleFeature(featureName)
38
- })))(_base.default);
35
+ }), (0, _data.withDispatch)((dispatch, _ref2) => {
36
+ let {
37
+ featureName
38
+ } = _ref2;
39
+ return {
40
+ onChange: () => dispatch(_store.store).toggleFeature(featureName)
41
+ };
42
+ }))(_base.default);
39
43
 
40
44
  exports.default = _default;
41
45
  //# sourceMappingURL=enable-feature.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-feature.js"],"names":["select","featureName","isFeatureActive","editPostStore","isChecked","dispatch","onChange","toggleFeature","BaseOption"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;eAIe,sBACd,sBAAY,CAAEA,MAAF,EAAU;AAAEC,EAAAA;AAAF,CAAV,KAA+B;AAC1C,QAAM;AAAEC,IAAAA;AAAF,MAAsBF,MAAM,CAAEG,YAAF,CAAlC;AACA,SAAO;AACNC,IAAAA,SAAS,EAAEF,eAAe,CAAED,WAAF;AADpB,GAAP;AAGA,CALD,CADc,EAOd,wBAAc,CAAEI,QAAF,EAAY;AAAEJ,EAAAA;AAAF,CAAZ,MAAmC;AAChDK,EAAAA,QAAQ,EAAE,MAAMD,QAAQ,CAAEF,YAAF,CAAR,CAA0BI,aAA1B,CAAyCN,WAAzC;AADgC,CAAnC,CAAd,CAPc,EAUZO,aAVY,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BaseOption from './base';\nimport { store as editPostStore } from '../../../store';\n\nexport default compose(\n\twithSelect( ( select, { featureName } ) => {\n\t\tconst { isFeatureActive } = select( editPostStore );\n\t\treturn {\n\t\t\tisChecked: isFeatureActive( featureName ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { featureName } ) => ( {\n\t\tonChange: () => dispatch( editPostStore ).toggleFeature( featureName ),\n\t} ) )\n)( BaseOption );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-feature.js"],"names":["select","featureName","isFeatureActive","editPostStore","isChecked","dispatch","onChange","toggleFeature","BaseOption"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;eAIe,sBACd,sBAAY,CAAEA,MAAF,WAA+B;AAAA,MAArB;AAAEC,IAAAA;AAAF,GAAqB;AAC1C,QAAM;AAAEC,IAAAA;AAAF,MAAsBF,MAAM,CAAEG,YAAF,CAAlC;AACA,SAAO;AACNC,IAAAA,SAAS,EAAEF,eAAe,CAAED,WAAF;AADpB,GAAP;AAGA,CALD,CADc,EAOd,wBAAc,CAAEI,QAAF;AAAA,MAAY;AAAEJ,IAAAA;AAAF,GAAZ;AAAA,SAAmC;AAChDK,IAAAA,QAAQ,EAAE,MAAMD,QAAQ,CAAEF,YAAF,CAAR,CAA0BI,aAA1B,CAAyCN,WAAzC;AADgC,GAAnC;AAAA,CAAd,CAPc,EAUZO,aAVY,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BaseOption from './base';\nimport { store as editPostStore } from '../../../store';\n\nexport default compose(\n\twithSelect( ( select, { featureName } ) => {\n\t\tconst { isFeatureActive } = select( editPostStore );\n\t\treturn {\n\t\t\tisChecked: isFeatureActive( featureName ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { featureName } ) => ( {\n\t\tonChange: () => dispatch( editPostStore ).toggleFeature( featureName ),\n\t} ) )\n)( BaseOption );\n"]}
@@ -22,9 +22,10 @@ var _store = require("../../../store");
22
22
  /**
23
23
  * Internal dependencies
24
24
  */
25
- var _default = (0, _compose.compose)((0, _data.withSelect)((select, {
26
- panelName
27
- }) => {
25
+ var _default = (0, _compose.compose)((0, _data.withSelect)((select, _ref) => {
26
+ let {
27
+ panelName
28
+ } = _ref;
28
29
  const {
29
30
  isEditorPanelEnabled,
30
31
  isEditorPanelRemoved
@@ -33,13 +34,19 @@ var _default = (0, _compose.compose)((0, _data.withSelect)((select, {
33
34
  isRemoved: isEditorPanelRemoved(panelName),
34
35
  isChecked: isEditorPanelEnabled(panelName)
35
36
  };
36
- }), (0, _compose.ifCondition)(({
37
- isRemoved
38
- }) => !isRemoved), (0, _data.withDispatch)((dispatch, {
39
- panelName
40
- }) => ({
41
- onChange: () => dispatch(_store.store).toggleEditorPanelEnabled(panelName)
42
- })))(_base.default);
37
+ }), (0, _compose.ifCondition)(_ref2 => {
38
+ let {
39
+ isRemoved
40
+ } = _ref2;
41
+ return !isRemoved;
42
+ }), (0, _data.withDispatch)((dispatch, _ref3) => {
43
+ let {
44
+ panelName
45
+ } = _ref3;
46
+ return {
47
+ onChange: () => dispatch(_store.store).toggleEditorPanelEnabled(panelName)
48
+ };
49
+ }))(_base.default);
43
50
 
44
51
  exports.default = _default;
45
52
  //# sourceMappingURL=enable-panel.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-panel.js"],"names":["select","panelName","isEditorPanelEnabled","isEditorPanelRemoved","editPostStore","isRemoved","isChecked","dispatch","onChange","toggleEditorPanelEnabled","BaseOption"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;eAIe,sBACd,sBAAY,CAAEA,MAAF,EAAU;AAAEC,EAAAA;AAAF,CAAV,KAA6B;AACxC,QAAM;AAAEC,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MAAiDH,MAAM,CAC5DI,YAD4D,CAA7D;AAGA,SAAO;AACNC,IAAAA,SAAS,EAAEF,oBAAoB,CAAEF,SAAF,CADzB;AAENK,IAAAA,SAAS,EAAEJ,oBAAoB,CAAED,SAAF;AAFzB,GAAP;AAIA,CARD,CADc,EAUd,0BAAa,CAAE;AAAEI,EAAAA;AAAF,CAAF,KAAqB,CAAEA,SAApC,CAVc,EAWd,wBAAc,CAAEE,QAAF,EAAY;AAAEN,EAAAA;AAAF,CAAZ,MAAiC;AAC9CO,EAAAA,QAAQ,EAAE,MACTD,QAAQ,CAAEH,YAAF,CAAR,CAA0BK,wBAA1B,CAAoDR,SAApD;AAF6C,CAAjC,CAAd,CAXc,EAeZS,aAfY,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BaseOption from './base';\nimport { store as editPostStore } from '../../../store';\n\nexport default compose(\n\twithSelect( ( select, { panelName } ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelRemoved } = select(\n\t\t\teditPostStore\n\t\t);\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( panelName ),\n\t\t\tisChecked: isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonChange: () =>\n\t\t\tdispatch( editPostStore ).toggleEditorPanelEnabled( panelName ),\n\t} ) )\n)( BaseOption );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-panel.js"],"names":["select","panelName","isEditorPanelEnabled","isEditorPanelRemoved","editPostStore","isRemoved","isChecked","dispatch","onChange","toggleEditorPanelEnabled","BaseOption"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;eAIe,sBACd,sBAAY,CAAEA,MAAF,WAA6B;AAAA,MAAnB;AAAEC,IAAAA;AAAF,GAAmB;AACxC,QAAM;AAAEC,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MAAiDH,MAAM,CAC5DI,YAD4D,CAA7D;AAGA,SAAO;AACNC,IAAAA,SAAS,EAAEF,oBAAoB,CAAEF,SAAF,CADzB;AAENK,IAAAA,SAAS,EAAEJ,oBAAoB,CAAED,SAAF;AAFzB,GAAP;AAIA,CARD,CADc,EAUd,0BAAa;AAAA,MAAE;AAAEI,IAAAA;AAAF,GAAF;AAAA,SAAqB,CAAEA,SAAvB;AAAA,CAAb,CAVc,EAWd,wBAAc,CAAEE,QAAF;AAAA,MAAY;AAAEN,IAAAA;AAAF,GAAZ;AAAA,SAAiC;AAC9CO,IAAAA,QAAQ,EAAE,MACTD,QAAQ,CAAEH,YAAF,CAAR,CAA0BK,wBAA1B,CAAoDR,SAApD;AAF6C,GAAjC;AAAA,CAAd,CAXc,EAeZS,aAfY,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BaseOption from './base';\nimport { store as editPostStore } from '../../../store';\n\nexport default compose(\n\twithSelect( ( select, { panelName } ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelRemoved } = select(\n\t\t\teditPostStore\n\t\t);\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( panelName ),\n\t\t\tisChecked: isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonChange: () =>\n\t\t\tdispatch( editPostStore ).toggleEditorPanelEnabled( panelName ),\n\t} ) )\n)( BaseOption );\n"]}
@@ -23,13 +23,16 @@ const {
23
23
  Slot
24
24
  } = (0, _components.createSlotFill)('EnablePluginDocumentSettingPanelOption');
25
25
 
26
- const EnablePluginDocumentSettingPanelOption = ({
27
- label,
28
- panelName
29
- }) => (0, _element.createElement)(Fill, null, (0, _element.createElement)(_index.EnablePanelOption, {
30
- label: label,
31
- panelName: panelName
32
- }));
26
+ const EnablePluginDocumentSettingPanelOption = _ref => {
27
+ let {
28
+ label,
29
+ panelName
30
+ } = _ref;
31
+ return (0, _element.createElement)(Fill, null, (0, _element.createElement)(_index.EnablePanelOption, {
32
+ label: label,
33
+ panelName: panelName
34
+ }));
35
+ };
33
36
 
34
37
  EnablePluginDocumentSettingPanelOption.Slot = Slot;
35
38
  var _default = EnablePluginDocumentSettingPanelOption;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-plugin-document-setting-panel.js"],"names":["Fill","Slot","EnablePluginDocumentSettingPanelOption","label","panelName"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiB,gCACtB,wCADsB,CAAvB;;AAIA,MAAMC,sCAAsC,GAAG,CAAE;AAAEC,EAAAA,KAAF;AAASC,EAAAA;AAAT,CAAF,KAC9C,4BAAC,IAAD,QACC,4BAAC,wBAAD;AAAmB,EAAA,KAAK,EAAGD,KAA3B;AAAmC,EAAA,SAAS,EAAGC;AAA/C,EADD,CADD;;AAMAF,sCAAsC,CAACD,IAAvC,GAA8CA,IAA9C;eAEeC,sC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { EnablePanelOption } from './index';\n\nconst { Fill, Slot } = createSlotFill(\n\t'EnablePluginDocumentSettingPanelOption'\n);\n\nconst EnablePluginDocumentSettingPanelOption = ( { label, panelName } ) => (\n\t<Fill>\n\t\t<EnablePanelOption label={ label } panelName={ panelName } />\n\t</Fill>\n);\n\nEnablePluginDocumentSettingPanelOption.Slot = Slot;\n\nexport default EnablePluginDocumentSettingPanelOption;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-plugin-document-setting-panel.js"],"names":["Fill","Slot","EnablePluginDocumentSettingPanelOption","label","panelName"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiB,gCACtB,wCADsB,CAAvB;;AAIA,MAAMC,sCAAsC,GAAG;AAAA,MAAE;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAF;AAAA,SAC9C,4BAAC,IAAD,QACC,4BAAC,wBAAD;AAAmB,IAAA,KAAK,EAAGD,KAA3B;AAAmC,IAAA,SAAS,EAAGC;AAA/C,IADD,CAD8C;AAAA,CAA/C;;AAMAF,sCAAsC,CAACD,IAAvC,GAA8CA,IAA9C;eAEeC,sC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { EnablePanelOption } from './index';\n\nconst { Fill, Slot } = createSlotFill(\n\t'EnablePluginDocumentSettingPanelOption'\n);\n\nconst EnablePluginDocumentSettingPanelOption = ( { label, panelName } ) => (\n\t<Fill>\n\t\t<EnablePanelOption label={ label } panelName={ panelName } />\n\t</Fill>\n);\n\nEnablePluginDocumentSettingPanelOption.Slot = Slot;\n\nexport default EnablePluginDocumentSettingPanelOption;\n"]}
@@ -11,6 +11,12 @@ Object.defineProperty(exports, "EnableCustomFieldsOption", {
11
11
  return _enableCustomFields.default;
12
12
  }
13
13
  });
14
+ Object.defineProperty(exports, "EnableFeature", {
15
+ enumerable: true,
16
+ get: function () {
17
+ return _enableFeature.default;
18
+ }
19
+ });
14
20
  Object.defineProperty(exports, "EnablePanelOption", {
15
21
  enumerable: true,
16
22
  get: function () {
@@ -29,12 +35,6 @@ Object.defineProperty(exports, "EnablePublishSidebarOption", {
29
35
  return _enablePublishSidebar.default;
30
36
  }
31
37
  });
32
- Object.defineProperty(exports, "EnableFeature", {
33
- enumerable: true,
34
- get: function () {
35
- return _enableFeature.default;
36
- }
37
- });
38
38
 
39
39
  var _enableCustomFields = _interopRequireDefault(require("./enable-custom-fields"));
40
40