@wordpress/editor 14.10.0 → 14.12.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 (366) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -10
  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 +119 -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 +274 -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 +148 -40
  20. package/build/components/commands/index.js.map +1 -1
  21. package/build/components/create-template-part-modal/index.js +1 -0
  22. package/build/components/create-template-part-modal/index.js.map +1 -1
  23. package/build/components/document-bar/index.js +17 -10
  24. package/build/components/document-bar/index.js.map +1 -1
  25. package/build/components/document-tools/index.js +7 -7
  26. package/build/components/document-tools/index.js.map +1 -1
  27. package/build/components/editor-interface/index.js +4 -4
  28. package/build/components/editor-interface/index.js.map +1 -1
  29. package/build/components/entities-saved-states/index.js +1 -1
  30. package/build/components/entities-saved-states/index.js.map +1 -1
  31. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
  32. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  33. package/build/components/global-styles-provider/index.js +25 -3
  34. package/build/components/global-styles-provider/index.js.map +1 -1
  35. package/build/components/header/index.js +12 -11
  36. package/build/components/header/index.js.map +1 -1
  37. package/build/components/inserter-sidebar/index.js +2 -2
  38. package/build/components/inserter-sidebar/index.js.map +1 -1
  39. package/build/components/more-menu/index.js +9 -7
  40. package/build/components/more-menu/index.js.map +1 -1
  41. package/build/components/page-attributes/parent.js +5 -5
  42. package/build/components/page-attributes/parent.js.map +1 -1
  43. package/build/components/plugin-more-menu-item/index.js +13 -11
  44. package/build/components/plugin-more-menu-item/index.js.map +1 -1
  45. package/build/components/plugin-preview-menu-item/index.js +15 -13
  46. package/build/components/plugin-preview-menu-item/index.js.map +1 -1
  47. package/build/components/plugin-sidebar/index.js +0 -15
  48. package/build/components/plugin-sidebar/index.js.map +1 -1
  49. package/build/components/post-actions/index.js +5 -5
  50. package/build/components/post-actions/index.js.map +1 -1
  51. package/build/components/post-author/panel.js +4 -4
  52. package/build/components/post-author/panel.js.map +1 -1
  53. package/build/components/post-card-panel/index.js +7 -36
  54. package/build/components/post-card-panel/index.js.map +1 -1
  55. package/build/components/post-content-information/index.js +1 -2
  56. package/build/components/post-content-information/index.js.map +1 -1
  57. package/build/components/post-featured-image/index.js +26 -7
  58. package/build/components/post-featured-image/index.js.map +1 -1
  59. package/build/components/post-last-revision/index.js +1 -1
  60. package/build/components/post-last-revision/index.js.map +1 -1
  61. package/build/components/post-schedule/label.js +1 -1
  62. package/build/components/post-schedule/label.js.map +1 -1
  63. package/build/components/post-taxonomies/flat-term-selector.js +11 -1
  64. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  65. package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -2
  66. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  67. package/build/components/post-template/swap-template-button.js +0 -3
  68. package/build/components/post-template/swap-template-button.js.map +1 -1
  69. package/build/components/post-transform-panel/index.js +0 -3
  70. package/build/components/post-transform-panel/index.js.map +1 -1
  71. package/build/components/post-url/index.js +1 -1
  72. package/build/components/post-url/index.js.map +1 -1
  73. package/build/components/post-url/panel.js +3 -3
  74. package/build/components/post-url/panel.js.map +1 -1
  75. package/build/components/preferences-modal/index.js +26 -22
  76. package/build/components/preferences-modal/index.js.map +1 -1
  77. package/build/components/preview-dropdown/index.js +23 -8
  78. package/build/components/preview-dropdown/index.js.map +1 -1
  79. package/build/components/provider/index.js +10 -12
  80. package/build/components/provider/index.js.map +1 -1
  81. package/build/components/provider/use-block-editor-settings.js +11 -10
  82. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  83. package/build/components/sidebar/header.js +2 -1
  84. package/build/components/sidebar/header.js.map +1 -1
  85. package/build/components/sidebar/index.js +3 -3
  86. package/build/components/sidebar/index.js.map +1 -1
  87. package/build/components/sidebar/post-summary.js +2 -2
  88. package/build/components/sidebar/post-summary.js.map +1 -1
  89. package/build/components/start-page-options/index.js +0 -3
  90. package/build/components/start-page-options/index.js.map +1 -1
  91. package/build/components/start-template-options/index.js +0 -3
  92. package/build/components/start-template-options/index.js.map +1 -1
  93. package/build/components/time-to-read/index.js +2 -2
  94. package/build/components/time-to-read/index.js.map +1 -1
  95. package/build/components/visual-editor/index.js +30 -29
  96. package/build/components/visual-editor/index.js.map +1 -1
  97. package/build/components/visual-editor/use-zoom-out-mode-exit.js +52 -0
  98. package/build/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -0
  99. package/build/components/zoom-out-toggle/index.js +37 -5
  100. package/build/components/zoom-out-toggle/index.js.map +1 -1
  101. package/build/dataviews/actions/duplicate-template-part.js +2 -2
  102. package/build/dataviews/actions/duplicate-template-part.js.map +1 -1
  103. package/build/store/actions.js +68 -18
  104. package/build/store/actions.js.map +1 -1
  105. package/build/store/constants.js +0 -2
  106. package/build/store/constants.js.map +1 -1
  107. package/build/store/index.js +0 -4
  108. package/build/store/index.js.map +1 -1
  109. package/build/store/private-actions.js +2 -2
  110. package/build/store/private-actions.js.map +1 -1
  111. package/build/store/selectors.js +5 -4
  112. package/build/store/selectors.js.map +1 -1
  113. package/build/utils/pageTypeBadge.js +51 -0
  114. package/build/utils/pageTypeBadge.js.map +1 -0
  115. package/build/utils/terms.js +2 -2
  116. package/build/utils/terms.js.map +1 -1
  117. package/build-module/bindings/post-meta.js +2 -1
  118. package/build-module/bindings/post-meta.js.map +1 -1
  119. package/build-module/components/collab-sidebar/add-comment.js +113 -0
  120. package/build-module/components/collab-sidebar/add-comment.js.map +1 -0
  121. package/build-module/components/collab-sidebar/comment-button-toolbar.js +30 -0
  122. package/build-module/components/collab-sidebar/comment-button-toolbar.js.map +1 -0
  123. package/build-module/components/collab-sidebar/comment-button.js +30 -0
  124. package/build-module/components/collab-sidebar/comment-button.js.map +1 -0
  125. package/build-module/components/collab-sidebar/comments.js +314 -0
  126. package/build-module/components/collab-sidebar/comments.js.map +1 -0
  127. package/build-module/components/collab-sidebar/constants.js +2 -0
  128. package/build-module/components/collab-sidebar/constants.js.map +1 -0
  129. package/build-module/components/collab-sidebar/index.js +266 -0
  130. package/build-module/components/collab-sidebar/index.js.map +1 -0
  131. package/build-module/components/collab-sidebar/utils.js +10 -0
  132. package/build-module/components/collab-sidebar/utils.js.map +1 -0
  133. package/build-module/components/commands/index.js +151 -44
  134. package/build-module/components/commands/index.js.map +1 -1
  135. package/build-module/components/create-template-part-modal/index.js +1 -0
  136. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  137. package/build-module/components/document-bar/index.js +19 -12
  138. package/build-module/components/document-bar/index.js.map +1 -1
  139. package/build-module/components/document-tools/index.js +8 -8
  140. package/build-module/components/document-tools/index.js.map +1 -1
  141. package/build-module/components/editor-interface/index.js +4 -4
  142. package/build-module/components/editor-interface/index.js.map +1 -1
  143. package/build-module/components/entities-saved-states/index.js +1 -1
  144. package/build-module/components/entities-saved-states/index.js.map +1 -1
  145. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
  146. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  147. package/build-module/components/global-styles-provider/index.js +25 -3
  148. package/build-module/components/global-styles-provider/index.js.map +1 -1
  149. package/build-module/components/header/index.js +12 -11
  150. package/build-module/components/header/index.js.map +1 -1
  151. package/build-module/components/inserter-sidebar/index.js +2 -2
  152. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  153. package/build-module/components/more-menu/index.js +9 -7
  154. package/build-module/components/more-menu/index.js.map +1 -1
  155. package/build-module/components/page-attributes/parent.js +5 -5
  156. package/build-module/components/page-attributes/parent.js.map +1 -1
  157. package/build-module/components/plugin-more-menu-item/index.js +12 -10
  158. package/build-module/components/plugin-more-menu-item/index.js.map +1 -1
  159. package/build-module/components/plugin-preview-menu-item/index.js +14 -12
  160. package/build-module/components/plugin-preview-menu-item/index.js.map +1 -1
  161. package/build-module/components/plugin-sidebar/index.js +0 -15
  162. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  163. package/build-module/components/post-actions/index.js +5 -5
  164. package/build-module/components/post-actions/index.js.map +1 -1
  165. package/build-module/components/post-author/panel.js +4 -4
  166. package/build-module/components/post-author/panel.js.map +1 -1
  167. package/build-module/components/post-card-panel/index.js +8 -36
  168. package/build-module/components/post-card-panel/index.js.map +1 -1
  169. package/build-module/components/post-content-information/index.js +1 -2
  170. package/build-module/components/post-content-information/index.js.map +1 -1
  171. package/build-module/components/post-featured-image/index.js +26 -7
  172. package/build-module/components/post-featured-image/index.js.map +1 -1
  173. package/build-module/components/post-last-revision/index.js +1 -1
  174. package/build-module/components/post-last-revision/index.js.map +1 -1
  175. package/build-module/components/post-schedule/label.js +1 -1
  176. package/build-module/components/post-schedule/label.js.map +1 -1
  177. package/build-module/components/post-taxonomies/flat-term-selector.js +14 -4
  178. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  179. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -2
  180. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  181. package/build-module/components/post-template/swap-template-button.js +0 -3
  182. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  183. package/build-module/components/post-transform-panel/index.js +0 -3
  184. package/build-module/components/post-transform-panel/index.js.map +1 -1
  185. package/build-module/components/post-url/index.js +1 -1
  186. package/build-module/components/post-url/index.js.map +1 -1
  187. package/build-module/components/post-url/panel.js +3 -3
  188. package/build-module/components/post-url/panel.js.map +1 -1
  189. package/build-module/components/preferences-modal/index.js +26 -22
  190. package/build-module/components/preferences-modal/index.js.map +1 -1
  191. package/build-module/components/preview-dropdown/index.js +24 -9
  192. package/build-module/components/preview-dropdown/index.js.map +1 -1
  193. package/build-module/components/provider/index.js +10 -12
  194. package/build-module/components/provider/index.js.map +1 -1
  195. package/build-module/components/provider/use-block-editor-settings.js +12 -11
  196. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  197. package/build-module/components/sidebar/header.js +2 -1
  198. package/build-module/components/sidebar/header.js.map +1 -1
  199. package/build-module/components/sidebar/index.js +4 -4
  200. package/build-module/components/sidebar/index.js.map +1 -1
  201. package/build-module/components/sidebar/post-summary.js +2 -2
  202. package/build-module/components/sidebar/post-summary.js.map +1 -1
  203. package/build-module/components/start-page-options/index.js +0 -3
  204. package/build-module/components/start-page-options/index.js.map +1 -1
  205. package/build-module/components/start-template-options/index.js +0 -3
  206. package/build-module/components/start-template-options/index.js.map +1 -1
  207. package/build-module/components/time-to-read/index.js +2 -2
  208. package/build-module/components/time-to-read/index.js.map +1 -1
  209. package/build-module/components/visual-editor/index.js +31 -30
  210. package/build-module/components/visual-editor/index.js.map +1 -1
  211. package/build-module/components/visual-editor/use-zoom-out-mode-exit.js +46 -0
  212. package/build-module/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -0
  213. package/build-module/components/zoom-out-toggle/index.js +37 -5
  214. package/build-module/components/zoom-out-toggle/index.js.map +1 -1
  215. package/build-module/dataviews/actions/duplicate-template-part.js +3 -3
  216. package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -1
  217. package/build-module/store/actions.js +64 -16
  218. package/build-module/store/actions.js.map +1 -1
  219. package/build-module/store/constants.js +0 -2
  220. package/build-module/store/constants.js.map +1 -1
  221. package/build-module/store/index.js +0 -4
  222. package/build-module/store/index.js.map +1 -1
  223. package/build-module/store/private-actions.js +3 -3
  224. package/build-module/store/private-actions.js.map +1 -1
  225. package/build-module/store/selectors.js +5 -4
  226. package/build-module/store/selectors.js.map +1 -1
  227. package/build-module/utils/pageTypeBadge.js +45 -0
  228. package/build-module/utils/pageTypeBadge.js.map +1 -0
  229. package/build-module/utils/terms.js +2 -2
  230. package/build-module/utils/terms.js.map +1 -1
  231. package/build-style/style-rtl.css +118 -60
  232. package/build-style/style.css +118 -60
  233. package/build-types/bindings/post-meta.d.ts.map +1 -1
  234. package/build-types/components/collab-sidebar/add-comment.d.ts +15 -0
  235. package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -0
  236. package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts +5 -0
  237. package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts.map +1 -0
  238. package/build-types/components/collab-sidebar/comment-button.d.ts +5 -0
  239. package/build-types/components/collab-sidebar/comment-button.d.ts.map +1 -0
  240. package/build-types/components/collab-sidebar/comments.d.ts +19 -0
  241. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -0
  242. package/build-types/components/collab-sidebar/constants.d.ts +2 -0
  243. package/build-types/components/collab-sidebar/constants.d.ts.map +1 -0
  244. package/build-types/components/collab-sidebar/index.d.ts +5 -0
  245. package/build-types/components/collab-sidebar/index.d.ts.map +1 -0
  246. package/build-types/components/collab-sidebar/utils.d.ts +8 -0
  247. package/build-types/components/collab-sidebar/utils.d.ts.map +1 -0
  248. package/build-types/components/commands/index.d.ts.map +1 -1
  249. package/build-types/components/create-template-part-modal/index.d.ts.map +1 -1
  250. package/build-types/components/document-bar/index.d.ts.map +1 -1
  251. package/build-types/components/document-tools/index.d.ts.map +1 -1
  252. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  253. package/build-types/components/header/index.d.ts +1 -2
  254. package/build-types/components/header/index.d.ts.map +1 -1
  255. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
  256. package/build-types/components/more-menu/index.d.ts.map +1 -1
  257. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  258. package/build-types/components/plugin-more-menu-item/index.d.ts +62 -2
  259. package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -1
  260. package/build-types/components/plugin-preview-menu-item/index.d.ts +41 -2
  261. package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -1
  262. package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
  263. package/build-types/components/post-author/panel.d.ts.map +1 -1
  264. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  265. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  266. package/build-types/components/post-template/hooks.d.ts +2 -2
  267. package/build-types/components/post-template/swap-template-button.d.ts.map +1 -1
  268. package/build-types/components/post-transform-panel/index.d.ts.map +1 -1
  269. package/build-types/components/preferences-modal/index.d.ts.map +1 -1
  270. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  271. package/build-types/components/provider/index.d.ts.map +1 -1
  272. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  273. package/build-types/components/sidebar/index.d.ts.map +1 -1
  274. package/build-types/components/start-page-options/index.d.ts.map +1 -1
  275. package/build-types/components/start-template-options/index.d.ts.map +1 -1
  276. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  277. package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts +5 -0
  278. package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts.map +1 -0
  279. package/build-types/components/zoom-out-toggle/index.d.ts +3 -1
  280. package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -1
  281. package/build-types/dataviews/store/reducer.d.ts +5 -2
  282. package/build-types/dataviews/store/reducer.d.ts.map +1 -1
  283. package/build-types/lock-unlock.d.ts +2 -2
  284. package/build-types/store/actions.d.ts +9 -1
  285. package/build-types/store/actions.d.ts.map +1 -1
  286. package/build-types/store/constants.d.ts +0 -2
  287. package/build-types/store/constants.d.ts.map +1 -1
  288. package/build-types/store/index.d.ts +9 -11
  289. package/build-types/store/index.d.ts.map +1 -1
  290. package/build-types/store/reducer.d.ts +24 -4
  291. package/build-types/store/reducer.d.ts.map +1 -1
  292. package/build-types/store/selectors.d.ts +3 -3
  293. package/build-types/store/selectors.d.ts.map +1 -1
  294. package/build-types/utils/pageTypeBadge.d.ts +5 -0
  295. package/build-types/utils/pageTypeBadge.d.ts.map +1 -0
  296. package/build-types/utils/terms.d.ts.map +1 -1
  297. package/package.json +39 -37
  298. package/src/bindings/post-meta.js +1 -0
  299. package/src/components/collab-sidebar/add-comment.js +121 -0
  300. package/src/components/collab-sidebar/comment-button-toolbar.js +29 -0
  301. package/src/components/collab-sidebar/comment-button.js +31 -0
  302. package/src/components/collab-sidebar/comments.js +404 -0
  303. package/src/components/collab-sidebar/constants.js +1 -0
  304. package/src/components/collab-sidebar/index.js +298 -0
  305. package/src/components/collab-sidebar/style.scss +111 -0
  306. package/src/components/collab-sidebar/utils.js +9 -0
  307. package/src/components/commands/index.js +390 -268
  308. package/src/components/create-template-part-modal/index.js +1 -0
  309. package/src/components/document-bar/index.js +25 -8
  310. package/src/components/document-bar/style.scss +13 -4
  311. package/src/components/document-tools/index.js +8 -8
  312. package/src/components/editor-interface/index.js +4 -4
  313. package/src/components/entities-saved-states/index.js +2 -2
  314. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
  315. package/src/components/global-styles-provider/index.js +32 -6
  316. package/src/components/header/index.js +20 -10
  317. package/src/components/inserter-sidebar/index.js +3 -6
  318. package/src/components/more-menu/index.js +12 -7
  319. package/src/components/page-attributes/parent.js +6 -4
  320. package/src/components/plugin-more-menu-item/index.js +12 -11
  321. package/src/components/plugin-post-publish-panel/test/__snapshots__/index.js.snap +1 -1
  322. package/src/components/plugin-preview-menu-item/index.js +14 -13
  323. package/src/components/plugin-sidebar/index.js +0 -13
  324. package/src/components/post-actions/index.js +8 -11
  325. package/src/components/post-author/panel.js +4 -2
  326. package/src/components/post-card-panel/index.js +9 -43
  327. package/src/components/post-card-panel/style.scss +1 -9
  328. package/src/components/post-content-information/index.js +1 -1
  329. package/src/components/post-featured-image/index.js +31 -16
  330. package/src/components/post-featured-image/style.scss +5 -2
  331. package/src/components/post-last-revision/index.js +1 -1
  332. package/src/components/post-schedule/label.js +1 -1
  333. package/src/components/post-sticky/test/index.js +6 -6
  334. package/src/components/post-taxonomies/flat-term-selector.js +15 -4
  335. package/src/components/post-taxonomies/hierarchical-term-selector.js +2 -2
  336. package/src/components/post-template/swap-template-button.js +0 -3
  337. package/src/components/post-transform-panel/index.js +0 -3
  338. package/src/components/post-url/index.js +1 -1
  339. package/src/components/post-url/panel.js +4 -2
  340. package/src/components/preferences-modal/index.js +26 -19
  341. package/src/components/preferences-modal/test/index.js +1 -1
  342. package/src/components/preview-dropdown/index.js +45 -18
  343. package/src/components/provider/index.js +31 -24
  344. package/src/components/provider/use-block-editor-settings.js +11 -10
  345. package/src/components/sidebar/header.js +3 -2
  346. package/src/components/sidebar/index.js +5 -3
  347. package/src/components/sidebar/post-summary.js +1 -1
  348. package/src/components/sidebar/style.scss +1 -3
  349. package/src/components/start-page-options/index.js +0 -3
  350. package/src/components/start-template-options/index.js +0 -3
  351. package/src/components/time-to-read/index.js +3 -3
  352. package/src/components/visual-editor/index.js +39 -42
  353. package/src/components/visual-editor/style.scss +11 -0
  354. package/src/components/visual-editor/use-zoom-out-mode-exit.js +49 -0
  355. package/src/components/zoom-out-toggle/index.js +39 -5
  356. package/src/dataviews/actions/duplicate-template-part.tsx +3 -3
  357. package/src/store/actions.js +113 -34
  358. package/src/store/constants.ts +0 -2
  359. package/src/store/index.js +0 -4
  360. package/src/store/private-actions.js +3 -3
  361. package/src/store/selectors.js +5 -4
  362. package/src/style.scss +1 -0
  363. package/src/utils/pageTypeBadge.js +41 -0
  364. package/src/utils/terms.js +4 -2
  365. package/src/utils/test/terms.js +3 -3
  366. package/tsconfig.tsbuildinfo +1 -1
@@ -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,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A,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,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,MAA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C/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,EAAEX,EAAE,CAAE,+CAAgD,CAAC;MAClEY,cAAc,EAAE;QACfC,QAAQ,EAAE,WAAW;QACrBC,SAAS,EAAE;MACZ;IACD,CAAE,CAAC;IAEHN,gBAAgB,CAAE;MACjBC,IAAI,EAAE,kBAAkB;MACxBC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAEX,EAAE,CAAE,oBAAqB,CAAC;MACvCY,cAAc,EAAE;QACfC,QAAQ,EAAE,SAAS;QACnBC,SAAS,EAAE;MACZ;IACD,CAAE,CAAC;IAEHN,gBAAgB,CAAE;MACjBC,IAAI,EAAE,kBAA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BC,WAAW,EAAEX,EAAE,CAAE,mCAAoC,CAAC;MACtDY,cAAc,EAAE;QACfC,QAAQ,EAAE,QAAQ;QAClBC,SAAS,EAAE;MACZ;IACD,CAAE,CAAC;IAEHN,gBAAgB,CAAE;MACjBC,IAAI,EAAE,yBAAyB;MAC/BC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAEX,EAAE,CAAE,0CAA2C,CAAC;MAC7DY,cAAc,EAAE;QACfC,QAAQ,EAAE,MAAM;QAChBC,SAAS,EAAE;MACZ,CAAC;MACDC,OAAO,EAAE,CACR;QACCF,QAAQ,EAAE,QAAQ;QAClBC,SAAS,EAAE;MACZ,CAAC;IAEH,CAAE,CAAC;IAEHN,gBAAgB,CAAE;MACjBC,IAAI,EAAE,6BAA6B;MACnCC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAEX,EAAE,CAAE,8CAA+C,CAAC;MACjEY,cAAc,EAAE;QACfC,QAAQ,EAAE,WAAW;QACrBC,SAAS,EAAE;MACZ,CAAC;MACDC,OAAO,EAAE,CACR;QACCF,QAAQ,EAAE,QAAQ;QAClBC,SAAS,EAAE;MACZ,CAAC,EACD;QACCD,QAAQ,EAAE,WAAW;QACrBC,SAAS,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":[]}
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,CAAE,MAAM;IAChBU,gBAAgB,CAAE;MACjBC,IAAI,EAAE,yBAAyB;MAC/BC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAEX,EAAE,CAAE,+CAAgD,CAAC;MAClEY,cAAc,EAAE;QACfC,QAAQ,EAAE,WAAW;QACrBC,SAAS,EAAE;MACZ;IACD,CAAE,CAAC;IAEHN,gBAAgB,CAAE;MACjBC,IAAI,EAAE,kBAAkB;MACxBC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAEX,EAAE,CAAE,oBAAqB,CAAC;MACvCY,cAAc,EAAE;QACfC,QAAQ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ACZ;IACD,CAAE,CAAC;IAEHN,gBAAgB,CAAE;MACjBC,IAAI,EAAE,gCAAgC;MACtCC,QAAQ,EAAE,MAAM;MAChBC,WAAW,EAAEX,EAAE,CAAE,mCAAoC,CAAC;MACtDY,cAAc,EAAE;QACfC,QAAQ,EAAE,QAAQ;QAClBC,SAAS,EAAE;MACZ;IACD,CAAE,CAAC;IAEHN,gBAAgB,CAAE;MACjBC,IAAI,EAAE,yBAAyB;MAC/BC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAEX,EAAE,CAAE,0CAA2C,CAAC;MAC7DY,cAAc,EAAE;QACfC,QAAQ,EAAE,MAAM;QAChBC,SAAS,EAAE;MACZ,CAAC;MACDC,OAAO,EAAE,CACR;QACCF,QAAQ,EAAE,QAAQ;QAClBC,SAAS,EAAE;MACZ,CAAC;IAEH,CAAE,CAAC;IAEHN,gBAAgB,CAAE;MACjBC,IAAI,EAAE,6BAA6B;MACnCC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAEX,EAAE,CAAE,8CAA+C,CAAC;MACjEY,cAAc,EAAE;QACfC,QAAQ,EAAE,WAAW;QACrBC,SAAS,EAAE;MACZ,CAAC;MACDC,OAAO,EAAE,CACR;QACCF,QAAQ,EAAE,QAAQ;QAClBC,SAAS,EAAE;MACZ,CAAC,EACD;QACCD,QAAQ,EAAE,WAAW;QACrBC,SAAS,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,34 @@ function useGlobalStylesUserConfig() {
58
58
  } = select(coreStore);
59
59
  const _globalStylesId = select(coreStore).__experimentalGetCurrentGlobalStylesId();
60
60
  let record;
61
- const userCanEditGlobalStyles = canUser('update', {
61
+
62
+ /*
63
+ * Ensure that the global styles ID request is complete by testing `_globalStylesId`,
64
+ * before firing off the `canUser` OPTIONS request for user capabilities, otherwise it will
65
+ * fetch `/wp/v2/global-styles` instead of `/wp/v2/global-styles/{id}`.
66
+ * NOTE: Please keep in sync any preload paths sent to `block_editor_rest_api_preload()`,
67
+ * or set using the `block_editor_rest_api_preload_paths` filter, if this changes.
68
+ */
69
+ const userCanEditGlobalStyles = _globalStylesId ? canUser('update', {
62
70
  kind: 'root',
63
71
  name: 'globalStyles',
64
72
  id: _globalStylesId
65
- });
66
- if (_globalStylesId) {
73
+ }) : null;
74
+ if (_globalStylesId &&
75
+ /*
76
+ * Test that the OPTIONS request for user capabilities is complete
77
+ * before fetching the global styles entity record.
78
+ * This is to avoid fetching the global styles entity unnecessarily.
79
+ */
80
+ typeof userCanEditGlobalStyles === 'boolean') {
81
+ /*
82
+ * Fetch the global styles entity record based on the user's capabilities.
83
+ * The default context is `edit` for users who can edit global styles.
84
+ * Otherwise, the context is `view`.
85
+ * NOTE: There is an equivalent conditional check using `current_user_can()` in the backend
86
+ * to preload the global styles entity. Please keep in sync any preload paths sent to `block_editor_rest_api_preload()`,
87
+ * or set using `block_editor_rest_api_preload_paths` filter, if this changes.
88
+ */
67
89
  if (userCanEditGlobalStyles) {
68
90
  record = getEditedEntityRecord('root', 'globalStyles', _globalStylesId);
69
91
  } 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,sBACD,CAAC;AAED,OAAO,S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C,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/*\n\t\t\t * Ensure that the global styles ID request is complete by testing `_globalStylesId`,\n\t\t\t * before firing off the `canUser` OPTIONS request for user capabilities, otherwise it will\n\t\t\t * fetch `/wp/v2/global-styles` instead of `/wp/v2/global-styles/{id}`.\n\t\t\t * NOTE: Please keep in sync any preload paths sent to `block_editor_rest_api_preload()`,\n\t\t\t * or set using the `block_editor_rest_api_preload_paths` filter, if this changes.\n\t\t\t */\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/*\n\t\t\t\t * Test that the OPTIONS request for user capabilities is complete\n\t\t\t\t * before fetching the global styles entity record.\n\t\t\t\t * This is to avoid fetching the global styles entity unnecessarily.\n\t\t\t\t */\n\t\t\t\ttypeof userCanEditGlobalStyles === 'boolean'\n\t\t\t) {\n\t\t\t\t/*\n\t\t\t\t * Fetch the global styles entity record based on the user's capabilities.\n\t\t\t\t * The default context is `edit` for users who can edit global styles.\n\t\t\t\t * Otherwise, the context is `view`.\n\t\t\t\t * NOTE: There is an equivalent conditional check using `current_user_can()` in the backend\n\t\t\t\t * to preload the global styles entity. Please keep in sync any preload paths sent to `block_editor_rest_api_preload()`,\n\t\t\t\t * or set using `block_editor_rest_api_preload_paths` filter, if this changes.\n\t\t\t\t */\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,sBACD,CAAC;AAED,OAAO,SAASY,uBAAuBA,CAAEC,IAAI,EAAEC,IAAI,EAAG;EACrD,OAAOjB,SAAS,CAAEgB,IAAI,EAAEC,IAAI,EAAE;IAC7B;AACF;AACA;AACA;AACA;IACEC,iBAAiB,EAAEjB,aAAa;IAChC;AACF;AACA;AACA;AACA;IACEkB,WAAW,EAAIC,GAAG,IAAM;MACvB,IAAKA,GAAG,KAAK,iBAAiB,EAAG;QAChC,OAAO,CAAEC,U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AAO,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":[]}
@@ -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';
@@ -24,6 +25,7 @@ import PostViewLink from '../post-view-link';
24
25
  import PreviewDropdown from '../preview-dropdown';
25
26
  import ZoomOutToggle from '../zoom-out-toggle';
26
27
  import { store as editorStore } from '../../store';
28
+ import { TEMPLATE_PART_POST_TYPE, PATTERN_POST_TYPE, NAVIGATION_POST_TYPE } from '../../store/constants';
27
29
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
28
30
  const toolbarVariations = {
29
31
  distractionFreeDisabled: {
@@ -64,8 +66,7 @@ function Header({
64
66
  forceIsDirty,
65
67
  forceDisableBlockTools,
66
68
  setEntitiesSavedStatesCallback,
67
- title,
68
- isEditorIframed
69
+ title
69
70
  }) {
70
71
  const isWideViewport = useViewportMatch('large');
71
72
  const isLargeViewport = useViewportMatch('medium');
@@ -76,15 +77,13 @@ function Header({
76
77
  isPublishSidebarOpened,
77
78
  showIconLabels,
78
79
  hasFixedToolbar,
79
- hasBlockSelection,
80
- isNestedEntity
80
+ hasBlockSelection
81
81
  } = useSelect(select => {
82
82
  const {
83
83
  get: getPreference
84
84
  } = select(preferencesStore);
85
85
  const {
86
86
  getEditorMode,
87
- getEditorSettings,
88
87
  getCurrentPostType,
89
88
  isPublishSidebarOpened: _isPublishSidebarOpened
90
89
  } = select(editorStore);
@@ -94,11 +93,11 @@ function Header({
94
93
  isPublishSidebarOpened: _isPublishSidebarOpened(),
95
94
  showIconLabels: getPreference('core', 'showIconLabels'),
96
95
  hasFixedToolbar: getPreference('core', 'fixedToolbar'),
97
- hasBlockSelection: !!select(blockEditorStore).getBlockSelectionStart(),
98
- isNestedEntity: !!getEditorSettings().onNavigateToPreviousEntityRecord
96
+ hasBlockSelection: !!select(blockEditorStore).getBlockSelectionStart()
99
97
  };
100
98
  }, []);
101
99
  const canBeZoomedOut = ['post', 'page', 'wp_template'].includes(postType);
100
+ const disablePreviewOption = [NAVIGATION_POST_TYPE, TEMPLATE_PART_POST_TYPE, PATTERN_POST_TYPE].includes(postType);
102
101
  const [isBlockToolsCollapsed, setIsBlockToolsCollapsed] = useState(true);
103
102
  const hasCenter = (!hasBlockSelection || isBlockToolsCollapsed) && !isTooNarrowForDocumentBar;
104
103
  const hasBackButton = useHasBackButton();
@@ -153,18 +152,20 @@ function Header({
153
152
  */
154
153
  _jsx(PostSavedState, {
155
154
  forceIsDirty: forceIsDirty
156
- }), canBeZoomedOut && isEditorIframed && isWideViewport && /*#__PURE__*/_jsx(ZoomOutToggle, {}), /*#__PURE__*/_jsx(PreviewDropdown, {
155
+ }), /*#__PURE__*/_jsx(PostViewLink, {}), /*#__PURE__*/_jsx(PreviewDropdown, {
157
156
  forceIsAutosaveable: forceIsDirty,
158
- disabled: isNestedEntity
157
+ disabled: disablePreviewOption
159
158
  }), /*#__PURE__*/_jsx(PostPreviewButton, {
160
159
  className: "editor-header__post-preview-button",
161
160
  forceIsAutosaveable: forceIsDirty
162
- }), /*#__PURE__*/_jsx(PostViewLink, {}), (isWideViewport || !showIconLabels) && /*#__PURE__*/_jsx(PinnedItems.Slot, {
161
+ }), canBeZoomedOut && isWideViewport && /*#__PURE__*/_jsx(ZoomOutToggle, {
162
+ disabled: forceDisableBlockTools
163
+ }), (isWideViewport || !showIconLabels) && /*#__PURE__*/_jsx(PinnedItems.Slot, {
163
164
  scope: "core"
164
165
  }), !customSaveButton && /*#__PURE__*/_jsx(PostPublishButtonOrToggle, {
165
166
  forceIsDirty: forceIsDirty,
166
167
  setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
167
- }), customSaveButton, /*#__PURE__*/_jsx(MoreMenu, {})]
168
+ }), /*#__PURE__*/_jsx(CollabSidebar, {}), customSaveButton, /*#__PURE__*/_jsx(MoreMenu, {})]
168
169
  })]
169
170
  });
170
171
  }
@@ -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>\n\t\t</div>\n\t);\n}\n\nexport default Header;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,aAAa,EAAEC,gBAAgB,QAAQ,oBAAoB;AACpE,SAASC,gBAAgB,IAAIC,MAAM,QAAQ,uBAAuB;AAClE,SAASN,KAAK,IAAIO,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,WAAW,QAAQ,sBAAsB;;AAElD;AACA;AACA;AACA,OAAOC,UAAU,IAAIC,gBAAgB,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;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","TEMPLATE_PART_POST_TYPE","PATTERN_POST_TYPE","NAVIGATION_POST_TYPE","jsx","_jsx","jsxs","_jsxs","toolbarVariations","distractionFreeDisabled","y","distractionFreeHover","distractionFreeHidden","visible","hidden","backButtonVariations","x","Header","customSaveButton","forceIsDirty","forceDisableBlockTools","setEntitiesSavedStatesCallback","title","isWideViewport","isLargeViewport","isTooNarrowForDocumentBar","postType","isTextEditor","isPublishSidebarOpened","showIconLabels","hasFixedToolbar","hasBlockSelection","select","get","getPreference","getEditorMode","getCurrentPostType","_isPublishSidebarOpened","getBlockSelectionStart","canBeZoomedOut","includes","disablePreviewOption","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 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';\nimport {\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../../store/constants';\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} ) {\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} = useSelect( ( select ) => {\n\t\tconst { get: getPreference } = select( preferencesStore );\n\t\tconst {\n\t\t\tgetEditorMode,\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};\n\t}, [] );\n\n\tconst canBeZoomedOut = [ 'post', 'page', 'wp_template' ].includes(\n\t\tpostType\n\t);\n\n\tconst disablePreviewOption = [\n\t\tNAVIGATION_POST_TYPE,\n\t\tTEMPLATE_PART_POST_TYPE,\n\t\tPATTERN_POST_TYPE,\n\t].includes( postType );\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<PostViewLink />\n\n\t\t\t\t<PreviewDropdown\n\t\t\t\t\tforceIsAutosaveable={ forceIsDirty }\n\t\t\t\t\tdisabled={ disablePreviewOption }\n\t\t\t\t/>\n\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\n\t\t\t\t{ canBeZoomedOut && isWideViewport && (\n\t\t\t\t\t<ZoomOutToggle disabled={ forceDisableBlockTools } />\n\t\t\t\t) }\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,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,aAAa,EAAEC,gBAAgB,QAAQ,oBAAoB;AACpE,SAASC,gBAAgB,IAAIC,MAAM,QAAQ,uBAAuB;AAClE,SAASN,KAAK,IAAIO,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,WAAW,QAAQ,sBAAsB;;AAElD;AACA;AAC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EAAG;QAAEC,IAAI,EAAE;MAAQ,CAAG;MAChCL,SAAS,EAAC,yBAAyB;MAAAC,QAAA,GAEjC,CAAE7B,gBAAgB,IAAI,CAAEU,sBAAsB;MAAA;MAC/C;AACL;AACA;AACA;AACA;AACA;AACA;MACKvB,IAAA,CAACT,cAAc;QAACuB,YAAY,EAAGA;MAAc,CAAE,CAC/C,eAEDd,IAAA,CAACR,YAAY,IAAE,CAAC,eAEhBQ,IAAA,CAACP,eAAe;QACf0D,mBAAmB,EAAGrC,YAAc;QACpCsC,QAAQ,EAAGhB;MAAsB,CACjC,CAAC,eAEFpC,IAAA,CAACX,iBAAiB;QACjBoD,SAAS,EAAC,oCAAoC;QAC9CU,mBAAmB,EAAGrC;MAAc,CACpC,CAAC,EAEAoB,cAAc,IAAIhB,cAAc,iBACjClB,IAAA,CAACN,aAAa;QAAC0D,QAAQ,EAAGrC;MAAwB,CAAE,CACpD,EAEC,CAAEG,cAAc,IAAI,CAAEM,cAAc,kBACrCxB,IAAA,CAACnB,WAAW,CAACkE,IAAI;QAACM,KAAK,EAAC;MAAM,CAAE,CAChC,EAEC,CAAExC,gBAAgB,iBACnBb,IAAA,CAACV,yBAAyB;QACzBwB,YAAY,EAAGA,YAAc;QAC7BE,8BAA8B,EAC7BA;MACA,CACD,CACD,eACDhB,IAAA,CAAClB,aAAa,IAAE,CAAC,EAEf+B,gBAAgB,eAClBb,IAAA,CAACZ,QAAQ,IAAE,CAAC;IAAA,CACD,CAAC;EAAA,CACT,CAAC;AAER;AAEA,eAAewB,MAAM","ignoreList":[]}
@@ -33,7 +33,7 @@ export default function InserterSidebar() {
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,oBAAoB;AACxD,SAASN,KAAK,IAAIO,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASR,KAAK,IAAIS,cAAc,QAAQ,sBAAsB;;AAE9D;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASV,KAAK,IAAIW,WAAW,QAAQ,aAAa;AAAC,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,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,wBAAwB;AAClE,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASR,KAAK,IAAIS,cAAc,QAAQ,sBAAsB;;AAE9D;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASV,KAAK,IAAIW,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnD,MAAM;EAAEC;AAA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,EAAGtB,aAAe;MAACM,SAAS,EAAC,yBAAyB;MAAAC,QAAA,EACjEF;IAAgB,CACd;EAAC;AAER","ignoreList":[]}
@@ -59,25 +59,27 @@ export default function MoreMenu() {
59
59
  onToggle: turnOffDistractionFree,
60
60
  label: __('Top toolbar'),
61
61
  info: __('Access all block and document tools in a single place'),
62
- messageActivated: __('Top toolbar activated'),
63
- messageDeactivated: __('Top toolbar deactivated')
62
+ messageActivated: __('Top toolbar activated.'),
63
+ messageDeactivated: __('Top toolbar deactivated.')
64
64
  }), /*#__PURE__*/_jsx(PreferenceToggleMenuItem, {
65
65
  scope: "core",
66
66
  name: "distractionFree",
67
67
  label: __('Distraction free'),
68
68
  info: __('Write with calmness'),
69
69
  handleToggling: false,
70
- onToggle: toggleDistractionFree,
71
- messageActivated: __('Distraction free mode activated'),
72
- messageDeactivated: __('Distraction free mode deactivated'),
70
+ onToggle: () => toggleDistractionFree({
71
+ createNotice: false
72
+ }),
73
+ messageActivated: __('Distraction free mode activated.'),
74
+ messageDeactivated: __('Distraction free mode deactivated.'),
73
75
  shortcut: displayShortcut.primaryShift('\\')
74
76
  }), /*#__PURE__*/_jsx(PreferenceToggleMenuItem, {
75
77
  scope: "core",
76
78
  name: "focusMode",
77
79
  label: __('Spotlight mode'),
78
80
  info: __('Focus on one block at a time'),
79
- messageActivated: __('Spotlight mode activated'),
80
- messageDeactivated: __('Spotlight mode deactivated')
81
+ messageActivated: __('Spotlight mode activated.'),
82
+ messageDeactivated: __('Spotlight mode deactivated.')
81
83
  }), /*#__PURE__*/_jsx(ViewMoreMenuGroup.Slot, {
82
84
  fillProps: {
83
85
  onClose
@@ -1 +1 @@
1
- {"version":3,"names":["__","_x","useSelect","useDispatch","displayShortcut","external","moreVertical","MenuGroup","MenuItem","VisuallyHidden","DropdownMenu","PreferenceToggleMenuItem","store","preferencesStore","interfaceStore","ActionItem","CopyContentMenuItem","ModeSwitcher","ToolsMoreMenuGroup","ViewMoreMenuGroup","editorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","MoreMenu","openModal","set","setPreference","toggleDistractionFree","showIconLabels","select","get","turnOffDistractionFree","children","icon","label","popoverProps","placement","className","toggleProps","showTooltip","variant","tooltipPosition","size","onClose","scope","name","onToggle","info","messageActivated","messageDeactivated","handleToggling","shortcut","primaryShift","Slot","fillProps","as","onClick","access","href","target","rel"],"sources":["@wordpress/editor/src/components/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { external, moreVertical } from '@wordpress/icons';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tDropdownMenu,\n} from '@wordpress/components';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { store as interfaceStore, ActionItem } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport ModeSwitcher from '../mode-switcher';\nimport ToolsMoreMenuGroup from './tools-more-menu-group';\nimport ViewMoreMenuGroup from './view-more-menu-group';\nimport { store as editorStore } from '../../store';\n\nexport default function MoreMenu() {\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst { toggleDistractionFree } = useDispatch( editorStore );\n\tconst showIconLabels = useSelect(\n\t\t( select ) =>\n\t\t\tselect( preferencesStore ).get( 'core', 'showIconLabels' ),\n\t\t[]\n\t);\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tplacement: 'bottom-end',\n\t\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t\t} }\n\t\t\t\ttoggleProps={ {\n\t\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\n\t\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\t\tsize: 'compact',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"distractionFree\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\t\t\t\t\thandleToggling={ false }\n\t\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primaryShift(\n\t\t\t\t\t\t\t\t\t'\\\\'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"focusMode\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ViewMoreMenuGroup.Slot fillProps={ { onClose } } />\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<ModeSwitcher />\n\t\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\t\tname=\"core/plugin-more-menu\"\n\t\t\t\t\t\t\tlabel={ __( 'Plugins' ) }\n\t\t\t\t\t\t\tas={ MenuGroup }\n\t\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal( 'editor/keyboard-shortcut-help' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<ToolsMoreMenuGroup.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal( 'editor/preferences' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Preferences' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,QAAQ,EAAEC,YAAY,QAAQ,kBAAkB;AACzD,SACCC,SAAS,EACTC,QAAQ,EACRC,cAAc,EACdC,YAAY,QACN,uBAAuB;AAC9B,SACCC,wBAAwB,EACx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D,OAAO,EAAGA,CAAA,KACThC,SAAS,CAAE,oBAAqB,CAChC;YAAAQ,QAAA,EAECpC,EAAE,CAAE,aAAc;UAAC,CACZ;QAAC,CACD,CAAC;MAAA,CACX;IACF,CACY;EAAC,CACd,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["__","_x","useSelect","useDispatch","displayShortcut","external","moreVertical","MenuGroup","MenuItem","VisuallyHidden","DropdownMenu","PreferenceToggleMenuItem","store","preferencesStore","interfaceStore","ActionItem","CopyContentMenuItem","ModeSwitcher","ToolsMoreMenuGroup","ViewMoreMenuGroup","editorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","MoreMenu","openModal","set","setPreference","toggleDistractionFree","showIconLabels","select","get","turnOffDistractionFree","children","icon","label","popoverProps","placement","className","toggleProps","showTooltip","variant","tooltipPosition","size","onClose","scope","name","onToggle","info","messageActivated","messageDeactivated","handleToggling","createNotice","shortcut","primaryShift","Slot","fillProps","as","onClick","access","href","target","rel"],"sources":["@wordpress/editor/src/components/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { external, moreVertical } from '@wordpress/icons';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tDropdownMenu,\n} from '@wordpress/components';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { store as interfaceStore, ActionItem } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport ModeSwitcher from '../mode-switcher';\nimport ToolsMoreMenuGroup from './tools-more-menu-group';\nimport ViewMoreMenuGroup from './view-more-menu-group';\nimport { store as editorStore } from '../../store';\n\nexport default function MoreMenu() {\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst { toggleDistractionFree } = useDispatch( editorStore );\n\tconst showIconLabels = useSelect(\n\t\t( select ) =>\n\t\t\tselect( preferencesStore ).get( 'core', 'showIconLabels' ),\n\t\t[]\n\t);\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tplacement: 'bottom-end',\n\t\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t\t} }\n\t\t\t\ttoggleProps={ {\n\t\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\n\t\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\t\tsize: 'compact',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar activated.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar deactivated.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"distractionFree\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\t\t\t\t\thandleToggling={ false }\n\t\t\t\t\t\t\t\tonToggle={ () =>\n\t\t\t\t\t\t\t\t\ttoggleDistractionFree( {\n\t\t\t\t\t\t\t\t\t\tcreateNotice: false,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode activated.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode deactivated.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primaryShift(\n\t\t\t\t\t\t\t\t\t'\\\\'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"focusMode\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode activated.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode deactivated.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ViewMoreMenuGroup.Slot fillProps={ { onClose } } />\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<ModeSwitcher />\n\t\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\t\tname=\"core/plugin-more-menu\"\n\t\t\t\t\t\t\tlabel={ __( 'Plugins' ) }\n\t\t\t\t\t\t\tas={ MenuGroup }\n\t\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal( 'editor/keyboard-shortcut-help' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<ToolsMoreMenuGroup.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal(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,CACnB,CAAC,eACXsB,IAAA,CAACN,mBAAmB,IAAE,CAAC,eACvBQ,KAAA,CAAChB,QAAQ;YACR6B,IAAI,EAAGhC,QAAU;YACjB0D,IAAI,EAAG/D,EAAE,CACR,qEACD,CAAG;YACHgE,MAAM,EAAC,QAAQ;YACfC,GAAG,EAAC,qBAAqB;YAAA7B,QAAA,GAEvBpC,EAAE,CAAE,MAAO,CAAC,eACdsB,IAAA,CAACb,cAAc;cAACmD,EAAE,EAAC,MAAM;cAAAxB,QAAA,EAEvB;cACApC,EAAE,CAAE,sBAAuB;YAAC,CAEd,CAAC;UAAA,CACR,CAAC,eACXsB,IAAA,CAACJ,kBAAkB,CAACwC,IAAI;YACvBC,SAAS,EAAG;cAAEZ;YAAQ;UAAG,CACzB,CAAC;QAAA,CACQ,CAAC,eACZzB,IAAA,CAACf,SAAS;UAAA6B,QAAA,eACTd,IAAA,CAACd,QAAQ;YACRqD,OAAO,EAAGA,CAAA,KACTjC,SAAS,CAAE,oBAAqB,CAChC;YAAAQ,QAAA,EAECpC,EAAE,CAAE,aAAc;UAAC,CACZ;QAAC,CACD,CAAC;MAAA,CACX;IACF,CACY;EAAC,CACd,CAAC;AAEL","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>'), {