@wordpress/edit-site 5.11.0 → 5.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 (587) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-page/index.js +105 -0
  3. package/build/components/add-new-page/index.js.map +1 -0
  4. package/build/components/add-new-template/add-custom-generic-template-modal-content.js +4 -5
  5. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  6. package/build/components/add-new-template/add-custom-template-modal-content.js +19 -22
  7. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  8. package/build/components/add-new-template/index.js +4 -5
  9. package/build/components/add-new-template/index.js.map +1 -1
  10. package/build/components/add-new-template/new-template-part.js +9 -12
  11. package/build/components/add-new-template/new-template-part.js.map +1 -1
  12. package/build/components/add-new-template/new-template.js +19 -26
  13. package/build/components/add-new-template/new-template.js.map +1 -1
  14. package/build/components/add-new-template/utils.js +71 -120
  15. package/build/components/add-new-template/utils.js.map +1 -1
  16. package/build/components/block-editor/back-button.js +1 -3
  17. package/build/components/block-editor/back-button.js.map +1 -1
  18. package/build/components/block-editor/block-inspector-button.js +3 -4
  19. package/build/components/block-editor/block-inspector-button.js.map +1 -1
  20. package/build/components/block-editor/editor-canvas.js +6 -7
  21. package/build/components/block-editor/editor-canvas.js.map +1 -1
  22. package/build/components/block-editor/index.js +13 -10
  23. package/build/components/block-editor/index.js.map +1 -1
  24. package/build/components/block-editor/inserter-media-categories.js +25 -42
  25. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  26. package/build/components/block-editor/resizable-editor.js +6 -7
  27. package/build/components/block-editor/resizable-editor.js.map +1 -1
  28. package/build/components/block-editor/resize-handle.js +5 -7
  29. package/build/components/block-editor/resize-handle.js.map +1 -1
  30. package/build/components/code-editor/code-editor-text-area.js +5 -6
  31. package/build/components/code-editor/code-editor-text-area.js.map +1 -1
  32. package/build/components/create-template-part-modal/index.js +25 -29
  33. package/build/components/create-template-part-modal/index.js.map +1 -1
  34. package/build/components/editor/index.js +26 -17
  35. package/build/components/editor/index.js.map +1 -1
  36. package/build/components/editor-canvas-container/index.js +7 -8
  37. package/build/components/editor-canvas-container/index.js.map +1 -1
  38. package/build/components/error-boundary/warning.js +8 -10
  39. package/build/components/error-boundary/warning.js.map +1 -1
  40. package/build/components/global-styles/block-preview-panel.js +7 -10
  41. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  42. package/build/components/global-styles/color-indicator-wrapper.js +4 -5
  43. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  44. package/build/components/global-styles/color-palette-panel.js +3 -4
  45. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  46. package/build/components/global-styles/dimensions-panel.js +1 -3
  47. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  48. package/build/components/global-styles/global-styles-provider.js +8 -10
  49. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  50. package/build/components/global-styles/gradients-palette-panel.js +3 -4
  51. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  52. package/build/components/global-styles/header.js +4 -5
  53. package/build/components/global-styles/header.js.map +1 -1
  54. package/build/components/global-styles/icon-with-current-color.js +4 -5
  55. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  56. package/build/components/global-styles/navigation-button.js +5 -6
  57. package/build/components/global-styles/navigation-button.js.map +1 -1
  58. package/build/components/global-styles/palette.js +10 -14
  59. package/build/components/global-styles/palette.js.map +1 -1
  60. package/build/components/global-styles/preview.js +41 -51
  61. package/build/components/global-styles/preview.js.map +1 -1
  62. package/build/components/global-styles/screen-block-list.js +4 -7
  63. package/build/components/global-styles/screen-block-list.js.map +1 -1
  64. package/build/components/global-styles/screen-block.js +9 -10
  65. package/build/components/global-styles/screen-block.js.map +1 -1
  66. package/build/components/global-styles/screen-color-palette.js +3 -4
  67. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  68. package/build/components/global-styles/screen-revisions/index.js +8 -8
  69. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  70. package/build/components/global-styles/screen-revisions/revisions-buttons.js +14 -19
  71. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  72. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +5 -11
  73. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  74. package/build/components/global-styles/screen-root.js +3 -3
  75. package/build/components/global-styles/screen-root.js.map +1 -1
  76. package/build/components/global-styles/screen-typography-element.js +3 -4
  77. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  78. package/build/components/global-styles/screen-typography.js +5 -6
  79. package/build/components/global-styles/screen-typography.js.map +1 -1
  80. package/build/components/global-styles/style-variations-container.js +5 -6
  81. package/build/components/global-styles/style-variations-container.js.map +1 -1
  82. package/build/components/global-styles/subtitle.js +4 -5
  83. package/build/components/global-styles/subtitle.js.map +1 -1
  84. package/build/components/global-styles/typography-panel.js +4 -5
  85. package/build/components/global-styles/typography-panel.js.map +1 -1
  86. package/build/components/global-styles/typography-preview.js +5 -6
  87. package/build/components/global-styles/typography-preview.js.map +1 -1
  88. package/build/components/global-styles/ui.js +40 -21
  89. package/build/components/global-styles/ui.js.map +1 -1
  90. package/build/components/global-styles/variations-panel.js +5 -6
  91. package/build/components/global-styles/variations-panel.js.map +1 -1
  92. package/build/components/header-edit-mode/document-actions/index.js +102 -23
  93. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  94. package/build/components/header-edit-mode/index.js +2 -6
  95. package/build/components/header-edit-mode/index.js.map +1 -1
  96. package/build/components/header-edit-mode/more-menu/index.js +49 -53
  97. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  98. package/build/components/header-edit-mode/tools-more-menu-group/index.js +5 -14
  99. package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  100. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  101. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  102. package/build/components/keyboard-shortcut-help-modal/index.js +41 -51
  103. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  104. package/build/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  105. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  106. package/build/components/layout/index.js +4 -12
  107. package/build/components/layout/index.js.map +1 -1
  108. package/build/components/list/added-by.js +13 -23
  109. package/build/components/list/added-by.js.map +1 -1
  110. package/build/components/list/header.js +4 -7
  111. package/build/components/list/header.js.map +1 -1
  112. package/build/components/list/index.js +2 -4
  113. package/build/components/list/index.js.map +1 -1
  114. package/build/components/list/table.js +35 -40
  115. package/build/components/list/table.js.map +1 -1
  116. package/build/components/page-actions/delete-page-menu-item.js +70 -0
  117. package/build/components/page-actions/delete-page-menu-item.js.map +1 -0
  118. package/build/components/page-actions/index.js +43 -0
  119. package/build/components/page-actions/index.js.map +1 -0
  120. package/build/components/page-content-lock/constants.js +9 -0
  121. package/build/components/page-content-lock/constants.js.map +1 -0
  122. package/build/components/page-content-lock/index.js +29 -0
  123. package/build/components/page-content-lock/index.js.map +1 -0
  124. package/build/components/page-content-lock/use-disable-non-content-blocks.js +49 -0
  125. package/build/components/page-content-lock/use-disable-non-content-blocks.js.map +1 -0
  126. package/build/components/page-content-lock/use-page-content-lock-notifications.js +112 -0
  127. package/build/components/page-content-lock/use-page-content-lock-notifications.js.map +1 -0
  128. package/build/components/preferences-modal/index.js +4 -5
  129. package/build/components/preferences-modal/index.js.map +1 -1
  130. package/build/components/resizable-frame/index.js +20 -12
  131. package/build/components/resizable-frame/index.js.map +1 -1
  132. package/build/components/revisions/index.js +11 -14
  133. package/build/components/revisions/index.js.map +1 -1
  134. package/build/components/routes/link.js +8 -12
  135. package/build/components/routes/link.js.map +1 -1
  136. package/build/components/routes/use-title.js +1 -5
  137. package/build/components/routes/use-title.js.map +1 -1
  138. package/build/components/save-button/index.js +13 -7
  139. package/build/components/save-button/index.js.map +1 -1
  140. package/build/components/save-hub/index.js +97 -5
  141. package/build/components/save-hub/index.js.map +1 -1
  142. package/build/components/save-panel/index.js +63 -17
  143. package/build/components/save-panel/index.js.map +1 -1
  144. package/build/components/secondary-sidebar/list-view-sidebar.js +8 -3
  145. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  146. package/build/components/sidebar/index.js +7 -5
  147. package/build/components/sidebar/index.js.map +1 -1
  148. package/build/components/sidebar-edit-mode/default-sidebar.js +11 -12
  149. package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  150. package/build/components/sidebar-edit-mode/index.js +13 -10
  151. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  152. package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js +79 -0
  153. package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +1 -0
  154. package/build/components/sidebar-edit-mode/page-panels/index.js +86 -0
  155. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -0
  156. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -5
  157. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  158. package/build/components/sidebar-edit-mode/settings-header/index.js +39 -21
  159. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  160. package/build/components/sidebar-edit-mode/sidebar-card/index.js +46 -0
  161. package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -0
  162. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +3 -4
  163. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  164. package/build/components/sidebar-edit-mode/{template-card → template-panel}/index.js +22 -18
  165. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -0
  166. package/build/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +7 -8
  167. package/{build-module/components/sidebar-edit-mode/template-revisions/index.js.map → build/components/sidebar-edit-mode/template-panel/last-revision.js.map} +1 -1
  168. package/build/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +12 -16
  169. package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -0
  170. package/build/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +15 -19
  171. package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -0
  172. package/build/components/sidebar-navigation-item/index.js +7 -8
  173. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  174. package/build/components/sidebar-navigation-screen/index.js +21 -14
  175. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  176. package/build/components/sidebar-navigation-screen-global-styles/index.js +103 -13
  177. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  178. package/build/components/sidebar-navigation-screen-navigation-item/index.js +3 -5
  179. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  180. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +7 -10
  181. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  182. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +17 -23
  183. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  184. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +20 -23
  185. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  186. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +4 -5
  187. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  188. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +8 -9
  189. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -1
  190. package/build/components/sidebar-navigation-screen-page/index.js +81 -10
  191. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  192. package/build/components/sidebar-navigation-screen-page/page-details.js +148 -0
  193. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -0
  194. package/build/components/sidebar-navigation-screen-page/status-label.js +110 -0
  195. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -0
  196. package/build/components/sidebar-navigation-screen-pages/index.js +128 -17
  197. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  198. package/build/components/sidebar-navigation-screen-template/index.js +22 -16
  199. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  200. package/build/components/sidebar-navigation-screen-template-part/index.js +105 -0
  201. package/build/components/sidebar-navigation-screen-template-part/index.js.map +1 -0
  202. package/build/components/sidebar-navigation-screen-templates/index.js +13 -18
  203. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  204. package/build/components/sidebar-navigation-subtitle/index.js +3 -4
  205. package/build/components/sidebar-navigation-subtitle/index.js.map +1 -1
  206. package/build/components/site-hub/index.js +20 -13
  207. package/build/components/site-hub/index.js.map +1 -1
  208. package/build/components/site-icon/index.js +4 -5
  209. package/build/components/site-icon/index.js.map +1 -1
  210. package/build/components/start-template-options/index.js +15 -21
  211. package/build/components/start-template-options/index.js.map +1 -1
  212. package/build/components/style-book/index.js +35 -39
  213. package/build/components/style-book/index.js.map +1 -1
  214. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +2 -2
  215. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  216. package/build/components/sync-state-with-url/use-sync-path-with-url.js +9 -10
  217. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  218. package/build/components/{list/actions → template-actions}/index.js +34 -31
  219. package/build/components/template-actions/index.js.map +1 -0
  220. package/build/components/{list/actions → template-actions}/rename-menu-item.js +4 -5
  221. package/build/components/template-actions/rename-menu-item.js.map +1 -0
  222. package/build/components/template-part-converter/convert-to-regular.js +4 -5
  223. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  224. package/build/components/template-part-converter/convert-to-template-part.js +8 -10
  225. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  226. package/build/components/template-part-converter/index.js +12 -18
  227. package/build/components/template-part-converter/index.js.map +1 -1
  228. package/build/components/welcome-guide/image.js +4 -5
  229. package/build/components/welcome-guide/image.js.map +1 -1
  230. package/build/hooks/commands/use-edit-mode-commands.js +6 -8
  231. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  232. package/build/hooks/push-changes-to-global-styles/index.js +11 -8
  233. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  234. package/build/hooks/template-part-edit.js +5 -6
  235. package/build/hooks/template-part-edit.js.map +1 -1
  236. package/build/index.js +3 -6
  237. package/build/index.js.map +1 -1
  238. package/build/store/actions.js +129 -125
  239. package/build/store/actions.js.map +1 -1
  240. package/build/store/private-actions.js +7 -10
  241. package/build/store/private-actions.js.map +1 -1
  242. package/build/store/reducer.js +32 -33
  243. package/build/store/reducer.js.map +1 -1
  244. package/build/store/selectors.js +35 -11
  245. package/build/store/selectors.js.map +1 -1
  246. package/build/store/utils.js +1 -3
  247. package/build/store/utils.js.map +1 -1
  248. package/build/utils/get-is-list-page.js +3 -4
  249. package/build/utils/get-is-list-page.js.map +1 -1
  250. package/build/utils/is-previewing-theme.js +1 -3
  251. package/build/utils/is-previewing-theme.js.map +1 -1
  252. package/build/utils/is-template-revertable.js +1 -1
  253. package/build/utils/is-template-revertable.js.map +1 -1
  254. package/build-module/components/add-new-page/index.js +93 -0
  255. package/build-module/components/add-new-page/index.js.map +1 -0
  256. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +4 -5
  257. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  258. package/build-module/components/add-new-template/add-custom-template-modal-content.js +19 -22
  259. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  260. package/build-module/components/add-new-template/index.js +4 -5
  261. package/build-module/components/add-new-template/index.js.map +1 -1
  262. package/build-module/components/add-new-template/new-template-part.js +9 -12
  263. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  264. package/build-module/components/add-new-template/new-template.js +18 -26
  265. package/build-module/components/add-new-template/new-template.js.map +1 -1
  266. package/build-module/components/add-new-template/utils.js +71 -120
  267. package/build-module/components/add-new-template/utils.js.map +1 -1
  268. package/build-module/components/block-editor/back-button.js +1 -3
  269. package/build-module/components/block-editor/back-button.js.map +1 -1
  270. package/build-module/components/block-editor/block-inspector-button.js +3 -4
  271. package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
  272. package/build-module/components/block-editor/editor-canvas.js +6 -7
  273. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  274. package/build-module/components/block-editor/index.js +12 -10
  275. package/build-module/components/block-editor/index.js.map +1 -1
  276. package/build-module/components/block-editor/inserter-media-categories.js +25 -42
  277. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
  278. package/build-module/components/block-editor/resizable-editor.js +6 -7
  279. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  280. package/build-module/components/block-editor/resize-handle.js +5 -7
  281. package/build-module/components/block-editor/resize-handle.js.map +1 -1
  282. package/build-module/components/code-editor/code-editor-text-area.js +5 -6
  283. package/build-module/components/code-editor/code-editor-text-area.js.map +1 -1
  284. package/build-module/components/create-template-part-modal/index.js +25 -29
  285. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  286. package/build-module/components/editor/index.js +26 -17
  287. package/build-module/components/editor/index.js.map +1 -1
  288. package/build-module/components/editor-canvas-container/index.js +7 -8
  289. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  290. package/build-module/components/error-boundary/warning.js +8 -10
  291. package/build-module/components/error-boundary/warning.js.map +1 -1
  292. package/build-module/components/global-styles/block-preview-panel.js +7 -10
  293. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  294. package/build-module/components/global-styles/color-indicator-wrapper.js +4 -5
  295. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  296. package/build-module/components/global-styles/color-palette-panel.js +3 -4
  297. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  298. package/build-module/components/global-styles/dimensions-panel.js +1 -3
  299. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  300. package/build-module/components/global-styles/global-styles-provider.js +8 -10
  301. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  302. package/build-module/components/global-styles/gradients-palette-panel.js +3 -4
  303. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  304. package/build-module/components/global-styles/header.js +4 -5
  305. package/build-module/components/global-styles/header.js.map +1 -1
  306. package/build-module/components/global-styles/icon-with-current-color.js +4 -5
  307. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  308. package/build-module/components/global-styles/navigation-button.js +5 -6
  309. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  310. package/build-module/components/global-styles/palette.js +10 -14
  311. package/build-module/components/global-styles/palette.js.map +1 -1
  312. package/build-module/components/global-styles/preview.js +41 -51
  313. package/build-module/components/global-styles/preview.js.map +1 -1
  314. package/build-module/components/global-styles/screen-block-list.js +4 -7
  315. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  316. package/build-module/components/global-styles/screen-block.js +9 -10
  317. package/build-module/components/global-styles/screen-block.js.map +1 -1
  318. package/build-module/components/global-styles/screen-color-palette.js +3 -4
  319. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  320. package/build-module/components/global-styles/screen-revisions/index.js +8 -8
  321. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  322. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +14 -19
  323. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  324. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +5 -10
  325. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  326. package/build-module/components/global-styles/screen-root.js +3 -3
  327. package/build-module/components/global-styles/screen-root.js.map +1 -1
  328. package/build-module/components/global-styles/screen-typography-element.js +3 -4
  329. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  330. package/build-module/components/global-styles/screen-typography.js +5 -6
  331. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  332. package/build-module/components/global-styles/style-variations-container.js +5 -6
  333. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  334. package/build-module/components/global-styles/subtitle.js +4 -5
  335. package/build-module/components/global-styles/subtitle.js.map +1 -1
  336. package/build-module/components/global-styles/typography-panel.js +4 -5
  337. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  338. package/build-module/components/global-styles/typography-preview.js +5 -6
  339. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  340. package/build-module/components/global-styles/ui.js +40 -21
  341. package/build-module/components/global-styles/ui.js.map +1 -1
  342. package/build-module/components/global-styles/variations-panel.js +5 -6
  343. package/build-module/components/global-styles/variations-panel.js.map +1 -1
  344. package/build-module/components/header-edit-mode/document-actions/index.js +102 -24
  345. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  346. package/build-module/components/header-edit-mode/index.js +2 -6
  347. package/build-module/components/header-edit-mode/index.js.map +1 -1
  348. package/build-module/components/header-edit-mode/more-menu/index.js +49 -53
  349. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  350. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +5 -13
  351. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  352. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  353. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  354. package/build-module/components/keyboard-shortcut-help-modal/index.js +39 -49
  355. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  356. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  357. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  358. package/build-module/components/layout/index.js +4 -12
  359. package/build-module/components/layout/index.js.map +1 -1
  360. package/build-module/components/list/added-by.js +13 -23
  361. package/build-module/components/list/added-by.js.map +1 -1
  362. package/build-module/components/list/header.js +4 -7
  363. package/build-module/components/list/header.js.map +1 -1
  364. package/build-module/components/list/index.js +2 -4
  365. package/build-module/components/list/index.js.map +1 -1
  366. package/build-module/components/list/table.js +34 -39
  367. package/build-module/components/list/table.js.map +1 -1
  368. package/build-module/components/page-actions/delete-page-menu-item.js +58 -0
  369. package/build-module/components/page-actions/delete-page-menu-item.js.map +1 -0
  370. package/build-module/components/page-actions/index.js +30 -0
  371. package/build-module/components/page-actions/index.js.map +1 -0
  372. package/build-module/components/page-content-lock/constants.js +2 -0
  373. package/build-module/components/page-content-lock/constants.js.map +1 -0
  374. package/build-module/components/page-content-lock/index.js +14 -0
  375. package/build-module/components/page-content-lock/index.js.map +1 -0
  376. package/build-module/components/page-content-lock/use-disable-non-content-blocks.js +36 -0
  377. package/build-module/components/page-content-lock/use-disable-non-content-blocks.js.map +1 -0
  378. package/build-module/components/page-content-lock/use-page-content-lock-notifications.js +98 -0
  379. package/build-module/components/page-content-lock/use-page-content-lock-notifications.js.map +1 -0
  380. package/build-module/components/preferences-modal/index.js +4 -5
  381. package/build-module/components/preferences-modal/index.js.map +1 -1
  382. package/build-module/components/resizable-frame/index.js +20 -12
  383. package/build-module/components/resizable-frame/index.js.map +1 -1
  384. package/build-module/components/revisions/index.js +11 -13
  385. package/build-module/components/revisions/index.js.map +1 -1
  386. package/build-module/components/routes/link.js +8 -12
  387. package/build-module/components/routes/link.js.map +1 -1
  388. package/build-module/components/routes/use-title.js +1 -5
  389. package/build-module/components/routes/use-title.js.map +1 -1
  390. package/build-module/components/save-button/index.js +13 -7
  391. package/build-module/components/save-button/index.js.map +1 -1
  392. package/build-module/components/save-hub/index.js +95 -8
  393. package/build-module/components/save-hub/index.js.map +1 -1
  394. package/build-module/components/save-panel/index.js +62 -19
  395. package/build-module/components/save-panel/index.js.map +1 -1
  396. package/build-module/components/secondary-sidebar/list-view-sidebar.js +9 -3
  397. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  398. package/build-module/components/sidebar/index.js +6 -5
  399. package/build-module/components/sidebar/index.js.map +1 -1
  400. package/build-module/components/sidebar-edit-mode/default-sidebar.js +11 -12
  401. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  402. package/build-module/components/sidebar-edit-mode/index.js +14 -11
  403. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  404. package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js +67 -0
  405. package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +1 -0
  406. package/build-module/components/sidebar-edit-mode/page-panels/index.js +67 -0
  407. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -0
  408. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -5
  409. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  410. package/build-module/components/sidebar-edit-mode/settings-header/index.js +36 -22
  411. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  412. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +35 -0
  413. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -0
  414. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +3 -4
  415. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  416. package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/index.js +20 -19
  417. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -0
  418. package/build-module/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +7 -8
  419. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -0
  420. package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +12 -16
  421. package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -0
  422. package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +15 -19
  423. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -0
  424. package/build-module/components/sidebar-navigation-item/index.js +7 -8
  425. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  426. package/build-module/components/sidebar-navigation-screen/index.js +22 -15
  427. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  428. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +104 -14
  429. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  430. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +3 -5
  431. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  432. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +7 -10
  433. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  434. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +17 -23
  435. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  436. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +20 -23
  437. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  438. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +4 -5
  439. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  440. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +8 -9
  441. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -1
  442. package/build-module/components/sidebar-navigation-screen-page/index.js +79 -14
  443. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  444. package/build-module/components/sidebar-navigation-screen-page/page-details.js +131 -0
  445. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -0
  446. package/build-module/components/sidebar-navigation-screen-page/status-label.js +97 -0
  447. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -0
  448. package/build-module/components/sidebar-navigation-screen-pages/index.js +125 -19
  449. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  450. package/build-module/components/sidebar-navigation-screen-template/index.js +22 -17
  451. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  452. package/build-module/components/sidebar-navigation-screen-template-part/index.js +86 -0
  453. package/build-module/components/sidebar-navigation-screen-template-part/index.js.map +1 -0
  454. package/build-module/components/sidebar-navigation-screen-templates/index.js +13 -18
  455. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  456. package/build-module/components/sidebar-navigation-subtitle/index.js +3 -4
  457. package/build-module/components/sidebar-navigation-subtitle/index.js.map +1 -1
  458. package/build-module/components/site-hub/index.js +21 -14
  459. package/build-module/components/site-hub/index.js.map +1 -1
  460. package/build-module/components/site-icon/index.js +4 -5
  461. package/build-module/components/site-icon/index.js.map +1 -1
  462. package/build-module/components/start-template-options/index.js +15 -21
  463. package/build-module/components/start-template-options/index.js.map +1 -1
  464. package/build-module/components/style-book/index.js +35 -39
  465. package/build-module/components/style-book/index.js.map +1 -1
  466. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +2 -2
  467. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  468. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +9 -10
  469. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  470. package/build-module/components/{list/actions → template-actions}/index.js +34 -31
  471. package/build-module/components/template-actions/index.js.map +1 -0
  472. package/build-module/components/{list/actions → template-actions}/rename-menu-item.js +4 -5
  473. package/build-module/components/template-actions/rename-menu-item.js.map +1 -0
  474. package/build-module/components/template-part-converter/convert-to-regular.js +4 -5
  475. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  476. package/build-module/components/template-part-converter/convert-to-template-part.js +8 -10
  477. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  478. package/build-module/components/template-part-converter/index.js +12 -18
  479. package/build-module/components/template-part-converter/index.js.map +1 -1
  480. package/build-module/components/welcome-guide/image.js +4 -5
  481. package/build-module/components/welcome-guide/image.js.map +1 -1
  482. package/build-module/hooks/commands/use-edit-mode-commands.js +6 -8
  483. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  484. package/build-module/hooks/push-changes-to-global-styles/index.js +11 -8
  485. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  486. package/build-module/hooks/template-part-edit.js +5 -6
  487. package/build-module/hooks/template-part-edit.js.map +1 -1
  488. package/build-module/index.js +3 -6
  489. package/build-module/index.js.map +1 -1
  490. package/build-module/store/actions.js +125 -126
  491. package/build-module/store/actions.js.map +1 -1
  492. package/build-module/store/private-actions.js +7 -10
  493. package/build-module/store/private-actions.js.map +1 -1
  494. package/build-module/store/reducer.js +30 -33
  495. package/build-module/store/reducer.js.map +1 -1
  496. package/build-module/store/selectors.js +31 -11
  497. package/build-module/store/selectors.js.map +1 -1
  498. package/build-module/store/utils.js +1 -3
  499. package/build-module/store/utils.js.map +1 -1
  500. package/build-module/utils/get-is-list-page.js +3 -4
  501. package/build-module/utils/get-is-list-page.js.map +1 -1
  502. package/build-module/utils/is-previewing-theme.js +1 -3
  503. package/build-module/utils/is-previewing-theme.js.map +1 -1
  504. package/build-module/utils/is-template-revertable.js +1 -1
  505. package/build-module/utils/is-template-revertable.js.map +1 -1
  506. package/build-style/style-rtl.css +281 -59
  507. package/build-style/style.css +281 -59
  508. package/package.json +39 -36
  509. package/src/components/add-new-page/index.js +105 -0
  510. package/src/components/add-new-template/new-template.js +2 -1
  511. package/src/components/block-editor/index.js +25 -14
  512. package/src/components/editor/index.js +14 -8
  513. package/src/components/editor/style.scss +6 -11
  514. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +7 -5
  515. package/src/components/global-styles/ui.js +28 -0
  516. package/src/components/header-edit-mode/document-actions/index.js +126 -32
  517. package/src/components/header-edit-mode/document-actions/style.scss +64 -9
  518. package/src/components/header-edit-mode/tools-more-menu-group/index.js +1 -6
  519. package/src/components/layout/index.js +3 -9
  520. package/src/components/list/table.js +6 -2
  521. package/src/components/page-actions/delete-page-menu-item.js +71 -0
  522. package/src/components/page-actions/index.js +36 -0
  523. package/src/components/page-content-lock/constants.js +5 -0
  524. package/src/components/page-content-lock/index.js +14 -0
  525. package/src/components/page-content-lock/use-disable-non-content-blocks.js +44 -0
  526. package/src/components/page-content-lock/use-page-content-lock-notifications.js +128 -0
  527. package/src/components/resizable-frame/index.js +15 -5
  528. package/src/components/resizable-frame/style.scss +20 -18
  529. package/src/components/revisions/index.js +6 -7
  530. package/src/components/save-button/index.js +6 -0
  531. package/src/components/save-hub/index.js +143 -38
  532. package/src/components/save-hub/style.scss +6 -0
  533. package/src/components/save-panel/index.js +62 -15
  534. package/src/components/secondary-sidebar/list-view-sidebar.js +8 -1
  535. package/src/components/sidebar/index.js +6 -4
  536. package/src/components/sidebar/style.scss +3 -4
  537. package/src/components/sidebar-edit-mode/index.js +16 -14
  538. package/src/components/sidebar-edit-mode/page-panels/content-blocks-list.js +77 -0
  539. package/src/components/sidebar-edit-mode/page-panels/index.js +89 -0
  540. package/src/components/sidebar-edit-mode/page-panels/style.scss +10 -0
  541. package/src/components/sidebar-edit-mode/settings-header/index.js +51 -28
  542. package/src/components/sidebar-edit-mode/sidebar-card/index.js +34 -0
  543. package/src/components/sidebar-edit-mode/sidebar-card/style.scss +34 -0
  544. package/src/components/sidebar-edit-mode/{template-card → template-panel}/index.js +22 -19
  545. package/src/components/sidebar-edit-mode/{template-card → template-panel}/style.scss +2 -32
  546. package/src/components/sidebar-navigation-screen/index.js +74 -50
  547. package/src/components/sidebar-navigation-screen/style.scss +45 -4
  548. package/src/components/sidebar-navigation-screen-global-styles/index.js +118 -12
  549. package/src/components/sidebar-navigation-screen-global-styles/style.scss +15 -0
  550. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +1 -1
  551. package/src/components/sidebar-navigation-screen-page/index.js +137 -24
  552. package/src/components/sidebar-navigation-screen-page/page-details.js +163 -0
  553. package/src/components/sidebar-navigation-screen-page/status-label.js +101 -0
  554. package/src/components/sidebar-navigation-screen-page/style.scss +80 -0
  555. package/src/components/sidebar-navigation-screen-pages/index.js +180 -44
  556. package/src/components/sidebar-navigation-screen-template/index.js +25 -22
  557. package/src/components/sidebar-navigation-screen-template-part/index.js +103 -0
  558. package/src/components/sidebar-navigation-screen-templates/index.js +1 -1
  559. package/src/components/sidebar-navigation-subtitle/style.scss +2 -2
  560. package/src/components/site-hub/index.js +21 -6
  561. package/src/components/site-hub/style.scss +26 -0
  562. package/src/components/{list/actions → template-actions}/index.js +19 -6
  563. package/src/hooks/push-changes-to-global-styles/index.js +13 -7
  564. package/src/store/actions.js +20 -1
  565. package/src/store/reducer.js +20 -0
  566. package/src/store/selectors.js +24 -0
  567. package/src/store/test/actions.js +31 -0
  568. package/src/store/test/reducer.js +44 -0
  569. package/src/store/test/selectors.js +57 -0
  570. package/src/style.scss +5 -2
  571. package/src/utils/is-previewing-theme.js +1 -4
  572. package/build/components/list/actions/index.js.map +0 -1
  573. package/build/components/list/actions/rename-menu-item.js.map +0 -1
  574. package/build/components/sidebar-edit-mode/template-card/index.js.map +0 -1
  575. package/build/components/sidebar-edit-mode/template-card/template-actions.js.map +0 -1
  576. package/build/components/sidebar-edit-mode/template-card/template-areas.js.map +0 -1
  577. package/build/components/sidebar-edit-mode/template-revisions/index.js.map +0 -1
  578. package/build-module/components/list/actions/index.js.map +0 -1
  579. package/build-module/components/list/actions/rename-menu-item.js.map +0 -1
  580. package/build-module/components/sidebar-edit-mode/template-card/index.js.map +0 -1
  581. package/build-module/components/sidebar-edit-mode/template-card/template-actions.js.map +0 -1
  582. package/build-module/components/sidebar-edit-mode/template-card/template-areas.js.map +0 -1
  583. package/src/components/sidebar-navigation-screen-pages/style.scss +0 -4
  584. /package/src/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +0 -0
  585. /package/src/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +0 -0
  586. /package/src/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +0 -0
  587. /package/src/components/{list/actions → template-actions}/rename-menu-item.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/style-variations-container.js"],"names":["GlobalStylesContext","areGlobalStyleConfigsEqual","blockEditorPrivateApis","Variation","variation","isFocused","setIsFocused","base","user","setUserConfig","context","settings","styles","merged","selectVariation","selectOnEnter","event","keyCode","ENTER","preventDefault","isActive","title","StyleVariationsContainer","variations","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","withEmptyVariation","map","index"],"mappings":";;;;;;;;;AAUA;;AAPA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AAKA,MAAM;AAAEA,EAAAA,mBAAF;AAAuBC,EAAAA;AAAvB,IAAsD,yBAC3DC,wBAD2D,CAA5D;;AAIA,SAASC,SAAT,OAAoC;AAAA,MAAhB;AAAEC,IAAAA;AAAF,GAAgB;AACnC,QAAM,CAAEC,SAAF,EAAaC,YAAb,IAA8B,uBAAU,KAAV,CAApC;AACA,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA;AAAd,MAAgC,yBAAYT,mBAAZ,CAAtC;AACA,QAAMU,OAAO,GAAG,sBAAS,MAAM;AAAA;;AAC9B,WAAO;AACNF,MAAAA,IAAI,EAAE;AACLG,QAAAA,QAAQ,yBAAEP,SAAS,CAACO,QAAZ,qEAAwB,EAD3B;AAELC,QAAAA,MAAM,uBAAER,SAAS,CAACQ,MAAZ,iEAAsB;AAFvB,OADA;AAKNL,MAAAA,IALM;AAMNM,MAAAA,MAAM,EAAE,mDAAyBN,IAAzB,EAA+BH,SAA/B,CANF;AAONK,MAAAA,aAAa,EAAE,MAAM,CAAE;AAPjB,KAAP;AASA,GAVe,EAUb,CAAEL,SAAF,EAAaG,IAAb,CAVa,CAAhB;;AAYA,QAAMO,eAAe,GAAG,MAAM;AAC7BL,IAAAA,aAAa,CAAE,MAAM;AACpB,aAAO;AACNE,QAAAA,QAAQ,EAAEP,SAAS,CAACO,QADd;AAENC,QAAAA,MAAM,EAAER,SAAS,CAACQ;AAFZ,OAAP;AAIA,KALY,CAAb;AAMA,GAPD;;AASA,QAAMG,aAAa,GAAKC,KAAF,IAA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ECV,MAAAA,QAAQ,EAAE,EAFX;AAGCC,MAAAA,MAAM,EAAE;AAHT,KADM,EAMN,GAAG,CAAEW,UAAF,aAAEA,UAAF,cAAEA,UAAF,GAAgB,EAAhB,EAAqBK,GAArB,CAA4BxB,SAAF;AAAA;;AAAA,aAAmB,EAC/C,GAAGA,SAD4C;AAE/CO,QAAAA,QAAQ,0BAAEP,SAAS,CAACO,QAAZ,uEAAwB,EAFe;AAG/CC,QAAAA,MAAM,wBAAER,SAAS,CAACQ,MAAZ,mEAAsB;AAHmB,OAAnB;AAAA,KAA1B,CANG,CAAP;AAYA,GAb0B,EAaxB,CAAEW,UAAF,CAbwB,CAA3B;AAeA,SACC,4BAAC,8BAAD;AACC,IAAA,OAAO,EAAG,CADX;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGI,kBAAkB,CAACC,GAAnB,CAAwB,CAAExB,SAAF,EAAayB,KAAb,KACzB,4BAAC,SAAD;AAAW,IAAA,GAAG,EAAGA,KAAjB;AAAyB,IAAA,SAAS,EAAGzB;AAArC,IADC,CAJH,CADD;AAUA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, useContext, useState } from '@wordpress/element';\nimport { ENTER } from '@wordpress/keycodes';\nimport { __experimentalGrid as Grid } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { mergeBaseAndUserConfigs } from './global-styles-provider';\nimport StylesPreview from './preview';\nimport { unlock } from '../../private-apis';\n\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\n\nfunction Variation( { variation } ) {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\tconst { base, user, setUserConfig } = useContext( GlobalStylesContext );\n\tconst context = useMemo( () => {\n\t\treturn {\n\t\t\tuser: {\n\t\t\t\tsettings: variation.settings ?? {},\n\t\t\t\tstyles: variation.styles ?? {},\n\t\t\t},\n\t\t\tbase,\n\t\t\tmerged: mergeBaseAndUserConfigs( base, variation ),\n\t\t\tsetUserConfig: () => {},\n\t\t};\n\t}, [ variation, base ] );\n\n\tconst selectVariation = () => {\n\t\tsetUserConfig( () => {\n\t\t\treturn {\n\t\t\t\tsettings: variation.settings,\n\t\t\t\tstyles: variation.styles,\n\t\t\t};\n\t\t} );\n\t};\n\n\tconst selectOnEnter = ( event ) => {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tselectVariation();\n\t\t}\n\t};\n\n\tconst isActive = useMemo( () => {\n\t\treturn areGlobalStyleConfigsEqual( user, variation );\n\t}, [ user, variation ] );\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ context }>\n\t\t\t<div\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-global-styles-variations_item',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-active': isActive,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\trole=\"button\"\n\t\t\t\tonClick={ selectVariation }\n\t\t\t\tonKeyDown={ selectOnEnter }\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\taria-label={ variation?.title }\n\t\t\t\taria-current={ isActive }\n\t\t\t\tonFocus={ () => setIsFocused( true ) }\n\t\t\t\tonBlur={ () => setIsFocused( false ) }\n\t\t\t>\n\t\t\t\t<div className=\"edit-site-global-styles-variations_item-preview\">\n\t\t\t\t\t<StylesPreview\n\t\t\t\t\t\tlabel={ variation?.title }\n\t\t\t\t\t\tisFocused={ isFocused }\n\t\t\t\t\t\twithHoverView\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n\nexport default function StyleVariationsContainer() {\n\tconst variations = useSelect( ( select ) => {\n\t\treturn select(\n\t\t\tcoreStore\n\t\t).__experimentalGetCurrentThemeGlobalStylesVariations();\n\t}, [] );\n\n\tconst withEmptyVariation = useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: __( 'Default' ),\n\t\t\t\tsettings: {},\n\t\t\t\tstyles: {},\n\t\t\t},\n\t\t\t...( variations ?? [] ).map( ( variation ) => ( {\n\t\t\t\t...variation,\n\t\t\t\tsettings: variation.settings ?? {},\n\t\t\t\tstyles: variation.styles ?? {},\n\t\t\t} ) ),\n\t\t];\n\t}, [ variations ] );\n\n\treturn (\n\t\t<Grid\n\t\t\tcolumns={ 2 }\n\t\t\tclassName=\"edit-site-global-styles-style-variations-container\"\n\t\t>\n\t\t\t{ withEmptyVariation.map( ( variation, index ) => (\n\t\t\t\t<Variation key={ index } variation={ variation } />\n\t\t\t) ) }\n\t\t</Grid>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/style-variations-container.js"],"names":["GlobalStylesContext","areGlobalStyleConfigsEqual","blockEditorPrivateApis","Variation","variation","isFocused","setIsFocused","base","user","setUserConfig","context","settings","styles","merged","selectVariation","selectOnEnter","event","keyCode","ENTER","preventDefault","isActive","title","StyleVariationsContainer","variations","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","withEmptyVariation","map","index"],"mappings":";;;;;;;;;AAUA;;AAPA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AAKA,MAAM;AAAEA,EAAAA,mBAAF;AAAuBC,EAAAA;AAAvB,IAAsD,yBAC3DC,wBAD2D,CAA5D;;AAIA,SAASC,SAAT,CAAoB;AAAEC,EAAAA;AAAF,CAApB,EAAoC;AACnC,QAAM,CAAEC,SAAF,EAAaC,YAAb,IAA8B,uBAAU,KAAV,CAApC;AACA,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA;AAAd,MAAgC,y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AAA,SAAS,EAAGzB;AAArC,IADC,CAJH,CADD;AAUA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, useContext, useState } from '@wordpress/element';\nimport { ENTER } from '@wordpress/keycodes';\nimport { __experimentalGrid as Grid } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { mergeBaseAndUserConfigs } from './global-styles-provider';\nimport StylesPreview from './preview';\nimport { unlock } from '../../private-apis';\n\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\n\nfunction Variation( { variation } ) {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\tconst { base, user, setUserConfig } = useContext( GlobalStylesContext );\n\tconst context = useMemo( () => {\n\t\treturn {\n\t\t\tuser: {\n\t\t\t\tsettings: variation.settings ?? {},\n\t\t\t\tstyles: variation.styles ?? {},\n\t\t\t},\n\t\t\tbase,\n\t\t\tmerged: mergeBaseAndUserConfigs( base, variation ),\n\t\t\tsetUserConfig: () => {},\n\t\t};\n\t}, [ variation, base ] );\n\n\tconst selectVariation = () => {\n\t\tsetUserConfig( () => {\n\t\t\treturn {\n\t\t\t\tsettings: variation.settings,\n\t\t\t\tstyles: variation.styles,\n\t\t\t};\n\t\t} );\n\t};\n\n\tconst selectOnEnter = ( event ) => {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tselectVariation();\n\t\t}\n\t};\n\n\tconst isActive = useMemo( () => {\n\t\treturn areGlobalStyleConfigsEqual( user, variation );\n\t}, [ user, variation ] );\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ context }>\n\t\t\t<div\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-global-styles-variations_item',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-active': isActive,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\trole=\"button\"\n\t\t\t\tonClick={ selectVariation }\n\t\t\t\tonKeyDown={ selectOnEnter }\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\taria-label={ variation?.title }\n\t\t\t\taria-current={ isActive }\n\t\t\t\tonFocus={ () => setIsFocused( true ) }\n\t\t\t\tonBlur={ () => setIsFocused( false ) }\n\t\t\t>\n\t\t\t\t<div className=\"edit-site-global-styles-variations_item-preview\">\n\t\t\t\t\t<StylesPreview\n\t\t\t\t\t\tlabel={ variation?.title }\n\t\t\t\t\t\tisFocused={ isFocused }\n\t\t\t\t\t\twithHoverView\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n\nexport default function StyleVariationsContainer() {\n\tconst variations = useSelect( ( select ) => {\n\t\treturn select(\n\t\t\tcoreStore\n\t\t).__experimentalGetCurrentThemeGlobalStylesVariations();\n\t}, [] );\n\n\tconst withEmptyVariation = useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: __( 'Default' ),\n\t\t\t\tsettings: {},\n\t\t\t\tstyles: {},\n\t\t\t},\n\t\t\t...( variations ?? [] ).map( ( variation ) => ( {\n\t\t\t\t...variation,\n\t\t\t\tsettings: variation.settings ?? {},\n\t\t\t\tstyles: variation.styles ?? {},\n\t\t\t} ) ),\n\t\t];\n\t}, [ variations ] );\n\n\treturn (\n\t\t<Grid\n\t\t\tcolumns={ 2 }\n\t\t\tclassName=\"edit-site-global-styles-style-variations-container\"\n\t\t>\n\t\t\t{ withEmptyVariation.map( ( variation, index ) => (\n\t\t\t\t<Variation key={ index } variation={ variation } />\n\t\t\t) ) }\n\t\t</Grid>\n\t);\n}\n"]}
@@ -12,11 +12,10 @@ var _components = require("@wordpress/components");
12
12
  /**
13
13
  * WordPress dependencies
14
14
  */
15
- function Subtitle(_ref) {
16
- let {
17
- children,
18
- level
19
- } = _ref;
15
+ function Subtitle({
16
+ children,
17
+ level
18
+ }) {
20
19
  return (0, _element.createElement)(_components.__experimentalHeading, {
21
20
  className: "edit-site-global-styles-subtitle",
22
21
  level: level !== null && level !== void 0 ? level : 2
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/subtitle.js"],"names":["Subtitle","children","level"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,SAASA,QAAT,OAAyC;AAAA,MAAtB;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAsB;AACxC,SACC,4BAAC,iCAAD;AACC,IAAA,SAAS,EAAC,kCADX;AAEC,IAAA,KAAK,EAAGA,KAAH,aAAGA,KAAH,cAAGA,KAAH,GAAY;AAFlB,KAIGD,QAJH,CADD;AAQA;;eAEcD,Q","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n\nfunction Subtitle( { children, level } ) {\n\treturn (\n\t\t<Heading\n\t\t\tclassName=\"edit-site-global-styles-subtitle\"\n\t\t\tlevel={ level ?? 2 }\n\t\t>\n\t\t\t{ children }\n\t\t</Heading>\n\t);\n}\n\nexport default Subtitle;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/subtitle.js"],"names":["Subtitle","children","level"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,SAASA,QAAT,CAAmB;AAAEC,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,CAAnB,EAAyC;AACxC,SACC,4BAAC,iCAAD;AACC,IAAA,SAAS,EAAC,kCADX;AAEC,IAAA,KAAK,EAAGA,KAAH,aAAGA,KAAH,cAAGA,KAAH,GAAY;AAFlB,KAIGD,QAJH,CADD;AAQA;;eAEcD,Q","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n\nfunction Subtitle( { children, level } ) {\n\treturn (\n\t\t<Heading\n\t\t\tclassName=\"edit-site-global-styles-subtitle\"\n\t\t\tlevel={ level ?? 2 }\n\t\t>\n\t\t\t{ children }\n\t\t</Heading>\n\t);\n}\n\nexport default Subtitle;\n"]}
@@ -25,11 +25,10 @@ const {
25
25
  TypographyPanel: StylesTypographyPanel
26
26
  } = (0, _privateApis.unlock)(_blockEditor.privateApis);
27
27
 
28
- function TypographyPanel(_ref) {
29
- let {
30
- element,
31
- headingLevel
32
- } = _ref;
28
+ function TypographyPanel({
29
+ element,
30
+ headingLevel
31
+ }) {
33
32
  let prefixParts = [];
34
33
 
35
34
  if (element === 'heading') {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/typography-panel.js"],"names":["useGlobalStyle","useGlobalSetting","useSettingsForBlockElement","TypographyPanel","StylesTypographyPanel","blockEditorPrivateApis","element","headingLevel","prefixParts","concat","prefix","join","style","undefined","shouldDecodeEncode","inheritedStyle","setStyle","rawSettings","usedElement","settings"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAM;AACLA,EAAAA,cADK;AAELC,EAAAA,gBAFK;AAGLC,EAAAA,0BAHK;AAILC,EAAAA,eAAe,EAAEC;AAJZ,IAKF,yBAAQC,wBAAR,CALJ;;AAOe,SAASF,eAAT,OAAsD;AAAA,MAA5B;AAAEG,IAAAA,OAAF;AAAWC,IAAAA;AAAX,GAA4B;AACpE,MAAIC,WAAW,GAAG,EAAlB;;AACA,MAAKF,OAAO,KAAK,SAAjB,EAA6B;AAC5BE,IAAAA,WAAW,GAAGA,WAAW,CAACC,MAAZ,CAAoB,CAAE,UAAF,EAAcF,YAAd,CAApB,CAAd;AACA,GAFD,MAEO,IAAKD,OAAO,IAAIA,OAAO,KAAK,MAA5B,EAAqC;AAC3CE,IAAAA,WAAW,GAAGA,WAAW,CAACC,MAAZ,CAAoB,CAAE,UAAF,EAAcH,OAAd,CAApB,CAAd;AACA;;AACD,QAAMI,MAAM,GAAGF,WAAW,CAACG,IAAZ,CAAkB,GAAlB,CAAf;AAEA,QAAM,CAAEC,KAAF,IAAYZ,cAAc,CAAEU,MAAF,EAAUG,SAAV,EAAqB,MAArB,EAA6B;AAC5DC,IAAAA,kBAAkB,EAAE;AADwC,GAA7B,CAAhC;AAGA,QAAM,CAAEC,cAAF,EAAkBC,QAAlB,IAA+BhB,cAAc,CAClDU,MADkD,EAElDG,SAFkD,EAGlD,KAHkD,EAIlD;AACCC,IAAAA,kBAAkB,EAAE;AADrB,GAJkD,CAAnD;AAQA,QAAM,CAAEG,WAAF,IAAkBhB,gBAAgB,CAAE,EAAF,CAAxC;AACA,QAAMiB,WAAW,GAAGZ,OAAO,KAAK,SAAZ,GAAwBC,YAAxB,GAAuCD,OAA3D;AACA,QAAMa,QAAQ,GAAGjB,0BAA0B,CAC1Ce,WAD0C,EAE1CJ,SAF0C,EAG1CK,WAH0C,CAA3C;AAMA,SACC,4BAAC,qBAAD;AACC,IAAA,cAAc,EAAGH,cADlB;AAEC,IAAA,KAAK,EAAGH,KAFT;AAGC,IAAA,QAAQ,EAAGI,QAHZ;AAIC,IAAA,QAAQ,EAAGG;AAJZ,IADD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst {\n\tuseGlobalStyle,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tTypographyPanel: StylesTypographyPanel,\n} = unlock( blockEditorPrivateApis );\n\nexport default function TypographyPanel( { element, headingLevel } ) {\n\tlet prefixParts = [];\n\tif ( element === 'heading' ) {\n\t\tprefixParts = prefixParts.concat( [ 'elements', headingLevel ] );\n\t} else if ( element && element !== 'text' ) {\n\t\tprefixParts = prefixParts.concat( [ 'elements', element ] );\n\t}\n\tconst prefix = prefixParts.join( '.' );\n\n\tconst [ style ] = useGlobalStyle( prefix, undefined, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle(\n\t\tprefix,\n\t\tundefined,\n\t\t'all',\n\t\t{\n\t\t\tshouldDecodeEncode: false,\n\t\t}\n\t);\n\tconst [ rawSettings ] = useGlobalSetting( '' );\n\tconst usedElement = element === 'heading' ? headingLevel : element;\n\tconst settings = useSettingsForBlockElement(\n\t\trawSettings,\n\t\tundefined,\n\t\tusedElement\n\t);\n\n\treturn (\n\t\t<StylesTypographyPanel\n\t\t\tinheritedValue={ inheritedStyle }\n\t\t\tvalue={ style }\n\t\t\tonChange={ setStyle }\n\t\t\tsettings={ settings }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/typography-panel.js"],"names":["useGlobalStyle","useGlobalSetting","useSettingsForBlockElement","TypographyPanel","StylesTypographyPanel","blockEditorPrivateApis","element","headingLevel","prefixParts","concat","prefix","join","style","undefined","shouldDecodeEncode","inheritedStyle","setStyle","rawSettings","usedElement","settings"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAM;AACLA,EAAAA,cADK;AAELC,EAAAA,gBAFK;AAGLC,EAAAA,0BAHK;AAILC,EAAAA,eAAe,EAAEC;AAJZ,IAKF,yBAAQC,wBAAR,CALJ;;AAOe,SAASF,eAAT,CAA0B;AAAEG,EAAAA,OAAF;AAAWC,EAAAA;AAAX,CAA1B,EAAsD;AACpE,MAAIC,WAAW,GAAG,EAAlB;;AACA,MAAKF,OAAO,KAAK,SAAjB,EAA6B;AAC5BE,IAAAA,WAAW,GAAGA,WAAW,CAACC,MAAZ,CAAoB,CAAE,UAAF,EAAcF,YAAd,CAApB,CAAd;AACA,GAFD,MAEO,IAAKD,OAAO,IAAIA,OAAO,KAAK,MAA5B,EAAqC;AAC3CE,IAAAA,WAAW,GAAGA,WAAW,CAACC,MAAZ,CAAoB,CAAE,UAAF,EAAcH,OAAd,CAApB,CAAd;AACA;;AACD,QAAMI,MAAM,GAAGF,WAAW,CAACG,IAAZ,CAAkB,GAAlB,CAAf;AAEA,QAAM,CAAEC,KAAF,IAAYZ,cAAc,CAAEU,MAAF,EAAUG,SAAV,EAAqB,MAArB,EAA6B;AAC5DC,IAAAA,kBAAkB,EAAE;AADwC,GAA7B,CAAhC;AAGA,QAAM,CAAEC,cAAF,EAAkBC,QAAlB,IAA+BhB,cAAc,CAClDU,MADkD,EAElDG,SAFkD,EAGlD,KAHkD,EAIlD;AACCC,IAAAA,kBAAkB,EAAE;AADrB,GAJkD,CAAnD;AAQA,QAAM,CAAEG,WAAF,IAAkBhB,gBAAgB,CAAE,EAAF,CAAxC;AACA,QAAMiB,WAAW,GAAGZ,OAAO,KAAK,SAAZ,GAAwBC,YAAxB,GAAuCD,OAA3D;AACA,QAAMa,QAAQ,GAAGjB,0BAA0B,CAC1Ce,WAD0C,EAE1CJ,SAF0C,EAG1CK,WAH0C,CAA3C;AAMA,SACC,4BAAC,qBAAD;AACC,IAAA,cAAc,EAAGH,cADlB;AAEC,IAAA,KAAK,EAAGH,KAFT;AAGC,IAAA,QAAQ,EAAGI,QAHZ;AAIC,IAAA,QAAQ,EAAGG;AAJZ,IADD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst {\n\tuseGlobalStyle,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tTypographyPanel: StylesTypographyPanel,\n} = unlock( blockEditorPrivateApis );\n\nexport default function TypographyPanel( { element, headingLevel } ) {\n\tlet prefixParts = [];\n\tif ( element === 'heading' ) {\n\t\tprefixParts = prefixParts.concat( [ 'elements', headingLevel ] );\n\t} else if ( element && element !== 'text' ) {\n\t\tprefixParts = prefixParts.concat( [ 'elements', element ] );\n\t}\n\tconst prefix = prefixParts.join( '.' );\n\n\tconst [ style ] = useGlobalStyle( prefix, undefined, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle(\n\t\tprefix,\n\t\tundefined,\n\t\t'all',\n\t\t{\n\t\t\tshouldDecodeEncode: false,\n\t\t}\n\t);\n\tconst [ rawSettings ] = useGlobalSetting( '' );\n\tconst usedElement = element === 'heading' ? headingLevel : element;\n\tconst settings = useSettingsForBlockElement(\n\t\trawSettings,\n\t\tundefined,\n\t\tusedElement\n\t);\n\n\treturn (\n\t\t<StylesTypographyPanel\n\t\t\tinheritedValue={ inheritedStyle }\n\t\t\tvalue={ style }\n\t\t\tonChange={ setStyle }\n\t\t\tsettings={ settings }\n\t\t/>\n\t);\n}\n"]}
@@ -22,12 +22,11 @@ const {
22
22
  useGlobalStyle
23
23
  } = (0, _privateApis.unlock)(_blockEditor.privateApis);
24
24
 
25
- function TypographyPreview(_ref) {
26
- let {
27
- name,
28
- element,
29
- headingLevel
30
- } = _ref;
25
+ function TypographyPreview({
26
+ name,
27
+ element,
28
+ headingLevel
29
+ }) {
31
30
  let prefix = '';
32
31
 
33
32
  if (element === 'heading') {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/typography-preview.js"],"names":["useGlobalStyle","blockEditorPrivateApis","TypographyPreview","name","element","headingLevel","prefix","fontFamily","gradientValue","backgroundColor","color","fontSize","fontStyle","fontWeight","letterSpacing","extraStyles","textDecoration","background"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAM;AAAEA,EAAAA;AAAF,IAAqB,yBAAQC,wBAAR,CAA3B;;AAEe,SAASC,iBAAT,OAA8D;AAAA,MAAlC;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,OAAR;AAAiBC,IAAAA;AAAjB,GAAkC;AAC5E,MAAIC,MAAM,GAAG,EAAb;;AACA,MAAKF,OAAO,KAAK,SAAjB,EAA6B;AAC5BE,IAAAA,MA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AAA,UANO;AAOPC,MAAAA,aAPO;AAQP,SAAGC;AARI;AAFT,UADD;AAiBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nexport default function TypographyPreview( { name, element, headingLevel } ) {\n\tlet prefix = '';\n\tif ( element === 'heading' ) {\n\t\tprefix = `elements.${ headingLevel }.`;\n\t} else if ( element && element !== 'text' ) {\n\t\tprefix = `elements.${ element }.`;\n\t}\n\n\tconst [ fontFamily ] = useGlobalStyle(\n\t\tprefix + 'typography.fontFamily',\n\t\tname\n\t);\n\tconst [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient', name );\n\tconst [ backgroundColor ] = useGlobalStyle(\n\t\tprefix + 'color.background',\n\t\tname\n\t);\n\tconst [ color ] = useGlobalStyle( prefix + 'color.text', name );\n\tconst [ fontSize ] = useGlobalStyle( prefix + 'typography.fontSize', name );\n\tconst [ fontStyle ] = useGlobalStyle(\n\t\tprefix + 'typography.fontStyle',\n\t\tname\n\t);\n\tconst [ fontWeight ] = useGlobalStyle(\n\t\tprefix + 'typography.fontWeight',\n\t\tname\n\t);\n\tconst [ letterSpacing ] = useGlobalStyle(\n\t\tprefix + 'typography.letterSpacing',\n\t\tname\n\t);\n\tconst extraStyles =\n\t\telement === 'link'\n\t\t\t? {\n\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t }\n\t\t\t: {};\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"edit-site-typography-preview\"\n\t\t\tstyle={ {\n\t\t\t\tfontFamily: fontFamily ?? 'serif',\n\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\tcolor,\n\t\t\t\tfontSize,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tletterSpacing,\n\t\t\t\t...extraStyles,\n\t\t\t} }\n\t\t>\n\t\t\tAa\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/typography-preview.js"],"names":["useGlobalStyle","blockEditorPrivateApis","TypographyPreview","name","element","headingLevel","prefix","fontFamily","gradientValue","backgroundColor","color","fontSize","fontStyle","fontWeight","letterSpacing","extraStyles","textDecoration","background"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAM;AAAEA,EAAAA;AAAF,IAAqB,yBAAQC,wBAAR,CAA3B;;AAEe,SAASC,iBAAT,CAA4B;AAAEC,EAAAA,IAAF;AAAQC,EAAAA,OAAR;AAAiBC,EAAAA;AAAjB,CAA5B,EAA8D;AAC5E,MAAIC,MAAM,GAAG,EAAb;;AACA,MAAKF,OAAO,KAAK,SAAjB,EAA6B;AAC5BE,IAAAA,MAAM,GAAI,YAAYD,YAAc,GAApC;AACA,GAFD,MAEO,IAAKD,OAAO,IAAIA,OAAO,KAAK,MAA5B,EAAqC;AAC3CE,IAAAA,MAAM,GAAI,YAAYF,OAAS,GAA/B;AACA;;AAED,QAAM,CAAEG,UAAF,IAAiBP,cAAc,CACpCM,MAAM,GAAG,uBAD2B,EAEpCH,IAFoC,CAArC;AAIA,QAAM,CAAEK,aAAF,IAAoBR,cAAc,CAAEM,MAAM,GAAG,gBAAX,EAA6BH,IAA7B,CAAxC;AACA,QAAM,CAAEM,eAAF,IAAsBT,cAAc,CACzCM,MAAM,GAAG,kBADgC,EAEzCH,IAFyC,CAA1C;AAIA,QAAM,CAAEO,KAAF,IAAYV,cAAc,CAAEM,MAAM,GAAG,YAAX,EAAyBH,IAAzB,CAAhC;AACA,QAAM,CAAEQ,QAAF,IAAeX,cAAc,CAAEM,MAAM,GAAG,qBAAX,EAAkCH,IAAlC,CAAnC;AACA,QAAM,CAAES,SAAF,IAAgBZ,cAAc,CACnCM,MAAM,GAAG,sBAD0B,EAEnCH,IAFmC,CAApC;AAIA,QAAM,CAAEU,UAAF,IAAiBb,cAAc,CACpCM,MAAM,GAAG,uBAD2B,EAEpCH,IAFoC,CAArC;AAIA,QAAM,CAAEW,aAAF,IAAoBd,cAAc,CACvCM,MAAM,GAAG,0BAD8B,EAEvCH,IAFuC,CAAxC;AAIA,QAAMY,WAAW,GAChBX,OAAO,KAAK,MAAZ,GACG;AACAY,IAAAA,cAAc,EAAE;AADhB,GADH,GAIG,EALJ;AAOA,SACC;AACC,IAAA,SAAS,EAAC,8BADX;AAEC,IAAA,KAAK,EAAG;AACPT,MAAAA,UAAU,EAAEA,UAAF,aAAEA,UAAF,cAAEA,UAAF,GAAgB,OADnB;AAEPU,MAAAA,UAAU,EAAET,aAAF,aAAEA,aAAF,cAAEA,aAAF,GAAmBC,eAFtB;AAGPC,MAAAA,KAHO;AAIPC,MAAAA,QAJO;AAKPC,MAAAA,SALO;AAMPC,MAAAA,UANO;AAOPC,MAAAA,aAPO;AAQP,SAAGC;AARI;AAFT,UADD;AAiBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nexport default function TypographyPreview( { name, element, headingLevel } ) {\n\tlet prefix = '';\n\tif ( element === 'heading' ) {\n\t\tprefix = `elements.${ headingLevel }.`;\n\t} else if ( element && element !== 'text' ) {\n\t\tprefix = `elements.${ element }.`;\n\t}\n\n\tconst [ fontFamily ] = useGlobalStyle(\n\t\tprefix + 'typography.fontFamily',\n\t\tname\n\t);\n\tconst [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient', name );\n\tconst [ backgroundColor ] = useGlobalStyle(\n\t\tprefix + 'color.background',\n\t\tname\n\t);\n\tconst [ color ] = useGlobalStyle( prefix + 'color.text', name );\n\tconst [ fontSize ] = useGlobalStyle( prefix + 'typography.fontSize', name );\n\tconst [ fontStyle ] = useGlobalStyle(\n\t\tprefix + 'typography.fontStyle',\n\t\tname\n\t);\n\tconst [ fontWeight ] = useGlobalStyle(\n\t\tprefix + 'typography.fontWeight',\n\t\tname\n\t);\n\tconst [ letterSpacing ] = useGlobalStyle(\n\t\tprefix + 'typography.letterSpacing',\n\t\tname\n\t);\n\tconst extraStyles =\n\t\telement === 'link'\n\t\t\t? {\n\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t }\n\t\t\t: {};\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"edit-site-typography-preview\"\n\t\t\tstyle={ {\n\t\t\t\tfontFamily: fontFamily ?? 'serif',\n\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\tcolor,\n\t\t\t\tfontSize,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tletterSpacing,\n\t\t\t\t...extraStyles,\n\t\t\t} }\n\t\t>\n\t\t\tAa\n\t\t</div>\n\t);\n}\n"]}
@@ -81,7 +81,7 @@ function GlobalStylesActionMenu() {
81
81
  canEditCSS,
82
82
  revisionsCount
83
83
  } = (0, _data.useSelect)(select => {
84
- var _globalStyles$_links$, _globalStyles$_links, _globalStyles$_links$2, _globalStyles$_links2, _globalStyles$_links3, _globalStyles$_links4;
84
+ var _globalStyles$_links$, _globalStyles$_links$2;
85
85
 
86
86
  const {
87
87
  getEntityRecord,
@@ -92,8 +92,8 @@ function GlobalStylesActionMenu() {
92
92
 
93
93
  const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
94
94
  return {
95
- canEditCSS: (_globalStyles$_links$ = !!(globalStyles !== null && globalStyles !== void 0 && (_globalStyles$_links = globalStyles._links) !== null && _globalStyles$_links !== void 0 && _globalStyles$_links['wp:action-edit-css'])) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : false,
96
- revisionsCount: (_globalStyles$_links$2 = globalStyles === null || globalStyles === void 0 ? void 0 : (_globalStyles$_links2 = globalStyles._links) === null || _globalStyles$_links2 === void 0 ? void 0 : (_globalStyles$_links3 = _globalStyles$_links2['version-history']) === null || _globalStyles$_links3 === void 0 ? void 0 : (_globalStyles$_links4 = _globalStyles$_links3[0]) === null || _globalStyles$_links4 === void 0 ? void 0 : _globalStyles$_links4.count) !== null && _globalStyles$_links$2 !== void 0 ? _globalStyles$_links$2 : 0
95
+ canEditCSS: (_globalStyles$_links$ = !!globalStyles?._links?.['wp:action-edit-css']) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : false,
96
+ revisionsCount: (_globalStyles$_links$2 = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$2 !== void 0 ? _globalStyles$_links$2 : 0
97
97
  };
98
98
  }, []);
99
99
  const {
@@ -137,22 +137,20 @@ function GlobalStylesActionMenu() {
137
137
  }));
138
138
  }
139
139
 
140
- function GlobalStylesNavigationScreen(_ref) {
141
- let {
142
- className,
143
- ...props
144
- } = _ref;
140
+ function GlobalStylesNavigationScreen({
141
+ className,
142
+ ...props
143
+ }) {
145
144
  return (0, _element.createElement)(_components.__experimentalNavigatorScreen, (0, _extends2.default)({
146
145
  className: ['edit-site-global-styles-sidebar__navigator-screen', className].filter(Boolean).join(' ')
147
146
  }, props));
148
147
  }
149
148
 
150
- function BlockStylesNavigationScreens(_ref2) {
151
- let {
152
- parentMenu,
153
- blockStyles,
154
- blockName
155
- } = _ref2;
149
+ function BlockStylesNavigationScreens({
150
+ parentMenu,
151
+ blockStyles,
152
+ blockName
153
+ }) {
156
154
  return blockStyles.map((style, index) => (0, _element.createElement)(GlobalStylesNavigationScreen, {
157
155
  key: index,
158
156
  path: parentMenu + '/variations/' + style.name
@@ -162,11 +160,10 @@ function BlockStylesNavigationScreens(_ref2) {
162
160
  })));
163
161
  }
164
162
 
165
- function ContextScreens(_ref3) {
166
- let {
167
- name,
168
- parentMenu = ''
169
- } = _ref3;
163
+ function ContextScreens({
164
+ name,
165
+ parentMenu = ''
166
+ }) {
170
167
  const blockStyleVariations = (0, _data.useSelect)(select => {
171
168
  const {
172
169
  getBlockStyles
@@ -177,7 +174,7 @@ function ContextScreens(_ref3) {
177
174
  path: parentMenu + '/colors/palette'
178
175
  }, (0, _element.createElement)(_screenColorPalette.default, {
179
176
  name: name
180
- })), !!(blockStyleVariations !== null && blockStyleVariations !== void 0 && blockStyleVariations.length) && (0, _element.createElement)(BlockStylesNavigationScreens, {
177
+ })), !!blockStyleVariations?.length && (0, _element.createElement)(BlockStylesNavigationScreens, {
181
178
  parentMenu: parentMenu,
182
179
  blockStyles: blockStyleVariations,
183
180
  blockName: name
@@ -241,6 +238,28 @@ function GlobalStylesBlockLink() {
241
238
  }, [selectedBlockClientId, selectedBlockName, blockHasGlobalStyles]);
242
239
  }
243
240
 
241
+ function GlobalStylesEditorCanvasContainerLink() {
242
+ const {
243
+ goTo,
244
+ location
245
+ } = (0, _components.__experimentalUseNavigator)();
246
+ const editorCanvasContainerView = (0, _data.useSelect)(select => (0, _privateApis.unlock)(select(_store.store)).getEditorCanvasContainerView(), []); // If the user switches the editor canvas container view, redirect
247
+ // to the appropriate screen. This effectively allows deep linking to the
248
+ // desired screens from outside the global styles navigation provider.
249
+
250
+ (0, _element.useEffect)(() => {
251
+ if (editorCanvasContainerView === 'global-styles-revisions') {
252
+ // Switching to the revisions container view should
253
+ // redirect to the revisions screen.
254
+ goTo('/revisions');
255
+ } else if (!!editorCanvasContainerView && location?.path === '/revisions') {
256
+ // Switching to any container other than revisions should
257
+ // redirect from the revisions screen to the root global styles screen.
258
+ goTo('/');
259
+ }
260
+ }, [editorCanvasContainerView, location?.path, goTo]);
261
+ }
262
+
244
263
  function GlobalStylesUI() {
245
264
  const blocks = (0, _blocks.getBlockTypes)();
246
265
  const editorCanvasContainerView = (0, _data.useSelect)(select => (0, _privateApis.unlock)(select(_store.store)).getEditorCanvasContainerView(), []);
@@ -292,7 +311,7 @@ function GlobalStylesUI() {
292
311
  key: 'screens-block-' + block.name,
293
312
  name: block.name,
294
313
  parentMenu: '/blocks/' + encodeURIComponent(block.name)
295
- })), 'style-book' === editorCanvasContainerView && (0, _element.createElement)(GlobalStylesStyleBook, null), (0, _element.createElement)(GlobalStylesActionMenu, null), (0, _element.createElement)(GlobalStylesBlockLink, null));
314
+ })), 'style-book' === editorCanvasContainerView && (0, _element.createElement)(GlobalStylesStyleBook, null), (0, _element.createElement)(GlobalStylesActionMenu, null), (0, _element.createElement)(GlobalStylesBlockLink, null), (0, _element.createElement)(GlobalStylesEditorCanvasContainerLink, null));
296
315
  }
297
316
 
298
317
  var _default = GlobalStylesUI;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"names":["SLOT_FILL_NAME","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","GlobalStylesActionMenu","toggle","preferencesStore","canEditCSS","revisionsCount","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","count","useGlobalStylesReset","blockEditorPrivateApis","canReset","onReset","goTo","setEditorCanvasContainerView","editSiteStore","loadCustomCSS","loadRevisions","hasRevisions","moreVertical","title","onClick","isDisabled","GlobalStylesNavigationScreen","className","props","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","name","ContextScreens","blockStyleVariations","getBlockStyles","blocksStore","length","GlobalStylesStyleBook","navigator","path","location","encodeURIComponent","startsWith","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","blockEditorStore","clientId","blockHasGlobalStyles","currentPath","newPath","skipFocus","GlobalStylesUI","blocks","editorCanvasContainerView","getEditorCanvasContainerView","block"],"mappings":";;;;;;;;;AAoBA;;;;AAjBA;;AAOA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAzCA;AACA;AACA;;AAoBA;AACA;AACA;AAmBA,MAAMA,cAAc,GAA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,EAAC;AAAnC,KACC,4BAAC,qBAAD,OADD,CAxCD,EA4CC,4BAAC,4BAAD;AAA8B,IAAA,IAAI,EAAC;AAAnC,KACC,4BAAC,qBAAD,OADD,CA5CD,EAgDC,4BAAC,4BAAD;AAA8B,IAAA,IAAI,EAAC;AAAnC,KACC,4BAAC,kBAAD,OADD,CAhDD,EAoDC,4BAAC,4BAAD;AAA8B,IAAA,IAAI,EAAG;AAArC,KACC,4BAAC,wBAAD,OADD,CApDD,EAwDGF,MAAM,CAAC3B,GAAP,CAAc8B,KAAF,IACb,4BAAC,4BAAD;AACC,IAAA,GAAG,EAAG,gBAAgBA,KAAK,CAAC3B,IAD7B;AAEC,IAAA,IAAI,EAAG,aAAaU,kBAAkB,CAAEiB,KAAK,CAAC3B,IAAR;AAFvC,KAIC,4BAAC,oBAAD;AAAa,IAAA,IAAI,EAAG2B,KAAK,CAAC3B;AAA1B,IAJD,CADC,CAxDH,EAiEC,4BAAC,cAAD,OAjED,EAmEGwB,MAAM,CAAC3B,GAAP,CAAc8B,KAAF,IACb,4BAAC,cAAD;AACC,IAAA,GAAG,EAAG,mBAAmBA,KAAK,CAAC3B,IADhC;AAEC,IAAA,IAAI,EAAG2B,KAAK,CAAC3B,IAFd;AAGC,IAAA,UAAU,EAAG,aAAaU,kBAAkB,CAAEiB,KAAK,CAAC3B,IAAR;AAH7C,IADC,CAnEH,EA2EG,iBAAiByB,yBAAjB,IACD,4BAAC,qBAAD,OA5EF,EA+EC,4BAAC,sBAAD,OA/ED,EAgFC,4BAAC,qBAAD,OAhFD,CADD;AAoFA;;eAEcF,c","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\tcreateSlotFill,\n\tDropdownMenu,\n} from '@wordpress/components';\nimport { getBlockTypes, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ScreenRoot from './screen-root';\nimport {\n\tuseBlockHasGlobalStyles,\n\tdefault as ScreenBlockList,\n} from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenTypographyElement from './screen-typography-element';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport ScreenLayout from './screen-layout';\nimport ScreenStyleVariations from './screen-style-variations';\nimport StyleBook from '../style-book';\nimport ScreenCSS from './screen-css';\nimport ScreenRevisions from './screen-revisions';\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\n\nconst SLOT_FILL_NAME = 'GlobalStylesMenu';\nconst { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { canEditCSS, revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t\trevisionsCount:\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0,\n\t\t};\n\t}, [] );\n\tconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { goTo } = useNavigator();\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst loadCustomCSS = () => goTo( '/css' );\n\tconst loadRevisions = () => {\n\t\tgoTo( '/revisions' );\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t};\n\tconst hasRevisions = revisionsCount >= 2;\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Styles actions' ) }\n\t\t\t\tcontrols={ [\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle: __( 'Reset to defaults' ),\n\t\t\t\t\t\tonClick: onReset,\n\t\t\t\t\t\tisDisabled: ! canReset,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle: __( 'Welcome Guide' ),\n\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\ttoggle( 'core/edit-site', 'welcomeGuideStyles' ),\n\t\t\t\t\t},\n\t\t\t\t\t...( canEditCSS\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: __( 'Additional CSS' ),\n\t\t\t\t\t\t\t\t\tonClick: loadCustomCSS,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: [] ),\n\t\t\t\t\t...( hasRevisions\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %d: number of revisions */\n\t\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t\t'%d Revision',\n\t\t\t\t\t\t\t\t\t\t\t'%d Revisions',\n\t\t\t\t\t\t\t\t\t\t\trevisionsCount\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\trevisionsCount\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tonClick: loadRevisions,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: [] ),\n\t\t\t\t] }\n\t\t\t/>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ [\n\t\t\t\t'edit-site-global-styles-sidebar__navigator-screen',\n\t\t\t\tclassName,\n\t\t\t]\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction BlockStylesNavigationScreens( {\n\tparentMenu,\n\tblockStyles,\n\tblockName,\n} ) {\n\treturn blockStyles.map( ( style, index ) => (\n\t\t<GlobalStylesNavigationScreen\n\t\t\tkey={ index }\n\t\t\tpath={ parentMenu + '/variations/' + style.name }\n\t\t>\n\t\t\t<ScreenBlock name={ blockName } variation={ style.name } />\n\t\t</GlobalStylesNavigationScreen>\n\t) );\n}\n\nfunction ContextScreens( { name, parentMenu = '' } ) {\n\tconst blockStyleVariations = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/palette' }\n\t\t\t>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ !! blockStyleVariations?.length && (\n\t\t\t\t<BlockStylesNavigationScreens\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\tblockStyles={ blockStyleVariations }\n\t\t\t\t\tblockName={ name }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction GlobalStylesStyleBook() {\n\tconst navigator = useNavigator();\n\tconst { path } = navigator.location;\n\treturn (\n\t\t<StyleBook\n\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\tpath === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\tpath.startsWith(\n\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t)\n\t\t\t}\n\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t// Now go to the selected block.\n\t\t\t\tnavigator.goTo( '/blocks/' + encodeURIComponent( blockName ) );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction GlobalStylesBlockLink() {\n\tconst navigator = useNavigator();\n\tconst { selectedBlockName, selectedBlockClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSelectedBlockClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\tselectedBlockName: getBlockName( clientId ),\n\t\t\t\tselectedBlockClientId: clientId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst blockHasGlobalStyles = useBlockHasGlobalStyles( selectedBlockName );\n\t// When we're in the `Blocks` screen enable deep linking to the selected block.\n\tuseEffect( () => {\n\t\tif ( ! selectedBlockClientId || ! blockHasGlobalStyles ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentPath = navigator.location.path;\n\t\tif (\n\t\t\tcurrentPath !== '/blocks' &&\n\t\t\t! currentPath.startsWith( '/blocks/' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst newPath = '/blocks/' + encodeURIComponent( selectedBlockName );\n\t\t// Avoid navigating to the same path. This can happen when selecting\n\t\t// a new block of the same type.\n\t\tif ( newPath !== currentPath ) {\n\t\t\tnavigator.goTo( newPath, { skipFocus: true } );\n\t\t}\n\t}, [ selectedBlockClientId, selectedBlockName, blockHasGlobalStyles ] );\n}\n\nfunction GlobalStylesUI() {\n\tconst blocks = getBlockTypes();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\treturn (\n\t\t<NavigatorProvider\n\t\t\tclassName=\"edit-site-global-styles-sidebar__navigator-provider\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<GlobalStylesNavigationScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/variations\">\n\t\t\t\t<ScreenStyleVariations />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography\">\n\t\t\t\t<ScreenTypography />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/text\">\n\t\t\t\t<ScreenTypographyElement element=\"text\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/link\">\n\t\t\t\t<ScreenTypographyElement element=\"link\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/heading\">\n\t\t\t\t<ScreenTypographyElement element=\"heading\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/caption\">\n\t\t\t\t<ScreenTypographyElement element=\"caption\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/button\">\n\t\t\t\t<ScreenTypographyElement element=\"button\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/colors\">\n\t\t\t\t<ScreenColors />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/layout\">\n\t\t\t\t<ScreenLayout />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/css\">\n\t\t\t\t<ScreenCSS />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path={ '/revisions' }>\n\t\t\t\t<ScreenRevisions />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\t\tkey={ 'menu-block-' + block.name }\n\t\t\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ block.name } />\n\t\t\t\t</GlobalStylesNavigationScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<ContextScreens\n\t\t\t\t\tkey={ 'screens-block-' + block.name }\n\t\t\t\t\tname={ block.name }\n\t\t\t\t\tparentMenu={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t/>\n\t\t\t) ) }\n\n\t\t\t{ 'style-book' === editorCanvasContainerView && (\n\t\t\t\t<GlobalStylesStyleBook />\n\t\t\t) }\n\n\t\t\t<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t</NavigatorProvider>\n\t);\n}\nexport { GlobalStylesMenuSlot };\nexport default GlobalStylesUI;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"names":["SLOT_FILL_NAME","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","GlobalStylesActionMenu","toggle","preferencesStore","canEditCSS","revisionsCount","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","count","useGlobalStylesReset","blockEditorPrivateApis","canReset","onReset","goTo","setEditorCanvasContainerView","editSiteStore","loadCustomCSS","loadRevisions","hasRevisions","moreVertical","title","onClick","isDisabled","GlobalStylesNavigationScreen","className","props","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","name","ContextScreens","blockStyleVariations","getBlockStyles","blocksStore","length","GlobalStylesStyleBook","navigator","path","location","encodeURIComponent","startsWith","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","blockEditorStore","clientId","blockHasGlobalStyles","currentPath","newPath","skipFocus","GlobalStylesEditorCanvasContainerLink","editorCanvasContainerView","getEditorCanvasContainerView","GlobalStylesUI","blocks","block"],"mappings":";;;;;;;;;AAoBA;;;;AAjBA;;AAOA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAzCA;AACA;AACA;;AAoBA;AACA;AACA;AAmBA,MAAMA,cAAc,GAAG,kBAAvB;AACA,MAAM;AAAEC,EAAAA,IAAI,EAAEC,oBAAR;AAA8BC,EAAAA,IAAI,EAAEC;AAApC,IACL,gCAAgBJ,cAAhB,CADD;;;AAGA,SAASK,sBAAT,GAAkC;AACjC,QAAM;AAAEC,IAAAA;AAAF,MAAa,uBAAaC,kBAAb,CAAnB;AACA,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MAAiC,qBAAaC,MAAF,IAAc;AAAA;;AAC/D,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA;AAAnB,QACLF,MAAM,CAAEG,eAAF,CADP;;AAGA,UAAMC,cAAc,GAAGF,sCAAsC,EAA7D;;AACA,UAAMG,YAAY,GAAGD,cAAc,GAChCH,eAAe,CAAE,MAAF,EAAU,cAAV,EAA0BG,cAA1B,CADiB,GAEhCE,SAFH;AAIA,WAAO;AACNR,MAAAA,UAAU,2BACT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,OADD,CA5CD,EAgDC,4BAAC,4BAAD;AAA8B,IAAA,IAAI,EAAC;AAAnC,KACC,4BAAC,kBAAD,OADD,CAhDD,EAoDC,4BAAC,4BAAD;AAA8B,IAAA,IAAI,EAAG;AAArC,KACC,4BAAC,wBAAD,OADD,CApDD,EAwDGE,MAAM,CAAC9B,GAAP,CAAc+B,KAAF,IACb,4BAAC,4BAAD;AACC,IAAA,GAAG,EAAG,gBAAgBA,KAAK,CAAC5B,IAD7B;AAEC,IAAA,IAAI,EAAG,aAAaU,kBAAkB,CAAEkB,KAAK,CAAC5B,IAAR;AAFvC,KAIC,4BAAC,oBAAD;AAAa,IAAA,IAAI,EAAG4B,KAAK,CAAC5B;AAA1B,IAJD,CADC,CAxDH,EAiEC,4BAAC,cAAD,OAjED,EAmEG2B,MAAM,CAAC9B,GAAP,CAAc+B,KAAF,IACb,4BAAC,cAAD;AACC,IAAA,GAAG,EAAG,mBAAmBA,KAAK,CAAC5B,IADhC;AAEC,IAAA,IAAI,EAAG4B,KAAK,CAAC5B,IAFd;AAGC,IAAA,UAAU,EAAG,aAAaU,kBAAkB,CAAEkB,KAAK,CAAC5B,IAAR;AAH7C,IADC,CAnEH,EA2EG,iBAAiBwB,yBAAjB,IACD,4BAAC,qBAAD,OA5EF,EA+EC,4BAAC,sBAAD,OA/ED,EAgFC,4BAAC,qBAAD,OAhFD,EAiFC,4BAAC,qCAAD,OAjFD,CADD;AAqFA;;eAEcE,c","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\tcreateSlotFill,\n\tDropdownMenu,\n} from '@wordpress/components';\nimport { getBlockTypes, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ScreenRoot from './screen-root';\nimport {\n\tuseBlockHasGlobalStyles,\n\tdefault as ScreenBlockList,\n} from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenTypographyElement from './screen-typography-element';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport ScreenLayout from './screen-layout';\nimport ScreenStyleVariations from './screen-style-variations';\nimport StyleBook from '../style-book';\nimport ScreenCSS from './screen-css';\nimport ScreenRevisions from './screen-revisions';\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\n\nconst SLOT_FILL_NAME = 'GlobalStylesMenu';\nconst { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { canEditCSS, revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t\trevisionsCount:\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0,\n\t\t};\n\t}, [] );\n\tconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { goTo } = useNavigator();\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst loadCustomCSS = () => goTo( '/css' );\n\tconst loadRevisions = () => {\n\t\tgoTo( '/revisions' );\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t};\n\tconst hasRevisions = revisionsCount >= 2;\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Styles actions' ) }\n\t\t\t\tcontrols={ [\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle: __( 'Reset to defaults' ),\n\t\t\t\t\t\tonClick: onReset,\n\t\t\t\t\t\tisDisabled: ! canReset,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle: __( 'Welcome Guide' ),\n\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\ttoggle( 'core/edit-site', 'welcomeGuideStyles' ),\n\t\t\t\t\t},\n\t\t\t\t\t...( canEditCSS\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: __( 'Additional CSS' ),\n\t\t\t\t\t\t\t\t\tonClick: loadCustomCSS,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: [] ),\n\t\t\t\t\t...( hasRevisions\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %d: number of revisions */\n\t\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t\t'%d Revision',\n\t\t\t\t\t\t\t\t\t\t\t'%d Revisions',\n\t\t\t\t\t\t\t\t\t\t\trevisionsCount\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\trevisionsCount\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tonClick: loadRevisions,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: [] ),\n\t\t\t\t] }\n\t\t\t/>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ [\n\t\t\t\t'edit-site-global-styles-sidebar__navigator-screen',\n\t\t\t\tclassName,\n\t\t\t]\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction BlockStylesNavigationScreens( {\n\tparentMenu,\n\tblockStyles,\n\tblockName,\n} ) {\n\treturn blockStyles.map( ( style, index ) => (\n\t\t<GlobalStylesNavigationScreen\n\t\t\tkey={ index }\n\t\t\tpath={ parentMenu + '/variations/' + style.name }\n\t\t>\n\t\t\t<ScreenBlock name={ blockName } variation={ style.name } />\n\t\t</GlobalStylesNavigationScreen>\n\t) );\n}\n\nfunction ContextScreens( { name, parentMenu = '' } ) {\n\tconst blockStyleVariations = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/palette' }\n\t\t\t>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ !! blockStyleVariations?.length && (\n\t\t\t\t<BlockStylesNavigationScreens\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\tblockStyles={ blockStyleVariations }\n\t\t\t\t\tblockName={ name }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction GlobalStylesStyleBook() {\n\tconst navigator = useNavigator();\n\tconst { path } = navigator.location;\n\treturn (\n\t\t<StyleBook\n\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\tpath === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\tpath.startsWith(\n\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t)\n\t\t\t}\n\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t// Now go to the selected block.\n\t\t\t\tnavigator.goTo( '/blocks/' + encodeURIComponent( blockName ) );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction GlobalStylesBlockLink() {\n\tconst navigator = useNavigator();\n\tconst { selectedBlockName, selectedBlockClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSelectedBlockClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\tselectedBlockName: getBlockName( clientId ),\n\t\t\t\tselectedBlockClientId: clientId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst blockHasGlobalStyles = useBlockHasGlobalStyles( selectedBlockName );\n\t// When we're in the `Blocks` screen enable deep linking to the selected block.\n\tuseEffect( () => {\n\t\tif ( ! selectedBlockClientId || ! blockHasGlobalStyles ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentPath = navigator.location.path;\n\t\tif (\n\t\t\tcurrentPath !== '/blocks' &&\n\t\t\t! currentPath.startsWith( '/blocks/' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst newPath = '/blocks/' + encodeURIComponent( selectedBlockName );\n\t\t// Avoid navigating to the same path. This can happen when selecting\n\t\t// a new block of the same type.\n\t\tif ( newPath !== currentPath ) {\n\t\t\tnavigator.goTo( newPath, { skipFocus: true } );\n\t\t}\n\t}, [ selectedBlockClientId, selectedBlockName, blockHasGlobalStyles ] );\n}\n\nfunction GlobalStylesEditorCanvasContainerLink() {\n\tconst { goTo, location } = useNavigator();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\n\t// If the user switches the editor canvas container view, redirect\n\t// to the appropriate screen. This effectively allows deep linking to the\n\t// desired screens from outside the global styles navigation provider.\n\tuseEffect( () => {\n\t\tif ( editorCanvasContainerView === 'global-styles-revisions' ) {\n\t\t\t// Switching to the revisions container view should\n\t\t\t// redirect to the revisions screen.\n\t\t\tgoTo( '/revisions' );\n\t\t} else if (\n\t\t\t!! editorCanvasContainerView &&\n\t\t\tlocation?.path === '/revisions'\n\t\t) {\n\t\t\t// Switching to any container other than revisions should\n\t\t\t// redirect from the revisions screen to the root global styles screen.\n\t\t\tgoTo( '/' );\n\t\t}\n\t}, [ editorCanvasContainerView, location?.path, goTo ] );\n}\n\nfunction GlobalStylesUI() {\n\tconst blocks = getBlockTypes();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\treturn (\n\t\t<NavigatorProvider\n\t\t\tclassName=\"edit-site-global-styles-sidebar__navigator-provider\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<GlobalStylesNavigationScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/variations\">\n\t\t\t\t<ScreenStyleVariations />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography\">\n\t\t\t\t<ScreenTypography />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/text\">\n\t\t\t\t<ScreenTypographyElement element=\"text\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/link\">\n\t\t\t\t<ScreenTypographyElement element=\"link\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/heading\">\n\t\t\t\t<ScreenTypographyElement element=\"heading\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/caption\">\n\t\t\t\t<ScreenTypographyElement element=\"caption\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/button\">\n\t\t\t\t<ScreenTypographyElement element=\"button\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/colors\">\n\t\t\t\t<ScreenColors />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/layout\">\n\t\t\t\t<ScreenLayout />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/css\">\n\t\t\t\t<ScreenCSS />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path={ '/revisions' }>\n\t\t\t\t<ScreenRevisions />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\t\tkey={ 'menu-block-' + block.name }\n\t\t\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ block.name } />\n\t\t\t\t</GlobalStylesNavigationScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<ContextScreens\n\t\t\t\t\tkey={ 'screens-block-' + block.name }\n\t\t\t\t\tname={ block.name }\n\t\t\t\t\tparentMenu={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t/>\n\t\t\t) ) }\n\n\t\t\t{ 'style-book' === editorCanvasContainerView && (\n\t\t\t\t<GlobalStylesStyleBook />\n\t\t\t) }\n\n\t\t\t<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t\t<GlobalStylesEditorCanvasContainerLink />\n\t\t</NavigatorProvider>\n\t);\n}\nexport { GlobalStylesMenuSlot };\nexport default GlobalStylesUI;\n"]}
@@ -24,7 +24,7 @@ var _navigationButton = require("./navigation-button");
24
24
  * Internal dependencies
25
25
  */
26
26
  function getCoreBlockStyles(blockStyles) {
27
- return blockStyles === null || blockStyles === void 0 ? void 0 : blockStyles.filter(style => style.source === 'block');
27
+ return blockStyles?.filter(style => style.source === 'block');
28
28
  }
29
29
 
30
30
  function useBlockVariations(name) {
@@ -38,16 +38,15 @@ function useBlockVariations(name) {
38
38
  return coreBlockStyles;
39
39
  }
40
40
 
41
- function VariationsPanel(_ref) {
42
- let {
43
- name
44
- } = _ref;
41
+ function VariationsPanel({
42
+ name
43
+ }) {
45
44
  const coreBlockStyles = useBlockVariations(name);
46
45
  return (0, _element.createElement)(_components.__experimentalItemGroup, {
47
46
  isBordered: true,
48
47
  isSeparated: true
49
48
  }, coreBlockStyles.map((style, index) => {
50
- if (style !== null && style !== void 0 && style.isDefault) {
49
+ if (style?.isDefault) {
51
50
  return null;
52
51
  }
53
52
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/variations-panel.js"],"names":["getCoreBlockStyles","blockStyles","filter","style","source","useBlockVariations","name","select","getBlockStyles","blocksStore","coreBlockStyles","VariationsPanel","map","index","isDefault","encodeURIComponent","label"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAIA,SAASA,kBAAT,CAA6BC,WAA7B,EAA2C;AAC1C,SAAOA,WAAP,aAAOA,WAAP,uBAAOA,WAAW,CAAEC,MAAb,CAAuBC,KAAF,IAAaA,KAAK,CAACC,MAAN,KAAiB,OAAnD,CAAP;AACA;;AAEM,SAASC,kBAAT,CAA6BC,IAA7B,EAAoC;AAC1C,QAAML,WAAW,GAAG,qBACjBM,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAqBD,MAAM,CAAEE,aAAF,CAAjC;AACA,WAAOD,cAAc,CAAEF,IAAF,CAArB;AACA,GAJkB,EAKnB,CAAEA,IAAF,CALmB,CAApB;AAOA,QAAMI,eAAe,GAAGV,kBAAkB,CAAEC,WAAF,CAA1C;AACA,SAAOS,eAAP;AACA;;AAEM,SAASC,eAAT,OAAqC;AAAA,MAAX;AAAEL,IAAAA;AAAF,GAAW;AAC3C,QAAMI,eAAe,GAAGL,kBAAkB,CAAEC,IAAF,CAA1C;AAEA,SACC,4BAAC,mCAAD;AAAW,IAAA,UAAU,MAArB;AAAsB,IAAA,WAAW;AAAjC,KACGI,eAAe,CAACE,GAAhB,CAAqB,CAAET,KAAF,EAASU,KAAT,KAAoB;AAC1C,QAAKV,KAAL,aAAKA,KAAL,eAAKA,KAAK,CAAEW,SAAZ,EAAwB;AACvB,aAAO,IAAP;AACA;;AACD,WACC,4BAAC,wCAAD;AACC,MAAA,GAAG,EAAGD,KADP;AAEC,MAAA,IAAI,EACH,aACAE,kBAAkB,CAAET,IAAF,CADlB,GAEA,cAFA,GAGAS,kBAAkB,CAAEZ,KAAK,CAACG,IAAR,CANpB;AAQC,oBAAaH,KAAK,CAACa;AARpB,OAUGb,KAAK,CAACa,KAVT,CADD;AAcA,GAlBC,CADH,CADD;AAuBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\n/**\n * Internal dependencies\n */\n\nimport { NavigationButtonAsItem } from './navigation-button';\n\nfunction getCoreBlockStyles( blockStyles ) {\n\treturn blockStyles?.filter( ( style ) => style.source === 'block' );\n}\n\nexport function useBlockVariations( name ) {\n\tconst blockStyles = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\tconst coreBlockStyles = getCoreBlockStyles( blockStyles );\n\treturn coreBlockStyles;\n}\n\nexport function VariationsPanel( { name } ) {\n\tconst coreBlockStyles = useBlockVariations( name );\n\n\treturn (\n\t\t<ItemGroup isBordered isSeparated>\n\t\t\t{ coreBlockStyles.map( ( style, index ) => {\n\t\t\t\tif ( style?.isDefault ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tpath={\n\t\t\t\t\t\t\t'/blocks/' +\n\t\t\t\t\t\t\tencodeURIComponent( name ) +\n\t\t\t\t\t\t\t'/variations/' +\n\t\t\t\t\t\t\tencodeURIComponent( style.name )\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-label={ style.label }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ style.label }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ItemGroup>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/variations-panel.js"],"names":["getCoreBlockStyles","blockStyles","filter","style","source","useBlockVariations","name","select","getBlockStyles","blocksStore","coreBlockStyles","VariationsPanel","map","index","isDefault","encodeURIComponent","label"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAIA,SAASA,kBAAT,CAA6BC,WAA7B,EAA2C;AAC1C,SAAOA,WAAW,EAAEC,MAAb,CAAuBC,KAAF,IAAaA,KAAK,CAACC,MAAN,KAAiB,OAAnD,CAAP;AACA;;AAEM,SAASC,kBAAT,CAA6BC,IAA7B,EAAoC;AAC1C,QAAML,WAAW,GAAG,qBACjBM,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAqBD,MAAM,CAAEE,aAAF,CAAjC;AACA,WAAOD,cAAc,CAAEF,IAAF,CAArB;AACA,GAJkB,EAKnB,CAAEA,IAAF,CALmB,CAApB;AAOA,QAAMI,eAAe,GAAGV,kBAAkB,CAAEC,WAAF,CAA1C;AACA,SAAOS,eAAP;AACA;;AAEM,SAASC,eAAT,CAA0B;AAAEL,EAAAA;AAAF,CAA1B,EAAqC;AAC3C,QAAMI,eAAe,GAAGL,kBAAkB,CAAEC,IAAF,CAA1C;AAEA,SACC,4BAAC,mCAAD;AAAW,IAAA,UAAU,MAArB;AAAsB,IAAA,WAAW;AAAjC,KACGI,eAAe,CAACE,GAAhB,CAAqB,CAAET,KAAF,EAASU,KAAT,KAAoB;AAC1C,QAAKV,KAAK,EAAEW,SAAZ,EAAwB;AACvB,aAAO,IAAP;AACA;;AACD,WACC,4BAAC,wCAAD;AACC,MAAA,GAAG,EAAGD,KADP;AAEC,MAAA,IAAI,EACH,aACAE,kBAAkB,CAAET,IAAF,CADlB,GAEA,cAFA,GAGAS,kBAAkB,CAAEZ,KAAK,CAACG,IAAR,CANpB;AAQC,oBAAaH,KAAK,CAACa;AARpB,OAUGb,KAAK,CAACa,KAVT,CADD;AAcA,GAlBC,CADH,CADD;AAuBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\n/**\n * Internal dependencies\n */\n\nimport { NavigationButtonAsItem } from './navigation-button';\n\nfunction getCoreBlockStyles( blockStyles ) {\n\treturn blockStyles?.filter( ( style ) => style.source === 'block' );\n}\n\nexport function useBlockVariations( name ) {\n\tconst blockStyles = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\tconst coreBlockStyles = getCoreBlockStyles( blockStyles );\n\treturn coreBlockStyles;\n}\n\nexport function VariationsPanel( { name } ) {\n\tconst coreBlockStyles = useBlockVariations( name );\n\n\treturn (\n\t\t<ItemGroup isBordered isSeparated>\n\t\t\t{ coreBlockStyles.map( ( style, index ) => {\n\t\t\t\tif ( style?.isDefault ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tpath={\n\t\t\t\t\t\t\t'/blocks/' +\n\t\t\t\t\t\t\tencodeURIComponent( name ) +\n\t\t\t\t\t\t\t'/variations/' +\n\t\t\t\t\t\t\tencodeURIComponent( style.name )\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-label={ style.label }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ style.label }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ItemGroup>\n\t);\n}\n"]}
@@ -9,6 +9,8 @@ exports.default = DocumentActions;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
+
12
14
  var _i18n = require("@wordpress/i18n");
13
15
 
14
16
  var _data = require("@wordpress/data");
@@ -19,11 +21,19 @@ var _blockEditor = require("@wordpress/block-editor");
19
21
 
20
22
  var _commands = require("@wordpress/commands");
21
23
 
24
+ var _icons = require("@wordpress/icons");
25
+
26
+ var _coreData = require("@wordpress/core-data");
27
+
22
28
  var _keycodes = require("@wordpress/keycodes");
23
29
 
24
30
  var _useEditedEntityRecord = _interopRequireDefault(require("../../use-edited-entity-record"));
25
31
 
26
- var _privateApis = require("../../../private-apis");
32
+ var _store = require("../../../store");
33
+
34
+ /**
35
+ * External dependencies
36
+ */
27
37
 
28
38
  /**
29
39
  * WordPress dependencies
@@ -32,25 +42,71 @@ var _privateApis = require("../../../private-apis");
32
42
  /**
33
43
  * Internal dependencies
34
44
  */
35
- const {
36
- store: commandsStore
37
- } = (0, _privateApis.unlock)(_commands.privateApis);
38
-
39
45
  function DocumentActions() {
46
+ const isPage = (0, _data.useSelect)(select => select(_store.store).isPage());
47
+ return isPage ? (0, _element.createElement)(PageDocumentActions, null) : (0, _element.createElement)(TemplateDocumentActions, null);
48
+ }
49
+
50
+ function PageDocumentActions() {
40
51
  const {
41
- open: openCommandCenter
42
- } = (0, _data.useDispatch)(commandsStore);
52
+ hasPageContentLock,
53
+ context
54
+ } = (0, _data.useSelect)(select => ({
55
+ hasPageContentLock: select(_store.store).hasPageContentLock(),
56
+ context: select(_store.store).getEditedPostContext()
57
+ }), []);
58
+ const {
59
+ hasResolved,
60
+ editedRecord
61
+ } = (0, _coreData.useEntityRecord)('postType', context.postType, context.postId);
62
+ const {
63
+ setHasPageContentLock
64
+ } = (0, _data.useDispatch)(_store.store);
65
+ const [hasEditedTemplate, setHasEditedTemplate] = (0, _element.useState)(false);
66
+ const prevHasPageContentLock = (0, _element.useRef)(false);
67
+ (0, _element.useEffect)(() => {
68
+ if (prevHasPageContentLock.current && !hasPageContentLock) {
69
+ setHasEditedTemplate(true);
70
+ }
71
+
72
+ prevHasPageContentLock.current = hasPageContentLock;
73
+ }, [hasPageContentLock]);
74
+
75
+ if (!hasResolved) {
76
+ return null;
77
+ }
78
+
79
+ if (!editedRecord) {
80
+ return (0, _element.createElement)("div", {
81
+ className: "edit-site-document-actions"
82
+ }, (0, _i18n.__)('Document not found'));
83
+ }
84
+
85
+ return hasPageContentLock ? (0, _element.createElement)(BaseDocumentActions, {
86
+ className: (0, _classnames.default)('is-page', {
87
+ 'is-animated': hasEditedTemplate
88
+ }),
89
+ icon: _icons.page
90
+ }, editedRecord.title) : (0, _element.createElement)(TemplateDocumentActions, {
91
+ className: "is-animated",
92
+ onBack: () => setHasPageContentLock(true)
93
+ });
94
+ }
95
+
96
+ function TemplateDocumentActions({
97
+ className,
98
+ onBack
99
+ }) {
43
100
  const {
44
101
  isLoaded,
45
102
  record,
46
103
  getTitle,
47
104
  icon
48
- } = (0, _useEditedEntityRecord.default)(); // Return a simple loading indicator until we have information to show.
105
+ } = (0, _useEditedEntityRecord.default)();
49
106
 
50
107
  if (!isLoaded) {
51
108
  return null;
52
- } // Return feedback that the template does not seem to exist.
53
-
109
+ }
54
110
 
55
111
  if (!record) {
56
112
  return (0, _element.createElement)("div", {
@@ -59,26 +115,49 @@ function DocumentActions() {
59
115
  }
60
116
 
61
117
  const entityLabel = record.type === 'wp_template_part' ? (0, _i18n.__)('template part') : (0, _i18n.__)('template');
62
- return (0, _element.createElement)(_components.Button, {
63
- className: "edit-site-document-actions",
118
+ return (0, _element.createElement)(BaseDocumentActions, {
119
+ className: className,
120
+ icon: icon,
121
+ onBack: onBack
122
+ }, (0, _element.createElement)(_components.VisuallyHidden, {
123
+ as: "span"
124
+ }, (0, _i18n.sprintf)(
125
+ /* translators: %s: the entity being edited, like "template"*/
126
+ (0, _i18n.__)('Editing %s: '), entityLabel)), getTitle());
127
+ }
128
+
129
+ function BaseDocumentActions({
130
+ className,
131
+ icon,
132
+ children,
133
+ onBack
134
+ }) {
135
+ const {
136
+ open: openCommandCenter
137
+ } = (0, _data.useDispatch)(_commands.store);
138
+ return (0, _element.createElement)("div", {
139
+ className: (0, _classnames.default)('edit-site-document-actions', className)
140
+ }, onBack && (0, _element.createElement)(_components.Button, {
141
+ className: "edit-site-document-actions__back",
142
+ icon: _icons.chevronLeftSmall,
143
+ onClick: event => {
144
+ event.stopPropagation();
145
+ onBack();
146
+ }
147
+ }, (0, _i18n.__)('Back')), (0, _element.createElement)(_components.Button, {
148
+ className: "edit-site-document-actions__command",
64
149
  onClick: () => openCommandCenter()
65
- }, (0, _element.createElement)("span", {
66
- className: "edit-site-document-actions__left"
67
- }), (0, _element.createElement)(_components.__experimentalHStack, {
150
+ }, (0, _element.createElement)(_components.__experimentalHStack, {
151
+ className: "edit-site-document-actions__title",
68
152
  spacing: 1,
69
- justify: "center",
70
- className: "edit-site-document-actions__title"
153
+ justify: "center"
71
154
  }, (0, _element.createElement)(_blockEditor.BlockIcon, {
72
155
  icon: icon
73
156
  }), (0, _element.createElement)(_components.__experimentalText, {
74
157
  size: "body",
75
158
  as: "h1"
76
- }, (0, _element.createElement)(_components.VisuallyHidden, {
77
- as: "span"
78
- }, (0, _i18n.sprintf)(
79
- /* translators: %s: the entity being edited, like "template"*/
80
- (0, _i18n.__)('Editing %s: '), entityLabel)), getTitle())), (0, _element.createElement)("span", {
159
+ }, children)), (0, _element.createElement)("span", {
81
160
  className: "edit-site-document-actions__shortcut"
82
- }, _keycodes.displayShortcut.primary('k')));
161
+ }, _keycodes.displayShortcut.primary('k'))));
83
162
  }
84
163
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/header-edit-mode/document-actions/index.js"],"names":["store","commandsStore","commandsPrivateApis","DocumentActions","open","openCommandCenter","isLoaded","record","getTitle","icon","entityLabel","type","displayShortcut","primary"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AAKA;;AACA;;AAnBA;AACA;AACA;;AAaA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA,KAAK,EAAEC;AAAT,IAA2B,yBAAQC,qBAAR,CAAjC;;AAEe,SAASC,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA,IAAI,EAAEC;AAAR,MAA8B,uBAAaJ,aAAb,CAApC;AACA,QAAM;AAAEK,IAAAA,QAAF;AAAYC,IAAAA,MAAZ;AAAoBC,IAAAA,QAApB;AAA8BC,IAAAA;AAA9B,MAAuC,qCAA7C,CAFyC,CAIzC;;AACA,MAAK,CAAEH,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA,GAPwC,CASzC;;;AACA,MAAK,CAAEC,MAAP,EAAgB;AACf,WACC;AAAK,MAAA,SAAS,EAAC;AAAf,OACG,cAAI,oBAAJ,CADH,CADD;AAKA;;AAED,QAAMG,WAAW,GAChBH,MAAM,CAACI,IAAP,KAAgB,kBAAhB,GACG,cAAI,eAAJ,CADH,GAEG,cAAI,UAAJ,CAHJ;AAKA,SACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,OAAO,EAAG,MAAMN,iBAAiB;AAFlC,KAIC;AAAM,IAAA,SAAS,EAAC;AAAhB,IAJD,EAKC,4BAAC,gCAAD;AACC,IAAA,OAAO,EAAG,CADX;AAEC,IAAA,OAAO,EAAC,QAFT;AAGC,IAAA,SAAS,EAAC;AAHX,KAKC,4BAAC,sBAAD;AAAW,IAAA,IAAI,EAAGI;AAAlB,IALD,EAMC,4BAAC,8BAAD;AAAM,IAAA,IAAI,EAAC,MAAX;AAAkB,IAAA,EAAE,EAAC;AAArB,KACC,4BAAC,0BAAD;AAAgB,IAAA,EAAE,EAAC;AAAnB,KACG;AACD;AACA,gBAAI,cAAJ,CAFC,EAGDC,WAHC,CADH,CADD,EAQGF,QAAQ,EARX,CAND,CALD,EAsBC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGI,0BAAgBC,OAAhB,CAAyB,GAAzB,CADH,CAtBD,CADD;AA4BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\tVisuallyHidden,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { privateApis as commandsPrivateApis } from '@wordpress/commands';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport useEditedEntityRecord from '../../use-edited-entity-record';\nimport { unlock } from '../../../private-apis';\n\nconst { store: commandsStore } = unlock( commandsPrivateApis );\n\nexport default function DocumentActions() {\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\tconst { isLoaded, record, getTitle, icon } = useEditedEntityRecord();\n\n\t// Return a simple loading indicator until we have information to show.\n\tif ( ! isLoaded ) {\n\t\treturn null;\n\t}\n\n\t// Return feedback that the template does not seem to exist.\n\tif ( ! record ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Document not found' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst entityLabel =\n\t\trecord.type === 'wp_template_part'\n\t\t\t? __( 'template part' )\n\t\t\t: __( 'template' );\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-site-document-actions\"\n\t\t\tonClick={ () => openCommandCenter() }\n\t\t>\n\t\t\t<span className=\"edit-site-document-actions__left\"></span>\n\t\t\t<HStack\n\t\t\t\tspacing={ 1 }\n\t\t\t\tjustify=\"center\"\n\t\t\t\tclassName=\"edit-site-document-actions__title\"\n\t\t\t>\n\t\t\t\t<BlockIcon icon={ icon } />\n\t\t\t\t<Text size=\"body\" as=\"h1\">\n\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t/* translators: %s: the entity being edited, like \"template\"*/\n\t\t\t\t\t\t\t__( 'Editing %s: ' ),\n\t\t\t\t\t\t\tentityLabel\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t{ getTitle() }\n\t\t\t\t</Text>\n\t\t\t</HStack>\n\t\t\t<span className=\"edit-site-document-actions__shortcut\">\n\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t</span>\n\t\t</Button>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/header-edit-mode/document-actions/index.js"],"names":["DocumentActions","isPage","select","editSiteStore","PageDocumentActions","hasPageContentLock","context","getEditedPostContext","hasResolved","editedRecord","postType","postId","setHasPageContentLock","hasEditedTemplate","setHasEditedTemplate","prevHasPageContentLock","current","pageIcon","title","TemplateDocumentActions","className","onBack","isLoaded","record","getTitle","icon","entityLabel","type","BaseDocumentActions","children","open","openCommandCenter","commandsStore","chevronLeftSmallIcon","event","st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A,IAAb;AAAmBI,EAAAA,QAAnB;AAA6BR,EAAAA;AAA7B,CAA9B,EAAsE;AACrE,QAAM;AAAES,IAAAA,IAAI,EAAEC;AAAR,MAA8B,uBAAaC,eAAb,CAApC;AACA,SACC;AACC,IAAA,SAAS,EAAG,yBAAY,4BAAZ,EAA0CZ,SAA1C;AADb,KAGGC,MAAM,IACP,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,kCADX;AAEC,IAAA,IAAI,EAAGY,uBAFR;AAGC,IAAA,OAAO,EAAKC,KAAF,IAAa;AACtBA,MAAAA,KAAK,CAACC,eAAN;AACAd,MAAAA,MAAM;AACN;AANF,KAQG,cAAI,MAAJ,CARH,CAJF,EAeC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,qCADX;AAEC,IAAA,OAAO,EAAG,MAAMU,iBAAiB;AAFlC,KAIC,4BAAC,gCAAD;AACC,IAAA,SAAS,EAAC,mCADX;AAEC,IAAA,OAAO,EAAG,CAFX;AAGC,IAAA,OAAO,EAAC;AAHT,KAKC,4BAAC,sBAAD;AAAW,IAAA,IAAI,EAAGN;AAAlB,IALD,EAMC,4BAAC,8BAAD;AAAM,IAAA,IAAI,EAAC,MAAX;AAAkB,IAAA,EAAE,EAAC;AAArB,KACGI,QADH,CAND,CAJD,EAcC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGO,0BAAgBC,OAAhB,CAAyB,GAAzB,CADH,CAdD,CAfD,CADD;AAoCA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\tVisuallyHidden,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { store as commandsStore } from '@wordpress/commands';\nimport {\n\tchevronLeftSmall as chevronLeftSmallIcon,\n\tpage as pageIcon,\n} from '@wordpress/icons';\nimport { useEntityRecord } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useState, useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useEditedEntityRecord from '../../use-edited-entity-record';\nimport { store as editSiteStore } from '../../../store';\n\nexport default function DocumentActions() {\n\tconst isPage = useSelect( ( select ) => select( editSiteStore ).isPage() );\n\treturn isPage ? <PageDocumentActions /> : <TemplateDocumentActions />;\n}\n\nfunction PageDocumentActions() {\n\tconst { hasPageContentLock, context } = useSelect(\n\t\t( select ) => ( {\n\t\t\thasPageContentLock: select( editSiteStore ).hasPageContentLock(),\n\t\t\tcontext: select( editSiteStore ).getEditedPostContext(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst { hasResolved, editedRecord } = useEntityRecord(\n\t\t'postType',\n\t\tcontext.postType,\n\t\tcontext.postId\n\t);\n\n\tconst { setHasPageContentLock } = useDispatch( editSiteStore );\n\n\tconst [ hasEditedTemplate, setHasEditedTemplate ] = useState( false );\n\tconst prevHasPageContentLock = useRef( false );\n\tuseEffect( () => {\n\t\tif ( prevHasPageContentLock.current && ! hasPageContentLock ) {\n\t\t\tsetHasEditedTemplate( true );\n\t\t}\n\t\tprevHasPageContentLock.current = hasPageContentLock;\n\t}, [ hasPageContentLock ] );\n\n\tif ( ! hasResolved ) {\n\t\treturn null;\n\t}\n\n\tif ( ! editedRecord ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Document not found' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn hasPageContentLock ? (\n\t\t<BaseDocumentActions\n\t\t\tclassName={ classnames( 'is-page', {\n\t\t\t\t'is-animated': hasEditedTemplate,\n\t\t\t} ) }\n\t\t\ticon={ pageIcon }\n\t\t>\n\t\t\t{ editedRecord.title }\n\t\t</BaseDocumentActions>\n\t) : (\n\t\t<TemplateDocumentActions\n\t\t\tclassName=\"is-animated\"\n\t\t\tonBack={ () => setHasPageContentLock( true ) }\n\t\t/>\n\t);\n}\n\nfunction TemplateDocumentActions( { className, onBack } ) {\n\tconst { isLoaded, record, getTitle, icon } = useEditedEntityRecord();\n\n\tif ( ! isLoaded ) {\n\t\treturn null;\n\t}\n\n\tif ( ! record ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Document not found' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst entityLabel =\n\t\trecord.type === 'wp_template_part'\n\t\t\t? __( 'template part' )\n\t\t\t: __( 'template' );\n\n\treturn (\n\t\t<BaseDocumentActions\n\t\t\tclassName={ className }\n\t\t\ticon={ icon }\n\t\t\tonBack={ onBack }\n\t\t>\n\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t{ sprintf(\n\t\t\t\t\t/* translators: %s: the entity being edited, like \"template\"*/\n\t\t\t\t\t__( 'Editing %s: ' ),\n\t\t\t\t\tentityLabel\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t\t{ getTitle() }\n\t\t</BaseDocumentActions>\n\t);\n}\n\nfunction BaseDocumentActions( { className, icon, children, onBack } ) {\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'edit-site-document-actions', className ) }\n\t\t>\n\t\t\t{ onBack && (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"edit-site-document-actions__back\"\n\t\t\t\t\ticon={ chevronLeftSmallIcon }\n\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tonBack();\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-document-actions__command\"\n\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tclassName=\"edit-site-document-actions__title\"\n\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\tjustify=\"center\"\n\t\t\t\t>\n\t\t\t\t\t<BlockIcon icon={ icon } />\n\t\t\t\t\t<Text size=\"body\" as=\"h1\">\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</Text>\n\t\t\t\t</HStack>\n\t\t\t\t<span className=\"edit-site-document-actions__shortcut\">\n\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t</span>\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n"]}