@wordpress/edit-post 7.34.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/CHANGELOG.md +15 -2
  2. package/build/commands/use-commands.js +56 -0
  3. package/build/commands/use-commands.js.map +1 -0
  4. package/build/components/{header/fullscreen-mode-close/index.js → back-button/fullscreen-mode-close.js} +18 -16
  5. package/build/components/back-button/fullscreen-mode-close.js.map +1 -0
  6. package/build/components/back-button/index.js +57 -0
  7. package/build/components/back-button/index.js.map +1 -0
  8. package/build/components/header/header-toolbar/index.native.js +63 -62
  9. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  10. package/build/components/header/index.native.js +2 -2
  11. package/build/components/header/index.native.js.map +1 -1
  12. package/build/components/init-pattern-modal/index.js +50 -43
  13. package/build/components/init-pattern-modal/index.js.map +1 -1
  14. package/build/components/layout/index.js +134 -156
  15. package/build/components/layout/index.js.map +1 -1
  16. package/build/components/layout/index.native.js +28 -21
  17. package/build/components/layout/index.native.js.map +1 -1
  18. package/build/components/{visual-editor → layout}/use-padding-appender.js +6 -1
  19. package/build/components/layout/use-padding-appender.js.map +1 -0
  20. package/build/components/layout/use-should-iframe.js +46 -0
  21. package/build/components/layout/use-should-iframe.js.map +1 -0
  22. package/build/components/meta-boxes/index.js +10 -9
  23. package/build/components/meta-boxes/index.js.map +1 -1
  24. package/build/components/meta-boxes/meta-boxes-area/index.js +13 -13
  25. package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  26. package/build/components/more-menu/index.js +49 -0
  27. package/build/components/more-menu/index.js.map +1 -0
  28. package/build/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +6 -5
  29. package/build/components/more-menu/manage-patterns-menu-item.js.map +1 -0
  30. package/build/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +2 -2
  31. package/build/components/more-menu/welcome-guide-menu-item.js.map +1 -0
  32. package/build/components/preferences-modal/enable-custom-fields.js +23 -18
  33. package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
  34. package/build/components/preferences-modal/index.js +4 -4
  35. package/build/components/preferences-modal/index.js.map +1 -1
  36. package/build/components/preferences-modal/meta-boxes-section.js +13 -13
  37. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  38. package/build/components/visual-editor/header.native.js +11 -10
  39. package/build/components/visual-editor/header.native.js.map +1 -1
  40. package/build/components/visual-editor/index.native.js +3 -3
  41. package/build/components/visual-editor/index.native.js.map +1 -1
  42. package/build/components/welcome-guide/default.js +50 -33
  43. package/build/components/welcome-guide/default.js.map +1 -1
  44. package/build/components/welcome-guide/image.js +13 -12
  45. package/build/components/welcome-guide/image.js.map +1 -1
  46. package/build/components/welcome-guide/index.js +2 -2
  47. package/build/components/welcome-guide/index.js.map +1 -1
  48. package/build/components/welcome-guide/template.js +12 -8
  49. package/build/components/welcome-guide/template.js.map +1 -1
  50. package/build/deprecated.js +9 -9
  51. package/build/deprecated.js.map +1 -1
  52. package/build/editor.js +16 -11
  53. package/build/editor.js.map +1 -1
  54. package/build/editor.native.js +18 -12
  55. package/build/editor.native.js.map +1 -1
  56. package/build/index.js +12 -13
  57. package/build/index.js.map +1 -1
  58. package/build/index.native.js +2 -2
  59. package/build/index.native.js.map +1 -1
  60. package/build/store/selectors.js +1 -1
  61. package/build/store/selectors.js.map +1 -1
  62. package/build-module/commands/use-commands.js +49 -0
  63. package/build-module/commands/use-commands.js.map +1 -0
  64. package/build-module/components/{header/fullscreen-mode-close/index.js → back-button/fullscreen-mode-close.js} +18 -16
  65. package/build-module/components/back-button/fullscreen-mode-close.js.map +1 -0
  66. package/build-module/components/back-button/index.js +49 -0
  67. package/build-module/components/back-button/index.js.map +1 -0
  68. package/build-module/components/header/header-toolbar/index.native.js +64 -62
  69. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  70. package/build-module/components/header/index.native.js +2 -2
  71. package/build-module/components/header/index.native.js.map +1 -1
  72. package/build-module/components/init-pattern-modal/index.js +52 -43
  73. package/build-module/components/init-pattern-modal/index.js.map +1 -1
  74. package/build-module/components/layout/index.js +139 -159
  75. package/build-module/components/layout/index.js.map +1 -1
  76. package/build-module/components/layout/index.native.js +30 -21
  77. package/build-module/components/layout/index.native.js.map +1 -1
  78. package/build-module/components/{visual-editor → layout}/use-padding-appender.js +6 -1
  79. package/build-module/components/layout/use-padding-appender.js.map +1 -0
  80. package/build-module/components/layout/use-should-iframe.js +39 -0
  81. package/build-module/components/layout/use-should-iframe.js.map +1 -0
  82. package/build-module/components/meta-boxes/index.js +12 -9
  83. package/build-module/components/meta-boxes/index.js.map +1 -1
  84. package/build-module/components/meta-boxes/meta-boxes-area/index.js +13 -11
  85. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  86. package/build-module/components/more-menu/index.js +43 -0
  87. package/build-module/components/more-menu/index.js.map +1 -0
  88. package/build-module/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +6 -5
  89. package/build-module/components/more-menu/manage-patterns-menu-item.js.map +1 -0
  90. package/build-module/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +2 -2
  91. package/build-module/components/more-menu/welcome-guide-menu-item.js.map +1 -0
  92. package/build-module/components/preferences-modal/enable-custom-fields.js +25 -18
  93. package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
  94. package/build-module/components/preferences-modal/index.js +4 -4
  95. package/build-module/components/preferences-modal/index.js.map +1 -1
  96. package/build-module/components/preferences-modal/meta-boxes-section.js +14 -13
  97. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  98. package/build-module/components/visual-editor/header.native.js +11 -10
  99. package/build-module/components/visual-editor/header.native.js.map +1 -1
  100. package/build-module/components/visual-editor/index.native.js +3 -3
  101. package/build-module/components/visual-editor/index.native.js.map +1 -1
  102. package/build-module/components/welcome-guide/default.js +52 -33
  103. package/build-module/components/welcome-guide/default.js.map +1 -1
  104. package/build-module/components/welcome-guide/image.js +14 -12
  105. package/build-module/components/welcome-guide/image.js.map +1 -1
  106. package/build-module/components/welcome-guide/index.js +2 -2
  107. package/build-module/components/welcome-guide/index.js.map +1 -1
  108. package/build-module/components/welcome-guide/template.js +14 -8
  109. package/build-module/components/welcome-guide/template.js.map +1 -1
  110. package/build-module/deprecated.js +9 -9
  111. package/build-module/deprecated.js.map +1 -1
  112. package/build-module/editor.js +17 -11
  113. package/build-module/editor.js.map +1 -1
  114. package/build-module/editor.native.js +18 -12
  115. package/build-module/editor.native.js.map +1 -1
  116. package/build-module/index.js +10 -7
  117. package/build-module/index.js.map +1 -1
  118. package/build-module/index.native.js +2 -2
  119. package/build-module/index.native.js.map +1 -1
  120. package/build-module/store/selectors.js +1 -1
  121. package/build-module/store/selectors.js.map +1 -1
  122. package/build-style/style-rtl.css +31 -392
  123. package/build-style/style.css +31 -392
  124. package/package.json +33 -33
  125. package/src/commands/use-commands.js +48 -0
  126. package/src/components/{header/fullscreen-mode-close/index.js → back-button/fullscreen-mode-close.js} +3 -3
  127. package/src/components/back-button/index.js +34 -0
  128. package/src/components/{header/fullscreen-mode-close → back-button}/style.scss +16 -2
  129. package/src/components/{header/fullscreen-mode-close/test/index.js → back-button/test/fullscreen-mode-close.js} +1 -1
  130. package/src/components/layout/index.js +151 -207
  131. package/src/components/layout/style.scss +9 -17
  132. package/src/components/{visual-editor → layout}/use-padding-appender.js +7 -1
  133. package/src/components/layout/use-should-iframe.js +40 -0
  134. package/src/components/meta-boxes/meta-boxes-area/index.js +4 -8
  135. package/src/components/{header/more-menu → more-menu}/index.js +2 -2
  136. package/src/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +1 -1
  137. package/src/index.js +11 -6
  138. package/src/store/selectors.js +8 -5
  139. package/src/style.scss +3 -10
  140. package/src/test/__snapshots__/editor.native.js.snap +72 -0
  141. package/src/test/editor.native.js +77 -0
  142. package/build/components/header/fullscreen-mode-close/index.js.map +0 -1
  143. package/build/components/header/index.js +0 -158
  144. package/build/components/header/index.js.map +0 -1
  145. package/build/components/header/main-dashboard-button/index.js +0 -33
  146. package/build/components/header/main-dashboard-button/index.js.map +0 -1
  147. package/build/components/header/more-menu/index.js +0 -43
  148. package/build/components/header/more-menu/index.js.map +0 -1
  149. package/build/components/header/more-menu/manage-patterns-menu-item.js.map +0 -1
  150. package/build/components/header/more-menu/welcome-guide-menu-item.js.map +0 -1
  151. package/build/components/sidebar/post-format/index.js +0 -21
  152. package/build/components/sidebar/post-format/index.js.map +0 -1
  153. package/build/components/sidebar/post-pending-status/index.js +0 -26
  154. package/build/components/sidebar/post-pending-status/index.js.map +0 -1
  155. package/build/components/sidebar/post-slug/index.js +0 -21
  156. package/build/components/sidebar/post-slug/index.js.map +0 -1
  157. package/build/components/sidebar/post-status/index.js +0 -92
  158. package/build/components/sidebar/post-status/index.js.map +0 -1
  159. package/build/components/sidebar/post-sticky/index.js +0 -26
  160. package/build/components/sidebar/post-sticky/index.js.map +0 -1
  161. package/build/components/sidebar/post-trash/index.js +0 -16
  162. package/build/components/sidebar/post-trash/index.js.map +0 -1
  163. package/build/components/sidebar/post-visibility/index.js +0 -78
  164. package/build/components/sidebar/post-visibility/index.js.map +0 -1
  165. package/build/components/sidebar/settings-header/index.js +0 -53
  166. package/build/components/sidebar/settings-header/index.js.map +0 -1
  167. package/build/components/sidebar/settings-sidebar/index.js +0 -193
  168. package/build/components/sidebar/settings-sidebar/index.js.map +0 -1
  169. package/build/components/text-editor/index.js +0 -61
  170. package/build/components/text-editor/index.js.map +0 -1
  171. package/build/components/visual-editor/block-inspector-button.js +0 -55
  172. package/build/components/visual-editor/block-inspector-button.js.map +0 -1
  173. package/build/components/visual-editor/index.js +0 -92
  174. package/build/components/visual-editor/index.js.map +0 -1
  175. package/build/components/visual-editor/use-padding-appender.js.map +0 -1
  176. package/build/hooks/commands/use-common-commands.js +0 -119
  177. package/build/hooks/commands/use-common-commands.js.map +0 -1
  178. package/build/hooks/components/index.js +0 -11
  179. package/build/hooks/components/index.js.map +0 -1
  180. package/build/hooks/index.js +0 -5
  181. package/build/hooks/index.js.map +0 -1
  182. package/build/hooks/validate-multiple-use/index.js +0 -134
  183. package/build/hooks/validate-multiple-use/index.js.map +0 -1
  184. package/build-module/components/header/fullscreen-mode-close/index.js.map +0 -1
  185. package/build-module/components/header/index.js +0 -150
  186. package/build-module/components/header/index.js.map +0 -1
  187. package/build-module/components/header/main-dashboard-button/index.js +0 -26
  188. package/build-module/components/header/main-dashboard-button/index.js.map +0 -1
  189. package/build-module/components/header/more-menu/index.js +0 -35
  190. package/build-module/components/header/more-menu/index.js.map +0 -1
  191. package/build-module/components/header/more-menu/manage-patterns-menu-item.js.map +0 -1
  192. package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +0 -1
  193. package/build-module/components/sidebar/post-format/index.js +0 -13
  194. package/build-module/components/sidebar/post-format/index.js.map +0 -1
  195. package/build-module/components/sidebar/post-pending-status/index.js +0 -18
  196. package/build-module/components/sidebar/post-pending-status/index.js.map +0 -1
  197. package/build-module/components/sidebar/post-slug/index.js +0 -13
  198. package/build-module/components/sidebar/post-slug/index.js.map +0 -1
  199. package/build-module/components/sidebar/post-status/index.js +0 -84
  200. package/build-module/components/sidebar/post-status/index.js.map +0 -1
  201. package/build-module/components/sidebar/post-sticky/index.js +0 -18
  202. package/build-module/components/sidebar/post-sticky/index.js.map +0 -1
  203. package/build-module/components/sidebar/post-trash/index.js +0 -9
  204. package/build-module/components/sidebar/post-trash/index.js.map +0 -1
  205. package/build-module/components/sidebar/post-visibility/index.js +0 -70
  206. package/build-module/components/sidebar/post-visibility/index.js.map +0 -1
  207. package/build-module/components/sidebar/settings-header/index.js +0 -46
  208. package/build-module/components/sidebar/settings-header/index.js.map +0 -1
  209. package/build-module/components/sidebar/settings-sidebar/index.js +0 -185
  210. package/build-module/components/sidebar/settings-sidebar/index.js.map +0 -1
  211. package/build-module/components/text-editor/index.js +0 -54
  212. package/build-module/components/text-editor/index.js.map +0 -1
  213. package/build-module/components/visual-editor/block-inspector-button.js +0 -47
  214. package/build-module/components/visual-editor/block-inspector-button.js.map +0 -1
  215. package/build-module/components/visual-editor/index.js +0 -84
  216. package/build-module/components/visual-editor/index.js.map +0 -1
  217. package/build-module/components/visual-editor/use-padding-appender.js.map +0 -1
  218. package/build-module/hooks/commands/use-common-commands.js +0 -112
  219. package/build-module/hooks/commands/use-common-commands.js.map +0 -1
  220. package/build-module/hooks/components/index.js +0 -8
  221. package/build-module/hooks/components/index.js.map +0 -1
  222. package/build-module/hooks/index.js +0 -6
  223. package/build-module/hooks/index.js.map +0 -1
  224. package/build-module/hooks/validate-multiple-use/index.js +0 -132
  225. package/build-module/hooks/validate-multiple-use/index.js.map +0 -1
  226. package/src/components/header/index.js +0 -156
  227. package/src/components/header/main-dashboard-button/index.js +0 -28
  228. package/src/components/header/style.scss +0 -251
  229. package/src/components/sidebar/post-format/index.js +0 -20
  230. package/src/components/sidebar/post-format/style.scss +0 -5
  231. package/src/components/sidebar/post-pending-status/index.js +0 -27
  232. package/src/components/sidebar/post-slug/index.js +0 -17
  233. package/src/components/sidebar/post-slug/style.scss +0 -5
  234. package/src/components/sidebar/post-status/index.js +0 -128
  235. package/src/components/sidebar/post-sticky/index.js +0 -27
  236. package/src/components/sidebar/post-trash/index.js +0 -12
  237. package/src/components/sidebar/post-visibility/index.js +0 -88
  238. package/src/components/sidebar/post-visibility/style.scss +0 -5
  239. package/src/components/sidebar/settings-header/index.js +0 -49
  240. package/src/components/sidebar/settings-sidebar/index.js +0 -247
  241. package/src/components/sidebar/style.scss +0 -18
  242. package/src/components/text-editor/index.js +0 -63
  243. package/src/components/text-editor/style.scss +0 -71
  244. package/src/components/visual-editor/block-inspector-button.js +0 -59
  245. package/src/components/visual-editor/index.js +0 -101
  246. package/src/components/visual-editor/style.scss +0 -53
  247. package/src/hooks/commands/use-common-commands.js +0 -126
  248. package/src/hooks/components/index.js +0 -13
  249. package/src/hooks/index.js +0 -5
  250. package/src/hooks/validate-multiple-use/index.js +0 -163
  251. /package/src/components/{header/fullscreen-mode-close/test/__snapshots__/index.js.snap → back-button/test/__snapshots__/fullscreen-mode-close.js.snap} +0 -0
  252. /package/src/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_preferences","_coreData","_editor","_deprecated","_interopRequireDefault","_lockUnlock","interfaceStore","unlock","editorPrivateApis","EMPTY_ARRAY","EMPTY_OBJECT","getEditorMode","exports","createRegistrySelector","select","_select$get","preferencesStore","get","isEditorSidebarOpened","activeGeneralSidebar","getActiveComplementaryArea","includes","isPluginSidebarOpened","getActiveGeneralSidebarName","convertPanelsToOldFormat","inactivePanels","openPanels","_ref","panelsWithEnabledState","reduce","accumulatedPanels","panelName","enabled","panels","currentPanelState","opened","getPreferences","deprecated","since","alternative","corePreferences","accumulatedPrefs","preferenceKey","value","getPreference","state","defaultValue","preferences","undefined","getHiddenBlockTypes","_select$get2","isPublishSidebarOpened","editorStore","isEditorPanelRemoved","isEditorPanelEnabled","isEditorPanelOpened","isModalActive","modalName","isFeatureActive","feature","isPluginItemPinned","pluginName","isItemPinned","getActiveMetaBoxLocations","createSelector","Object","keys","metaBoxes","locations","filter","location","isMetaBoxLocationActive","isMetaBoxLocationVisible","getMetaBoxesPerLocation","some","id","length","getAllMetaBoxes","values","flat","hasMetaBoxes","isSavingMetaBoxes","isSaving","__experimentalGetPreviewDeviceType","version","getDeviceType","isInserterOpened","__experimentalGetInsertionPoint","getInsertionPoint","isListViewOpened","isEditingTemplate","getCurrentPostType","areMetaBoxesInitialized","initialized","getEditedPostTemplate","postId","type","postType","slug","getCurrentPost","getSite","getEditedEntityRecord","getEntityRecords","coreStore","siteSettings","isPostsPage","page_for_posts","defaultTemplateId","getDefaultTemplateId","currentTemplate","getEditedPostAttribute","templateWithSameSlug","per_page","find","template","slugToCheck"],"sources":["@wordpress/edit-post/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\nconst EMPTY_ARRAY = [];\nconst EMPTY_OBJECT = {};\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport const getEditorMode = createRegistrySelector(\n\t( select ) => () =>\n\t\tselect( preferencesStore ).get( 'core', 'editorMode' ) ?? 'visual'\n);\n\n/**\n * Returns true if the editor sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the editor sidebar is opened.\n */\nexport const isEditorSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\treturn [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\tactiveGeneralSidebar\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the plugin sidebar is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the plugin sidebar is opened.\n */\nexport const isPluginSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\treturn (\n\t\t\t!! activeGeneralSidebar &&\n\t\t\t! [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\t\tactiveGeneralSidebar\n\t\t\t)\n\t\t);\n\t}\n);\n\n/**\n * Returns the current active general sidebar name, or null if there is no\n * general sidebar active. The active general sidebar is a unique name to\n * identify either an editor or plugin sidebar.\n *\n * Examples:\n *\n * - `edit-post/document`\n * - `my-plugin/insert-image-sidebar`\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Active general sidebar name.\n */\nexport const getActiveGeneralSidebarName = createRegistrySelector(\n\t( select ) => () => {\n\t\treturn select( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t}\n);\n\n/**\n * Converts panels from the new preferences store format to the old format\n * that the post editor previously used.\n *\n * The resultant converted data should look like this:\n * {\n * panelName: {\n * enabled: false,\n * opened: true,\n * },\n * anotherPanelName: {\n * opened: true\n * },\n * }\n *\n * @param {string[] | undefined} inactivePanels An array of inactive panel names.\n * @param {string[] | undefined} openPanels An array of open panel names.\n *\n * @return {Object} The converted panel data.\n */\nfunction convertPanelsToOldFormat( inactivePanels, openPanels ) {\n\t// First reduce the inactive panels.\n\tconst panelsWithEnabledState = inactivePanels?.reduce(\n\t\t( accumulatedPanels, panelName ) => ( {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\tenabled: false,\n\t\t\t},\n\t\t} ),\n\t\t{}\n\t);\n\n\t// Then reduce the open panels, passing in the result of the previous\n\t// reduction as the initial value so that both open and inactive\n\t// panel state is combined.\n\tconst panels = openPanels?.reduce( ( accumulatedPanels, panelName ) => {\n\t\tconst currentPanelState = accumulatedPanels?.[ panelName ];\n\t\treturn {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\t...currentPanelState,\n\t\t\t\topened: true,\n\t\t\t},\n\t\t};\n\t}, panelsWithEnabledState ?? {} );\n\n\t// The panels variable will only be set if openPanels wasn't `undefined`.\n\t// If it isn't set just return `panelsWithEnabledState`, and if that isn't\n\t// set return an empty object.\n\treturn panels ?? panelsWithEnabledState ?? EMPTY_OBJECT;\n}\n\n/**\n * Returns the preferences (these preferences are persisted locally).\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Preferences Object.\n */\nexport const getPreferences = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).getPreferences`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\tconst corePreferences = [ 'editorMode', 'hiddenBlockTypes' ].reduce(\n\t\t( accumulatedPrefs, preferenceKey ) => {\n\t\t\tconst value = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\tpreferenceKey\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\t...accumulatedPrefs,\n\t\t\t\t[ preferenceKey ]: value,\n\t\t\t};\n\t\t},\n\t\t{}\n\t);\n\n\t// Panels were a preference, but the data structure changed when the state\n\t// was migrated to the preferences store. They need to be converted from\n\t// the new preferences store format to old format to ensure no breaking\n\t// changes for plugins.\n\tconst inactivePanels = select( preferencesStore ).get(\n\t\t'core',\n\t\t'inactivePanels'\n\t);\n\tconst openPanels = select( preferencesStore ).get( 'core', 'openPanels' );\n\tconst panels = convertPanelsToOldFormat( inactivePanels, openPanels );\n\n\treturn {\n\t\t...corePreferences,\n\t\tpanels,\n\t};\n} );\n\n/**\n *\n * @param {Object} state Global application state.\n * @param {string} preferenceKey Preference Key.\n * @param {*} defaultValue Default Value.\n *\n * @return {*} Preference Value.\n */\nexport function getPreference( state, preferenceKey, defaultValue ) {\n\tdeprecated( `select( 'core/edit-post' ).getPreference`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\t// Avoid using the `getPreferences` registry selector where possible.\n\tconst preferences = getPreferences( state );\n\tconst value = preferences[ preferenceKey ];\n\treturn value === undefined ? defaultValue : value;\n}\n\n/**\n * Returns an array of blocks that are hidden.\n *\n * @return {Array} A list of the hidden block types\n */\nexport const getHiddenBlockTypes = createRegistrySelector( ( select ) => () => {\n\treturn (\n\t\tselect( preferencesStore ).get( 'core', 'hiddenBlockTypes' ) ??\n\t\tEMPTY_ARRAY\n\t);\n} );\n\n/**\n * Returns true if the publish sidebar is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the publish sidebar is open.\n */\nexport const isPublishSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated( `select( 'core/edit-post' ).isPublishSidebarOpened`, {\n\t\t\tsince: '6.6',\n\t\t\talternative: `select( 'core/editor' ).isPublishSidebarOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isPublishSidebarOpened();\n\t}\n);\n\n/**\n * Returns true if the given panel was programmatically removed, or false otherwise.\n * All panels are not removed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is removed.\n */\nexport const isEditorPanelRemoved = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelRemoved`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelRemoved`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelRemoved( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is enabled, or false otherwise. Panels are\n * enabled by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is enabled.\n */\nexport const isEditorPanelEnabled = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelEnabled`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelEnabled`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelEnabled( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is open, or false otherwise. Panels are\n * closed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is open.\n */\nexport const isEditorPanelOpened = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelOpened`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelOpened( panelName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @deprecated since WP 6.3 use `core/interface` store's selector with the same name instead.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport const isModalActive = createRegistrySelector(\n\t( select ) => ( state, modalName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isModalActive`, {\n\t\t\tsince: '6.3',\n\t\t\talternative: `select( 'core/interface' ).isModalActive`,\n\t\t} );\n\t\treturn !! select( interfaceStore ).isModalActive( modalName );\n\t}\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, feature ) => {\n\t\treturn !! select( preferencesStore ).get( 'core/edit-post', feature );\n\t}\n);\n\n/**\n * Returns true if the plugin item is pinned to the header.\n * When the value is not set it defaults to true.\n *\n * @param {Object} state Global application state.\n * @param {string} pluginName Plugin item name.\n *\n * @return {boolean} Whether the plugin item is pinned.\n */\nexport const isPluginItemPinned = createRegistrySelector(\n\t( select ) => ( state, pluginName ) => {\n\t\treturn select( interfaceStore ).isItemPinned( 'core', pluginName );\n\t}\n);\n\n/**\n * Returns an array of active meta box locations.\n *\n * @param {Object} state Post editor state.\n *\n * @return {string[]} Active meta box locations.\n */\nexport const getActiveMetaBoxLocations = createSelector(\n\t( state ) => {\n\t\treturn Object.keys( state.metaBoxes.locations ).filter( ( location ) =>\n\t\t\tisMetaBoxLocationActive( state, location )\n\t\t);\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if a metabox location is active and visible\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active and visible.\n */\nexport const isMetaBoxLocationVisible = createRegistrySelector(\n\t( select ) => ( state, location ) => {\n\t\treturn (\n\t\t\tisMetaBoxLocationActive( state, location ) &&\n\t\t\tgetMetaBoxesPerLocation( state, location )?.some( ( { id } ) => {\n\t\t\t\treturn select( editorStore ).isEditorPanelEnabled(\n\t\t\t\t\tstate,\n\t\t\t\t\t`meta-box-${ id }`\n\t\t\t\t);\n\t\t\t} )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if there is an active meta box in the given location, or false\n * otherwise.\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active.\n */\nexport function isMetaBoxLocationActive( state, location ) {\n\tconst metaBoxes = getMetaBoxesPerLocation( state, location );\n\treturn !! metaBoxes && metaBoxes.length !== 0;\n}\n\n/**\n * Returns the list of all the available meta boxes for a given location.\n *\n * @param {Object} state Global application state.\n * @param {string} location Meta box location to test.\n *\n * @return {?Array} List of meta boxes.\n */\nexport function getMetaBoxesPerLocation( state, location ) {\n\treturn state.metaBoxes.locations[ location ];\n}\n\n/**\n * Returns the list of all the available meta boxes.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} List of meta boxes.\n */\nexport const getAllMetaBoxes = createSelector(\n\t( state ) => {\n\t\treturn Object.values( state.metaBoxes.locations ).flat();\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if the post is using Meta Boxes\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether there are metaboxes or not.\n */\nexport function hasMetaBoxes( state ) {\n\treturn getActiveMetaBoxLocations( state ).length > 0;\n}\n\n/**\n * Returns true if the Meta Boxes are being saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the metaboxes are being saved.\n */\nexport function isSavingMetaBoxes( state ) {\n\treturn state.metaBoxes.isSaving;\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport const __experimentalGetPreviewDeviceType = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\talternative: `select( 'core/editor' ).getDeviceType`,\n\t\t\t}\n\t\t);\n\t\treturn select( editorStore ).getDeviceType();\n\t}\n);\n\n/**\n * Returns true if the inserter is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport const isInserterOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isInserterOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isInserterOpened`,\n\t} );\n\treturn select( editorStore ).isInserterOpened();\n} );\n\n/**\n * Get the insertion point for the inserter.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-post' ).__experimentalGetInsertionPoint`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t}\n\t\t);\n\t\treturn unlock( select( editorStore ) ).getInsertionPoint();\n\t}\n);\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport const isListViewOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isListViewOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isListViewOpened`,\n\t} );\n\treturn select( editorStore ).isListViewOpened();\n} );\n\n/**\n * Returns true if the template editing mode is enabled.\n *\n * @deprecated\n */\nexport const isEditingTemplate = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isEditingTemplate`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).getRenderingMode`,\n\t} );\n\treturn select( editorStore ).getCurrentPostType() === 'wp_template';\n} );\n\n/**\n * Returns true if meta boxes are initialized.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether meta boxes are initialized.\n */\nexport function areMetaBoxesInitialized( state ) {\n\treturn state.metaBoxes.initialized;\n}\n\n/**\n * Retrieves the template of the currently edited post.\n *\n * @return {Object?} Post Template.\n */\nexport const getEditedPostTemplate = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst {\n\t\t\tid: postId,\n\t\t\ttype: postType,\n\t\t\tslug,\n\t\t} = select( editorStore ).getCurrentPost();\n\t\tconst { getSite, getEditedEntityRecord, getEntityRecords } =\n\t\t\tselect( coreStore );\n\t\tconst siteSettings = getSite();\n\t\t// First check if the current page is set as the posts page.\n\t\tconst isPostsPage = +postId === siteSettings?.page_for_posts;\n\t\tif ( isPostsPage ) {\n\t\t\tconst defaultTemplateId = select( coreStore ).getDefaultTemplateId(\n\t\t\t\t{ slug: 'home' }\n\t\t\t);\n\t\t\treturn getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\tdefaultTemplateId\n\t\t\t);\n\t\t}\n\t\tconst currentTemplate =\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' );\n\t\tif ( currentTemplate ) {\n\t\t\tconst templateWithSameSlug = getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\t{ per_page: -1 }\n\t\t\t)?.find( ( template ) => template.slug === currentTemplate );\n\t\t\tif ( ! templateWithSameSlug ) {\n\t\t\t\treturn templateWithSameSlug;\n\t\t\t}\n\t\t\treturn getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\ttemplateWithSameSlug.id\n\t\t\t);\n\t\t}\n\t\tlet slugToCheck;\n\t\t// In `draft` status we might not have a slug available, so we use the `single`\n\t\t// post type templates slug(ex page, single-post, single-product etc..).\n\t\t// Pages do not need the `single` prefix in the slug to be prioritized\n\t\t// through template hierarchy.\n\t\tif ( slug ) {\n\t\t\tslugToCheck =\n\t\t\t\tpostType === 'page'\n\t\t\t\t\t? `${ postType }-${ slug }`\n\t\t\t\t\t: `single-${ postType }-${ slug }`;\n\t\t} else {\n\t\t\tslugToCheck = postType === 'page' ? 'page' : `single-${ postType }`;\n\t\t}\n\t\tconst defaultTemplateId = select( coreStore ).getDefaultTemplateId( {\n\t\t\tslug: slugToCheck,\n\t\t} );\n\t\treturn select( coreStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template',\n\t\t\tdefaultTemplateId\n\t\t);\n\t}\n);\n"],"mappings":";;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAIA,IAAAI,WAAA,GAAAC,sBAAA,CAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AAfA;AACA;AACA;;AAUA;AACA;AACA;;AAGA,MAAM;EAAEO;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AACtD,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAMC,YAAY,GAAG,CAAC,CAAC;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAAE,4BAAsB,EAChDC,MAAM,IAAM;EAAA,IAAAC,WAAA;EAAA,QAAAA,WAAA,GACbD,MAAM,CAAEE,kBAAiB,CAAC,CAACC,GAAG,CAAE,MAAM,EAAE,YAAa,CAAC,cAAAF,WAAA,cAAAA,WAAA,GAAI,QAAQ;AAAA,CACpE,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,qBAAqB,GAAAN,OAAA,CAAAM,qBAAA,GAAG,IAAAL,4BAAsB,EACxDC,MAAM,IAAM,MAAM;EACnB,MAAMK,oBAAoB,GACzBL,MAAM,CAAER,cAAe,CAAC,CAACc,0BAA0B,CAAE,MAAO,CAAC;EAC9D,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ACD,CAAC;EACF;EACA,MAAME,eAAe,GACpB/F,MAAM,CAAEsC,aAAY,CAAC,CAAC0D,sBAAsB,CAAE,UAAW,CAAC;EAC3D,IAAKD,eAAe,EAAG;IACtB,MAAME,oBAAoB,GAAGT,gBAAgB,CAC5C,UAAU,EACV,aAAa,EACb;MAAEU,QAAQ,EAAE,CAAC;IAAE,CAChB,CAAC,EAAEC,IAAI,CAAIC,QAAQ,IAAMA,QAAQ,CAAChB,IAAI,KAAKW,eAAgB,CAAC;IAC5D,IAAK,CAAEE,oBAAoB,EAAG;MAC7B,OAAOA,oBAAoB;IAC5B;IACA,OAAOV,qBAAqB,CAC3B,UAAU,EACV,aAAa,EACbU,oBAAoB,CAACpC,EACtB,CAAC;EACF;EACA,IAAIwC,WAAW;EACf;EACA;EACA;EACA;EACA,IAAKjB,IAAI,EAAG;IACXiB,WAAW,GACVlB,QAAQ,KAAK,MAAM,GACf,GAAGA,QAAU,IAAIC,IAAM,EAAC,GACxB,UAAUD,QAAU,IAAIC,IAAM,EAAC;EACrC,CAAC,MAAM;IACNiB,WAAW,GAAGlB,QAAQ,KAAK,MAAM,GAAG,MAAM,GAAI,UAAUA,QAAU,EAAC;EACpE;EACA,MAAMU,iBAAiB,GAAG7F,MAAM,CAAEyF,eAAU,CAAC,CAACK,oBAAoB,CAAE;IACnEV,IAAI,EAAEiB;EACP,CAAE,CAAC;EACH,OAAOrG,MAAM,CAAEyF,eAAU,CAAC,CAACF,qBAAqB,CAC/C,UAAU,EACV,aAAa,EACbM,iBACD,CAAC;AACF,CACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_preferences","_coreData","_editor","_deprecated","_interopRequireDefault","_lockUnlock","interfaceStore","unlock","editorPrivateApis","EMPTY_ARRAY","EMPTY_OBJECT","getEditorMode","exports","createRegistrySelector","select","_select$get","preferencesStore","get","isEditorSidebarOpened","activeGeneralSidebar","getActiveComplementaryArea","includes","isPluginSidebarOpened","getActiveGeneralSidebarName","convertPanelsToOldFormat","inactivePanels","openPanels","_ref","panelsWithEnabledState","reduce","accumulatedPanels","panelName","enabled","panels","currentPanelState","opened","getPreferences","deprecated","since","alternative","corePreferences","accumulatedPrefs","preferenceKey","value","getPreference","state","defaultValue","preferences","undefined","getHiddenBlockTypes","_select$get2","isPublishSidebarOpened","editorStore","isEditorPanelRemoved","isEditorPanelEnabled","isEditorPanelOpened","isModalActive","modalName","isFeatureActive","feature","isPluginItemPinned","pluginName","isItemPinned","getActiveMetaBoxLocations","createSelector","Object","keys","metaBoxes","locations","filter","location","isMetaBoxLocationActive","isMetaBoxLocationVisible","getMetaBoxesPerLocation","some","id","length","getAllMetaBoxes","values","flat","hasMetaBoxes","isSavingMetaBoxes","isSaving","__experimentalGetPreviewDeviceType","version","getDeviceType","isInserterOpened","__experimentalGetInsertionPoint","getInsertionPoint","isListViewOpened","isEditingTemplate","getCurrentPostType","areMetaBoxesInitialized","initialized","getEditedPostTemplate","postId","type","postType","slug","getCurrentPost","getSite","getEditedEntityRecord","getEntityRecords","coreStore","siteSettings","isPostsPage","page_for_posts","defaultTemplateId","getDefaultTemplateId","currentTemplate","getEditedPostAttribute","templateWithSameSlug","per_page","find","template","slugToCheck"],"sources":["@wordpress/edit-post/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\nconst EMPTY_ARRAY = [];\nconst EMPTY_OBJECT = {};\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport const getEditorMode = createRegistrySelector(\n\t( select ) => () =>\n\t\tselect( preferencesStore ).get( 'core', 'editorMode' ) ?? 'visual'\n);\n\n/**\n * Returns true if the editor sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the editor sidebar is opened.\n */\nexport const isEditorSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\treturn [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\tactiveGeneralSidebar\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the plugin sidebar is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the plugin sidebar is opened.\n */\nexport const isPluginSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\treturn (\n\t\t\t!! activeGeneralSidebar &&\n\t\t\t! [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\t\tactiveGeneralSidebar\n\t\t\t)\n\t\t);\n\t}\n);\n\n/**\n * Returns the current active general sidebar name, or null if there is no\n * general sidebar active. The active general sidebar is a unique name to\n * identify either an editor or plugin sidebar.\n *\n * Examples:\n *\n * - `edit-post/document`\n * - `my-plugin/insert-image-sidebar`\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Active general sidebar name.\n */\nexport const getActiveGeneralSidebarName = createRegistrySelector(\n\t( select ) => () => {\n\t\treturn select( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t}\n);\n\n/**\n * Converts panels from the new preferences store format to the old format\n * that the post editor previously used.\n *\n * The resultant converted data should look like this:\n * {\n * panelName: {\n * enabled: false,\n * opened: true,\n * },\n * anotherPanelName: {\n * opened: true\n * },\n * }\n *\n * @param {string[] | undefined} inactivePanels An array of inactive panel names.\n * @param {string[] | undefined} openPanels An array of open panel names.\n *\n * @return {Object} The converted panel data.\n */\nfunction convertPanelsToOldFormat( inactivePanels, openPanels ) {\n\t// First reduce the inactive panels.\n\tconst panelsWithEnabledState = inactivePanels?.reduce(\n\t\t( accumulatedPanels, panelName ) => ( {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\tenabled: false,\n\t\t\t},\n\t\t} ),\n\t\t{}\n\t);\n\n\t// Then reduce the open panels, passing in the result of the previous\n\t// reduction as the initial value so that both open and inactive\n\t// panel state is combined.\n\tconst panels = openPanels?.reduce( ( accumulatedPanels, panelName ) => {\n\t\tconst currentPanelState = accumulatedPanels?.[ panelName ];\n\t\treturn {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\t...currentPanelState,\n\t\t\t\topened: true,\n\t\t\t},\n\t\t};\n\t}, panelsWithEnabledState ?? {} );\n\n\t// The panels variable will only be set if openPanels wasn't `undefined`.\n\t// If it isn't set just return `panelsWithEnabledState`, and if that isn't\n\t// set return an empty object.\n\treturn panels ?? panelsWithEnabledState ?? EMPTY_OBJECT;\n}\n\n/**\n * Returns the preferences (these preferences are persisted locally).\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Preferences Object.\n */\nexport const getPreferences = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).getPreferences`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\tconst corePreferences = [ 'editorMode', 'hiddenBlockTypes' ].reduce(\n\t\t( accumulatedPrefs, preferenceKey ) => {\n\t\t\tconst value = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\tpreferenceKey\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\t...accumulatedPrefs,\n\t\t\t\t[ preferenceKey ]: value,\n\t\t\t};\n\t\t},\n\t\t{}\n\t);\n\n\t// Panels were a preference, but the data structure changed when the state\n\t// was migrated to the preferences store. They need to be converted from\n\t// the new preferences store format to old format to ensure no breaking\n\t// changes for plugins.\n\tconst inactivePanels = select( preferencesStore ).get(\n\t\t'core',\n\t\t'inactivePanels'\n\t);\n\tconst openPanels = select( preferencesStore ).get( 'core', 'openPanels' );\n\tconst panels = convertPanelsToOldFormat( inactivePanels, openPanels );\n\n\treturn {\n\t\t...corePreferences,\n\t\tpanels,\n\t};\n} );\n\n/**\n *\n * @param {Object} state Global application state.\n * @param {string} preferenceKey Preference Key.\n * @param {*} defaultValue Default Value.\n *\n * @return {*} Preference Value.\n */\nexport function getPreference( state, preferenceKey, defaultValue ) {\n\tdeprecated( `select( 'core/edit-post' ).getPreference`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\t// Avoid using the `getPreferences` registry selector where possible.\n\tconst preferences = getPreferences( state );\n\tconst value = preferences[ preferenceKey ];\n\treturn value === undefined ? defaultValue : value;\n}\n\n/**\n * Returns an array of blocks that are hidden.\n *\n * @return {Array} A list of the hidden block types\n */\nexport const getHiddenBlockTypes = createRegistrySelector( ( select ) => () => {\n\treturn (\n\t\tselect( preferencesStore ).get( 'core', 'hiddenBlockTypes' ) ??\n\t\tEMPTY_ARRAY\n\t);\n} );\n\n/**\n * Returns true if the publish sidebar is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the publish sidebar is open.\n */\nexport const isPublishSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated( `select( 'core/edit-post' ).isPublishSidebarOpened`, {\n\t\t\tsince: '6.6',\n\t\t\talternative: `select( 'core/editor' ).isPublishSidebarOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isPublishSidebarOpened();\n\t}\n);\n\n/**\n * Returns true if the given panel was programmatically removed, or false otherwise.\n * All panels are not removed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is removed.\n */\nexport const isEditorPanelRemoved = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelRemoved`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelRemoved`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelRemoved( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is enabled, or false otherwise. Panels are\n * enabled by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is enabled.\n */\nexport const isEditorPanelEnabled = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelEnabled`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelEnabled`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelEnabled( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is open, or false otherwise. Panels are\n * closed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is open.\n */\nexport const isEditorPanelOpened = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelOpened`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelOpened( panelName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @deprecated since WP 6.3 use `core/interface` store's selector with the same name instead.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport const isModalActive = createRegistrySelector(\n\t( select ) => ( state, modalName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isModalActive`, {\n\t\t\tsince: '6.3',\n\t\t\talternative: `select( 'core/interface' ).isModalActive`,\n\t\t} );\n\t\treturn !! select( interfaceStore ).isModalActive( modalName );\n\t}\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, feature ) => {\n\t\treturn !! select( preferencesStore ).get( 'core/edit-post', feature );\n\t}\n);\n\n/**\n * Returns true if the plugin item is pinned to the header.\n * When the value is not set it defaults to true.\n *\n * @param {Object} state Global application state.\n * @param {string} pluginName Plugin item name.\n *\n * @return {boolean} Whether the plugin item is pinned.\n */\nexport const isPluginItemPinned = createRegistrySelector(\n\t( select ) => ( state, pluginName ) => {\n\t\treturn select( interfaceStore ).isItemPinned( 'core', pluginName );\n\t}\n);\n\n/**\n * Returns an array of active meta box locations.\n *\n * @param {Object} state Post editor state.\n *\n * @return {string[]} Active meta box locations.\n */\nexport const getActiveMetaBoxLocations = createSelector(\n\t( state ) => {\n\t\treturn Object.keys( state.metaBoxes.locations ).filter( ( location ) =>\n\t\t\tisMetaBoxLocationActive( state, location )\n\t\t);\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if a metabox location is active and visible\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active and visible.\n */\nexport const isMetaBoxLocationVisible = createRegistrySelector(\n\t( select ) => ( state, location ) => {\n\t\treturn (\n\t\t\tisMetaBoxLocationActive( state, location ) &&\n\t\t\tgetMetaBoxesPerLocation( state, location )?.some( ( { id } ) => {\n\t\t\t\treturn select( editorStore ).isEditorPanelEnabled(\n\t\t\t\t\tstate,\n\t\t\t\t\t`meta-box-${ id }`\n\t\t\t\t);\n\t\t\t} )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if there is an active meta box in the given location, or false\n * otherwise.\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active.\n */\nexport function isMetaBoxLocationActive( state, location ) {\n\tconst metaBoxes = getMetaBoxesPerLocation( state, location );\n\treturn !! metaBoxes && metaBoxes.length !== 0;\n}\n\n/**\n * Returns the list of all the available meta boxes for a given location.\n *\n * @param {Object} state Global application state.\n * @param {string} location Meta box location to test.\n *\n * @return {?Array} List of meta boxes.\n */\nexport function getMetaBoxesPerLocation( state, location ) {\n\treturn state.metaBoxes.locations[ location ];\n}\n\n/**\n * Returns the list of all the available meta boxes.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} List of meta boxes.\n */\nexport const getAllMetaBoxes = createSelector(\n\t( state ) => {\n\t\treturn Object.values( state.metaBoxes.locations ).flat();\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if the post is using Meta Boxes\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether there are metaboxes or not.\n */\nexport function hasMetaBoxes( state ) {\n\treturn getActiveMetaBoxLocations( state ).length > 0;\n}\n\n/**\n * Returns true if the Meta Boxes are being saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the metaboxes are being saved.\n */\nexport function isSavingMetaBoxes( state ) {\n\treturn state.metaBoxes.isSaving;\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport const __experimentalGetPreviewDeviceType = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\talternative: `select( 'core/editor' ).getDeviceType`,\n\t\t\t}\n\t\t);\n\t\treturn select( editorStore ).getDeviceType();\n\t}\n);\n\n/**\n * Returns true if the inserter is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport const isInserterOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isInserterOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isInserterOpened`,\n\t} );\n\treturn select( editorStore ).isInserterOpened();\n} );\n\n/**\n * Get the insertion point for the inserter.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-post' ).__experimentalGetInsertionPoint`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t}\n\t\t);\n\t\treturn unlock( select( editorStore ) ).getInsertionPoint();\n\t}\n);\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport const isListViewOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isListViewOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isListViewOpened`,\n\t} );\n\treturn select( editorStore ).isListViewOpened();\n} );\n\n/**\n * Returns true if the template editing mode is enabled.\n *\n * @deprecated\n */\nexport const isEditingTemplate = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isEditingTemplate`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).getRenderingMode`,\n\t} );\n\treturn select( editorStore ).getCurrentPostType() === 'wp_template';\n} );\n\n/**\n * Returns true if meta boxes are initialized.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether meta boxes are initialized.\n */\nexport function areMetaBoxesInitialized( state ) {\n\treturn state.metaBoxes.initialized;\n}\n\n/**\n * Retrieves the template of the currently edited post.\n *\n * @return {Object?} Post Template.\n */\nexport const getEditedPostTemplate = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst {\n\t\t\tid: postId,\n\t\t\ttype: postType,\n\t\t\tslug,\n\t\t} = select( editorStore ).getCurrentPost();\n\t\tconst { getSite, getEditedEntityRecord, getEntityRecords } =\n\t\t\tselect( coreStore );\n\t\tconst siteSettings = getSite();\n\t\t// First check if the current page is set as the posts page.\n\t\tconst isPostsPage = +postId === siteSettings?.page_for_posts;\n\t\tif ( isPostsPage ) {\n\t\t\tconst defaultTemplateId = select( coreStore ).getDefaultTemplateId(\n\t\t\t\t{ slug: 'home' }\n\t\t\t);\n\t\t\treturn getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\tdefaultTemplateId\n\t\t\t);\n\t\t}\n\t\tconst currentTemplate =\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' );\n\t\tif ( currentTemplate ) {\n\t\t\tconst templateWithSameSlug = getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\t{ per_page: -1 }\n\t\t\t)?.find( ( template ) => template.slug === currentTemplate );\n\t\t\tif ( ! templateWithSameSlug ) {\n\t\t\t\treturn templateWithSameSlug;\n\t\t\t}\n\t\t\treturn getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\ttemplateWithSameSlug.id\n\t\t\t);\n\t\t}\n\t\tlet slugToCheck;\n\t\t// In `draft` status we might not have a slug available, so we use the `single`\n\t\t// post type templates slug(ex page, single-post, single-product etc..).\n\t\t// Pages do not need the `single` prefix in the slug to be prioritized\n\t\t// through template hierarchy.\n\t\tif ( slug ) {\n\t\t\tslugToCheck =\n\t\t\t\tpostType === 'page'\n\t\t\t\t\t? `${ postType }-${ slug }`\n\t\t\t\t\t: `single-${ postType }-${ slug }`;\n\t\t} else {\n\t\t\tslugToCheck = postType === 'page' ? 'page' : `single-${ postType }`;\n\t\t}\n\t\tconst defaultTemplateId = select( coreStore ).getDefaultTemplateId( {\n\t\t\tslug: slugToCheck,\n\t\t} );\n\n\t\treturn defaultTemplateId\n\t\t\t? select( coreStore ).getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_template',\n\t\t\t\t\tdefaultTemplateId\n\t\t\t )\n\t\t\t: null;\n\t}\n);\n"],"mappings":";;;;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D,IAAK,CAAEE,oBAAoB,EAAG;MAC7B,OAAOA,oBAAoB;IAC5B;IACA,OAAOV,qBAAqB,CAC3B,UAAU,EACV,aAAa,EACbU,oBAAoB,CAACpC,EACtB,CAAC;EACF;EACA,IAAIwC,WAAW;EACf;EACA;EACA;EACA;EACA,IAAKjB,IAAI,EAAG;IACXiB,WAAW,GACVlB,QAAQ,KAAK,MAAM,GACf,GAAGA,QAAU,IAAIC,IAAM,EAAC,GACxB,UAAUD,QAAU,IAAIC,IAAM,EAAC;EACrC,CAAC,MAAM;IACNiB,WAAW,GAAGlB,QAAQ,KAAK,MAAM,GAAG,MAAM,GAAI,UAAUA,QAAU,EAAC;EACpE;EACA,MAAMU,iBAAiB,GAAG7F,MAAM,CAAEyF,eAAU,CAAC,CAACK,oBAAoB,CAAE;IACnEV,IAAI,EAAEiB;EACP,CAAE,CAAC;EAEH,OAAOR,iBAAiB,GACrB7F,MAAM,CAAEyF,eAAU,CAAC,CAACF,qBAAqB,CACzC,UAAU,EACV,aAAa,EACbM,iBACA,CAAC,GACD,IAAI;AACR,CACD,CAAC","ignoreList":[]}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useSelect, useDispatch } from '@wordpress/data';
5
+ import { __ } from '@wordpress/i18n';
6
+ import { fullscreen } from '@wordpress/icons';
7
+ import { useCommand } from '@wordpress/commands';
8
+ import { store as preferencesStore } from '@wordpress/preferences';
9
+ import { store as noticesStore } from '@wordpress/notices';
10
+ export default function useCommands() {
11
+ const {
12
+ isFullscreen
13
+ } = useSelect(select => {
14
+ const {
15
+ get
16
+ } = select(preferencesStore);
17
+ return {
18
+ isFullscreen: get('core/edit-post', 'fullscreenMode')
19
+ };
20
+ }, []);
21
+ const {
22
+ toggle
23
+ } = useDispatch(preferencesStore);
24
+ const {
25
+ createInfoNotice
26
+ } = useDispatch(noticesStore);
27
+ useCommand({
28
+ name: 'core/toggle-fullscreen-mode',
29
+ label: isFullscreen ? __('Exit fullscreen') : __('Enter fullscreen'),
30
+ icon: fullscreen,
31
+ callback: ({
32
+ close
33
+ }) => {
34
+ toggle('core/edit-post', 'fullscreenMode');
35
+ close();
36
+ createInfoNotice(isFullscreen ? __('Fullscreen off.') : __('Fullscreen on.'), {
37
+ id: 'core/edit-post/toggle-fullscreen-mode/notice',
38
+ type: 'snackbar',
39
+ actions: [{
40
+ label: __('Undo'),
41
+ onClick: () => {
42
+ toggle('core/edit-post', 'fullscreenMode');
43
+ }
44
+ }]
45
+ });
46
+ }
47
+ });
48
+ }
49
+ //# sourceMappingURL=use-commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useSelect","useDispatch","__","fullscreen","useCommand","store","preferencesStore","noticesStore","useCommands","isFullscreen","select","get","toggle","createInfoNotice","name","label","icon","callback","close","id","type","actions","onClick"],"sources":["@wordpress/edit-post/src/commands/use-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { fullscreen } from '@wordpress/icons';\nimport { useCommand } from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function useCommands() {\n\tconst { isFullscreen } = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\n\t\treturn {\n\t\t\tisFullscreen: get( 'core/edit-post', 'fullscreenMode' ),\n\t\t};\n\t}, [] );\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-fullscreen-mode',\n\t\tlabel: isFullscreen\n\t\t\t? __( 'Exit fullscreen' )\n\t\t\t: __( 'Enter fullscreen' ),\n\t\ticon: fullscreen,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'fullscreenMode' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisFullscreen ? __( 'Fullscreen off.' ) : __( 'Fullscreen on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-post/toggle-fullscreen-mode/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\ttoggle( 'core/edit-post', 'fullscreenMode' );\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} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,UAAU,QAAQ,qBAAqB;AAChD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SAASD,KAAK,IAAIE,YAAY,QAAQ,oBAAoB;AAE1D,eAAe,SAASC,WAAWA,CAAA,EAAG;EACrC,MAAM;IAAEC;EAAa,CAAC,GAAGT,SAAS,CAAIU,MAAM,IAAM;IACjD,MAAM;MAAEC;IAAI,CAAC,GAAGD,MAAM,CAAEJ,gBAAiB,CAAC;IAE1C,OAAO;MACNG,YAAY,EAAEE,GAAG,CAAE,gBAAgB,EAAE,gBAAiB;IACvD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEC;EAAO,CAAC,GAAGX,WAAW,CAAEK,gBAAiB,CAAC;EAClD,MAAM;IAAEO;EAAiB,CAAC,GAAGZ,WAAW,CAAEM,YAAa,CAAC;EAExDH,UAAU,CAAE;IACXU,IAAI,EAAE,6BAA6B;IACnCC,KAAK,EAAEN,YAAY,GAChBP,EAAE,CAAE,iBAAkB,CAAC,GACvBA,EAAE,CAAE,kBAAmB,CAAC;IAC3Bc,IAAI,EAAEb,UAAU;IAChBc,QAAQ,EAAEA,CAAE;MAAEC;IAAM,CAAC,KAAM;MAC1BN,MAAM,CAAE,gBAAgB,EAAE,gBAAiB,CAAC;MAC5CM,KAAK,CAAC,CAAC;MACPL,gBAAgB,CACfJ,YAAY,GAAGP,EAAE,CAAE,iBAAkB,CAAC,GAAGA,EAAE,CAAE,gBAAiB,CAAC,EAC/D;QACCiB,EAAE,EAAE,8CAA8C;QAClDC,IAAI,EAAE,UAAU;QAChBC,OAAO,EAAE,CACR;UACCN,KAAK,EAAEb,EAAE,CAAE,MAAO,CAAC;UACnBoB,OAAO,EAAEA,CAAA,KAAM;YACdV,MAAM,CAAE,gBAAgB,EAAE,gBAAiB,CAAC;UAC7C;QACD,CAAC;MAEH,CACD,CAAC;IACF;EACD,CAAE,CAAC;AACJ","ignoreList":[]}
@@ -1,8 +1,7 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * External dependencies
4
3
  */
5
- import classnames from 'classnames';
4
+ import clsx from 'clsx';
6
5
 
7
6
  /**
8
7
  * WordPress dependencies
@@ -19,7 +18,8 @@ import { useReducedMotion } from '@wordpress/compose';
19
18
  /**
20
19
  * Internal dependencies
21
20
  */
22
- import { store as editPostStore } from '../../../store';
21
+ import { store as editPostStore } from '../../store';
22
+ import { jsx as _jsx } from "react/jsx-runtime";
23
23
  function FullscreenModeClose({
24
24
  showTooltip,
25
25
  icon,
@@ -57,7 +57,7 @@ function FullscreenModeClose({
57
57
  if (!isActive || !postType) {
58
58
  return null;
59
59
  }
60
- let buttonIcon = createElement(Icon, {
60
+ let buttonIcon = /*#__PURE__*/_jsx(Icon, {
61
61
  size: "36px",
62
62
  icon: wordpress
63
63
  });
@@ -71,7 +71,7 @@ function FullscreenModeClose({
71
71
  }
72
72
  };
73
73
  if (siteIconUrl) {
74
- buttonIcon = createElement(motion.img, {
74
+ buttonIcon = /*#__PURE__*/_jsx(motion.img, {
75
75
  variants: !disableMotion && effect,
76
76
  alt: __('Site Icon'),
77
77
  className: "edit-post-fullscreen-mode-close_site-icon",
@@ -84,12 +84,12 @@ function FullscreenModeClose({
84
84
 
85
85
  // Override default icon if custom icon is provided via props.
86
86
  if (icon) {
87
- buttonIcon = createElement(Icon, {
87
+ buttonIcon = /*#__PURE__*/_jsx(Icon, {
88
88
  size: "36px",
89
89
  icon: icon
90
90
  });
91
91
  }
92
- const classes = classnames({
92
+ const classes = clsx({
93
93
  'edit-post-fullscreen-mode-close': true,
94
94
  'has-icon': siteIconUrl
95
95
  });
@@ -97,14 +97,16 @@ function FullscreenModeClose({
97
97
  post_type: postType.slug
98
98
  });
99
99
  const buttonLabel = (_postType$labels$view = postType?.labels?.view_items) !== null && _postType$labels$view !== void 0 ? _postType$labels$view : __('Back');
100
- return createElement(motion.div, {
101
- whileHover: "expand"
102
- }, createElement(Button, {
103
- className: classes,
104
- href: buttonHref,
105
- label: buttonLabel,
106
- showTooltip: showTooltip
107
- }, buttonIcon));
100
+ return /*#__PURE__*/_jsx(motion.div, {
101
+ whileHover: "expand",
102
+ children: /*#__PURE__*/_jsx(Button, {
103
+ className: classes,
104
+ href: buttonHref,
105
+ label: buttonLabel,
106
+ showTooltip: showTooltip,
107
+ children: buttonIcon
108
+ })
109
+ });
108
110
  }
109
111
  export default FullscreenModeClose;
110
- //# sourceMappingURL=index.js.map
112
+ //# sourceMappingURL=fullscreen-mode-close.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["clsx","useSelect","Button","Icon","__unstableMotion","motion","__","addQueryArgs","wordpress","store","editorStore","coreStore","useReducedMotion","editPostStore","jsx","_jsx","FullscreenModeClose","showTooltip","icon","href","initialPost","_postType$labels$view","isActive","isRequestingSiteIcon","postType","siteIconUrl","select","getCurrentPostType","isFeatureActive","getEntityRecord","getPostType","isResolving","siteData","undefined","_postType","type","site_icon_url","disableMotion","buttonIcon","size","effect","expand","scale","transition","duration","img","variants","alt","className","src","classes","buttonHref","post_type","slug","buttonLabel","labels","view_items","div","whileHover","children","label"],"sources":["@wordpress/edit-post/src/components/back-button/fullscreen-mode-close.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {\n\tconst { isActive, isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { isFeatureActive } = select( editPostStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\t\t\tconst _postType = initialPost?.type || getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( _postType ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! isActive || ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.25,\n\t\t\ttransition: { type: 'tween', duration: '0.3' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\tconst classes = clsx( {\n\t\t'edit-post-fullscreen-mode-close': true,\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\tconst buttonHref =\n\t\thref ??\n\t\taddQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType.slug,\n\t\t} );\n\n\tconst buttonLabel = postType?.labels?.view_items ?? __( 'Back' );\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\tclassName={ classes }\n\t\t\t\thref={ buttonHref }\n\t\t\t\tlabel={ buttonLabel }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,MAAM,EACNC,IAAI,EACJC,gBAAgB,IAAIC,MAAM,QACpB,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASC,gBAAgB,QAAQ,oBAAoB;;AAErD;AACA;AACA;AACA,SAASH,KAAK,IAAII,aAAa,QAAQ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mB","ignoreList":[]}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { privateApis as editorPrivateApis } from '@wordpress/editor';
5
+ import { __unstableMotion as motion } from '@wordpress/components';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import FullscreenModeClose from './fullscreen-mode-close';
11
+ import { unlock } from '../../lock-unlock';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ const {
14
+ BackButton: BackButtonFill
15
+ } = unlock(editorPrivateApis);
16
+ const slideX = {
17
+ hidden: {
18
+ x: '-100%'
19
+ },
20
+ distractionFreeInactive: {
21
+ x: 0
22
+ },
23
+ hover: {
24
+ x: 0,
25
+ transition: {
26
+ type: 'tween',
27
+ delay: 0.2
28
+ }
29
+ }
30
+ };
31
+ function BackButton({
32
+ initialPost
33
+ }) {
34
+ return /*#__PURE__*/_jsx(BackButtonFill, {
35
+ children: /*#__PURE__*/_jsx(motion.div, {
36
+ variants: slideX,
37
+ transition: {
38
+ type: 'tween',
39
+ delay: 0.8
40
+ },
41
+ children: /*#__PURE__*/_jsx(FullscreenModeClose, {
42
+ showTooltip: true,
43
+ initialPost: initialPost
44
+ })
45
+ })
46
+ });
47
+ }
48
+ export default BackButton;
49
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["privateApis","editorPrivateApis","__unstableMotion","motion","FullscreenModeClose","unlock","jsx","_jsx","BackButton","BackButtonFill","slideX","hidden","x","distractionFreeInactive","hover","transition","type","delay","initialPost","children","div","variants","showTooltip"],"sources":["@wordpress/edit-post/src/components/back-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { __unstableMotion as motion } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport { unlock } from '../../lock-unlock';\n\nconst { BackButton: BackButtonFill } = unlock( editorPrivateApis );\n\nconst slideX = {\n\thidden: { x: '-100%' },\n\tdistractionFreeInactive: { x: 0 },\n\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nfunction BackButton( { initialPost } ) {\n\treturn (\n\t\t<BackButtonFill>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideX }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t>\n\t\t\t\t<FullscreenModeClose showTooltip initialPost={ initialPost } />\n\t\t\t</motion.div>\n\t\t</BackButtonFill>\n\t);\n}\n\nexport default BackButton;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,gBAAgB,IAAIC,MAAM,QAAQ,uBAAuB;;AAElE;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,yBAAyB;AACzD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAM;EAAEC,UAAU,EAAEC;AAAe,CAAC,GAAGJ,MAAM,CAAEJ,iBAAkB,CAAC;AAElE,MAAMS,MAAM,GAAG;EACdC,MAAM,EAAE;IAAEC,CAAC,EAAE;EAAQ,CAAC;EACtBC,uBAAuB,EAAE;IAAED,CAAC,EAAE;EAAE,CAAC;EACjCE,KAAK,EAAE;IAAEF,CAAC,EAAE,CAAC;IAAEG,UAAU,EAAE;MAAEC,IAAI,EAAE,OAAO;MAAEC,KAAK,EAAE;IAAI;EAAE;AAC1D,CAAC;AAED,SAAST,UAAUA,CAAE;EAAEU;AAAY,CAAC,EAAG;EACtC,oBACCX,IAAA,CAACE,cAAc;IAAAU,QAAA,eACdZ,IAAA,CAACJ,MAAM,CAACiB,GAAG;MACVC,QAAQ,EAAGX,MAAQ;MACnBK,UAAU,EAAG;QAAEC,IAAI,EAAE,OAAO;QAAEC,KAAK,EAAE;MAAI,CAAG;MAAAE,QAAA,eAE5CZ,IAAA,CAACH,mBAAmB;QAACkB,WAAW;QAACJ,WAAW,EAAGA;MAAa,CAAE;IAAC,CACpD;EAAC,CACE,CAAC;AAEnB;AAEA,eAAeV,UAAU","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * External dependencies
4
3
  */
@@ -24,6 +23,8 @@ import { toggleUndoButton, toggleRedoButton, subscribeOnUndoPressed, subscribeOn
24
23
  */
25
24
  import styles from './style.scss';
26
25
  import { store as editPostStore } from '../../../store';
26
+ import { jsx as _jsx } from "react/jsx-runtime";
27
+ import { jsxs as _jsxs } from "react/jsx-runtime";
27
28
  const shadowStyle = {
28
29
  shadowOffset: {
29
30
  width: 2,
@@ -80,43 +81,41 @@ function HeaderToolbar({
80
81
  inserterMethod: 'quick-inserter'
81
82
  });
82
83
  }, [insertBlock]);
83
- const renderMediaButtons = createElement(ToolbarGroup, null, createElement(ToolbarButton, {
84
- key: "imageButton",
85
- title: __('Image'),
86
- icon: imageIcon,
87
- onClick: onInsertBlock('core/image'),
88
- testID: "insert-image-button",
89
- extraProps: {
90
- hint: __('Insert Image Block')
91
- }
92
- }), createElement(ToolbarButton, {
93
- key: "videoButton",
94
- title: __('Video'),
95
- icon: videoIcon,
96
- onClick: onInsertBlock('core/video'),
97
- testID: "insert-video-button",
98
- extraProps: {
99
- hint: __('Insert Video Block')
100
- }
101
- }), createElement(ToolbarButton, {
102
- key: "galleryButton",
103
- title: __('Gallery'),
104
- icon: galleryIcon,
105
- onClick: onInsertBlock('core/gallery'),
106
- testID: "insert-gallery-button",
107
- extraProps: {
108
- hint: __('Insert Gallery Block')
109
- }
110
- }), createElement(ToolbarButton, {
111
- key: "audioButton",
112
- title: __('Audio'),
113
- icon: audioIcon,
114
- onClick: onInsertBlock('core/audio'),
115
- testID: "insert-audio-button",
116
- extraProps: {
117
- hint: __('Insert Audio Block')
118
- }
119
- }));
84
+ const renderMediaButtons = /*#__PURE__*/_jsxs(ToolbarGroup, {
85
+ children: [/*#__PURE__*/_jsx(ToolbarButton, {
86
+ title: __('Image'),
87
+ icon: imageIcon,
88
+ onClick: onInsertBlock('core/image'),
89
+ testID: "insert-image-button",
90
+ extraProps: {
91
+ hint: __('Insert Image Block')
92
+ }
93
+ }, "imageButton"), /*#__PURE__*/_jsx(ToolbarButton, {
94
+ title: __('Video'),
95
+ icon: videoIcon,
96
+ onClick: onInsertBlock('core/video'),
97
+ testID: "insert-video-button",
98
+ extraProps: {
99
+ hint: __('Insert Video Block')
100
+ }
101
+ }, "videoButton"), /*#__PURE__*/_jsx(ToolbarButton, {
102
+ title: __('Gallery'),
103
+ icon: galleryIcon,
104
+ onClick: onInsertBlock('core/gallery'),
105
+ testID: "insert-gallery-button",
106
+ extraProps: {
107
+ hint: __('Insert Gallery Block')
108
+ }
109
+ }, "galleryButton"), /*#__PURE__*/_jsx(ToolbarButton, {
110
+ title: __('Audio'),
111
+ icon: audioIcon,
112
+ onClick: onInsertBlock('core/audio'),
113
+ testID: "insert-audio-button",
114
+ extraProps: {
115
+ hint: __('Insert Audio Block')
116
+ }
117
+ }, "audioButton")]
118
+ });
120
119
 
121
120
  /* translators: accessibility text for the editor toolbar */
122
121
  const toolbarAriaLabel = __('Document tools');
@@ -124,33 +123,36 @@ function HeaderToolbar({
124
123
  const showKeyboardButtonStyles = [usePreferredColorSchemeStyle(styles['header-toolbar__keyboard-hide-container'], styles['header-toolbar__keyboard-hide-container--dark']), shadowStyle, {
125
124
  shadowColor: Platform.isAndroid ? styles['header-toolbar__keyboard-hide-shadow--solid'].color : shadowColor.color
126
125
  }];
127
- return createElement(View, {
126
+ return /*#__PURE__*/_jsxs(View, {
128
127
  ref: anchorNodeRef,
129
128
  testID: toolbarAriaLabel,
130
129
  accessibilityLabel: toolbarAriaLabel,
131
- style: containerStyle
132
- }, createElement(ScrollView, {
133
- ref: scrollViewRef,
134
- onContentSizeChange: scrollToStart,
135
- horizontal: true,
136
- showsHorizontalScrollIndicator: false,
137
- keyboardShouldPersistTaps: "always",
138
- alwaysBounceHorizontal: false,
139
- contentContainerStyle: styles['header-toolbar__scrollable-content']
140
- }, createElement(Inserter, {
141
- disabled: !showInserter
142
- }), noContentSelected && renderMediaButtons, createElement(BlockToolbar, {
143
- anchorNodeRef: anchorNodeRef.current
144
- })), showKeyboardHideButton && createElement(ToolbarGroup, {
145
- passedStyle: showKeyboardButtonStyles
146
- }, createElement(ToolbarButton, {
147
- title: __('Hide keyboard'),
148
- icon: keyboardClose,
149
- onClick: onHideKeyboard,
150
- extraProps: {
151
- hint: __('Tap to hide the keyboard')
152
- }
153
- })));
130
+ style: containerStyle,
131
+ children: [/*#__PURE__*/_jsxs(ScrollView, {
132
+ ref: scrollViewRef,
133
+ onContentSizeChange: scrollToStart,
134
+ horizontal: true,
135
+ showsHorizontalScrollIndicator: false,
136
+ keyboardShouldPersistTaps: "always",
137
+ alwaysBounceHorizontal: false,
138
+ contentContainerStyle: styles['header-toolbar__scrollable-content'],
139
+ children: [/*#__PURE__*/_jsx(Inserter, {
140
+ disabled: !showInserter
141
+ }), noContentSelected && renderMediaButtons, /*#__PURE__*/_jsx(BlockToolbar, {
142
+ anchorNodeRef: anchorNodeRef.current
143
+ })]
144
+ }), showKeyboardHideButton && /*#__PURE__*/_jsx(ToolbarGroup, {
145
+ passedStyle: showKeyboardButtonStyles,
146
+ children: /*#__PURE__*/_jsx(ToolbarButton, {
147
+ title: __('Hide keyboard'),
148
+ icon: keyboardClose,
149
+ onClick: onHideKeyboard,
150
+ extraProps: {
151
+ hint: __('Tap to hide the keyboard')
152
+ }
153
+ })
154
+ })]
155
+ });
154
156
  }
155
157
  export default compose([withSelect(select => {
156
158
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["ScrollView","StyleSheet","View","useCallback","useRef","useEffect","Platform","compose","usePreferredColorSchemeStyle","withSelect","withDispatch","withViewportMatch","__","Inserter","BlockToolbar","store","blockEditorStore","ToolbarGroup","ToolbarButton","keyboardClose","audio","audioIcon","media","imageIcon","video","videoIcon","gallery","galleryIcon","editorStore","createBlock","toggleUndoButton","toggleRedoButton","subscribeOnUndoPressed","subscribeOnRedoPressed","styles","editPostStore","shadowStyle","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","HeaderToolbar","hasRedo","hasUndo","redo","undo","showInserter","showKeyboardHideButton","insertBlock","onHideKeyboard","isRTL","noContentSelected","anchorNodeRef","containerStyle","borderTopWidth","hairlineWidth","onUndoSubscription","onRedoSubscription","remove","scrollViewRef","scrollToStart","isAndroid","current","scrollToEnd","scrollTo","x","onInsertBlock","blockType","undefined","source","inserterMethod","renderMediaButtons","createElement","key","title","icon","onClick","testID","extraProps","hint","toolbarAriaLabel","shadowColor","showKeyboardButtonStyles","color","ref","accessibilityLabel","style","onContentSizeChange","horizontal","showsHorizontalScrollIndicator","keyboardShouldPersistTaps","alwaysBounceHorizontal","contentContainerStyle","disabled","passedStyle","select","getBlockRootClientId","getBlockSelectionEnd","hasInserterItems","hasSelectedBlock","getEditorSettings","isAnyBlockSelected","hasEditorRedo","hasEditorUndo","getEditorMode","richEditingEnabled","isTextModeEnabled","getSettings","dispatch","clearSelectedBlock","togglePostTitleSelection","isLargeViewport"],"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { ScrollView, StyleSheet, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useRef, useEffect, Platform } from '@wordpress/element';\nimport { compose, usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { withViewportMatch } from '@wordpress/viewport';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInserter,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ToolbarGroup, ToolbarButton } from '@wordpress/components';\nimport {\n\tkeyboardClose,\n\taudio as audioIcon,\n\tmedia as imageIcon,\n\tvideo as videoIcon,\n\tgallery as galleryIcon,\n} from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\ttoggleUndoButton,\n\ttoggleRedoButton,\n\tsubscribeOnUndoPressed,\n\tsubscribeOnRedoPressed,\n} from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { store as editPostStore } from '../../../store';\n\nconst shadowStyle = {\n\tshadowOffset: { width: 2, height: 2 },\n\tshadowOpacity: 1,\n\tshadowRadius: 6,\n\televation: 18,\n};\n\nfunction HeaderToolbar( {\n\thasRedo,\n\thasUndo,\n\tredo,\n\tundo,\n\tshowInserter,\n\tshowKeyboardHideButton,\n\tinsertBlock,\n\tonHideKeyboard,\n\tisRTL,\n\tnoContentSelected,\n} ) {\n\tconst anchorNodeRef = useRef();\n\n\tconst containerStyle = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'header-toolbar__container' ],\n\t\t\tstyles[ 'header-toolbar__container--dark' ]\n\t\t),\n\t\t{ borderTopWidth: StyleSheet.hairlineWidth },\n\t];\n\n\tuseEffect( () => {\n\t\tconst onUndoSubscription = subscribeOnUndoPressed( undo );\n\t\tconst onRedoSubscription = subscribeOnRedoPressed( redo );\n\n\t\treturn () => {\n\t\t\tonUndoSubscription?.remove();\n\t\t\tonRedoSubscription?.remove();\n\t\t};\n\t}, [ undo, redo ] );\n\n\tuseEffect( () => {\n\t\ttoggleUndoButton( ! hasUndo );\n\t}, [ hasUndo ] );\n\n\tuseEffect( () => {\n\t\ttoggleRedoButton( ! hasRedo );\n\t}, [ hasRedo ] );\n\n\tconst scrollViewRef = useRef( null );\n\tconst scrollToStart = () => {\n\t\t// scrollview doesn't seem to automatically adjust to RTL on Android so, scroll to end when Android\n\t\tif ( Platform.isAndroid && isRTL ) {\n\t\t\tscrollViewRef.current.scrollToEnd();\n\t\t} else {\n\t\t\tscrollViewRef.current.scrollTo( { x: 0 } );\n\t\t}\n\t};\n\n\tconst onInsertBlock = useCallback(\n\t\t( blockType ) => () => {\n\t\t\tinsertBlock( createBlock( blockType ), undefined, undefined, true, {\n\t\t\t\tsource: 'inserter_menu',\n\t\t\t\tinserterMethod: 'quick-inserter',\n\t\t\t} );\n\t\t},\n\t\t[ insertBlock ]\n\t);\n\n\tconst renderMediaButtons = (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"imageButton\"\n\t\t\t\ttitle={ __( 'Image' ) }\n\t\t\t\ticon={ imageIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/image' ) }\n\t\t\t\ttestID=\"insert-image-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Image Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"videoButton\"\n\t\t\t\ttitle={ __( 'Video' ) }\n\t\t\t\ticon={ videoIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/video' ) }\n\t\t\t\ttestID=\"insert-video-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Video Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"galleryButton\"\n\t\t\t\ttitle={ __( 'Gallery' ) }\n\t\t\t\ticon={ galleryIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/gallery' ) }\n\t\t\t\ttestID=\"insert-gallery-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Gallery Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"audioButton\"\n\t\t\t\ttitle={ __( 'Audio' ) }\n\t\t\t\ticon={ audioIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/audio' ) }\n\t\t\t\ttestID=\"insert-audio-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Audio Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t</ToolbarGroup>\n\t);\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst shadowColor = usePreferredColorSchemeStyle(\n\t\tstyles[ 'header-toolbar__keyboard-hide-shadow--light' ],\n\t\tstyles[ 'header-toolbar__keyboard-hide-shadow--dark' ]\n\t);\n\tconst showKeyboardButtonStyles = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'header-toolbar__keyboard-hide-container' ],\n\t\t\tstyles[ 'header-toolbar__keyboard-hide-container--dark' ]\n\t\t),\n\t\tshadowStyle,\n\t\t{\n\t\t\tshadowColor: Platform.isAndroid\n\t\t\t\t? styles[ 'header-toolbar__keyboard-hide-shadow--solid' ].color\n\t\t\t\t: shadowColor.color,\n\t\t},\n\t];\n\n\treturn (\n\t\t<View\n\t\t\tref={ anchorNodeRef }\n\t\t\ttestID={ toolbarAriaLabel }\n\t\t\taccessibilityLabel={ toolbarAriaLabel }\n\t\t\tstyle={ containerStyle }\n\t\t>\n\t\t\t<ScrollView\n\t\t\t\tref={ scrollViewRef }\n\t\t\t\tonContentSizeChange={ scrollToStart }\n\t\t\t\thorizontal\n\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\talwaysBounceHorizontal={ false }\n\t\t\t\tcontentContainerStyle={\n\t\t\t\t\tstyles[ 'header-toolbar__scrollable-content' ]\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Inserter disabled={ ! showInserter } />\n\n\t\t\t\t{ noContentSelected && renderMediaButtons }\n\t\t\t\t<BlockToolbar anchorNodeRef={ anchorNodeRef.current } />\n\t\t\t</ScrollView>\n\t\t\t{ showKeyboardHideButton && (\n\t\t\t\t<ToolbarGroup passedStyle={ showKeyboardButtonStyles }>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Hide keyboard' ) }\n\t\t\t\t\t\ticon={ keyboardClose }\n\t\t\t\t\t\tonClick={ onHideKeyboard }\n\t\t\t\t\t\textraProps={ {\n\t\t\t\t\t\t\thint: __( 'Tap to hide the keyboard' ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockSelectionEnd,\n\t\t\thasInserterItems,\n\t\t\thasSelectedBlock,\n\t\t} = select( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst isAnyBlockSelected = hasSelectedBlock();\n\t\treturn {\n\t\t\thasRedo: select( editorStore ).hasEditorRedo(),\n\t\t\thasUndo: select( editorStore ).hasEditorUndo(),\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tshowInserter:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'visual' &&\n\t\t\t\tgetEditorSettings().richEditingEnabled &&\n\t\t\t\thasInserterItems(\n\t\t\t\t\tgetBlockRootClientId( getBlockSelectionEnd() )\n\t\t\t\t),\n\t\t\tisTextModeEnabled:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'text',\n\t\t\tisRTL: select( blockEditorStore ).getSettings().isRTL,\n\t\t\tnoContentSelected: ! isAnyBlockSelected,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { clearSelectedBlock, insertBlock } =\n\t\t\tdispatch( blockEditorStore );\n\t\tconst { togglePostTitleSelection } = dispatch( editorStore );\n\n\t\treturn {\n\t\t\tredo: dispatch( editorStore ).redo,\n\t\t\tundo: dispatch( editorStore ).undo,\n\t\t\tonHideKeyboard() {\n\t\t\t\tclearSelectedBlock();\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t\tinsertBlock,\n\t\t};\n\t} ),\n\twithViewportMatch( { isLargeViewport: 'medium' } ),\n] )( HeaderToolbar );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;;AAE3D;AACA;AACA;AACA,SAASC,W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AC,CAACmB,IAAI;IAClCI,cAAcA,CAAA,EAAG;MAChB4D,kBAAkB,CAAC,CAAC;MACpBC,wBAAwB,CAAE,KAAM,CAAC;IAClC,CAAC;IACD9D;EACD,CAAC;AACF,CAAE,CAAC,EACHvC,iBAAiB,CAAE;EAAEsG,eAAe,EAAE;AAAS,CAAE,CAAC,CACjD,CAAC,CAAEtE,aAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["ScrollView","StyleSheet","View","useCallback","useRef","useEffect","Platform","compose","usePreferredColorSchemeStyle","withSelect","withDispatch","withViewportMatch","__","Inserter","BlockToolbar","store","blockEditorStore","ToolbarGroup","ToolbarButton","keyboardClose","audio","audioIcon","media","imageIcon","video","videoIcon","gallery","galleryIcon","editorStore","createBlock","toggleUndoButton","toggleRedoButton","subscribeOnUndoPressed","subscribeOnRedoPressed","styles","editPostStore","jsx","_jsx","jsxs","_jsxs","shadowStyle","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","HeaderToolbar","hasRedo","hasUndo","redo","undo","showInserter","showKeyboardHideButton","insertBlock","onHideKeyboard","isRTL","noContentSelected","anchorNodeRef","containerStyle","borderTopWidth","hairlineWidth","onUndoSubscription","onRedoSubscription","remove","scrollViewRef","scrollToStart","isAndroid","current","scrollToEnd","scrollTo","x","onInsertBlock","blockType","undefined","source","inserterMethod","renderMediaButtons","children","title","icon","onClick","testID","extraProps","hint","toolbarAriaLabel","shadowColor","showKeyboardButtonStyles","color","ref","accessibilityLabel","style","onContentSizeChange","horizontal","showsHorizontalScrollIndicator","keyboardShouldPersistTaps","alwaysBounceHorizontal","contentContainerStyle","disabled","passedStyle","select","getBlockRootClientId","getBlockSelectionEnd","hasInserterItems","hasSelectedBlock","getEditorSettings","isAnyBlockSelected","hasEditorRedo","hasEditorUndo","getEditorMode","richEditingEnabled","isTextModeEnabled","getSettings","dispatch","clearSelectedBlock","togglePostTitleSelection","isLargeViewport"],"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { ScrollView, StyleSheet, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useRef, useEffect, Platform } from '@wordpress/element';\nimport { compose, usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { withViewportMatch } from '@wordpress/viewport';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInserter,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ToolbarGroup, ToolbarButton } from '@wordpress/components';\nimport {\n\tkeyboardClose,\n\taudio as audioIcon,\n\tmedia as imageIcon,\n\tvideo as videoIcon,\n\tgallery as galleryIcon,\n} from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\ttoggleUndoButton,\n\ttoggleRedoButton,\n\tsubscribeOnUndoPressed,\n\tsubscribeOnRedoPressed,\n} from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { store as editPostStore } from '../../../store';\n\nconst shadowStyle = {\n\tshadowOffset: { width: 2, height: 2 },\n\tshadowOpacity: 1,\n\tshadowRadius: 6,\n\televation: 18,\n};\n\nfunction HeaderToolbar( {\n\thasRedo,\n\thasUndo,\n\tredo,\n\tundo,\n\tshowInserter,\n\tshowKeyboardHideButton,\n\tinsertBlock,\n\tonHideKeyboard,\n\tisRTL,\n\tnoContentSelected,\n} ) {\n\tconst anchorNodeRef = useRef();\n\n\tconst containerStyle = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'header-toolbar__container' ],\n\t\t\tstyles[ 'header-toolbar__container--dark' ]\n\t\t),\n\t\t{ borderTopWidth: StyleSheet.hairlineWidth },\n\t];\n\n\tuseEffect( () => {\n\t\tconst onUndoSubscription = subscribeOnUndoPressed( undo );\n\t\tconst onRedoSubscription = subscribeOnRedoPressed( redo );\n\n\t\treturn () => {\n\t\t\tonUndoSubscription?.remove();\n\t\t\tonRedoSubscription?.remove();\n\t\t};\n\t}, [ undo, redo ] );\n\n\tuseEffect( () => {\n\t\ttoggleUndoButton( ! hasUndo );\n\t}, [ hasUndo ] );\n\n\tuseEffect( () => {\n\t\ttoggleRedoButton( ! hasRedo );\n\t}, [ hasRedo ] );\n\n\tconst scrollViewRef = useRef( null );\n\tconst scrollToStart = () => {\n\t\t// scrollview doesn't seem to automatically adjust to RTL on Android so, scroll to end when Android\n\t\tif ( Platform.isAndroid && isRTL ) {\n\t\t\tscrollViewRef.current.scrollToEnd();\n\t\t} else {\n\t\t\tscrollViewRef.current.scrollTo( { x: 0 } );\n\t\t}\n\t};\n\n\tconst onInsertBlock = useCallback(\n\t\t( blockType ) => () => {\n\t\t\tinsertBlock( createBlock( blockType ), undefined, undefined, true, {\n\t\t\t\tsource: 'inserter_menu',\n\t\t\t\tinserterMethod: 'quick-inserter',\n\t\t\t} );\n\t\t},\n\t\t[ insertBlock ]\n\t);\n\n\tconst renderMediaButtons = (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"imageButton\"\n\t\t\t\ttitle={ __( 'Image' ) }\n\t\t\t\ticon={ imageIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/image' ) }\n\t\t\t\ttestID=\"insert-image-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Image Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"videoButton\"\n\t\t\t\ttitle={ __( 'Video' ) }\n\t\t\t\ticon={ videoIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/video' ) }\n\t\t\t\ttestID=\"insert-video-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Video Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"galleryButton\"\n\t\t\t\ttitle={ __( 'Gallery' ) }\n\t\t\t\ticon={ galleryIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/gallery' ) }\n\t\t\t\ttestID=\"insert-gallery-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Gallery Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"audioButton\"\n\t\t\t\ttitle={ __( 'Audio' ) }\n\t\t\t\ticon={ audioIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/audio' ) }\n\t\t\t\ttestID=\"insert-audio-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Audio Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t</ToolbarGroup>\n\t);\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst shadowColor = usePreferredColorSchemeStyle(\n\t\tstyles[ 'header-toolbar__keyboard-hide-shadow--light' ],\n\t\tstyles[ 'header-toolbar__keyboard-hide-shadow--dark' ]\n\t);\n\tconst showKeyboardButtonStyles = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'header-toolbar__keyboard-hide-container' ],\n\t\t\tstyles[ 'header-toolbar__keyboard-hide-container--dark' ]\n\t\t),\n\t\tshadowStyle,\n\t\t{\n\t\t\tshadowColor: Platform.isAndroid\n\t\t\t\t? styles[ 'header-toolbar__keyboard-hide-shadow--solid' ].color\n\t\t\t\t: shadowColor.color,\n\t\t},\n\t];\n\n\treturn (\n\t\t<View\n\t\t\tref={ anchorNodeRef }\n\t\t\ttestID={ toolbarAriaLabel }\n\t\t\taccessibilityLabel={ toolbarAriaLabel }\n\t\t\tstyle={ containerStyle }\n\t\t>\n\t\t\t<ScrollView\n\t\t\t\tref={ scrollViewRef }\n\t\t\t\tonContentSizeChange={ scrollToStart }\n\t\t\t\thorizontal\n\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\talwaysBounceHorizontal={ false }\n\t\t\t\tcontentContainerStyle={\n\t\t\t\t\tstyles[ 'header-toolbar__scrollable-content' ]\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Inserter disabled={ ! showInserter } />\n\n\t\t\t\t{ noContentSelected && renderMediaButtons }\n\t\t\t\t<BlockToolbar anchorNodeRef={ anchorNodeRef.current } />\n\t\t\t</ScrollView>\n\t\t\t{ showKeyboardHideButton && (\n\t\t\t\t<ToolbarGroup passedStyle={ showKeyboardButtonStyles }>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Hide keyboard' ) }\n\t\t\t\t\t\ticon={ keyboardClose }\n\t\t\t\t\t\tonClick={ onHideKeyboard }\n\t\t\t\t\t\textraProps={ {\n\t\t\t\t\t\t\thint: __( 'Tap to hide the keyboard' ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockSelectionEnd,\n\t\t\thasInserterItems,\n\t\t\thasSelectedBlock,\n\t\t} = select( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst isAnyBlockSelected = hasSelectedBlock();\n\t\treturn {\n\t\t\thasRedo: select( editorStore ).hasEditorRedo(),\n\t\t\thasUndo: select( editorStore ).hasEditorUndo(),\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tshowInserter:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'visual' &&\n\t\t\t\tgetEditorSettings().richEditingEnabled &&\n\t\t\t\thasInserterItems(\n\t\t\t\t\tgetBlockRootClientId( getBlockSelectionEnd() )\n\t\t\t\t),\n\t\t\tisTextModeEnabled:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'text',\n\t\t\tisRTL: select( blockEditorStore ).getSettings().isRTL,\n\t\t\tnoContentSelected: ! isAnyBlockSelected,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { clearSelectedBlock, insertBlock } =\n\t\t\tdispatch( blockEditorStore );\n\t\tconst { togglePostTitleSelection } = dispatch( editorStore );\n\n\t\treturn {\n\t\t\tredo: dispatch( editorStore ).redo,\n\t\t\tundo: dispatch( editorStore ).undo,\n\t\t\tonHideKeyboard() {\n\t\t\t\tclearSelectedBlock();\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t\tinsertBlock,\n\t\t};\n\t} ),\n\twithViewportMatch( { isLargeViewport: 'medium' } ),\n] )( HeaderToolbar );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;;AAE3D;AACA;AACA;AACA,SAASC,WAAW,EAAEC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,oBAAoB;AAC7E,SAASC,OAAO,EAAEC,4BAA4B,QAAQ,oBAAoB;AAC1E,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,QAAQ,EACRC,YAAY,EACZC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,YAAY,EAAEC,aAAa,QAAQ,uBAAuB;AACnE,SACCC,aAAa,EACbC,KAAK,IAAIC,SAAS,EAClBC,KAAK,IAAIC,SAAS,EAClBC,KAAK,IAAIC,SAAS,EAClBC,OAAO,IAAIC,WAAW,QAChB,kBAAkB;AACzB,SAASZ,KAAK,IAAIa,WAAW,QAAQ,mBAAmB;AACxD,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SACCC,gBAAgB,EAChBC,gBAAgB,EAChBC,sBAAsB,EACtBC,sBAAsB,QAChB,gCAAgC;;AAEvC;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;AACjC,SAAS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AC,CAAC,CAACK,kBAAkB,IACtCP,gBAAgB,CACfF,oBAAoB,CAAEC,oBAAoB,CAAC,CAAE,CAC9C,CAAC;IACFS,iBAAiB,EAChBX,MAAM,CAAEjE,aAAc,CAAC,CAAC0E,aAAa,CAAC,CAAC,KAAK,MAAM;IACnDrD,KAAK,EAAE4C,MAAM,CAAEpF,gBAAiB,CAAC,CAACgG,WAAW,CAAC,CAAC,CAACxD,KAAK;IACrDC,iBAAiB,EAAE,CAAEiD;EACtB,CAAC;AACF,CAAE,CAAC,EACHhG,YAAY,CAAIuG,QAAQ,IAAM;EAC7B,MAAM;IAAEC,kBAAkB;IAAE5D;EAAY,CAAC,GACxC2D,QAAQ,CAAEjG,gBAAiB,CAAC;EAC7B,MAAM;IAAEmG;EAAyB,CAAC,GAAGF,QAAQ,CAAErF,WAAY,CAAC;EAE5D,OAAO;IACNsB,IAAI,EAAE+D,QAAQ,CAAErF,WAAY,CAAC,CAACsB,IAAI;IAClCC,IAAI,EAAE8D,QAAQ,CAAErF,WAAY,CAAC,CAACuB,IAAI;IAClCI,cAAcA,CAAA,EAAG;MAChB2D,kBAAkB,CAAC,CAAC;MACpBC,wBAAwB,CAAE,KAAM,CAAC;IAClC,CAAC;IACD7D;EACD,CAAC;AACF,CAAE,CAAC,EACH3C,iBAAiB,CAAE;EAAEyG,eAAe,EAAE;AAAS,CAAE,CAAC,CACjD,CAAC,CAAErE,aAAc,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * External dependencies
4
3
  */
@@ -14,6 +13,7 @@ import '@wordpress/editor';
14
13
  * Internal dependencies
15
14
  */
16
15
  import HeaderToolbar from './header-toolbar';
16
+ import { jsx as _jsx } from "react/jsx-runtime";
17
17
  export default class Header extends Component {
18
18
  constructor() {
19
19
  super(...arguments);
@@ -42,7 +42,7 @@ export default class Header extends Component {
42
42
  });
43
43
  }
44
44
  render() {
45
- return createElement(HeaderToolbar, {
45
+ return /*#__PURE__*/_jsx(HeaderToolbar, {
46
46
  showKeyboardHideButton: this.state.isKeyboardVisible
47
47
  });
48
48
  }