@wordpress/editor 14.10.0 → 14.11.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 (292) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +2 -2
  3. package/build/bindings/post-meta.js +2 -1
  4. package/build/bindings/post-meta.js.map +1 -1
  5. package/build/components/collab-sidebar/add-comment.js +120 -0
  6. package/build/components/collab-sidebar/add-comment.js.map +1 -0
  7. package/build/components/collab-sidebar/comment-button-toolbar.js +37 -0
  8. package/build/components/collab-sidebar/comment-button-toolbar.js.map +1 -0
  9. package/build/components/collab-sidebar/comment-button.js +37 -0
  10. package/build/components/collab-sidebar/comment-button.js.map +1 -0
  11. package/build/components/collab-sidebar/comments.js +321 -0
  12. package/build/components/collab-sidebar/comments.js.map +1 -0
  13. package/build/components/collab-sidebar/constants.js +8 -0
  14. package/build/components/collab-sidebar/constants.js.map +1 -0
  15. package/build/components/collab-sidebar/index.js +272 -0
  16. package/build/components/collab-sidebar/index.js.map +1 -0
  17. package/build/components/collab-sidebar/utils.js +16 -0
  18. package/build/components/collab-sidebar/utils.js.map +1 -0
  19. package/build/components/commands/index.js +6 -6
  20. package/build/components/commands/index.js.map +1 -1
  21. package/build/components/document-bar/index.js +8 -7
  22. package/build/components/document-bar/index.js.map +1 -1
  23. package/build/components/document-tools/index.js +1 -5
  24. package/build/components/document-tools/index.js.map +1 -1
  25. package/build/components/editor-interface/index.js +3 -2
  26. package/build/components/editor-interface/index.js.map +1 -1
  27. package/build/components/entities-saved-states/index.js +1 -1
  28. package/build/components/entities-saved-states/index.js.map +1 -1
  29. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
  30. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  31. package/build/components/global-styles-provider/index.js +13 -3
  32. package/build/components/global-styles-provider/index.js.map +1 -1
  33. package/build/components/header/index.js +5 -2
  34. package/build/components/header/index.js.map +1 -1
  35. package/build/components/inserter-sidebar/index.js +2 -2
  36. package/build/components/inserter-sidebar/index.js.map +1 -1
  37. package/build/components/page-attributes/parent.js +5 -5
  38. package/build/components/page-attributes/parent.js.map +1 -1
  39. package/build/components/plugin-more-menu-item/index.js +13 -11
  40. package/build/components/plugin-more-menu-item/index.js.map +1 -1
  41. package/build/components/plugin-preview-menu-item/index.js +15 -13
  42. package/build/components/plugin-preview-menu-item/index.js.map +1 -1
  43. package/build/components/plugin-sidebar/index.js +0 -15
  44. package/build/components/plugin-sidebar/index.js.map +1 -1
  45. package/build/components/post-actions/index.js +5 -5
  46. package/build/components/post-actions/index.js.map +1 -1
  47. package/build/components/post-author/panel.js +4 -4
  48. package/build/components/post-author/panel.js.map +1 -1
  49. package/build/components/post-card-panel/index.js +7 -36
  50. package/build/components/post-card-panel/index.js.map +1 -1
  51. package/build/components/post-content-information/index.js +1 -2
  52. package/build/components/post-content-information/index.js.map +1 -1
  53. package/build/components/post-featured-image/index.js +26 -7
  54. package/build/components/post-featured-image/index.js.map +1 -1
  55. package/build/components/post-last-revision/index.js +1 -1
  56. package/build/components/post-last-revision/index.js.map +1 -1
  57. package/build/components/post-schedule/label.js +1 -1
  58. package/build/components/post-schedule/label.js.map +1 -1
  59. package/build/components/post-taxonomies/flat-term-selector.js +9 -1
  60. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  61. package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -2
  62. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  63. package/build/components/post-url/index.js +1 -1
  64. package/build/components/post-url/index.js.map +1 -1
  65. package/build/components/post-url/panel.js +3 -3
  66. package/build/components/post-url/panel.js.map +1 -1
  67. package/build/components/preview-dropdown/index.js +0 -4
  68. package/build/components/preview-dropdown/index.js.map +1 -1
  69. package/build/components/provider/index.js +10 -12
  70. package/build/components/provider/index.js.map +1 -1
  71. package/build/components/provider/use-block-editor-settings.js +1 -1
  72. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  73. package/build/components/sidebar/header.js +2 -1
  74. package/build/components/sidebar/header.js.map +1 -1
  75. package/build/components/sidebar/index.js +3 -3
  76. package/build/components/sidebar/index.js.map +1 -1
  77. package/build/components/time-to-read/index.js +2 -2
  78. package/build/components/time-to-read/index.js.map +1 -1
  79. package/build/components/visual-editor/index.js +25 -27
  80. package/build/components/visual-editor/index.js.map +1 -1
  81. package/build/components/visual-editor/use-zoom-out-mode-exit.js +52 -0
  82. package/build/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -0
  83. package/build/components/zoom-out-toggle/index.js +37 -5
  84. package/build/components/zoom-out-toggle/index.js.map +1 -1
  85. package/build/dataviews/actions/duplicate-template-part.js +2 -2
  86. package/build/dataviews/actions/duplicate-template-part.js.map +1 -1
  87. package/build/store/actions.js +4 -3
  88. package/build/store/actions.js.map +1 -1
  89. package/build/store/private-actions.js +2 -2
  90. package/build/store/private-actions.js.map +1 -1
  91. package/build/store/selectors.js +3 -2
  92. package/build/store/selectors.js.map +1 -1
  93. package/build/utils/pageTypeBadge.js +51 -0
  94. package/build/utils/pageTypeBadge.js.map +1 -0
  95. package/build/utils/terms.js +2 -2
  96. package/build/utils/terms.js.map +1 -1
  97. package/build-module/bindings/post-meta.js +2 -1
  98. package/build-module/bindings/post-meta.js.map +1 -1
  99. package/build-module/components/collab-sidebar/add-comment.js +114 -0
  100. package/build-module/components/collab-sidebar/add-comment.js.map +1 -0
  101. package/build-module/components/collab-sidebar/comment-button-toolbar.js +30 -0
  102. package/build-module/components/collab-sidebar/comment-button-toolbar.js.map +1 -0
  103. package/build-module/components/collab-sidebar/comment-button.js +30 -0
  104. package/build-module/components/collab-sidebar/comment-button.js.map +1 -0
  105. package/build-module/components/collab-sidebar/comments.js +314 -0
  106. package/build-module/components/collab-sidebar/comments.js.map +1 -0
  107. package/build-module/components/collab-sidebar/constants.js +2 -0
  108. package/build-module/components/collab-sidebar/constants.js.map +1 -0
  109. package/build-module/components/collab-sidebar/index.js +264 -0
  110. package/build-module/components/collab-sidebar/index.js.map +1 -0
  111. package/build-module/components/collab-sidebar/utils.js +10 -0
  112. package/build-module/components/collab-sidebar/utils.js.map +1 -0
  113. package/build-module/components/commands/index.js +6 -6
  114. package/build-module/components/commands/index.js.map +1 -1
  115. package/build-module/components/document-bar/index.js +9 -8
  116. package/build-module/components/document-bar/index.js.map +1 -1
  117. package/build-module/components/document-tools/index.js +2 -6
  118. package/build-module/components/document-tools/index.js.map +1 -1
  119. package/build-module/components/editor-interface/index.js +3 -2
  120. package/build-module/components/editor-interface/index.js.map +1 -1
  121. package/build-module/components/entities-saved-states/index.js +1 -1
  122. package/build-module/components/entities-saved-states/index.js.map +1 -1
  123. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
  124. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  125. package/build-module/components/global-styles-provider/index.js +13 -3
  126. package/build-module/components/global-styles-provider/index.js.map +1 -1
  127. package/build-module/components/header/index.js +5 -2
  128. package/build-module/components/header/index.js.map +1 -1
  129. package/build-module/components/inserter-sidebar/index.js +2 -2
  130. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  131. package/build-module/components/page-attributes/parent.js +5 -5
  132. package/build-module/components/page-attributes/parent.js.map +1 -1
  133. package/build-module/components/plugin-more-menu-item/index.js +12 -10
  134. package/build-module/components/plugin-more-menu-item/index.js.map +1 -1
  135. package/build-module/components/plugin-preview-menu-item/index.js +14 -12
  136. package/build-module/components/plugin-preview-menu-item/index.js.map +1 -1
  137. package/build-module/components/plugin-sidebar/index.js +0 -15
  138. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  139. package/build-module/components/post-actions/index.js +5 -5
  140. package/build-module/components/post-actions/index.js.map +1 -1
  141. package/build-module/components/post-author/panel.js +4 -4
  142. package/build-module/components/post-author/panel.js.map +1 -1
  143. package/build-module/components/post-card-panel/index.js +8 -36
  144. package/build-module/components/post-card-panel/index.js.map +1 -1
  145. package/build-module/components/post-content-information/index.js +1 -2
  146. package/build-module/components/post-content-information/index.js.map +1 -1
  147. package/build-module/components/post-featured-image/index.js +26 -7
  148. package/build-module/components/post-featured-image/index.js.map +1 -1
  149. package/build-module/components/post-last-revision/index.js +1 -1
  150. package/build-module/components/post-last-revision/index.js.map +1 -1
  151. package/build-module/components/post-schedule/label.js +1 -1
  152. package/build-module/components/post-schedule/label.js.map +1 -1
  153. package/build-module/components/post-taxonomies/flat-term-selector.js +12 -4
  154. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  155. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -2
  156. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  157. package/build-module/components/post-url/index.js +1 -1
  158. package/build-module/components/post-url/index.js.map +1 -1
  159. package/build-module/components/post-url/panel.js +3 -3
  160. package/build-module/components/post-url/panel.js.map +1 -1
  161. package/build-module/components/preview-dropdown/index.js +0 -4
  162. package/build-module/components/preview-dropdown/index.js.map +1 -1
  163. package/build-module/components/provider/index.js +10 -12
  164. package/build-module/components/provider/index.js.map +1 -1
  165. package/build-module/components/provider/use-block-editor-settings.js +1 -1
  166. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  167. package/build-module/components/sidebar/header.js +2 -1
  168. package/build-module/components/sidebar/header.js.map +1 -1
  169. package/build-module/components/sidebar/index.js +4 -4
  170. package/build-module/components/sidebar/index.js.map +1 -1
  171. package/build-module/components/time-to-read/index.js +2 -2
  172. package/build-module/components/time-to-read/index.js.map +1 -1
  173. package/build-module/components/visual-editor/index.js +26 -28
  174. package/build-module/components/visual-editor/index.js.map +1 -1
  175. package/build-module/components/visual-editor/use-zoom-out-mode-exit.js +46 -0
  176. package/build-module/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -0
  177. package/build-module/components/zoom-out-toggle/index.js +37 -5
  178. package/build-module/components/zoom-out-toggle/index.js.map +1 -1
  179. package/build-module/dataviews/actions/duplicate-template-part.js +3 -3
  180. package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -1
  181. package/build-module/store/actions.js +4 -3
  182. package/build-module/store/actions.js.map +1 -1
  183. package/build-module/store/private-actions.js +3 -3
  184. package/build-module/store/private-actions.js.map +1 -1
  185. package/build-module/store/selectors.js +3 -2
  186. package/build-module/store/selectors.js.map +1 -1
  187. package/build-module/utils/pageTypeBadge.js +45 -0
  188. package/build-module/utils/pageTypeBadge.js.map +1 -0
  189. package/build-module/utils/terms.js +2 -2
  190. package/build-module/utils/terms.js.map +1 -1
  191. package/build-style/style-rtl.css +96 -54
  192. package/build-style/style.css +96 -54
  193. package/build-types/bindings/post-meta.d.ts.map +1 -1
  194. package/build-types/components/collab-sidebar/add-comment.d.ts +15 -0
  195. package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -0
  196. package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts +5 -0
  197. package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts.map +1 -0
  198. package/build-types/components/collab-sidebar/comment-button.d.ts +5 -0
  199. package/build-types/components/collab-sidebar/comment-button.d.ts.map +1 -0
  200. package/build-types/components/collab-sidebar/comments.d.ts +19 -0
  201. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -0
  202. package/build-types/components/collab-sidebar/constants.d.ts +2 -0
  203. package/build-types/components/collab-sidebar/constants.d.ts.map +1 -0
  204. package/build-types/components/collab-sidebar/index.d.ts +5 -0
  205. package/build-types/components/collab-sidebar/index.d.ts.map +1 -0
  206. package/build-types/components/collab-sidebar/utils.d.ts +8 -0
  207. package/build-types/components/collab-sidebar/utils.d.ts.map +1 -0
  208. package/build-types/components/commands/index.d.ts.map +1 -1
  209. package/build-types/components/document-bar/index.d.ts.map +1 -1
  210. package/build-types/components/document-tools/index.d.ts.map +1 -1
  211. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  212. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  213. package/build-types/components/header/index.d.ts.map +1 -1
  214. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
  215. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  216. package/build-types/components/plugin-more-menu-item/index.d.ts +62 -2
  217. package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -1
  218. package/build-types/components/plugin-preview-menu-item/index.d.ts +41 -2
  219. package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -1
  220. package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
  221. package/build-types/components/post-author/panel.d.ts.map +1 -1
  222. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  223. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  224. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  225. package/build-types/components/provider/index.d.ts.map +1 -1
  226. package/build-types/components/sidebar/index.d.ts.map +1 -1
  227. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  228. package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts +5 -0
  229. package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts.map +1 -0
  230. package/build-types/components/zoom-out-toggle/index.d.ts +3 -1
  231. package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -1
  232. package/build-types/store/actions.d.ts.map +1 -1
  233. package/build-types/store/selectors.d.ts.map +1 -1
  234. package/build-types/utils/pageTypeBadge.d.ts +5 -0
  235. package/build-types/utils/pageTypeBadge.d.ts.map +1 -0
  236. package/build-types/utils/terms.d.ts.map +1 -1
  237. package/package.json +38 -37
  238. package/src/bindings/post-meta.js +1 -0
  239. package/src/components/collab-sidebar/add-comment.js +124 -0
  240. package/src/components/collab-sidebar/comment-button-toolbar.js +29 -0
  241. package/src/components/collab-sidebar/comment-button.js +31 -0
  242. package/src/components/collab-sidebar/comments.js +404 -0
  243. package/src/components/collab-sidebar/constants.js +1 -0
  244. package/src/components/collab-sidebar/index.js +307 -0
  245. package/src/components/collab-sidebar/style.scss +111 -0
  246. package/src/components/collab-sidebar/utils.js +9 -0
  247. package/src/components/commands/index.js +9 -7
  248. package/src/components/document-bar/index.js +15 -7
  249. package/src/components/document-bar/style.scss +0 -4
  250. package/src/components/document-tools/index.js +1 -7
  251. package/src/components/editor-interface/index.js +4 -3
  252. package/src/components/entities-saved-states/index.js +2 -2
  253. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
  254. package/src/components/global-styles-provider/index.js +20 -6
  255. package/src/components/header/index.js +3 -1
  256. package/src/components/inserter-sidebar/index.js +3 -6
  257. package/src/components/page-attributes/parent.js +6 -4
  258. package/src/components/plugin-more-menu-item/index.js +12 -11
  259. package/src/components/plugin-preview-menu-item/index.js +14 -13
  260. package/src/components/plugin-sidebar/index.js +0 -13
  261. package/src/components/post-actions/index.js +8 -11
  262. package/src/components/post-author/panel.js +4 -2
  263. package/src/components/post-card-panel/index.js +9 -43
  264. package/src/components/post-card-panel/style.scss +1 -9
  265. package/src/components/post-content-information/index.js +1 -1
  266. package/src/components/post-featured-image/index.js +31 -16
  267. package/src/components/post-featured-image/style.scss +5 -2
  268. package/src/components/post-last-revision/index.js +1 -1
  269. package/src/components/post-schedule/label.js +1 -1
  270. package/src/components/post-sticky/test/index.js +6 -6
  271. package/src/components/post-taxonomies/flat-term-selector.js +15 -4
  272. package/src/components/post-taxonomies/hierarchical-term-selector.js +2 -2
  273. package/src/components/post-url/index.js +1 -1
  274. package/src/components/post-url/panel.js +4 -2
  275. package/src/components/preview-dropdown/index.js +0 -2
  276. package/src/components/provider/index.js +31 -24
  277. package/src/components/provider/use-block-editor-settings.js +1 -1
  278. package/src/components/sidebar/header.js +3 -2
  279. package/src/components/sidebar/index.js +5 -3
  280. package/src/components/time-to-read/index.js +3 -3
  281. package/src/components/visual-editor/index.js +32 -41
  282. package/src/components/visual-editor/use-zoom-out-mode-exit.js +49 -0
  283. package/src/components/zoom-out-toggle/index.js +39 -5
  284. package/src/dataviews/actions/duplicate-template-part.tsx +3 -3
  285. package/src/store/actions.js +5 -3
  286. package/src/store/private-actions.js +3 -3
  287. package/src/store/selectors.js +3 -2
  288. package/src/style.scss +1 -0
  289. package/src/utils/pageTypeBadge.js +41 -0
  290. package/src/utils/terms.js +4 -2
  291. package/src/utils/test/terms.js +3 -3
  292. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useViewportMatch","useSelect","useDispatch","__","_x","NavigableToolbar","ToolSelector","store","blockEditorStore","Button","ToolbarItem","listView","plus","useCallback","keyboardShortcutsStore","preferencesStore","unlock","editorStore","EditorHistoryRedo","EditorHistoryUndo","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DocumentTools","className","disableBlockTools","setIsInserterOpened","setIsListViewOpened","isDistractionFree","isInserterOpened","isListViewOpen","listViewShortcut","inserterSidebarToggleRef","listViewToggleRef","showIconLabels","select","get","isListViewOpened","getEditorMode","getInserterSidebarToggleRef","getListViewToggleRef","getShortcutRepresentation","__unstableGetEditorMode","isVisualMode","isZoomedOutView","preventDefault","event","isLargeViewport","isWideViewport","toolbarAriaLabel","toggleListView","toggleInserter","longLabel","shortLabel","variant","children","ref","as","isPressed","onMouseDown","onClick","disabled","icon","label","showTooltip","undefined","size","shortcut"],"sources":["@wordpress/editor/src/components/document-tools/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tNavigableToolbar,\n\tToolSelector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport EditorHistoryRedo from '../editor-history/redo';\nimport EditorHistoryUndo from '../editor-history/undo';\n\nfunction DocumentTools( { className, disableBlockTools = false } ) {\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tisDistractionFree,\n\t\tisInserterOpened,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tinserterSidebarToggleRef,\n\t\tlistViewToggleRef,\n\t\tshowIconLabels,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst {\n\t\t\tisListViewOpened,\n\t\t\tgetEditorMode,\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tgetListViewToggleRef,\n\t\t} = unlock( select( editorStore ) );\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\n\t\treturn {\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/editor/toggle-list-view'\n\t\t\t),\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisVisualMode: getEditorMode() === 'visual',\n\t\t\tisZoomedOutView: __unstableGetEditorMode() === 'zoom-out',\n\t\t};\n\t}, [] );\n\n\tconst preventDefault = ( event ) => {\n\t\t// Because the inserter behaves like a dialog,\n\t\t// if the inserter is opened already then when we click on the toggle button\n\t\t// then the initial click event will close the inserter and then be propagated\n\t\t// to the inserter toggle and it will open it again.\n\t\t// To prevent this we need to stop the propagation of the event.\n\t\t// This won't be necessary when the inserter no longer behaves like a dialog.\n\n\t\tif ( isInserterOpened ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserter = useCallback(\n\t\t() => setIsInserterOpened( ! isInserterOpened ),\n\t\t[ isInserterOpened, setIsInserterOpened ]\n\t);\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Block Inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t// Some plugins expect and use the `edit-post-header-toolbar` CSS class to\n\t\t// find the toolbar and inject UI elements into it. This is not officially\n\t\t// supported, but we're keeping it in the list of class names for backwards\n\t\t// compatibility.\n\t\t<NavigableToolbar\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-document-tools',\n\t\t\t\t'edit-post-header-toolbar',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"editor-document-tools__left\">\n\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tref={ inserterSidebarToggleRef }\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"editor-document-tools__inserter-toggle\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\taria-expanded={ isInserterOpened }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\tclassName=\"editor-document-tools__document-overview-toggle\"\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ __( 'Document Overview' ) }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\t\t\tsize=\"compact\"\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</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SACCC,gBAAgB,EAChBC,YAAY,EACZC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,MAAM,EAAEC,WAAW,QAAQ,uBAAuB;AAC3D,SAASC,QAAQ,EAAEC,IAAI,QAAQ,kBAAkB;AACjD,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASN,KAAK,IAAIO,sBAAsB,QAAQ,+BAA+B;AAC/E,SAASP,KAAK,IAAIQ,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAAST,KAAK,IAAIU,WAAW,QAAQ,aAAa;AAClD,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,OAAOC,iBAAiB,MAAM,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEvD,SAASC,aAAaA,CAAE;EAAEC,SAAS;EAAEC,iBAAiB,GAAG;AAAM,CAAC,EAAG;EAClE,MAAM;IAAEC,mBAAmB;IAAEC;EAAoB,CA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CACA,CACF;MAAA,CACG;IAAC,CACW;EAAC;AAErB;AAEA,eAAe3C,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useViewportMatch","useSelect","useDispatch","__","_x","NavigableToolbar","ToolSelector","Button","ToolbarItem","listView","plus","useCallback","store","keyboardShortcutsStore","preferencesStore","unlock","editorStore","EditorHistoryRedo","EditorHistoryUndo","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DocumentTools","className","disableBlockTools","setIsInserterOpened","setIsListViewOpened","isDistractionFree","isInserterOpened","isListViewOpen","listViewShortcut","inserterSidebarToggleRef","listViewToggleRef","showIconLabels","select","get","isListViewOpened","getEditorMode","getInserterSidebarToggleRef","getListViewToggleRef","getShortcutRepresentation","isVisualMode","preventDefault","event","isLargeViewport","isWideViewport","toolbarAriaLabel","toggleListView","toggleInserter","longLabel","shortLabel","variant","children","ref","as","isPressed","onMouseDown","onClick","disabled","icon","label","showTooltip","undefined","size","shortcut"],"sources":["@wordpress/editor/src/components/document-tools/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { NavigableToolbar, ToolSelector } from '@wordpress/block-editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport EditorHistoryRedo from '../editor-history/redo';\nimport EditorHistoryUndo from '../editor-history/undo';\n\nfunction DocumentTools( { className, disableBlockTools = false } ) {\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tisDistractionFree,\n\t\tisInserterOpened,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tinserterSidebarToggleRef,\n\t\tlistViewToggleRef,\n\t\tshowIconLabels,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst {\n\t\t\tisListViewOpened,\n\t\t\tgetEditorMode,\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tgetListViewToggleRef,\n\t\t} = unlock( select( editorStore ) );\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\n\t\treturn {\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/editor/toggle-list-view'\n\t\t\t),\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisVisualMode: getEditorMode() === 'visual',\n\t\t};\n\t}, [] );\n\n\tconst preventDefault = ( event ) => {\n\t\t// Because the inserter behaves like a dialog,\n\t\t// if the inserter is opened already then when we click on the toggle button\n\t\t// then the initial click event will close the inserter and then be propagated\n\t\t// to the inserter toggle and it will open it again.\n\t\t// To prevent this we need to stop the propagation of the event.\n\t\t// This won't be necessary when the inserter no longer behaves like a dialog.\n\n\t\tif ( isInserterOpened ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserter = useCallback(\n\t\t() => setIsInserterOpened( ! isInserterOpened ),\n\t\t[ isInserterOpened, setIsInserterOpened ]\n\t);\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Block Inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t// Some plugins expect and use the `edit-post-header-toolbar` CSS class to\n\t\t// find the toolbar and inject UI elements into it. This is not officially\n\t\t// supported, but we're keeping it in the list of class names for backwards\n\t\t// compatibility.\n\t\t<NavigableToolbar\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-document-tools',\n\t\t\t\t'edit-post-header-toolbar',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"editor-document-tools__left\">\n\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tref={ inserterSidebarToggleRef }\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"editor-document-tools__inserter-toggle\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\taria-expanded={ isInserterOpened }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\tclassName=\"editor-document-tools__document-overview-toggle\"\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ __( 'Document Overview' ) }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\t\t\t\t\tref={ listViewToggleRef }\n\t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BuC,IAAI,EAAC;UAAS,CACd,CACD,eACD9C,IAAA,CAACZ,WAAW;YACXiD,EAAE,EAAGvC,iBAAmB;YACxB8C,WAAW,EAAG,CAAE5B,cAAgB;YAChCkB,OAAO,EAAGlB,cAAc,GAAG,UAAU,GAAG6B,SAAW;YACnDC,IAAI,EAAC;UAAS,CACd,CAAC,eACF9C,IAAA,CAACZ,WAAW;YACXiD,EAAE,EAAGxC,iBAAmB;YACxB+C,WAAW,EAAG,CAAE5B,cAAgB;YAChCkB,OAAO,EAAGlB,cAAc,GAAG,UAAU,GAAG6B,SAAW;YACnDC,IAAI,EAAC;UAAS,CACd,CAAC,EACA,CAAEpC,iBAAiB,iBACpBV,IAAA,CAACZ,WAAW;YACXiD,EAAE,EAAGlD,MAAQ;YACbmB,SAAS,EAAC,iDAAiD;YAC3DoC,IAAI,EAAGrD,QAAU;YACjBoD,QAAQ,EAAGlC,iBAAmB;YAC9B+B,SAAS,EAAG1B;YACZ;YACA+B,KAAK,EAAG5D,EAAE,CAAE,mBAAoB,CAAG;YACnCyD,OAAO,EAAGV,cAAgB;YAC1BiB,QAAQ,EAAGlC,gBAAkB;YAC7B+B,WAAW,EAAG,CAAE5B,cAAgB;YAChCkB,OAAO,EACNlB,cAAc,GAAG,UAAU,GAAG6B,SAC9B;YACD,iBAAgBjC,cAAgB;YAChCwB,GAAG,EAAGrB,iBAAmB;YACzB+B,IAAI,EAAC;UAAS,CACd,CACD;QAAA,CACA,CACF;MAAA,CACG;IAAC,CACW;EAAC;AAErB;AAEA,eAAezC,aAAa","ignoreList":[]}
@@ -83,10 +83,11 @@ export default function EditorInterface({
83
83
  isInserterOpened: select(editorStore).isInserterOpened(),
84
84
  isListViewOpened: select(editorStore).isListViewOpened(),
85
85
  isDistractionFree: get('core', 'distractionFree'),
86
- isPreviewMode: editorSettings.__unstableIsPreviewMode,
86
+ isPreviewMode: editorSettings.isPreviewMode,
87
87
  showBlockBreadcrumbs: get('core', 'showBlockBreadcrumbs'),
88
+ documentLabel:
88
89
  // translators: Default label for the Document in the Block Breadcrumb.
89
- documentLabel: postTypeLabel || _x('Document', 'noun'),
90
+ postTypeLabel || _x('Document', 'noun, breadcrumb'),
90
91
  isZoomOut: _isZoomOut()
91
92
  };
92
93
  }, []);
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","InterfaceSkeleton","ComplementaryArea","useSelect","__","_x","store","preferencesStore","blockEditorStore","BlockBreadcrumb","BlockToolbar","useViewportMatch","useState","useCallback","editorStore","EditorNotices","Header","InserterSidebar","ListViewSidebar","SavePublishPanels","TextEditor","VisualEditor","EditorContentSlotFill","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","interfaceLabels","header","body","sidebar","actions","footer","EditorInterface","className","styles","children","forceIsDirty","contentRef","disableIframe","autoFocus","customSaveButton","customSavePanel","forceDisableBlockTools","title","iframeProps","mode","isRichEditingEnabled","isInserterOpened","isListViewOpened","isDistractionFree","isPreviewMode","showBlockBreadcrumbs","documentLabel","isZoomOut","select","get","getEditorSettings","getPostTypeLabel","editorSettings","postTypeLabel","_isZoomOut","getEditorMode","richEditingEnabled","__unstableIsPreviewMode","isLargeViewport","secondarySidebarLabel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","labels","secondarySidebar","isEditorIframed","editorNotices","Slot","scope","content","editorCanvasView","hideDragHandle","rootLabelText","isEntitiesSavedStatesOpen","forceIsDirtyPublishPanel","undefined"],"sources":["@wordpress/editor/src/components/editor-interface/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { InterfaceSkeleton, ComplementaryArea } from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as blockEditorStore,\n\tBlockBreadcrumb,\n\tBlockToolbar,\n} from '@wordpress/block-editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport EditorNotices from '../editor-notices';\nimport Header from '../header';\nimport InserterSidebar from '../inserter-sidebar';\nimport ListViewSidebar from '../list-view-sidebar';\nimport SavePublishPanels from '../save-publish-panels';\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditorContentSlotFill from './content-slot-fill';\n\nimport { unlock } from '../../lock-unlock';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nexport default function EditorInterface( {\n\tclassName,\n\tstyles,\n\tchildren,\n\tforceIsDirty,\n\tcontentRef,\n\tdisableIframe,\n\tautoFocus,\n\tcustomSaveButton,\n\tcustomSavePanel,\n\tforceDisableBlockTools,\n\ttitle,\n\tiframeProps,\n} ) {\n\tconst {\n\t\tmode,\n\t\tisRichEditingEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tisDistractionFree,\n\t\tisPreviewMode,\n\t\tshowBlockBreadcrumbs,\n\t\tdocumentLabel,\n\t\tisZoomOut,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\t\tconst { isZoomOut: _isZoomOut } = unlock( select( blockEditorStore ) );\n\n\t\treturn {\n\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editorStore ).isListViewOpened(),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisPreviewMode: editorSettings.__unstableIsPreviewMode,\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\tisZoomOut: _isZoomOut(),\n\t\t};\n\t}, [] );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tisDistractionFree={ isDistractionFree }\n\t\t\tclassName={ clsx( 'editor-editor-interface', className, {\n\t\t\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t\t\t\t'is-distraction-free': isDistractionFree && ! isPreviewMode,\n\t\t\t} ) }\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={\n\t\t\t\t! isPreviewMode && (\n\t\t\t\t\t<Header\n\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcustomSaveButton={ customSaveButton }\n\t\t\t\t\t\tforceDisableBlockTools={ forceDisableBlockTools }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\tisEditorIframed={ ! disableIframe }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\tsecondarySidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\tmode === 'visual' &&\n\t\t\t\t( ( isInserterOpened && <InserterSidebar /> ) ||\n\t\t\t\t\t( isListViewOpened && <ListViewSidebar /> ) )\n\t\t\t}\n\t\t\tsidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree && <ComplementaryArea.Slot scope=\"core\" />\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ ! isDistractionFree && ! isPreviewMode && (\n\t\t\t\t\t\t<EditorNotices />\n\t\t\t\t\t) }\n\n\t\t\t\t\t<EditorContentSlotFill.Slot>\n\t\t\t\t\t\t{ ( [ editorCanvasView ] ) =>\n\t\t\t\t\t\t\teditorCanvasView ? (\n\t\t\t\t\t\t\t\teditorCanvasView\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t( mode === 'text' ||\n\t\t\t\t\t\t\t\t\t\t\t! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t\t\t\t\t<TextEditor\n\t\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t! isLargeViewport &&\n\t\t\t\t\t\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ( isPreviewMode ||\n\t\t\t\t\t\t\t\t\t\t( isRichEditingEnabled &&\n\t\t\t\t\t\t\t\t\t\t\tmode === 'visual' ) ) && (\n\t\t\t\t\t\t\t\t\t\t<VisualEditor\n\t\t\t\t\t\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t\t\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\t\t\t\t\t\t\tdisableIframe={ disableIframe }\n\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\t\t\t\t\t\t\tiframeProps={ iframeProps }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t</EditorContentSlotFill.Slot>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t! isZoomOut &&\n\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t)\n\t\t\t}\n\t\t\tactions={\n\t\t\t\t! isPreviewMode\n\t\t\t\t\t? customSavePanel || (\n\t\t\t\t\t\t\t<SavePublishPanels\n\t\t\t\t\t\t\t\tcloseEntitiesSavedStates={\n\t\t\t\t\t\t\t\t\tcloseEntitiesSavedStates\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tforceIsDirtyPublishPanel={ forceIsDirty }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t )\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,iBAAiB,EAAEC,iBAAiB,QAAQ,sBAAsB;AAC3E,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SACCD,KAAK,IAAIE,gBAAgB,EACzBC,eAAe,EACfC,YAAY,QACN,yBAAyB;AAChC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,QAAQ,EAAEC,WAAW,QAAQ,oBAAoB;;AAE1D;AACA;AACA;AACA,SAASP,KAAK,IAAIQ,WAAW,QAAQ,aAAa;AAClD,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,eAAe,MAAM,qBAAqB;AACjD,OAAOC,eAAe,MAAM,sBAAsB;AAClD,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,OAAOC,UAAU,MAAM,gBAAgB;AACvC,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,qBAAqB,MAAM,qBAAqB;AAEvD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,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Y;YACZiB,MAAM,EAAGA,MAAQ;YACjBG,UAAU,EAAGA,UAAY;YACzBC,aAAa,EAAGA;YAChB;YACA;YAAA;YACAC,SAAS,EAAGA,SAAW;YACvBK,WAAW,EAAGA;UAAa,CAC3B,CACD,EACCT,QAAQ;QAAA,CACT;MACF,CAEyB,CAAC;IAAA,CAC5B,CACF;IACDJ,MAAM,EACL,CAAEmB,aAAa,IACf,CAAED,iBAAiB,IACnBe,eAAe,IACfb,oBAAoB,IACpBL,oBAAoB,IACpB,CAAEO,SAAS,IACXR,IAAI,KAAK,QAAQ,iBAChBxB,IAAA,CAAChB,eAAe;MAAC0E,aAAa,EAAG3B;IAAe,CAAE,CAEnD;IACDtB,OAAO,EACN,CAAEoB,aAAa,GACZT,eAAe,iBACfpB,IAAA,CAACN,iBAAiB;MACjBqD,wBAAwB,EACvBA,wBACA;MACDY,yBAAyB,EACxBd,2BACA;MACDC,8BAA8B,EAC7BA,8BACA;MACDc,wBAAwB,EAAG7C;IAAc,CACzC,CACA,GACD8C;EACH,CACD,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["clsx","InterfaceSkeleton","ComplementaryArea","useSelect","__","_x","store","preferencesStore","blockEditorStore","BlockBreadcrumb","BlockToolbar","useViewportMatch","useState","useCallback","editorStore","EditorNotices","Header","InserterSidebar","ListViewSidebar","SavePublishPanels","TextEditor","VisualEditor","EditorContentSlotFill","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","interfaceLabels","header","body","sidebar","actions","footer","EditorInterface","className","styles","children","forceIsDirty","contentRef","disableIframe","autoFocus","customSaveButton","customSavePanel","forceDisableBlockTools","title","iframeProps","mode","isRichEditingEnabled","isInserterOpened","isListViewOpened","isDistractionFree","isPreviewMode","showBlockBreadcrumbs","documentLabel","isZoomOut","select","get","getEditorSettings","getPostTypeLabel","editorSettings","postTypeLabel","_isZoomOut","getEditorMode","richEditingEnabled","isLargeViewport","secondarySidebarLabel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","labels","secondarySidebar","isEditorIframed","editorNotices","Slot","scope","content","editorCanvasView","hideDragHandle","rootLabelText","isEntitiesSavedStatesOpen","forceIsDirtyPublishPanel","undefined"],"sources":["@wordpress/editor/src/components/editor-interface/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { InterfaceSkeleton, ComplementaryArea } from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as blockEditorStore,\n\tBlockBreadcrumb,\n\tBlockToolbar,\n} from '@wordpress/block-editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport EditorNotices from '../editor-notices';\nimport Header from '../header';\nimport InserterSidebar from '../inserter-sidebar';\nimport ListViewSidebar from '../list-view-sidebar';\nimport SavePublishPanels from '../save-publish-panels';\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditorContentSlotFill from './content-slot-fill';\n\nimport { unlock } from '../../lock-unlock';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nexport default function EditorInterface( {\n\tclassName,\n\tstyles,\n\tchildren,\n\tforceIsDirty,\n\tcontentRef,\n\tdisableIframe,\n\tautoFocus,\n\tcustomSaveButton,\n\tcustomSavePanel,\n\tforceDisableBlockTools,\n\ttitle,\n\tiframeProps,\n} ) {\n\tconst {\n\t\tmode,\n\t\tisRichEditingEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tisDistractionFree,\n\t\tisPreviewMode,\n\t\tshowBlockBreadcrumbs,\n\t\tdocumentLabel,\n\t\tisZoomOut,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\t\tconst { isZoomOut: _isZoomOut } = unlock( select( blockEditorStore ) );\n\n\t\treturn {\n\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editorStore ).isListViewOpened(),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisPreviewMode: editorSettings.isPreviewMode,\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\tdocumentLabel:\n\t\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\t\tpostTypeLabel || _x( 'Document', 'noun, breadcrumb' ),\n\t\t\tisZoomOut: _isZoomOut(),\n\t\t};\n\t}, [] );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tisDistractionFree={ isDistractionFree }\n\t\t\tclassName={ clsx( 'editor-editor-interface', className, {\n\t\t\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t\t\t\t'is-distraction-free': isDistractionFree && ! isPreviewMode,\n\t\t\t} ) }\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={\n\t\t\t\t! isPreviewMode && (\n\t\t\t\t\t<Header\n\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcustomSaveButton={ customSaveButton }\n\t\t\t\t\t\tforceDisableBlockTools={ forceDisableBlockTools }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\tisEditorIframed={ ! disableIframe }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\tsecondarySidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\tmode === 'visual' &&\n\t\t\t\t( ( isInserterOpened && <InserterSidebar /> ) ||\n\t\t\t\t\t( isListViewOpened && <ListViewSidebar /> ) )\n\t\t\t}\n\t\t\tsidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree && <ComplementaryArea.Slot scope=\"core\" />\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ ! isDistractionFree && ! isPreviewMode && (\n\t\t\t\t\t\t<EditorNotices />\n\t\t\t\t\t) }\n\n\t\t\t\t\t<EditorContentSlotFill.Slot>\n\t\t\t\t\t\t{ ( [ editorCanvasView ] ) =>\n\t\t\t\t\t\t\teditorCanvasView ? (\n\t\t\t\t\t\t\t\teditorCanvasView\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t( mode === 'text' ||\n\t\t\t\t\t\t\t\t\t\t\t! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t\t\t\t\t<TextEditor\n\t\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t! isLargeViewport &&\n\t\t\t\t\t\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ( isPreviewMode ||\n\t\t\t\t\t\t\t\t\t\t( isRichEditingEnabled &&\n\t\t\t\t\t\t\t\t\t\t\tmode === 'visual' ) ) && (\n\t\t\t\t\t\t\t\t\t\t<VisualEditor\n\t\t\t\t\t\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t\t\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\t\t\t\t\t\t\tdisableIframe={ disableIframe }\n\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\t\t\t\t\t\t\tiframeProps={ iframeProps }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t</EditorContentSlotFill.Slot>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t! isZoomOut &&\n\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t)\n\t\t\t}\n\t\t\tactions={\n\t\t\t\t! isPreviewMode\n\t\t\t\t\t? customSavePanel || (\n\t\t\t\t\t\t\t<SavePublishPanels\n\t\t\t\t\t\t\t\tcloseEntitiesSavedStates={\n\t\t\t\t\t\t\t\t\tcloseEntitiesSavedStates\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tforceIsDirtyPublishPanel={ forceIsDirty }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t )\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,iBAAiB,EAAEC,iBAAiB,QAAQ,sBAAsB;AAC3E,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SACCD,KAAK,IAAIE,gBAAgB,EACzBC,eAAe,EACfC,YAAY,QACN,yBAAyB;AAChC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD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AqB,CAACuD,IAAI;QAAAtC,QAAA,EACxBA,CAAE,CAAEyC,gBAAgB,CAAE,KACvBA,gBAAgB,GACfA,gBAAgB,gBAEhBnD,KAAA,CAAAF,SAAA;UAAAY,QAAA,GACG,CAAEe,aAAa,KACdL,IAAI,KAAK,MAAM,IAChB,CAAEC,oBAAoB,CAAE,iBACxBzB,IAAA,CAACL;UACA;UACA;UAAA;YACAuB,SAAS,EAAGA;UAAW,CACvB,CACD,EACA,CAAEW,aAAa,IAChB,CAAEa,eAAe,IACjBlB,IAAI,KAAK,QAAQ,iBAChBxB,IAAA,CAACf,YAAY;YAACuE,cAAc;UAAA,CAAE,CAC9B,EACA,CAAE3B,aAAa,IACdJ,oBAAoB,IACrBD,IAAI,KAAK,QAAU,kBACpBxB,IAAA,CAACJ,YAAY;YACZiB,MAAM,EAAGA,MAAQ;YACjBG,UAAU,EAAGA,UAAY;YACzBC,aAAa,EAAGA;YAChB;YACA;YAAA;YACAC,SAAS,EAAGA,SAAW;YACvBK,WAAW,EAAGA;UAAa,CAC3B,CACD,EACCT,QAAQ;QAAA,CACT;MACF,CAEyB,CAAC;IAAA,CAC5B,CACF;IACDJ,MAAM,EACL,CAAEmB,aAAa,IACf,CAAED,iBAAiB,IACnBc,eAAe,IACfZ,oBAAoB,IACpBL,oBAAoB,IACpB,CAAEO,SAAS,IACXR,IAAI,KAAK,QAAQ,iBAChBxB,IAAA,CAAChB,eAAe;MAACyE,aAAa,EAAG1B;IAAe,CAAE,CAEnD;IACDtB,OAAO,EACN,CAAEoB,aAAa,GACZT,eAAe,iBACfpB,IAAA,CAACN,iBAAiB;MACjBoD,wBAAwB,EACvBA,wBACA;MACDY,yBAAyB,EACxBd,2BACA;MACDC,8BAA8B,EAC7BA,8BACA;MACDc,wBAAwB,EAAG5C;IAAc,CACzC,CACA,GACD6C;EACH,CACD,CAAC;AAEJ","ignoreList":[]}
@@ -148,7 +148,7 @@ export function EntitiesSavedStatesExtensible({
148
148
  }), /*#__PURE__*/_jsx("p", {
149
149
  id: renderDialog ? dialogDescription : undefined,
150
150
  children: isDirty ? createInterpolateElement(sprintf(/* translators: %d: number of site changes waiting to be saved. */
151
- _n('There is <strong>%d site change</strong> waiting to be saved.', 'There are <strong>%d site changes</strong> waiting to be saved.', sortedPartitionedSavables.length), sortedPartitionedSavables.length), {
151
+ _n('There is <strong>%d site change</strong> waiting to be saved.', 'There are <strong>%d site changes</strong> waiting to be saved.', dirtyEntityRecords.length), dirtyEntityRecords.length), {
152
152
  strong: /*#__PURE__*/_jsx("strong", {})
153
153
  }) : __('Select the items you want to save.')
154
154
  })]
@@ -1 +1 @@
1
- {"version":3,"names":["Button","Flex","FlexItem","__","_n","sprintf","useCallback","useRef","createInterpolateElement","__experimentalUseDialog","useDialog","useInstanceId","useDispatch","EntityTypeList","useIsDirty","store","editorStore","unlock","jsx","_jsx","jsxs","_jsxs","identity","values","EntitiesSavedStates","close","renderDialog","undefined","isDirtyProps","EntitiesSavedStatesExtensible","additionalPrompt","onSave","saveEnabled","saveEnabledProp","saveLabel","dirtyEntityRecords","isDirty","setUnselectedEntities","unselectedEntities","saveButtonRef","saveDirtyEntities","partitionedSavables","reduce","acc","record","name","push","site","siteSavables","wp_template","templateSavables","wp_template_part","templatePartSavables","contentSavables","sortedPartitionedSavables","Object","filter","Array","isArray","dismissPanel","saveDialogRef","saveDialogProps","onClose","dialogLabel","dialogDescription","ref","className","role","children","gap","isBlock","as","variant","size","onClick","disabled","accessibleWhenDisabled","entitiesToSkip","id","length","strong","map","list"],"sources":["@wordpress/editor/src/components/entities-saved-states/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Flex, FlexItem } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseRef,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport {\n\t__experimentalUseDialog as useDialog,\n\tuseInstanceId,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport EntityTypeList from './entity-type-list';\nimport { useIsDirty } from './hooks/use-is-dirty';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction identity( values ) {\n\treturn values;\n}\n\n/**\n * Renders the component for managing saved states of entities.\n *\n * @param {Object} props The component props.\n * @param {Function} props.close The function to close the dialog.\n * @param {Function} props.renderDialog The function to render the dialog.\n *\n * @return {JSX.Element} The rendered component.\n */\nexport default function EntitiesSavedStates( {\n\tclose,\n\trenderDialog = undefined,\n} ) {\n\tconst isDirtyProps = useIsDirty();\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\tclose={ close }\n\t\t\trenderDialog={ renderDialog }\n\t\t\t{ ...isDirtyProps }\n\t\t/>\n\t);\n}\n\n/**\n * Renders a panel for saving entities with dirty records.\n *\n * @param {Object} props The component props.\n * @param {string} props.additionalPrompt Additional prompt to display.\n * @param {Function} props.close Function to close the panel.\n * @param {Function} props.onSave Function to call when saving entities.\n * @param {boolean} props.saveEnabled Flag indicating if save is enabled.\n * @param {string} props.saveLabel Label for the save button.\n * @param {Function} props.renderDialog Function to render a custom dialog.\n * @param {Array} props.dirtyEntityRecords Array of dirty entity records.\n * @param {boolean} props.isDirty Flag indicating if there are dirty entities.\n * @param {Function} props.setUnselectedEntities Function to set unselected entities.\n * @param {Array} props.unselectedEntities Array of unselected entities.\n *\n * @return {JSX.Element} The rendered component.\n */\nexport function EntitiesSavedStatesExtensible( {\n\tadditionalPrompt = undefined,\n\tclose,\n\tonSave = identity,\n\tsaveEnabled: saveEnabledProp = undefined,\n\tsaveLabel = __( 'Save' ),\n\trenderDialog = undefined,\n\tdirtyEntityRecords,\n\tisDirty,\n\tsetUnselectedEntities,\n\tunselectedEntities,\n} ) {\n\tconst saveButtonRef = useRef();\n\tconst { saveDirtyEntities } = unlock( useDispatch( editorStore ) );\n\t// To group entities by type.\n\tconst partitionedSavables = dirtyEntityRecords.reduce( ( acc, record ) => {\n\t\tconst { name } = record;\n\t\tif ( ! acc[ name ] ) {\n\t\t\tacc[ name ] = [];\n\t\t}\n\t\tacc[ name ].push( record );\n\t\treturn acc;\n\t}, {} );\n\n\t// Sort entity groups.\n\tconst {\n\t\tsite: siteSavables,\n\t\twp_template: templateSavables,\n\t\twp_template_part: templatePartSavables,\n\t\t...contentSavables\n\t} = partitionedSavables;\n\tconst sortedPartitionedSavables = [\n\t\tsiteSavables,\n\t\ttemplateSavables,\n\t\ttemplatePartSavables,\n\t\t...Object.values( contentSavables ),\n\t].filter( Array.isArray );\n\n\tconst saveEnabled = saveEnabledProp ?? isDirty;\n\t// Explicitly define this with no argument passed. Using `close` on\n\t// its own will use the event object in place of the expected saved entities.\n\tconst dismissPanel = useCallback( () => close(), [ close ] );\n\n\tconst [ saveDialogRef, saveDialogProps ] = useDialog( {\n\t\tonClose: () => dismissPanel(),\n\t} );\n\tconst dialogLabel = useInstanceId( EntitiesSavedStatesExtensible, 'label' );\n\tconst dialogDescription = useInstanceId(\n\t\tEntitiesSavedStatesExtensible,\n\t\t'description'\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={ saveDialogRef }\n\t\t\t{ ...saveDialogProps }\n\t\t\tclassName=\"entities-saved-states__panel\"\n\t\t\trole={ renderDialog ? 'dialog' : undefined }\n\t\t\taria-labelledby={ renderDialog ? dialogLabel : undefined }\n\t\t\taria-describedby={ renderDialog ? dialogDescription : undefined }\n\t\t>\n\t\t\t<Flex className=\"entities-saved-states__panel-header\" gap={ 2 }>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tonClick={ dismissPanel }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tref={ saveButtonRef }\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tdisabled={ ! saveEnabled }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\tsaveDirtyEntities( {\n\t\t\t\t\t\t\tonSave,\n\t\t\t\t\t\t\tdirtyEntityRecords,\n\t\t\t\t\t\t\tentitiesToSkip: unselectedEntities,\n\t\t\t\t\t\t\tclose,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tclassName=\"editor-entities-saved-states__save-button\"\n\t\t\t\t>\n\t\t\t\t\t{ saveLabel }\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\n\t\t\t<div className=\"entities-saved-states__text-prompt\">\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"entities-saved-states__text-prompt--header-wrapper\"\n\t\t\t\t\tid={ renderDialog ? dialogLabel : undefined }\n\t\t\t\t>\n\t\t\t\t\t<strong className=\"entities-saved-states__text-prompt--header\">\n\t\t\t\t\t\t{ __( 'Are you ready to save?' ) }\n\t\t\t\t\t</strong>\n\t\t\t\t\t{ additionalPrompt }\n\t\t\t\t</div>\n\t\t\t\t<p id={ renderDialog ? dialogDescription : undefined }>\n\t\t\t\t\t{ isDirty\n\t\t\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %d: number of site changes waiting to be saved. */\n\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t'There is <strong>%d site change</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\t'There are <strong>%d site changes</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\tsortedPartitionedSavables.length\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tsortedPartitionedSavables.length\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{ strong: <strong /> }\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Select the items you want to save.' ) }\n\t\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t{ sortedPartitionedSavables.map( ( list ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityTypeList\n\t\t\t\t\t\tkey={ list[ 0 ].name }\n\t\t\t\t\t\tlist={ list }\n\t\t\t\t\t\tunselectedEntities={ unselectedEntities }\n\t\t\t\t\t\tsetUnselectedEntities={ setUnselectedEntities }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,uBAAuB;AAC9D,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SACCC,WAAW,EACXC,MAAM,EACNC,wBAAwB,QAClB,oBAAoB;AAC3B,SACCC,uBAAuB,IAAIC,SAAS,EACpCC,aAAa,QACP,oBAAoB;AAC3B,SAASC,WAAW,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE3C,SAASC,QAAQA,CAAEC,MAAM,EAAG;EAC3B,OAAOA,MAAM;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,mBAAmBA,CAAE;EAC5CC,KAAK;EACLC,YAAY,GAAGC;AAChB,CAAC,EAAG;EACH,MAAMC,YAAY,GAAGd,UAAU,CAAC,CAAC;EACjC,oBACCK,IAAA,CAACU,6BAA6B;IAC7BJ,KAAK,EAAGA,KAAO;IACfC,YAAY,EAAGA,YAAc;IAAA,GACxBE;EAAY,CACjB,CAAC;AAEJ;;AAEA;AAC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kBAAkB;UAClB0C,cAAc,EAAEvC,kBAAkB;UAClCb;QACD,CAAE,CACF;QACDyC,SAAS,EAAC,2CAA2C;QAAAE,QAAA,EAEnDlC;MAAS,CACF,CAAC;IAAA,CACN,CAAC,eAEPb,KAAA;MAAK6C,SAAS,EAAC,oCAAoC;MAAAE,QAAA,gBAClD/C,KAAA;QACC6C,SAAS,EAAC,oDAAoD;QAC9DY,EAAE,EAAGpD,YAAY,GAAGqC,WAAW,GAAGpC,SAAW;QAAAyC,QAAA,gBAE7CjD,IAAA;UAAQ+C,SAAS,EAAC,4CAA4C;UAAAE,QAAA,EAC3DjE,EAAE,CAAE,wBAAyB;QAAC,CACzB,CAAC,EACP2B,gBAAgB;MAAA,CACd,CAAC,eACNX,IAAA;QAAG2D,EAAE,EAAGpD,YAAY,GAAGsC,iBAAiB,GAAGrC,SAAW;QAAAyC,QAAA,EACnDhC,OAAO,GACN5B,wBAAwB,CACxBH,OAAO,CACN;QACAD,EAAE,CACD,+DAA+D,EAC/D,iEAAiE,EACjEkD,yBAAyB,CAACyB,MAC3B,CAAC,EACDzB,yBAAyB,CAACyB,MAC3B,CAAC,EACD;UAAEC,MAAM,eAAE7D,IAAA,aAAS;QAAE,CACrB,CAAC,GACDhB,EAAE,CAAE,oCAAqC;MAAC,CAC3C,CAAC;IAAA,CACA,CAAC,EAEJmD,yBAAyB,CAAC2B,GAAG,CAAIC,IAAI,IAAM;MAC5C,oBACC/D,IAAA,CAACN,cAAc;QAEdqE,IAAI,EAAGA,IAAM;QACb5C,kBAAkB,EAAGA,kBAAoB;QACzCD,qBAAqB,EAAGA;MAAuB,GAHzC6C,IAAI,CAAE,CAAC,CAAE,CAACrC,IAIhB,CAAC;IAEJ,CAAE,CAAC;EAAA,CACC,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["Button","Flex","FlexItem","__","_n","sprintf","useCallback","useRef","createInterpolateElement","__experimentalUseDialog","useDialog","useInstanceId","useDispatch","EntityTypeList","useIsDirty","store","editorStore","unlock","jsx","_jsx","jsxs","_jsxs","identity","values","EntitiesSavedStates","close","renderDialog","undefined","isDirtyProps","EntitiesSavedStatesExtensible","additionalPrompt","onSave","saveEnabled","saveEnabledProp","saveLabel","dirtyEntityRecords","isDirty","setUnselectedEntities","unselectedEntities","saveButtonRef","saveDirtyEntities","partitionedSavables","reduce","acc","record","name","push","site","siteSavables","wp_template","templateSavables","wp_template_part","templatePartSavables","contentSavables","sortedPartitionedSavables","Object","filter","Array","isArray","dismissPanel","saveDialogRef","saveDialogProps","onClose","dialogLabel","dialogDescription","ref","className","role","children","gap","isBlock","as","variant","size","onClick","disabled","accessibleWhenDisabled","entitiesToSkip","id","length","strong","map","list"],"sources":["@wordpress/editor/src/components/entities-saved-states/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Flex, FlexItem } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseRef,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport {\n\t__experimentalUseDialog as useDialog,\n\tuseInstanceId,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport EntityTypeList from './entity-type-list';\nimport { useIsDirty } from './hooks/use-is-dirty';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction identity( values ) {\n\treturn values;\n}\n\n/**\n * Renders the component for managing saved states of entities.\n *\n * @param {Object} props The component props.\n * @param {Function} props.close The function to close the dialog.\n * @param {Function} props.renderDialog The function to render the dialog.\n *\n * @return {JSX.Element} The rendered component.\n */\nexport default function EntitiesSavedStates( {\n\tclose,\n\trenderDialog = undefined,\n} ) {\n\tconst isDirtyProps = useIsDirty();\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\tclose={ close }\n\t\t\trenderDialog={ renderDialog }\n\t\t\t{ ...isDirtyProps }\n\t\t/>\n\t);\n}\n\n/**\n * Renders a panel for saving entities with dirty records.\n *\n * @param {Object} props The component props.\n * @param {string} props.additionalPrompt Additional prompt to display.\n * @param {Function} props.close Function to close the panel.\n * @param {Function} props.onSave Function to call when saving entities.\n * @param {boolean} props.saveEnabled Flag indicating if save is enabled.\n * @param {string} props.saveLabel Label for the save button.\n * @param {Function} props.renderDialog Function to render a custom dialog.\n * @param {Array} props.dirtyEntityRecords Array of dirty entity records.\n * @param {boolean} props.isDirty Flag indicating if there are dirty entities.\n * @param {Function} props.setUnselectedEntities Function to set unselected entities.\n * @param {Array} props.unselectedEntities Array of unselected entities.\n *\n * @return {JSX.Element} The rendered component.\n */\nexport function EntitiesSavedStatesExtensible( {\n\tadditionalPrompt = undefined,\n\tclose,\n\tonSave = identity,\n\tsaveEnabled: saveEnabledProp = undefined,\n\tsaveLabel = __( 'Save' ),\n\trenderDialog = undefined,\n\tdirtyEntityRecords,\n\tisDirty,\n\tsetUnselectedEntities,\n\tunselectedEntities,\n} ) {\n\tconst saveButtonRef = useRef();\n\tconst { saveDirtyEntities } = unlock( useDispatch( editorStore ) );\n\t// To group entities by type.\n\tconst partitionedSavables = dirtyEntityRecords.reduce( ( acc, record ) => {\n\t\tconst { name } = record;\n\t\tif ( ! acc[ name ] ) {\n\t\t\tacc[ name ] = [];\n\t\t}\n\t\tacc[ name ].push( record );\n\t\treturn acc;\n\t}, {} );\n\n\t// Sort entity groups.\n\tconst {\n\t\tsite: siteSavables,\n\t\twp_template: templateSavables,\n\t\twp_template_part: templatePartSavables,\n\t\t...contentSavables\n\t} = partitionedSavables;\n\tconst sortedPartitionedSavables = [\n\t\tsiteSavables,\n\t\ttemplateSavables,\n\t\ttemplatePartSavables,\n\t\t...Object.values( contentSavables ),\n\t].filter( Array.isArray );\n\n\tconst saveEnabled = saveEnabledProp ?? isDirty;\n\t// Explicitly define this with no argument passed. Using `close` on\n\t// its own will use the event object in place of the expected saved entities.\n\tconst dismissPanel = useCallback( () => close(), [ close ] );\n\n\tconst [ saveDialogRef, saveDialogProps ] = useDialog( {\n\t\tonClose: () => dismissPanel(),\n\t} );\n\tconst dialogLabel = useInstanceId( EntitiesSavedStatesExtensible, 'label' );\n\tconst dialogDescription = useInstanceId(\n\t\tEntitiesSavedStatesExtensible,\n\t\t'description'\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={ saveDialogRef }\n\t\t\t{ ...saveDialogProps }\n\t\t\tclassName=\"entities-saved-states__panel\"\n\t\t\trole={ renderDialog ? 'dialog' : undefined }\n\t\t\taria-labelledby={ renderDialog ? dialogLabel : undefined }\n\t\t\taria-describedby={ renderDialog ? dialogDescription : undefined }\n\t\t>\n\t\t\t<Flex className=\"entities-saved-states__panel-header\" gap={ 2 }>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tonClick={ dismissPanel }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tref={ saveButtonRef }\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tdisabled={ ! saveEnabled }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\tsaveDirtyEntities( {\n\t\t\t\t\t\t\tonSave,\n\t\t\t\t\t\t\tdirtyEntityRecords,\n\t\t\t\t\t\t\tentitiesToSkip: unselectedEntities,\n\t\t\t\t\t\t\tclose,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tclassName=\"editor-entities-saved-states__save-button\"\n\t\t\t\t>\n\t\t\t\t\t{ saveLabel }\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\n\t\t\t<div className=\"entities-saved-states__text-prompt\">\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"entities-saved-states__text-prompt--header-wrapper\"\n\t\t\t\t\tid={ renderDialog ? dialogLabel : undefined }\n\t\t\t\t>\n\t\t\t\t\t<strong className=\"entities-saved-states__text-prompt--header\">\n\t\t\t\t\t\t{ __( 'Are you ready to save?' ) }\n\t\t\t\t\t</strong>\n\t\t\t\t\t{ additionalPrompt }\n\t\t\t\t</div>\n\t\t\t\t<p id={ renderDialog ? dialogDescription : undefined }>\n\t\t\t\t\t{ isDirty\n\t\t\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %d: number of site changes waiting to be saved. */\n\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t'There is <strong>%d site change</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\t'There are <strong>%d site changes</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{ strong: <strong /> }\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Select the items you want to save.' ) }\n\t\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t{ sortedPartitionedSavables.map( ( list ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityTypeList\n\t\t\t\t\t\tkey={ list[ 0 ].name }\n\t\t\t\t\t\tlist={ list }\n\t\t\t\t\t\tunselectedEntities={ unselectedEntities }\n\t\t\t\t\t\tsetUnselectedEntities={ setUnselectedEntities }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,uBAAuB;AAC9D,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SACCC,WAAW,EACXC,MAAM,EACN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B,GAAGrC,SAAW;QAAAyC,QAAA,EACnDhC,OAAO,GACN5B,wBAAwB,CACxBH,OAAO,CACN;QACAD,EAAE,CACD,+DAA+D,EAC/D,iEAAiE,EACjE+B,kBAAkB,CAAC4C,MACpB,CAAC,EACD5C,kBAAkB,CAAC4C,MACpB,CAAC,EACD;UAAEC,MAAM,eAAE7D,IAAA,aAAS;QAAE,CACrB,CAAC,GACDhB,EAAE,CAAE,oCAAqC;MAAC,CAC3C,CAAC;IAAA,CACA,CAAC,EAEJmD,yBAAyB,CAAC2B,GAAG,CAAIC,IAAI,IAAM;MAC5C,oBACC/D,IAAA,CAACN,cAAc;QAEdqE,IAAI,EAAGA,IAAM;QACb5C,kBAAkB,EAAGA,kBAAoB;QACzCD,qBAAqB,EAAGA;MAAuB,GAHzC6C,IAAI,CAAE,CAAC,CAAE,CAACrC,IAIhB,CAAC;IAEJ,CAAE,CAAC;EAAA,CACC,CAAC;AAER","ignoreList":[]}
@@ -67,7 +67,7 @@ function EditorKeyboardShortcutsRegister() {
67
67
  registerShortcut({
68
68
  name: 'core/editor/toggle-list-view',
69
69
  category: 'global',
70
- description: __('Open the List View.'),
70
+ description: __('Show or hide the List View.'),
71
71
  keyCombination: {
72
72
  modifier: 'access',
73
73
  character: 'o'
@@ -76,7 +76,7 @@ function EditorKeyboardShortcutsRegister() {
76
76
  registerShortcut({
77
77
  name: 'core/editor/toggle-distraction-free',
78
78
  category: 'global',
79
- description: __('Toggle distraction free mode.'),
79
+ description: __('Enter or exit distraction free mode.'),
80
80
  keyCombination: {
81
81
  modifier: 'primaryShift',
82
82
  character: '\\'
@@ -85,7 +85,7 @@ function EditorKeyboardShortcutsRegister() {
85
85
  registerShortcut({
86
86
  name: 'core/editor/toggle-sidebar',
87
87
  category: 'global',
88
- description: __('Show or hide the Settings sidebar.'),
88
+ description: __('Show or hide the Settings panel.'),
89
89
  keyCombination: {
90
90
  modifier: 'primaryShift',
91
91
  character: ','
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useDispatch","__","BlockEditorKeyboardShortcuts","store","keyboardShortcutsStore","isAppleOS","jsx","_jsx","EditorKeyboardShortcutsRegister","registerShortcut","name","category","description","keyCombination","modifier","character","aliases","Register"],"sources":["@wordpress/editor/src/components/global-keyboard-shortcuts/register-shortcuts.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { BlockEditorKeyboardShortcuts } from '@wordpress/block-editor';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\n\n/**\n * Component for registering editor keyboard shortcuts.\n *\n * @return {Element} The component to be rendered.\n */\nfunction EditorKeyboardShortcutsRegister() {\n\t// Registering the shortcuts.\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/toggle-mode',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Switch between visual editor and code editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'secondary',\n\t\t\t\tcharacter: 'm',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t\t// Disable on Apple OS because it conflicts with the browser's\n\t\t\t// history shortcut. It's a fine alias for both Windows and Linux.\n\t\t\t// Since there's no conflict for Ctrl+Shift+Z on both Windows and\n\t\t\t// Linux, we keep it as the default for consistency.\n\t\t\taliases: isAppleOS()\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmodifier: 'primary',\n\t\t\t\t\t\t\tcharacter: 'y',\n\t\t\t\t\t\t},\n\t\t\t\t ],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/toggle-list-view',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Open the List View.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'o',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/toggle-distraction-free',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Toggle distraction free mode.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: '\\\\',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/toggle-sidebar',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Show or hide the Settings sidebar.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: ',',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/keyboard-shortcuts',\n\t\t\tcategory: 'main',\n\t\t\tdescription: __( 'Display these keyboard shortcuts.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'h',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/next-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the next part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrl',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'n',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/previous-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the previous part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'p',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\t\tcharacter: '~',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\treturn <BlockEditorKeyboardShortcuts.Register />;\n}\n\nexport default EditorKeyboardShortcutsRegister;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,4BAA4B,QAAQ,yBAAyB;AACtE,SAASC,KAAK,IAAIC,sBAAsB,QAAQ,+BAA+B;AAC/E,SAASC,SAAS,QAAQ,qBAAqB;;AAE/C;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA;AAKA,SAASC,+BAA+BA,CAAA,EAAG;EAC1C;EACA,MAAM;IAAEC;EAAiB,CAAC,GAAGT,WAAW,CAAEI,sBAAuB,CAAC;EAClEL,SAAS,CAAE,MAAM;IAChBU,gBAAgB,CAAE;MACjBC,IAAI,EAAE,yBAAyB;MAC/BC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,E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A,CAACL,4BAA4B,CAACe,QAAQ,IAAE,CAAC;AACjD;AAEA,eAAeT,+BAA+B","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","useDispatch","__","BlockEditorKeyboardShortcuts","store","keyboardShortcutsStore","isAppleOS","jsx","_jsx","EditorKeyboardShortcutsRegister","registerShortcut","name","category","description","keyCombination","modifier","character","aliases","Register"],"sources":["@wordpress/editor/src/components/global-keyboard-shortcuts/register-shortcuts.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { BlockEditorKeyboardShortcuts } from '@wordpress/block-editor';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\n\n/**\n * Component for registering editor keyboard shortcuts.\n *\n * @return {Element} The component to be rendered.\n */\nfunction EditorKeyboardShortcutsRegister() {\n\t// Registering the shortcuts.\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/toggle-mode',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Switch between visual editor and code editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'secondary',\n\t\t\t\tcharacter: 'm',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t\t// Disable on Apple OS because it conflicts with the browser's\n\t\t\t// history shortcut. It's a fine alias for both Windows and Linux.\n\t\t\t// Since there's no conflict for Ctrl+Shift+Z on both Windows and\n\t\t\t// Linux, we keep it as the default for consistency.\n\t\t\taliases: isAppleOS()\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmodifier: 'primary',\n\t\t\t\t\t\t\tcharacter: 'y',\n\t\t\t\t\t\t},\n\t\t\t\t ],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/toggle-list-view',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Show or hide the List View.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'o',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/toggle-distraction-free',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Enter or exit distraction free mode.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: '\\\\',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/toggle-sidebar',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Show or hide the Settings panel.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: ',',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/keyboard-shortcuts',\n\t\t\tcategory: 'main',\n\t\t\tdescription: __( 'Display these keyboard shortcuts.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'h',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/next-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the next part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrl',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'n',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/previous-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the previous part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'p',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\t\tcharacter: '~',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\treturn <BlockEditorKeyboardShortcuts.Register />;\n}\n\nexport default EditorKeyboardShortcutsRegister;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,4BAA4B,QAAQ,yBAAyB;AACtE,SAASC,KAAK,IAAIC,sBAAsB,QAAQ,+BAA+B;AAC/E,SAASC,SAAS,QAAQ,qBAAqB;;AAE/C;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA;AAKA,SAASC,+BAA+BA,CAAA,EAAG;EAC1C;EACA,MAAM;IAAEC;EAAiB,CAAC,GAAGT,WAAW,CAAEI,sBAAuB,CAAC;EAClEL,SAAS,CAA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EAAE;MACZ,CAAC;IAEH,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEN,gBAAgB,CAAG,CAAC;EAEzB,oBAAOF,IAAA,CAACL,4BAA4B,CAACe,QAAQ,IAAE,CAAC;AACjD;AAEA,eAAeT,+BAA+B","ignoreList":[]}
@@ -58,12 +58,22 @@ function useGlobalStylesUserConfig() {
58
58
  } = select(coreStore);
59
59
  const _globalStylesId = select(coreStore).__experimentalGetCurrentGlobalStylesId();
60
60
  let record;
61
- const userCanEditGlobalStyles = canUser('update', {
61
+
62
+ // We want the global styles ID request to finish before triggering
63
+ // the OPTIONS request for user capabilities, otherwise it will
64
+ // fetch `/wp/v2/global-styles` instead of
65
+ // `/wp/v2/global-styles/{id}`!
66
+ // Please adjust the preloaded requests if this changes!
67
+ const userCanEditGlobalStyles = _globalStylesId ? canUser('update', {
62
68
  kind: 'root',
63
69
  name: 'globalStyles',
64
70
  id: _globalStylesId
65
- });
66
- if (_globalStylesId) {
71
+ }) : null;
72
+ if (_globalStylesId &&
73
+ // We want the OPTIONS request for user capabilities to finish
74
+ // before getting the records, otherwise we'll fetch both!
75
+ typeof userCanEditGlobalStyles === 'boolean') {
76
+ // Please adjust the preloaded requests if this changes!
67
77
  if (userCanEditGlobalStyles) {
68
78
  record = getEditedEntityRecord('root', 'globalStyles', _globalStylesId);
69
79
  } else {
@@ -1 +1 @@
1
- {"version":3,"names":["deepmerge","isPlainObject","privateApis","blockEditorPrivateApis","store","coreStore","useSelect","useDispatch","useMemo","useCallback","unlock","jsx","_jsx","GlobalStylesContext","cleanEmptyObject","mergeBaseAndUserConfigs","base","user","isMergeableObject","customMerge","key","baseConfig","userConfig","undefined","useGlobalStylesUserConfig","globalStylesId","isReady","settings","styles","_links","select","getEntityRecord","getEditedEntityRecord","hasFinishedResolution","canUser","_globalStylesId","__experimentalGetCurrentGlobalStylesId","record","userCanEditGlobalStyles","kind","name","id","context","hasResolved","editEntityRecord","config","setConfig","callbackOrObject","options","_record$styles","_record$settings","_record$_links","currentConfig","updatedConfig","useGlobalStylesBaseConfig","__experimentalGetCurrentThemeBaseGlobalStyles","useGlobalStylesContext","isUserConfigReady","setUserConfig","isBaseConfigReady","mergedConfig","merged","GlobalStylesProvider","children","Provider","value"],"sources":["@wordpress/editor/src/components/global-styles-provider/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport deepmerge from 'deepmerge';\nimport { isPlainObject } from 'is-plain-object';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { GlobalStylesContext, cleanEmptyObject } = unlock(\n\tblockEditorPrivateApis\n);\n\nexport function mergeBaseAndUserConfigs( base, user ) {\n\treturn deepmerge( base, user, {\n\t\t/*\n\t\t * We only pass as arrays the presets,\n\t\t * in which case we want the new array of values\n\t\t * to override the old array (no merging).\n\t\t */\n\t\tisMergeableObject: isPlainObject,\n\t\t/*\n\t\t * Exceptions to the above rule.\n\t\t * Background images should be replaced, not merged,\n\t\t * as they themselves are specific object definitions for the style.\n\t\t */\n\t\tcustomMerge: ( key ) => {\n\t\t\tif ( key === 'backgroundImage' ) {\n\t\t\t\treturn ( baseConfig, userConfig ) => userConfig;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\t} );\n}\n\nfunction useGlobalStylesUserConfig() {\n\tconst { globalStylesId, isReady, settings, styles, _links } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetEditedEntityRecord,\n\t\t\t\thasFinishedResolution,\n\t\t\t\tcanUser,\n\t\t\t} = select( coreStore );\n\t\t\tconst _globalStylesId =\n\t\t\t\tselect( coreStore ).__experimentalGetCurrentGlobalStylesId();\n\n\t\t\tlet record;\n\t\t\tconst userCanEditGlobalStyles = canUser( 'update', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'globalStyles',\n\t\t\t\tid: _globalStylesId,\n\t\t\t} );\n\n\t\t\tif ( _globalStylesId ) {\n\t\t\t\tif ( userCanEditGlobalStyles ) {\n\t\t\t\t\trecord = getEditedEntityRecord(\n\t\t\t\t\t\t'root',\n\t\t\t\t\t\t'globalStyles',\n\t\t\t\t\t\t_globalStylesId\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\trecord = getEntityRecord(\n\t\t\t\t\t\t'root',\n\t\t\t\t\t\t'globalStyles',\n\t\t\t\t\t\t_globalStylesId,\n\t\t\t\t\t\t{ context: 'view' }\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet hasResolved = false;\n\t\t\tif (\n\t\t\t\thasFinishedResolution(\n\t\t\t\t\t'__experimentalGetCurrentGlobalStylesId'\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tif ( _globalStylesId ) {\n\t\t\t\t\thasResolved = userCanEditGlobalStyles\n\t\t\t\t\t\t? hasFinishedResolution( 'getEditedEntityRecord', [\n\t\t\t\t\t\t\t\t'root',\n\t\t\t\t\t\t\t\t'globalStyles',\n\t\t\t\t\t\t\t\t_globalStylesId,\n\t\t\t\t\t\t ] )\n\t\t\t\t\t\t: hasFinishedResolution( 'getEntityRecord', [\n\t\t\t\t\t\t\t\t'root',\n\t\t\t\t\t\t\t\t'globalStyles',\n\t\t\t\t\t\t\t\t_globalStylesId,\n\t\t\t\t\t\t\t\t{ context: 'view' },\n\t\t\t\t\t\t ] );\n\t\t\t\t} else {\n\t\t\t\t\thasResolved = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tglobalStylesId: _globalStylesId,\n\t\t\t\tisReady: hasResolved,\n\t\t\t\tsettings: record?.settings,\n\t\t\t\tstyles: record?.styles,\n\t\t\t\t_links: record?._links,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { getEditedEntityRecord } = useSelect( coreStore );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst config = useMemo( () => {\n\t\treturn {\n\t\t\tsettings: settings ?? {},\n\t\t\tstyles: styles ?? {},\n\t\t\t_links: _links ?? {},\n\t\t};\n\t}, [ settings, styles, _links ] );\n\n\tconst setConfig = useCallback(\n\t\t/**\n\t\t * Set the global styles config.\n\t\t * @param {Function|Object} callbackOrObject If the callbackOrObject is a function, pass the current config to the callback so the consumer can merge values.\n\t\t * Otherwise, overwrite the current config with the incoming object.\n\t\t * @param {Object} options Options for editEntityRecord Core selector.\n\t\t */\n\t\t( callbackOrObject, options = {} ) => {\n\t\t\tconst record = getEditedEntityRecord(\n\t\t\t\t'root',\n\t\t\t\t'globalStyles',\n\t\t\t\tglobalStylesId\n\t\t\t);\n\n\t\t\tconst currentConfig = {\n\t\t\t\tstyles: record?.styles ?? {},\n\t\t\t\tsettings: record?.settings ?? {},\n\t\t\t\t_links: record?._links ?? {},\n\t\t\t};\n\n\t\t\tconst updatedConfig =\n\t\t\t\ttypeof callbackOrObject === 'function'\n\t\t\t\t\t? callbackOrObject( currentConfig )\n\t\t\t\t\t: callbackOrObject;\n\n\t\t\teditEntityRecord(\n\t\t\t\t'root',\n\t\t\t\t'globalStyles',\n\t\t\t\tglobalStylesId,\n\t\t\t\t{\n\t\t\t\t\tstyles: cleanEmptyObject( updatedConfig.styles ) || {},\n\t\t\t\t\tsettings: cleanEmptyObject( updatedConfig.settings ) || {},\n\t\t\t\t\t_links: cleanEmptyObject( updatedConfig._links ) || {},\n\t\t\t\t},\n\t\t\t\toptions\n\t\t\t);\n\t\t},\n\t\t[ globalStylesId, editEntityRecord, getEditedEntityRecord ]\n\t);\n\n\treturn [ isReady, config, setConfig ];\n}\n\nfunction useGlobalStylesBaseConfig() {\n\tconst baseConfig = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).__experimentalGetCurrentThemeBaseGlobalStyles(),\n\t\t[]\n\t);\n\treturn [ !! baseConfig, baseConfig ];\n}\n\nexport function useGlobalStylesContext() {\n\tconst [ isUserConfigReady, userConfig, setUserConfig ] =\n\t\tuseGlobalStylesUserConfig();\n\tconst [ isBaseConfigReady, baseConfig ] = useGlobalStylesBaseConfig();\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! baseConfig || ! userConfig ) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t}, [ userConfig, baseConfig ] );\n\n\tconst context = useMemo( () => {\n\t\treturn {\n\t\t\tisReady: isUserConfigReady && isBaseConfigReady,\n\t\t\tuser: userConfig,\n\t\t\tbase: baseConfig,\n\t\t\tmerged: mergedConfig,\n\t\t\tsetUserConfig,\n\t\t};\n\t}, [\n\t\tmergedConfig,\n\t\tuserConfig,\n\t\tbaseConfig,\n\t\tsetUserConfig,\n\t\tisUserConfigReady,\n\t\tisBaseConfigReady,\n\t] );\n\n\treturn context;\n}\n\nexport function GlobalStylesProvider( { children } ) {\n\tconst context = useGlobalStylesContext();\n\tif ( ! context.isReady ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ context }>\n\t\t\t{ children }\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,WAAW;AACjC,SAASC,aAAa,QAAQ,iBAAiB;;AAE/C;AACA;AACA;AACA,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;;AAEzD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAM;EAAEC,mBAAmB;EAAEC;AAAiB,CAAC,GAAGJ,MAAM,CACvDP,sB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,GACrDlC,yBAAyB,CAAC,CAAC;EAC5B,MAAM,CAAEmC,iBAAiB,EAAEtC,UAAU,CAAE,GAAGiC,yBAAyB,CAAC,CAAC;EAErE,MAAMM,YAAY,GAAGpD,OAAO,CAAE,MAAM;IACnC,IAAK,CAAEa,UAAU,IAAI,CAAEC,UAAU,EAAG;MACnC,OAAO,CAAC,CAAC;IACV;IAEA,OAAOP,uBAAuB,CAAEM,UAAU,EAAEC,UAAW,CAAC;EACzD,CAAC,EAAE,CAAEA,UAAU,EAAED,UAAU,CAAG,CAAC;EAE/B,MAAMqB,OAAO,GAAGlC,OAAO,CAAE,MAAM;IAC9B,OAAO;MACNkB,OAAO,EAAE+B,iBAAiB,IAAIE,iBAAiB;MAC/C1C,IAAI,EAAEK,UAAU;MAChBN,IAAI,EAAEK,UAAU;MAChBwC,MAAM,EAAED,YAAY;MACpBF;IACD,CAAC;EACF,CAAC,EAAE,CACFE,YAAY,EACZtC,UAAU,EACVD,UAAU,EACVqC,aAAa,EACbD,iBAAiB,EACjBE,iBAAiB,CAChB,CAAC;EAEH,OAAOjB,OAAO;AACf;AAEA,OAAO,SAASoB,oBAAoBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACpD,MAAMrB,OAAO,GAAGc,sBAAsB,CAAC,CAAC;EACxC,IAAK,CAAEd,OAAO,CAAChB,OAAO,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,oBACCd,IAAA,CAACC,mBAAmB,CAACmD,QAAQ;IAACC,KAAK,EAAGvB,OAAS;IAAAqB,QAAA,EAC5CA;EAAQ,CACmB,CAAC;AAEjC","ignoreList":[]}
1
+ {"version":3,"names":["deepmerge","isPlainObject","privateApis","blockEditorPrivateApis","store","coreStore","useSelect","useDispatch","useMemo","useCallback","unlock","jsx","_jsx","GlobalStylesContext","cleanEmptyObject","mergeBaseAndUserConfigs","base","user","isMergeableObject","customMerge","key","baseConfig","userConfig","undefined","useGlobalStylesUserConfig","globalStylesId","isReady","settings","styles","_links","select","getEntityRecord","getEditedEntityRecord","hasFinishedResolution","canUser","_globalStylesId","__experimentalGetCurrentGlobalStylesId","record","userCanEditGlobalStyles","kind","name","id","context","hasResolved","editEntityRecord","config","setConfig","callbackOrObject","options","_record$styles","_record$settings","_record$_links","currentConfig","updatedConfig","useGlobalStylesBaseConfig","__experimentalGetCurrentThemeBaseGlobalStyles","useGlobalStylesContext","isUserConfigReady","setUserConfig","isBaseConfigReady","mergedConfig","merged","GlobalStylesProvider","children","Provider","value"],"sources":["@wordpress/editor/src/components/global-styles-provider/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport deepmerge from 'deepmerge';\nimport { isPlainObject } from 'is-plain-object';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { GlobalStylesContext, cleanEmptyObject } = unlock(\n\tblockEditorPrivateApis\n);\n\nexport function mergeBaseAndUserConfigs( base, user ) {\n\treturn deepmerge( base, user, {\n\t\t/*\n\t\t * We only pass as arrays the presets,\n\t\t * in which case we want the new array of values\n\t\t * to override the old array (no merging).\n\t\t */\n\t\tisMergeableObject: isPlainObject,\n\t\t/*\n\t\t * Exceptions to the above rule.\n\t\t * Background images should be replaced, not merged,\n\t\t * as they themselves are specific object definitions for the style.\n\t\t */\n\t\tcustomMerge: ( key ) => {\n\t\t\tif ( key === 'backgroundImage' ) {\n\t\t\t\treturn ( baseConfig, userConfig ) => userConfig;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\t} );\n}\n\nfunction useGlobalStylesUserConfig() {\n\tconst { globalStylesId, isReady, settings, styles, _links } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetEditedEntityRecord,\n\t\t\t\thasFinishedResolution,\n\t\t\t\tcanUser,\n\t\t\t} = select( coreStore );\n\t\t\tconst _globalStylesId =\n\t\t\t\tselect( coreStore ).__experimentalGetCurrentGlobalStylesId();\n\n\t\t\tlet record;\n\n\t\t\t// We want the global styles ID request to finish before triggering\n\t\t\t// the OPTIONS request for user capabilities, otherwise it will\n\t\t\t// fetch `/wp/v2/global-styles` instead of\n\t\t\t// `/wp/v2/global-styles/{id}`!\n\t\t\t// Please adjust the preloaded requests if this changes!\n\t\t\tconst userCanEditGlobalStyles = _globalStylesId\n\t\t\t\t? canUser( 'update', {\n\t\t\t\t\t\tkind: 'root',\n\t\t\t\t\t\tname: 'globalStyles',\n\t\t\t\t\t\tid: _globalStylesId,\n\t\t\t\t } )\n\t\t\t\t: null;\n\n\t\t\tif (\n\t\t\t\t_globalStylesId &&\n\t\t\t\t// We want the OPTIONS request for user capabilities to finish\n\t\t\t\t// before getting the records, otherwise we'll fetch both!\n\t\t\t\ttypeof userCanEditGlobalStyles === 'boolean'\n\t\t\t) {\n\t\t\t\t// Please adjust the preloaded requests if this changes!\n\t\t\t\tif ( userCanEditGlobalStyles ) {\n\t\t\t\t\trecord = getEditedEntityRecord(\n\t\t\t\t\t\t'root',\n\t\t\t\t\t\t'globalStyles',\n\t\t\t\t\t\t_globalStylesId\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\trecord = getEntityRecord(\n\t\t\t\t\t\t'root',\n\t\t\t\t\t\t'globalStyles',\n\t\t\t\t\t\t_globalStylesId,\n\t\t\t\t\t\t{ context: 'view' }\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet hasResolved = false;\n\t\t\tif (\n\t\t\t\thasFinishedResolution(\n\t\t\t\t\t'__experimentalGetCurrentGlobalStylesId'\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tif ( _globalStylesId ) {\n\t\t\t\t\thasResolved = userCanEditGlobalStyles\n\t\t\t\t\t\t? hasFinishedResolution( 'getEditedEntityRecord', [\n\t\t\t\t\t\t\t\t'root',\n\t\t\t\t\t\t\t\t'globalStyles',\n\t\t\t\t\t\t\t\t_globalStylesId,\n\t\t\t\t\t\t ] )\n\t\t\t\t\t\t: hasFinishedResolution( 'getEntityRecord', [\n\t\t\t\t\t\t\t\t'root',\n\t\t\t\t\t\t\t\t'globalStyles',\n\t\t\t\t\t\t\t\t_globalStylesId,\n\t\t\t\t\t\t\t\t{ context: 'view' },\n\t\t\t\t\t\t ] );\n\t\t\t\t} else {\n\t\t\t\t\thasResolved = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tglobalStylesId: _globalStylesId,\n\t\t\t\tisReady: hasResolved,\n\t\t\t\tsettings: record?.settings,\n\t\t\t\tstyles: record?.styles,\n\t\t\t\t_links: record?._links,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { getEditedEntityRecord } = useSelect( coreStore );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst config = useMemo( () => {\n\t\treturn {\n\t\t\tsettings: settings ?? {},\n\t\t\tstyles: styles ?? {},\n\t\t\t_links: _links ?? {},\n\t\t};\n\t}, [ settings, styles, _links ] );\n\n\tconst setConfig = useCallback(\n\t\t/**\n\t\t * Set the global styles config.\n\t\t * @param {Function|Object} callbackOrObject If the callbackOrObject is a function, pass the current config to the callback so the consumer can merge values.\n\t\t * Otherwise, overwrite the current config with the incoming object.\n\t\t * @param {Object} options Options for editEntityRecord Core selector.\n\t\t */\n\t\t( callbackOrObject, options = {} ) => {\n\t\t\tconst record = getEditedEntityRecord(\n\t\t\t\t'root',\n\t\t\t\t'globalStyles',\n\t\t\t\tglobalStylesId\n\t\t\t);\n\n\t\t\tconst currentConfig = {\n\t\t\t\tstyles: record?.styles ?? {},\n\t\t\t\tsettings: record?.settings ?? {},\n\t\t\t\t_links: record?._links ?? {},\n\t\t\t};\n\n\t\t\tconst updatedConfig =\n\t\t\t\ttypeof callbackOrObject === 'function'\n\t\t\t\t\t? callbackOrObject( currentConfig )\n\t\t\t\t\t: callbackOrObject;\n\n\t\t\teditEntityRecord(\n\t\t\t\t'root',\n\t\t\t\t'globalStyles',\n\t\t\t\tglobalStylesId,\n\t\t\t\t{\n\t\t\t\t\tstyles: cleanEmptyObject( updatedConfig.styles ) || {},\n\t\t\t\t\tsettings: cleanEmptyObject( updatedConfig.settings ) || {},\n\t\t\t\t\t_links: cleanEmptyObject( updatedConfig._links ) || {},\n\t\t\t\t},\n\t\t\t\toptions\n\t\t\t);\n\t\t},\n\t\t[ globalStylesId, editEntityRecord, getEditedEntityRecord ]\n\t);\n\n\treturn [ isReady, config, setConfig ];\n}\n\nfunction useGlobalStylesBaseConfig() {\n\tconst baseConfig = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).__experimentalGetCurrentThemeBaseGlobalStyles(),\n\t\t[]\n\t);\n\treturn [ !! baseConfig, baseConfig ];\n}\n\nexport function useGlobalStylesContext() {\n\tconst [ isUserConfigReady, userConfig, setUserConfig ] =\n\t\tuseGlobalStylesUserConfig();\n\tconst [ isBaseConfigReady, baseConfig ] = useGlobalStylesBaseConfig();\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! baseConfig || ! userConfig ) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t}, [ userConfig, baseConfig ] );\n\n\tconst context = useMemo( () => {\n\t\treturn {\n\t\t\tisReady: isUserConfigReady && isBaseConfigReady,\n\t\t\tuser: userConfig,\n\t\t\tbase: baseConfig,\n\t\t\tmerged: mergedConfig,\n\t\t\tsetUserConfig,\n\t\t};\n\t}, [\n\t\tmergedConfig,\n\t\tuserConfig,\n\t\tbaseConfig,\n\t\tsetUserConfig,\n\t\tisUserConfigReady,\n\t\tisBaseConfigReady,\n\t] );\n\n\treturn context;\n}\n\nexport function GlobalStylesProvider( { children } ) {\n\tconst context = useGlobalStylesContext();\n\tif ( ! context.isReady ) {\n\t\treturn null;\n\t}\n\n\treturn (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,UAAU,EACVqC,aAAa,EACbD,iBAAiB,EACjBE,iBAAiB,CAChB,CAAC;EAEH,OAAOjB,OAAO;AACf;AAEA,OAAO,SAASoB,oBAAoBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACpD,MAAMrB,OAAO,GAAGc,sBAAsB,CAAC,CAAC;EACxC,IAAK,CAAEd,OAAO,CAAChB,OAAO,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,oBACCd,IAAA,CAACC,mBAAmB,CAACmD,QAAQ;IAACC,KAAK,EAAGvB,OAAS;IAAAqB,QAAA,EAC5CA;EAAQ,CACmB,CAAC;AAEjC","ignoreList":[]}
@@ -12,6 +12,7 @@ import { PinnedItems } from '@wordpress/interface';
12
12
  /**
13
13
  * Internal dependencies
14
14
  */
15
+ import CollabSidebar from '../collab-sidebar';
15
16
  import BackButton, { useHasBackButton } from './back-button';
16
17
  import CollapsibleBlockToolbar from '../collapsible-block-toolbar';
17
18
  import DocumentBar from '../document-bar';
@@ -153,7 +154,9 @@ function Header({
153
154
  */
154
155
  _jsx(PostSavedState, {
155
156
  forceIsDirty: forceIsDirty
156
- }), canBeZoomedOut && isEditorIframed && isWideViewport && /*#__PURE__*/_jsx(ZoomOutToggle, {}), /*#__PURE__*/_jsx(PreviewDropdown, {
157
+ }), canBeZoomedOut && isEditorIframed && isWideViewport && /*#__PURE__*/_jsx(ZoomOutToggle, {
158
+ disabled: forceDisableBlockTools
159
+ }), /*#__PURE__*/_jsx(PreviewDropdown, {
157
160
  forceIsAutosaveable: forceIsDirty,
158
161
  disabled: isNestedEntity
159
162
  }), /*#__PURE__*/_jsx(PostPreviewButton, {
@@ -164,7 +167,7 @@ function Header({
164
167
  }), !customSaveButton && /*#__PURE__*/_jsx(PostPublishButtonOrToggle, {
165
168
  forceIsDirty: forceIsDirty,
166
169
  setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
167
- }), customSaveButton, /*#__PURE__*/_jsx(MoreMenu, {})]
170
+ }), /*#__PURE__*/_jsx(CollabSidebar, {}), customSaveButton, /*#__PURE__*/_jsx(MoreMenu, {})]
168
171
  })]
169
172
  });
170
173
  }
@@ -1 +1 @@
1
- {"version":3,"names":["store","blockEditorStore","useSelect","useMediaQuery","useViewportMatch","__unstableMotion","motion","preferencesStore","useState","PinnedItems","BackButton","useHasBackButton","CollapsibleBlockToolbar","DocumentBar","DocumentTools","MoreMenu","PostPreviewButton","PostPublishButtonOrToggle","PostSavedState","PostViewLink","PreviewDropdown","ZoomOutToggle","editorStore","jsx","_jsx","jsxs","_jsxs","toolbarVariations","distractionFreeDisabled","y","distractionFreeHover","distractionFreeHidden","visible","hidden","backButtonVariations","x","Header","customSaveButton","forceIsDirty","forceDisableBlockTools","setEntitiesSavedStatesCallback","title","isEditorIframed","isWideViewport","isLargeViewport","isTooNarrowForDocumentBar","postType","isTextEditor","isPublishSidebarOpened","showIconLabels","hasFixedToolbar","hasBlockSelection","isNestedEntity","select","get","getPreference","getEditorMode","getEditorSettings","getCurrentPostType","_isPublishSidebarOpened","getBlockSelectionStart","onNavigateToPreviousEntityRecord","canBeZoomedOut","includes","isBlockToolsCollapsed","setIsBlockToolsCollapsed","hasCenter","hasBackButton","className","children","div","variants","transition","type","Slot","disableBlockTools","isCollapsed","onToggle","forceIsAutosaveable","disabled","scope"],"sources":["@wordpress/editor/src/components/header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useMediaQuery, useViewportMatch } from '@wordpress/compose';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useState } from '@wordpress/element';\nimport { PinnedItems } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport BackButton, { useHasBackButton } from './back-button';\nimport CollapsibleBlockToolbar from '../collapsible-block-toolbar';\nimport DocumentBar from '../document-bar';\nimport DocumentTools from '../document-tools';\nimport MoreMenu from '../more-menu';\nimport PostPreviewButton from '../post-preview-button';\nimport PostPublishButtonOrToggle from '../post-publish-button/post-publish-button-or-toggle';\nimport PostSavedState from '../post-saved-state';\nimport PostViewLink from '../post-view-link';\nimport PreviewDropdown from '../preview-dropdown';\nimport ZoomOutToggle from '../zoom-out-toggle';\nimport { store as editorStore } from '../../store';\n\nconst toolbarVariations = {\n\tdistractionFreeDisabled: { y: '-50px' },\n\tdistractionFreeHover: { y: 0 },\n\tdistractionFreeHidden: { y: '-50px' },\n\tvisible: { y: 0 },\n\thidden: { y: 0 },\n};\n\nconst backButtonVariations = {\n\tdistractionFreeDisabled: { x: '-100%' },\n\tdistractionFreeHover: { x: 0 },\n\tdistractionFreeHidden: { x: '-100%' },\n\tvisible: { x: 0 },\n\thidden: { x: 0 },\n};\n\nfunction Header( {\n\tcustomSaveButton,\n\tforceIsDirty,\n\tforceDisableBlockTools,\n\tsetEntitiesSavedStatesCallback,\n\ttitle,\n\tisEditorIframed,\n} ) {\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isTooNarrowForDocumentBar = useMediaQuery( '(max-width: 403px)' );\n\tconst {\n\t\tpostType,\n\t\tisTextEditor,\n\t\tisPublishSidebarOpened,\n\t\tshowIconLabels,\n\t\thasFixedToolbar,\n\t\thasBlockSelection,\n\t\tisNestedEntity,\n\t} = useSelect( ( select ) => {\n\t\tconst { get: getPreference } = select( preferencesStore );\n\t\tconst {\n\t\t\tgetEditorMode,\n\t\t\tgetEditorSettings,\n\t\t\tgetCurrentPostType,\n\t\t\tisPublishSidebarOpened: _isPublishSidebarOpened,\n\t\t} = select( editorStore );\n\n\t\treturn {\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tisTextEditor: getEditorMode() === 'text',\n\t\t\tisPublishSidebarOpened: _isPublishSidebarOpened(),\n\t\t\tshowIconLabels: getPreference( 'core', 'showIconLabels' ),\n\t\t\thasFixedToolbar: getPreference( 'core', 'fixedToolbar' ),\n\t\t\thasBlockSelection:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\tisNestedEntity:\n\t\t\t\t!! getEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\n\tconst canBeZoomedOut = [ 'post', 'page', 'wp_template' ].includes(\n\t\tpostType\n\t);\n\n\tconst [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =\n\t\tuseState( true );\n\n\tconst hasCenter =\n\t\t( ! hasBlockSelection || isBlockToolsCollapsed ) &&\n\t\t! isTooNarrowForDocumentBar;\n\tconst hasBackButton = useHasBackButton();\n\t/*\n\t * The edit-post-header classname is only kept for backward compatability\n\t * as some plugins might be relying on its presence.\n\t */\n\treturn (\n\t\t<div className=\"editor-header edit-post-header\">\n\t\t\t{ hasBackButton && (\n\t\t\t\t<motion.div\n\t\t\t\t\tclassName=\"editor-header__back-button\"\n\t\t\t\t\tvariants={ backButtonVariations }\n\t\t\t\t\ttransition={ { type: 'tween' } }\n\t\t\t\t>\n\t\t\t\t\t<BackButton.Slot />\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t\t<motion.div\n\t\t\t\tvariants={ toolbarVariations }\n\t\t\t\tclassName=\"editor-header__toolbar\"\n\t\t\t\ttransition={ { type: 'tween' } }\n\t\t\t>\n\t\t\t\t<DocumentTools\n\t\t\t\t\tdisableBlockTools={ forceDisableBlockTools || isTextEditor }\n\t\t\t\t/>\n\t\t\t\t{ hasFixedToolbar && isLargeViewport && (\n\t\t\t\t\t<CollapsibleBlockToolbar\n\t\t\t\t\t\tisCollapsed={ isBlockToolsCollapsed }\n\t\t\t\t\t\tonToggle={ setIsBlockToolsCollapsed }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</motion.div>\n\t\t\t{ hasCenter && (\n\t\t\t\t<motion.div\n\t\t\t\t\tclassName=\"editor-header__center\"\n\t\t\t\t\tvariants={ toolbarVariations }\n\t\t\t\t\ttransition={ { type: 'tween' } }\n\t\t\t\t>\n\t\t\t\t\t<DocumentBar title={ title } />\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t\t<motion.div\n\t\t\t\tvariants={ toolbarVariations }\n\t\t\t\ttransition={ { type: 'tween' } }\n\t\t\t\tclassName=\"editor-header__settings\"\n\t\t\t>\n\t\t\t\t{ ! customSaveButton && ! isPublishSidebarOpened && (\n\t\t\t\t\t/*\n\t\t\t\t\t * This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t * We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t * we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t * We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t * when the publish sidebar has been closed.\n\t\t\t\t\t */\n\t\t\t\t\t<PostSavedState forceIsDirty={ forceIsDirty } />\n\t\t\t\t) }\n\n\t\t\t\t{ canBeZoomedOut && isEditorIframed && isWideViewport && (\n\t\t\t\t\t<ZoomOutToggle />\n\t\t\t\t) }\n\n\t\t\t\t<PreviewDropdown\n\t\t\t\t\tforceIsAutosaveable={ forceIsDirty }\n\t\t\t\t\tdisabled={ isNestedEntity }\n\t\t\t\t/>\n\t\t\t\t<PostPreviewButton\n\t\t\t\t\tclassName=\"editor-header__post-preview-button\"\n\t\t\t\t\tforceIsAutosaveable={ forceIsDirty }\n\t\t\t\t/>\n\t\t\t\t<PostViewLink />\n\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<PinnedItems.Slot scope=\"core\" />\n\t\t\t\t) }\n\n\t\t\t\t{ ! customSaveButton && (\n\t\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ customSaveButton }\n\t\t\t\t<MoreMenu />\n\t\t\t</motion.div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B;MACjCG,QAAQ,EAAG5C,iBAAmB;MAC9B6C,UAAU,EAAG;QAAEC,IAAI,EAAE;MAAQ,CAAG;MAAAJ,QAAA,eAEhC7C,IAAA,CAACX,WAAW;QAAC4B,KAAK,EAAGA;MAAO,CAAE;IAAC,CACpB,CACZ,eACDf,KAAA,CAACpB,MAAM,CAACgE,GAAG;MACVC,QAAQ,EAAG5C,iBAAmB;MAC9B6C,UAAU,EAAG;QAAEC,IAAI,EAAE;MAAQ,CAAG;MAChCL,SAAS,EAAC,yBAAyB;MAAAC,QAAA,GAEjC,CAAEhC,gBAAgB,IAAI,CAAEW,sBAAsB;MAAA;MAC/C;AACL;AACA;AACA;AACA;AACA;AACA;MACKxB,IAAA,CAACN,cAAc;QAACoB,YAAY,EAAGA;MAAc,CAAE,CAC/C,EAECwB,cAAc,IAAIpB,eAAe,IAAIC,cAAc,iBACpDnB,IAAA,CAACH,aAAa,IAAE,CAChB,eAEDG,IAAA,CAACJ,eAAe;QACf0D,mBAAmB,EAAGxC,YAAc;QACpCyC,QAAQ,EAAG3B;MAAgB,CAC3B,CAAC,eACF5B,IAAA,CAACR,iBAAiB;QACjBoD,SAAS,EAAC,oCAAoC;QAC9CU,mBAAmB,EAAGxC;MAAc,CACpC,CAAC,eACFd,IAAA,CAACL,YAAY,IAAE,CAAC,EAEd,CAAEwB,cAAc,IAAI,CAAEM,cAAc,kBACrCzB,IAAA,CAACf,WAAW,CAACiE,IAAI;QAACM,KAAK,EAAC;MAAM,CAAE,CAChC,EAEC,CAAE3C,gBAAgB,iBACnBb,IAAA,CAACP,yBAAyB;QACzBqB,YAAY,EAAGA,YAAc;QAC7BE,8BAA8B,EAC7BA;MACA,CACD,CACD,EAECH,gBAAgB,eAClBb,IAAA,CAACT,QAAQ,IAAE,CAAC;IAAA,CACD,CAAC;EAAA,CACT,CAAC;AAER;AAEA,eAAeqB,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["store","blockEditorStore","useSelect","useMediaQuery","useViewportMatch","__unstableMotion","motion","preferencesStore","useState","PinnedItems","CollabSidebar","BackButton","useHasBackButton","CollapsibleBlockToolbar","DocumentBar","DocumentTools","MoreMenu","PostPreviewButton","PostPublishButtonOrToggle","PostSavedState","PostViewLink","PreviewDropdown","ZoomOutToggle","editorStore","jsx","_jsx","jsxs","_jsxs","toolbarVariations","distractionFreeDisabled","y","distractionFreeHover","distractionFreeHidden","visible","hidden","backButtonVariations","x","Header","customSaveButton","forceIsDirty","forceDisableBlockTools","setEntitiesSavedStatesCallback","title","isEditorIframed","isWideViewport","isLargeViewport","isTooNarrowForDocumentBar","postType","isTextEditor","isPublishSidebarOpened","showIconLabels","hasFixedToolbar","hasBlockSelection","isNestedEntity","select","get","getPreference","getEditorMode","getEditorSettings","getCurrentPostType","_isPublishSidebarOpened","getBlockSelectionStart","onNavigateToPreviousEntityRecord","canBeZoomedOut","includes","isBlockToolsCollapsed","setIsBlockToolsCollapsed","hasCenter","hasBackButton","className","children","div","variants","transition","type","Slot","disableBlockTools","isCollapsed","onToggle","disabled","forceIsAutosaveable","scope"],"sources":["@wordpress/editor/src/components/header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useMediaQuery, useViewportMatch } from '@wordpress/compose';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useState } from '@wordpress/element';\nimport { PinnedItems } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport CollabSidebar from '../collab-sidebar';\nimport BackButton, { useHasBackButton } from './back-button';\nimport CollapsibleBlockToolbar from '../collapsible-block-toolbar';\nimport DocumentBar from '../document-bar';\nimport DocumentTools from '../document-tools';\nimport MoreMenu from '../more-menu';\nimport PostPreviewButton from '../post-preview-button';\nimport PostPublishButtonOrToggle from '../post-publish-button/post-publish-button-or-toggle';\nimport PostSavedState from '../post-saved-state';\nimport PostViewLink from '../post-view-link';\nimport PreviewDropdown from '../preview-dropdown';\nimport ZoomOutToggle from '../zoom-out-toggle';\nimport { store as editorStore } from '../../store';\n\nconst toolbarVariations = {\n\tdistractionFreeDisabled: { y: '-50px' },\n\tdistractionFreeHover: { y: 0 },\n\tdistractionFreeHidden: { y: '-50px' },\n\tvisible: { y: 0 },\n\thidden: { y: 0 },\n};\n\nconst backButtonVariations = {\n\tdistractionFreeDisabled: { x: '-100%' },\n\tdistractionFreeHover: { x: 0 },\n\tdistractionFreeHidden: { x: '-100%' },\n\tvisible: { x: 0 },\n\thidden: { x: 0 },\n};\n\nfunction Header( {\n\tcustomSaveButton,\n\tforceIsDirty,\n\tforceDisableBlockTools,\n\tsetEntitiesSavedStatesCallback,\n\ttitle,\n\tisEditorIframed,\n} ) {\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isTooNarrowForDocumentBar = useMediaQuery( '(max-width: 403px)' );\n\tconst {\n\t\tpostType,\n\t\tisTextEditor,\n\t\tisPublishSidebarOpened,\n\t\tshowIconLabels,\n\t\thasFixedToolbar,\n\t\thasBlockSelection,\n\t\tisNestedEntity,\n\t} = useSelect( ( select ) => {\n\t\tconst { get: getPreference } = select( preferencesStore );\n\t\tconst {\n\t\t\tgetEditorMode,\n\t\t\tgetEditorSettings,\n\t\t\tgetCurrentPostType,\n\t\t\tisPublishSidebarOpened: _isPublishSidebarOpened,\n\t\t} = select( editorStore );\n\n\t\treturn {\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tisTextEditor: getEditorMode() === 'text',\n\t\t\tisPublishSidebarOpened: _isPublishSidebarOpened(),\n\t\t\tshowIconLabels: getPreference( 'core', 'showIconLabels' ),\n\t\t\thasFixedToolbar: getPreference( 'core', 'fixedToolbar' ),\n\t\t\thasBlockSelection:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\tisNestedEntity:\n\t\t\t\t!! getEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\n\tconst canBeZoomedOut = [ 'post', 'page', 'wp_template' ].includes(\n\t\tpostType\n\t);\n\n\tconst [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =\n\t\tuseState( true );\n\n\tconst hasCenter =\n\t\t( ! hasBlockSelection || isBlockToolsCollapsed ) &&\n\t\t! isTooNarrowForDocumentBar;\n\tconst hasBackButton = useHasBackButton();\n\t/*\n\t * The edit-post-header classname is only kept for backward compatability\n\t * as some plugins might be relying on its presence.\n\t */\n\treturn (\n\t\t<div className=\"editor-header edit-post-header\">\n\t\t\t{ hasBackButton && (\n\t\t\t\t<motion.div\n\t\t\t\t\tclassName=\"editor-header__back-button\"\n\t\t\t\t\tvariants={ backButtonVariations }\n\t\t\t\t\ttransition={ { type: 'tween' } }\n\t\t\t\t>\n\t\t\t\t\t<BackButton.Slot />\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t\t<motion.div\n\t\t\t\tvariants={ toolbarVariations }\n\t\t\t\tclassName=\"editor-header__toolbar\"\n\t\t\t\ttransition={ { type: 'tween' } }\n\t\t\t>\n\t\t\t\t<DocumentTools\n\t\t\t\t\tdisableBlockTools={ forceDisableBlockTools || isTextEditor }\n\t\t\t\t/>\n\t\t\t\t{ hasFixedToolbar && isLargeViewport && (\n\t\t\t\t\t<CollapsibleBlockToolbar\n\t\t\t\t\t\tisCollapsed={ isBlockToolsCollapsed }\n\t\t\t\t\t\tonToggle={ setIsBlockToolsCollapsed }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</motion.div>\n\t\t\t{ hasCenter && (\n\t\t\t\t<motion.div\n\t\t\t\t\tclassName=\"editor-header__center\"\n\t\t\t\t\tvariants={ toolbarVariations }\n\t\t\t\t\ttransition={ { type: 'tween' } }\n\t\t\t\t>\n\t\t\t\t\t<DocumentBar title={ title } />\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t\t<motion.div\n\t\t\t\tvariants={ toolbarVariations }\n\t\t\t\ttransition={ { type: 'tween' } }\n\t\t\t\tclassName=\"editor-header__settings\"\n\t\t\t>\n\t\t\t\t{ ! customSaveButton && ! isPublishSidebarOpened && (\n\t\t\t\t\t/*\n\t\t\t\t\t * This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t * We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t * we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t * We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t * when the publish sidebar has been closed.\n\t\t\t\t\t */\n\t\t\t\t\t<PostSavedState forceIsDirty={ forceIsDirty } />\n\t\t\t\t) }\n\n\t\t\t\t{ canBeZoomedOut && isEditorIframed && isWideViewport && (\n\t\t\t\t\t<ZoomOutToggle disabled={ forceDisableBlockTools } />\n\t\t\t\t) }\n\n\t\t\t\t<PreviewDropdown\n\t\t\t\t\tforceIsAutosaveable={ forceIsDirty }\n\t\t\t\t\tdisabled={ isNestedEntity }\n\t\t\t\t/>\n\t\t\t\t<PostPreviewButton\n\t\t\t\t\tclassName=\"editor-header__post-preview-button\"\n\t\t\t\t\tforceIsAutosaveable={ forceIsDirty }\n\t\t\t\t/>\n\t\t\t\t<PostViewLink />\n\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<PinnedItems.Slot scope=\"core\" />\n\t\t\t\t) }\n\n\t\t\t\t{ ! customSaveButton && (\n\t\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<CollabSidebar />\n\n\t\t\t\t{ customSaveButton }\n\t\t\t\t<MoreMenu />\n\t\t\t</motion.div>\n\t\t</div>\n\t);\n}\n\nexport default Header;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KA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terSidebar() {
33
33
  } = unlock(select(editorStore));
34
34
  const {
35
35
  getBlockRootClientId,
36
- __unstableGetEditorMode,
36
+ isZoomOut,
37
37
  getSectionRootClientId
38
38
  } = unlock(select(blockEditorStore));
39
39
  const {
@@ -43,7 +43,7 @@ export default function InserterSidebar() {
43
43
  getActiveComplementaryArea
44
44
  } = select(interfaceStore);
45
45
  const getBlockSectionRootClientId = () => {
46
- if (__unstableGetEditorMode() === 'zoom-out') {
46
+ if (isZoomOut()) {
47
47
  const sectionRootClientId = getSectionRootClientId();
48
48
  if (sectionRootClientId) {
49
49
  return sectionRootClientId;
@@ -1 +1 @@
1
- {"version":3,"names":["useDispatch","useSelect","store","blockEditorStore","privateApis","blockEditorPrivateApis","useViewportMatch","useCallback","useRef","preferencesStore","ESCAPE","interfaceStore","unlock","editorStore","jsx","_jsx","PrivateInserterLibrary","InserterSidebar","blockSectionRootClientId","inserterSidebarToggleRef","inserter","showMostUsedBlocks","sidebarIsOpened","select","getInserterSidebarToggleRef","getInserter","isPublishSidebarOpened","getBlockRootClientId","__unstableGetEditorMode","getSectionRootClientId","get","getActiveComplementaryArea","getBlockSectionRootClientId","sectionRootClientId","setIsInserterOpened","disableComplementaryArea","isMobileViewport","libraryRef","closeInserterSidebar","current","focus","closeOnEscape","event","keyCode","defaultPrevented","preventDefault","inserterContents","className","children","showInserterHelpPanel","shouldFocusBlock","rootClientId","onSelect","__experimentalInitialTab","tab","__experimentalInitialCategory","category","__experimentalFilterValue","filterValue","onPatternCategorySelection","undefined","ref","onClose","onKeyDown"],"sources":["@wordpress/editor/src/components/inserter-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { ESCAPE } from '@wordpress/keycodes';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\nconst { PrivateInserterLibrary } = unlock( blockEditorPrivateApis );\n\nexport default function InserterSidebar() {\n\tconst {\n\t\tblockSectionRootClientId,\n\t\tinserterSidebarToggleRef,\n\t\tinserter,\n\t\tshowMostUsedBlocks,\n\t\tsidebarIsOpened,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tgetInserter,\n\t\t\tisPublishSidebarOpened,\n\t\t} = unlock( select( editorStore ) );\n\t\tconst {\n\t\t\tgetBlockRootClientId,\n\t\t\t__unstableGetEditorMode,\n\t\t\tgetSectionRootClientId,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst getBlockSectionRootClientId = () => {\n\t\t\tif ( __unstableGetEditorMode() === 'zoom-out' ) {\n\t\t\t\tconst sectionRootClientId = getSectionRootClientId();\n\n\t\t\t\tif ( sectionRootClientId ) {\n\t\t\t\t\treturn sectionRootClientId;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn getBlockRootClientId();\n\t\t};\n\t\treturn {\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tinserter: getInserter(),\n\t\t\tshowMostUsedBlocks: get( 'core', 'mostUsedBlocks' ),\n\t\t\tblockSectionRootClientId: getBlockSectionRootClientId(),\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tgetActiveComplementaryArea( 'core' ) || isPublishSidebarOpened()\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened } = useDispatch( editorStore );\n\tconst { disableComplementaryArea } = useDispatch( interfaceStore );\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst libraryRef = useRef();\n\n\t// When closing the inserter, focus should return to the toggle button.\n\tconst closeInserterSidebar = useCallback( () => {\n\t\tsetIsInserterOpened( false );\n\t\tinserterSidebarToggleRef.current?.focus();\n\t}, [ inserterSidebarToggleRef, setIsInserterOpened ] );\n\n\tconst closeOnEscape = useCallback(\n\t\t( event ) => {\n\t\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcloseInserterSidebar();\n\t\t\t}\n\t\t},\n\t\t[ closeInserterSidebar ]\n\t);\n\n\tconst inserterContents = (\n\t\t<div className=\"editor-inserter-sidebar__content\">\n\t\t\t<PrivateInserterLibrary\n\t\t\t\tshowMostUsedBlocks={ showMostUsedBlocks }\n\t\t\t\tshowInserterHelpPanel\n\t\t\t\tshouldFocusBlock={ isMobileViewport }\n\t\t\t\trootClientId={ blockSectionRootClientId }\n\t\t\t\tonSelect={ inserter.onSelect }\n\t\t\t\t__experimentalInitialTab={ inserter.tab }\n\t\t\t\t__experimentalInitialCategory={ inserter.category }\n\t\t\t\t__experimentalFilterValue={ inserter.filterValue }\n\t\t\t\tonPatternCategorySelection={\n\t\t\t\t\tsidebarIsOpened\n\t\t\t\t\t\t? () => disableComplementaryArea( 'core' )\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tref={ libraryRef }\n\t\t\t\tonClose={ closeInserterSidebar }\n\t\t\t/>\n\t\t</div>\n\t);\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div onKeyDown={ closeOnEscape } className=\"editor-inserter-sidebar\">\n\t\t\t{ inserterContents }\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,EAAEC,MAAM,QAAQ,oBAA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ACkC,GAAK;MACzCC,6BAA6B,EAAGnC,QAAQ,CAACoC,QAAU;MACnDC,yBAAyB,EAAGrC,QAAQ,CAACsC,WAAa;MAClDC,0BAA0B,EACzBrC,eAAe,GACZ,MAAMa,wBAAwB,CAAE,MAAO,CAAC,GACxCyB,SACH;MACDC,GAAG,EAAGxB,UAAY;MAClByB,OAAO,EAAGxB;IAAsB,CAChC;EAAC,CACE,CACL;EAED;IAAA;IACC;IACAvB,IAAA;MAAKgD,SAAS,EAAGtB,aAAe;MAACM,SAAS,EAAC,yBAAyB;MAAAC,QAAA,EACjEF;IAAgB,CACd;EAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["useDispatch","useSelect","store","blockEditorStore","privateApis","blockEditorPrivateApis","useViewportMatch","useCallback","useRef","preferencesStore","ESCAPE","interfaceStore","unlock","editorStore","jsx","_jsx","PrivateInserterLibrary","InserterSidebar","blockSectionRootClientId","inserterSidebarToggleRef","inserter","showMostUsedBlocks","sidebarIsOpened","select","getInserterSidebarToggleRef","getInserter","isPublishSidebarOpened","getBlockRootClientId","isZoomOut","getSectionRootClientId","get","getActiveComplementaryArea","getBlockSectionRootClientId","sectionRootClientId","setIsInserterOpened","disableComplementaryArea","isMobileViewport","libraryRef","closeInserterSidebar","current","focus","closeOnEscape","event","keyCode","defaultPrevented","preventDefault","inserterContents","className","children","showInserterHelpPanel","shouldFocusBlock","rootClientId","onSelect","__experimentalInitialTab","tab","__experimentalInitialCategory","category","__experimentalFilterValue","filterValue","onPatternCategorySelection","undefined","ref","onClose","onKeyDown"],"sources":["@wordpress/editor/src/components/inserter-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { ESCAPE } from '@wordpress/keycodes';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\nconst { PrivateInserterLibrary } = unlock( blockEditorPrivateApis );\n\nexport default function InserterSidebar() {\n\tconst {\n\t\tblockSectionRootClientId,\n\t\tinserterSidebarToggleRef,\n\t\tinserter,\n\t\tshowMostUsedBlocks,\n\t\tsidebarIsOpened,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tgetInserter,\n\t\t\tisPublishSidebarOpened,\n\t\t} = unlock( select( editorStore ) );\n\t\tconst { getBlockRootClientId, isZoomOut, getSectionRootClientId } =\n\t\t\tunlock( select( blockEditorStore ) );\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst getBlockSectionRootClientId = () => {\n\t\t\tif ( isZoomOut() ) {\n\t\t\t\tconst sectionRootClientId = getSectionRootClientId();\n\n\t\t\t\tif ( sectionRootClientId ) {\n\t\t\t\t\treturn sectionRootClientId;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn getBlockRootClientId();\n\t\t};\n\t\treturn {\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tinserter: getInserter(),\n\t\t\tshowMostUsedBlocks: get( 'core', 'mostUsedBlocks' ),\n\t\t\tblockSectionRootClientId: getBlockSectionRootClientId(),\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tgetActiveComplementaryArea( 'core' ) || isPublishSidebarOpened()\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened } = useDispatch( editorStore );\n\tconst { disableComplementaryArea } = useDispatch( interfaceStore );\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst libraryRef = useRef();\n\n\t// When closing the inserter, focus should return to the toggle button.\n\tconst closeInserterSidebar = useCallback( () => {\n\t\tsetIsInserterOpened( false );\n\t\tinserterSidebarToggleRef.current?.focus();\n\t}, [ inserterSidebarToggleRef, setIsInserterOpened ] );\n\n\tconst closeOnEscape = useCallback(\n\t\t( event ) => {\n\t\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcloseInserterSidebar();\n\t\t\t}\n\t\t},\n\t\t[ closeInserterSidebar ]\n\t);\n\n\tconst inserterContents = (\n\t\t<div className=\"editor-inserter-sidebar__content\">\n\t\t\t<PrivateInserterLibrary\n\t\t\t\tshowMostUsedBlocks={ showMostUsedBlocks }\n\t\t\t\tshowInserterHelpPanel\n\t\t\t\tshouldFocusBlock={ isMobileViewport }\n\t\t\t\trootClientId={ blockSectionRootClientId }\n\t\t\t\tonSelect={ inserter.onSelect }\n\t\t\t\t__experimentalInitialTab={ inserter.tab }\n\t\t\t\t__experimentalInitialCategory={ inserter.category }\n\t\t\t\t__experimentalFilterValue={ inserter.filterValue }\n\t\t\t\tonPatternCategorySelection={\n\t\t\t\t\tsidebarIsOpened\n\t\t\t\t\t\t? () => disableComplementaryArea( 'core' )\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tref={ libraryRef }\n\t\t\t\tonClose={ closeInserterSidebar }\n\t\t\t/>\n\t\t</div>\n\t);\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div onKeyDown={ closeOnEscape } className=\"editor-inserter-sidebar\">\n\t\t\t{ inserterContents }\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,EAAEC,MAAM,QAAQ,oBAAoB;AACxD,SAASN,KAAK,IAAIO,gBAAgB,QAAQ,wBAAw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AAyB,EAAGrC,QAAQ,CAACsC,WAAa;MAClDC,0BAA0B,EACzBrC,eAAe,GACZ,MAAMa,wBAAwB,CAAE,MAAO,CAAC,GACxCyB,SACH;MACDC,GAAG,EAAGxB,UAAY;MAClByB,OAAO,EAAGxB;IAAsB,CAChC;EAAC,CACE,CACL;EAED;IAAA;IACC;IACAvB,IAAA;MAAKgD,SAAS,EAAGtB,aAAe;MAACM,SAAS,EAAC,yBAAyB;MAAAC,QAAA,EACjEF;IAAgB,CACd;EAAC;AAER","ignoreList":[]}
@@ -188,10 +188,10 @@ function PostParentToggle({
188
188
  size: "compact",
189
189
  className: "editor-post-parent__panel-toggle",
190
190
  variant: "tertiary",
191
- "aria-expanded": isOpen
191
+ "aria-expanded": isOpen,
192
+ "aria-label":
192
193
  // translators: %s: Current post parent.
193
- ,
194
- "aria-label": sprintf(__('Change parent: %s'), parentTitle),
194
+ sprintf(__('Change parent: %s'), parentTitle),
195
195
  onClick: onClick,
196
196
  children: parentTitle
197
197
  });
@@ -236,8 +236,8 @@ export function ParentRow() {
236
236
  title: __('Parent'),
237
237
  onClose: onClose
238
238
  }), /*#__PURE__*/_jsxs("div", {
239
- children: [createInterpolateElement(sprintf(/* translators: %1$s The home URL of the WordPress installation without the scheme. */
240
- __('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %1$s<wbr />/services<wbr />/pricing.'), filterURLForDisplay(homeUrl).replace(/([/.])/g, '<wbr />$1')), {
239
+ children: [createInterpolateElement(sprintf(/* translators: %s: The home URL of the WordPress installation without the scheme. */
240
+ __('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %s<wbr />/services<wbr />/pricing.'), filterURLForDisplay(homeUrl).replace(/([/.])/g, '<wbr />$1')), {
241
241
  wbr: /*#__PURE__*/_jsx("wbr", {})
242
242
  }), /*#__PURE__*/_jsx("p", {
243
243
  children: createInterpolateElement(__('They also show up as sub-items in the default navigation menu. <a>Learn more.</a>'), {