@wordpress/edit-site 5.11.0 → 5.12.1

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 (1056) hide show
  1. package/CHANGELOG.md +7 -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-pattern/index.js +99 -0
  5. package/build/components/add-new-pattern/index.js.map +1 -0
  6. package/build/components/add-new-template/add-custom-generic-template-modal-content.js +4 -5
  7. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  8. package/build/components/add-new-template/add-custom-template-modal-content.js +27 -44
  9. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  10. package/build/components/add-new-template/index.js +6 -15
  11. package/build/components/add-new-template/index.js.map +1 -1
  12. package/build/components/add-new-template/new-template.js +26 -35
  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/app/index.js +2 -2
  17. package/build/components/app/index.js.map +1 -1
  18. package/build/components/block-editor/back-button.js +6 -6
  19. package/build/components/block-editor/back-button.js.map +1 -1
  20. package/build/components/block-editor/block-inspector-button.js +3 -4
  21. package/build/components/block-editor/block-inspector-button.js.map +1 -1
  22. package/build/components/block-editor/constants.js +9 -0
  23. package/build/components/block-editor/constants.js.map +1 -0
  24. package/build/components/block-editor/editor-canvas.js +14 -15
  25. package/build/components/block-editor/editor-canvas.js.map +1 -1
  26. package/build/components/block-editor/get-block-editor-provider.js +42 -0
  27. package/build/components/block-editor/get-block-editor-provider.js.map +1 -0
  28. package/build/components/block-editor/index.js +6 -129
  29. package/build/components/block-editor/index.js.map +1 -1
  30. package/build/components/block-editor/inserter-media-categories.js +25 -42
  31. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  32. package/build/components/block-editor/providers/default-block-editor-provider.js +58 -0
  33. package/build/components/block-editor/providers/default-block-editor-provider.js.map +1 -0
  34. package/build/components/block-editor/providers/navigation-block-editor-provider.js +117 -0
  35. package/build/components/block-editor/providers/navigation-block-editor-provider.js.map +1 -0
  36. package/build/components/block-editor/resizable-editor.js +6 -7
  37. package/build/components/block-editor/resizable-editor.js.map +1 -1
  38. package/build/components/block-editor/resize-handle.js +5 -7
  39. package/build/components/block-editor/resize-handle.js.map +1 -1
  40. package/build/components/block-editor/site-editor-canvas.js +137 -0
  41. package/build/components/block-editor/site-editor-canvas.js.map +1 -0
  42. package/build/components/block-editor/use-site-editor-settings.js +82 -0
  43. package/build/components/block-editor/use-site-editor-settings.js.map +1 -0
  44. package/build/components/canvas-spinner/index.js +18 -1
  45. package/build/components/canvas-spinner/index.js.map +1 -1
  46. package/build/components/code-editor/code-editor-text-area.js +5 -6
  47. package/build/components/code-editor/code-editor-text-area.js.map +1 -1
  48. package/build/components/create-pattern-modal/index.js +125 -0
  49. package/build/components/create-pattern-modal/index.js.map +1 -0
  50. package/build/components/create-template-part-modal/index.js +73 -33
  51. package/build/components/create-template-part-modal/index.js.map +1 -1
  52. package/build/components/editor/index.js +43 -24
  53. package/build/components/editor/index.js.map +1 -1
  54. package/build/components/editor-canvas-container/index.js +29 -12
  55. package/build/components/editor-canvas-container/index.js.map +1 -1
  56. package/build/components/error-boundary/warning.js +8 -10
  57. package/build/components/error-boundary/warning.js.map +1 -1
  58. package/build/components/global-styles/block-preview-panel.js +7 -10
  59. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  60. package/build/components/global-styles/color-indicator-wrapper.js +7 -9
  61. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  62. package/build/components/global-styles/color-palette-panel.js +5 -6
  63. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  64. package/build/components/global-styles/dimensions-panel.js +3 -5
  65. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  66. package/build/components/global-styles/global-styles-provider.js +20 -26
  67. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  68. package/build/components/global-styles/gradients-palette-panel.js +5 -6
  69. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  70. package/build/components/global-styles/header.js +4 -5
  71. package/build/components/global-styles/header.js.map +1 -1
  72. package/build/components/global-styles/hooks.js +3 -3
  73. package/build/components/global-styles/hooks.js.map +1 -1
  74. package/build/components/global-styles/icon-with-current-color.js +7 -9
  75. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  76. package/build/components/global-styles/navigation-button.js +15 -17
  77. package/build/components/global-styles/navigation-button.js.map +1 -1
  78. package/build/components/global-styles/palette.js +12 -16
  79. package/build/components/global-styles/palette.js.map +1 -1
  80. package/build/components/global-styles/preview.js +43 -53
  81. package/build/components/global-styles/preview.js.map +1 -1
  82. package/build/components/global-styles/root-menu.js +2 -2
  83. package/build/components/global-styles/root-menu.js.map +1 -1
  84. package/build/components/global-styles/screen-block-list.js +6 -9
  85. package/build/components/global-styles/screen-block-list.js.map +1 -1
  86. package/build/components/global-styles/screen-block.js +11 -12
  87. package/build/components/global-styles/screen-block.js.map +1 -1
  88. package/build/components/global-styles/screen-color-palette.js +3 -4
  89. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  90. package/build/components/global-styles/screen-colors.js +2 -2
  91. package/build/components/global-styles/screen-colors.js.map +1 -1
  92. package/build/components/global-styles/screen-css.js +2 -2
  93. package/build/components/global-styles/screen-css.js.map +1 -1
  94. package/build/components/global-styles/screen-layout.js +2 -2
  95. package/build/components/global-styles/screen-layout.js.map +1 -1
  96. package/build/components/global-styles/screen-revisions/index.js +12 -12
  97. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  98. package/build/components/global-styles/screen-revisions/revisions-buttons.js +14 -19
  99. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  100. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +7 -13
  101. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  102. package/build/components/global-styles/screen-root.js +5 -5
  103. package/build/components/global-styles/screen-root.js.map +1 -1
  104. package/build/components/global-styles/screen-typography-element.js +3 -4
  105. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  106. package/build/components/global-styles/screen-typography.js +8 -9
  107. package/build/components/global-styles/screen-typography.js.map +1 -1
  108. package/build/components/global-styles/style-variations-container.js +15 -8
  109. package/build/components/global-styles/style-variations-container.js.map +1 -1
  110. package/build/components/global-styles/subtitle.js +4 -5
  111. package/build/components/global-styles/subtitle.js.map +1 -1
  112. package/build/components/global-styles/typography-panel.js +6 -7
  113. package/build/components/global-styles/typography-panel.js.map +1 -1
  114. package/build/components/global-styles/typography-preview.js +7 -8
  115. package/build/components/global-styles/typography-preview.js.map +1 -1
  116. package/build/components/global-styles/ui.js +123 -50
  117. package/build/components/global-styles/ui.js.map +1 -1
  118. package/build/components/global-styles/variations-panel.js +5 -6
  119. package/build/components/global-styles/variations-panel.js.map +1 -1
  120. package/build/components/global-styles-renderer/index.js +2 -2
  121. package/build/components/global-styles-renderer/index.js.map +1 -1
  122. package/build/components/header-edit-mode/document-actions/index.js +136 -24
  123. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  124. package/build/components/header-edit-mode/index.js +8 -14
  125. package/build/components/header-edit-mode/index.js.map +1 -1
  126. package/build/components/header-edit-mode/more-menu/index.js +49 -53
  127. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  128. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +4 -7
  129. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
  130. package/build/components/header-edit-mode/tools-more-menu-group/index.js +5 -14
  131. package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  132. package/build/components/header-edit-mode/undo-redo/redo.js +2 -6
  133. package/build/components/header-edit-mode/undo-redo/redo.js.map +1 -1
  134. package/build/components/header-edit-mode/undo-redo/undo.js +2 -6
  135. package/build/components/header-edit-mode/undo-redo/undo.js.map +1 -1
  136. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  137. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  138. package/build/components/keyboard-shortcut-help-modal/index.js +42 -51
  139. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  140. package/build/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  141. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  142. package/build/components/keyboard-shortcuts/edit-mode.js +7 -2
  143. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  144. package/build/components/keyboard-shortcuts/index.js +7 -2
  145. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  146. package/build/components/keyboard-shortcuts/register.js +1 -1
  147. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  148. package/build/components/layout/hooks.js +21 -0
  149. package/build/components/layout/hooks.js.map +1 -1
  150. package/build/components/layout/index.js +44 -34
  151. package/build/components/layout/index.js.map +1 -1
  152. package/build/components/list/added-by.js +13 -23
  153. package/build/components/list/added-by.js.map +1 -1
  154. package/build/components/list/header.js +4 -7
  155. package/build/components/list/header.js.map +1 -1
  156. package/build/components/list/index.js +4 -6
  157. package/build/components/list/index.js.map +1 -1
  158. package/build/components/list/table.js +35 -40
  159. package/build/components/list/table.js.map +1 -1
  160. package/build/components/page/header.js +41 -0
  161. package/build/components/page/header.js.map +1 -0
  162. package/build/components/page/index.js +49 -0
  163. package/build/components/page/index.js.map +1 -0
  164. package/build/components/page-actions/delete-page-menu-item.js +70 -0
  165. package/build/components/page-actions/delete-page-menu-item.js.map +1 -0
  166. package/build/components/page-actions/index.js +43 -0
  167. package/build/components/page-actions/index.js.map +1 -0
  168. package/build/components/page-content-focus-manager/back-to-page-notification.js +67 -0
  169. package/build/components/page-content-focus-manager/back-to-page-notification.js.map +1 -0
  170. package/build/components/page-content-focus-manager/constants.js +9 -0
  171. package/build/components/page-content-focus-manager/constants.js.map +1 -0
  172. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +60 -0
  173. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -0
  174. package/build/components/page-content-focus-manager/edit-template-notification.js +121 -0
  175. package/build/components/page-content-focus-manager/edit-template-notification.js.map +1 -0
  176. package/build/components/page-content-focus-manager/index.js +37 -0
  177. package/build/components/page-content-focus-manager/index.js.map +1 -0
  178. package/build/components/page-library/grid-item.js +165 -0
  179. package/build/components/page-library/grid-item.js.map +1 -0
  180. package/build/components/page-library/grid.js +49 -0
  181. package/build/components/page-library/grid.js.map +1 -0
  182. package/build/components/page-library/index.js +61 -0
  183. package/build/components/page-library/index.js.map +1 -0
  184. package/build/components/page-library/no-patterns.js +20 -0
  185. package/build/components/page-library/no-patterns.js.map +1 -0
  186. package/build/components/page-library/patterns-list.js +108 -0
  187. package/build/components/page-library/patterns-list.js.map +1 -0
  188. package/build/components/page-library/search-items.js +172 -0
  189. package/build/components/page-library/search-items.js.map +1 -0
  190. package/build/components/page-library/use-library-settings.js +53 -0
  191. package/build/components/page-library/use-library-settings.js.map +1 -0
  192. package/build/components/page-library/use-patterns.js +194 -0
  193. package/build/components/page-library/use-patterns.js.map +1 -0
  194. package/build/components/page-library/utils.js +30 -0
  195. package/build/components/page-library/utils.js.map +1 -0
  196. package/build/components/page-main/index.js +46 -0
  197. package/build/components/page-main/index.js.map +1 -0
  198. package/build/components/page-templates/index.js +101 -0
  199. package/build/components/page-templates/index.js.map +1 -0
  200. package/build/components/preferences-modal/enable-feature.js +4 -7
  201. package/build/components/preferences-modal/enable-feature.js.map +1 -1
  202. package/build/components/preferences-modal/index.js +4 -5
  203. package/build/components/preferences-modal/index.js.map +1 -1
  204. package/build/components/resizable-frame/index.js +25 -15
  205. package/build/components/resizable-frame/index.js.map +1 -1
  206. package/build/components/revisions/index.js +14 -17
  207. package/build/components/revisions/index.js.map +1 -1
  208. package/build/components/routes/link.js +15 -22
  209. package/build/components/routes/link.js.map +1 -1
  210. package/build/components/routes/use-title.js +3 -7
  211. package/build/components/routes/use-title.js.map +1 -1
  212. package/build/components/save-button/index.js +23 -13
  213. package/build/components/save-button/index.js.map +1 -1
  214. package/build/components/save-hub/index.js +97 -5
  215. package/build/components/save-hub/index.js.map +1 -1
  216. package/build/components/save-panel/index.js +63 -19
  217. package/build/components/save-panel/index.js.map +1 -1
  218. package/build/components/secondary-sidebar/inserter-sidebar.js +4 -8
  219. package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  220. package/build/components/secondary-sidebar/list-view-sidebar.js +51 -9
  221. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  222. package/build/components/sidebar/index.js +14 -8
  223. package/build/components/sidebar/index.js.map +1 -1
  224. package/build/components/sidebar-button/index.js +2 -4
  225. package/build/components/sidebar-button/index.js.map +1 -1
  226. package/build/components/sidebar-edit-mode/default-sidebar.js +11 -12
  227. package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  228. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +22 -8
  229. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  230. package/build/components/sidebar-edit-mode/index.js +13 -10
  231. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  232. package/build/components/sidebar-edit-mode/page-panels/edit-template.js +84 -0
  233. package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -0
  234. package/build/components/sidebar-edit-mode/page-panels/index.js +99 -0
  235. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -0
  236. package/build/components/sidebar-edit-mode/page-panels/page-content.js +35 -0
  237. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -0
  238. package/build/components/sidebar-edit-mode/page-panels/page-status.js +192 -0
  239. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -0
  240. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +45 -0
  241. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -0
  242. package/build/components/sidebar-edit-mode/page-panels/publish-date.js +98 -0
  243. package/build/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -0
  244. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +8 -12
  245. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  246. package/build/components/sidebar-edit-mode/settings-header/index.js +52 -21
  247. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  248. package/build/components/sidebar-edit-mode/sidebar-card/index.js +46 -0
  249. package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -0
  250. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +5 -6
  251. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  252. package/build/components/sidebar-edit-mode/{template-card → template-panel}/index.js +30 -22
  253. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -0
  254. package/build/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +7 -8
  255. 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
  256. package/build/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +12 -16
  257. package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -0
  258. package/build/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +15 -19
  259. package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -0
  260. package/build/components/sidebar-navigation-item/index.js +17 -14
  261. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  262. package/build/components/sidebar-navigation-screen/index.js +38 -20
  263. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  264. package/build/components/sidebar-navigation-screen-details-footer/index.js +36 -0
  265. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -0
  266. package/build/components/sidebar-navigation-screen-details-panel/index.js +58 -0
  267. package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -0
  268. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +22 -0
  269. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -0
  270. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +35 -0
  271. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -0
  272. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +22 -0
  273. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -0
  274. package/build/components/sidebar-navigation-screen-global-styles/index.js +114 -24
  275. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  276. package/build/components/sidebar-navigation-screen-library/category-item.js +48 -0
  277. package/build/components/sidebar-navigation-screen-library/category-item.js.map +1 -0
  278. package/build/components/sidebar-navigation-screen-library/index.js +112 -0
  279. package/build/components/sidebar-navigation-screen-library/index.js.map +1 -0
  280. package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +36 -0
  281. package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +1 -0
  282. package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js +76 -0
  283. package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +1 -0
  284. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js +41 -0
  285. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +1 -0
  286. package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js +40 -0
  287. package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +1 -0
  288. package/build/components/sidebar-navigation-screen-main/index.js +12 -13
  289. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  290. package/build/components/sidebar-navigation-screen-navigation-item/index.js +5 -7
  291. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  292. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +42 -0
  293. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -0
  294. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +41 -0
  295. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -0
  296. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +49 -97
  297. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  298. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +84 -0
  299. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -0
  300. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +71 -0
  301. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -0
  302. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +54 -0
  303. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -0
  304. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +49 -0
  305. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -0
  306. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +163 -0
  307. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -0
  308. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  309. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  310. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +59 -26
  311. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  312. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +75 -31
  313. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  314. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +23 -53
  315. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  316. package/build/components/sidebar-navigation-screen-page/index.js +63 -12
  317. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  318. package/build/components/sidebar-navigation-screen-page/page-details.js +150 -0
  319. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -0
  320. package/build/components/sidebar-navigation-screen-page/status-label.js +111 -0
  321. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -0
  322. package/build/components/sidebar-navigation-screen-pages/index.js +133 -21
  323. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  324. package/build/components/sidebar-navigation-screen-pattern/index.js +66 -0
  325. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -0
  326. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +41 -0
  327. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -0
  328. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +33 -0
  329. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -0
  330. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +40 -0
  331. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -0
  332. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +47 -0
  333. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -0
  334. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +82 -0
  335. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -0
  336. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +80 -0
  337. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -0
  338. package/build/components/sidebar-navigation-screen-template/home-template-details.js +212 -0
  339. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -0
  340. package/build/components/sidebar-navigation-screen-template/index.js +43 -23
  341. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  342. package/build/components/sidebar-navigation-screen-templates/index.js +23 -28
  343. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  344. package/build/components/site-hub/index.js +29 -24
  345. package/build/components/site-hub/index.js.map +1 -1
  346. package/build/components/site-icon/index.js +4 -5
  347. package/build/components/site-icon/index.js.map +1 -1
  348. package/build/components/start-template-options/index.js +15 -21
  349. package/build/components/start-template-options/index.js.map +1 -1
  350. package/build/components/style-book/index.js +45 -50
  351. package/build/components/style-book/index.js.map +1 -1
  352. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +16 -6
  353. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  354. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +4 -4
  355. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  356. package/build/components/sync-state-with-url/use-sync-path-with-url.js +21 -12
  357. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  358. package/build/components/table/index.js +29 -0
  359. package/build/components/table/index.js.map +1 -0
  360. package/build/components/{list/actions → template-actions}/index.js +34 -31
  361. package/build/components/template-actions/index.js.map +1 -0
  362. package/build/components/{list/actions → template-actions}/rename-menu-item.js +4 -5
  363. package/build/components/template-actions/rename-menu-item.js.map +1 -0
  364. package/build/components/template-part-converter/convert-to-regular.js +4 -5
  365. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  366. package/build/components/template-part-converter/convert-to-template-part.js +7 -27
  367. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  368. package/build/components/template-part-converter/index.js +12 -18
  369. package/build/components/template-part-converter/index.js.map +1 -1
  370. package/build/components/welcome-guide/editor.js +1 -1
  371. package/build/components/welcome-guide/editor.js.map +1 -1
  372. package/build/components/welcome-guide/image.js +4 -5
  373. package/build/components/welcome-guide/image.js.map +1 -1
  374. package/build/components/welcome-guide/styles.js +4 -3
  375. package/build/components/welcome-guide/styles.js.map +1 -1
  376. package/build/hooks/commands/use-common-commands.js +190 -0
  377. package/build/hooks/commands/use-common-commands.js.map +1 -0
  378. package/build/hooks/commands/use-edit-mode-commands.js +71 -29
  379. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  380. package/build/hooks/index.js +2 -0
  381. package/build/hooks/index.js.map +1 -1
  382. package/build/hooks/navigation-menu-edit.js +95 -0
  383. package/build/hooks/navigation-menu-edit.js.map +1 -0
  384. package/build/hooks/push-changes-to-global-styles/index.js +15 -10
  385. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  386. package/build/hooks/template-part-edit.js +11 -15
  387. package/build/hooks/template-part-edit.js.map +1 -1
  388. package/build/index.js +3 -6
  389. package/build/index.js.map +1 -1
  390. package/build/{private-apis.js → lock-unlock.js} +1 -1
  391. package/build/lock-unlock.js.map +1 -0
  392. package/build/store/actions.js +165 -125
  393. package/build/store/actions.js.map +1 -1
  394. package/build/store/index.js +3 -3
  395. package/build/store/index.js.map +1 -1
  396. package/build/store/private-actions.js +7 -10
  397. package/build/store/private-actions.js.map +1 -1
  398. package/build/store/reducer.js +33 -33
  399. package/build/store/reducer.js.map +1 -1
  400. package/build/store/selectors.js +70 -22
  401. package/build/store/selectors.js.map +1 -1
  402. package/build/store/utils.js +1 -3
  403. package/build/store/utils.js.map +1 -1
  404. package/build/utils/get-is-list-page.js +13 -7
  405. package/build/utils/get-is-list-page.js.map +1 -1
  406. package/build/utils/is-previewing-theme.js +2 -4
  407. package/build/utils/is-previewing-theme.js.map +1 -1
  408. package/build/utils/is-template-revertable.js +1 -1
  409. package/build/utils/is-template-revertable.js.map +1 -1
  410. package/build/utils/use-activate-theme.js +3 -3
  411. package/build/utils/use-activate-theme.js.map +1 -1
  412. package/build/utils/use-debounced-input.js +26 -0
  413. package/build/utils/use-debounced-input.js.map +1 -0
  414. package/build-module/components/add-new-page/index.js +93 -0
  415. package/build-module/components/add-new-page/index.js.map +1 -0
  416. package/build-module/components/add-new-pattern/index.js +82 -0
  417. package/build-module/components/add-new-pattern/index.js.map +1 -0
  418. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +4 -5
  419. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  420. package/build-module/components/add-new-template/add-custom-template-modal-content.js +25 -41
  421. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  422. package/build-module/components/add-new-template/index.js +6 -13
  423. package/build-module/components/add-new-template/index.js.map +1 -1
  424. package/build-module/components/add-new-template/new-template.js +22 -31
  425. package/build-module/components/add-new-template/new-template.js.map +1 -1
  426. package/build-module/components/add-new-template/utils.js +71 -120
  427. package/build-module/components/add-new-template/utils.js.map +1 -1
  428. package/build-module/components/app/index.js +1 -1
  429. package/build-module/components/app/index.js.map +1 -1
  430. package/build-module/components/block-editor/back-button.js +5 -5
  431. package/build-module/components/block-editor/back-button.js.map +1 -1
  432. package/build-module/components/block-editor/block-inspector-button.js +3 -4
  433. package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
  434. package/build-module/components/block-editor/constants.js +2 -0
  435. package/build-module/components/block-editor/constants.js.map +1 -0
  436. package/build-module/components/block-editor/editor-canvas.js +12 -12
  437. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  438. package/build-module/components/block-editor/get-block-editor-provider.js +31 -0
  439. package/build-module/components/block-editor/get-block-editor-provider.js.map +1 -0
  440. package/build-module/components/block-editor/index.js +9 -125
  441. package/build-module/components/block-editor/index.js.map +1 -1
  442. package/build-module/components/block-editor/inserter-media-categories.js +25 -42
  443. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
  444. package/build-module/components/block-editor/providers/default-block-editor-provider.js +42 -0
  445. package/build-module/components/block-editor/providers/default-block-editor-provider.js.map +1 -0
  446. package/build-module/components/block-editor/providers/navigation-block-editor-provider.js +102 -0
  447. package/build-module/components/block-editor/providers/navigation-block-editor-provider.js.map +1 -0
  448. package/build-module/components/block-editor/resizable-editor.js +6 -7
  449. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  450. package/build-module/components/block-editor/resize-handle.js +5 -7
  451. package/build-module/components/block-editor/resize-handle.js.map +1 -1
  452. package/build-module/components/block-editor/site-editor-canvas.js +115 -0
  453. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -0
  454. package/build-module/components/block-editor/use-site-editor-settings.js +67 -0
  455. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -0
  456. package/build-module/components/canvas-spinner/index.js +15 -1
  457. package/build-module/components/canvas-spinner/index.js.map +1 -1
  458. package/build-module/components/code-editor/code-editor-text-area.js +5 -6
  459. package/build-module/components/code-editor/code-editor-text-area.js.map +1 -1
  460. package/build-module/components/create-pattern-modal/index.js +113 -0
  461. package/build-module/components/create-pattern-modal/index.js.map +1 -0
  462. package/build-module/components/create-template-part-modal/index.js +70 -34
  463. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  464. package/build-module/components/editor/index.js +43 -24
  465. package/build-module/components/editor/index.js.map +1 -1
  466. package/build-module/components/editor-canvas-container/index.js +26 -10
  467. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  468. package/build-module/components/error-boundary/warning.js +8 -10
  469. package/build-module/components/error-boundary/warning.js.map +1 -1
  470. package/build-module/components/global-styles/block-preview-panel.js +7 -10
  471. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  472. package/build-module/components/global-styles/color-indicator-wrapper.js +7 -8
  473. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  474. package/build-module/components/global-styles/color-palette-panel.js +4 -5
  475. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  476. package/build-module/components/global-styles/dimensions-panel.js +2 -4
  477. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  478. package/build-module/components/global-styles/global-styles-provider.js +18 -25
  479. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  480. package/build-module/components/global-styles/gradients-palette-panel.js +4 -5
  481. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  482. package/build-module/components/global-styles/header.js +4 -5
  483. package/build-module/components/global-styles/header.js.map +1 -1
  484. package/build-module/components/global-styles/hooks.js +1 -1
  485. package/build-module/components/global-styles/hooks.js.map +1 -1
  486. package/build-module/components/global-styles/icon-with-current-color.js +7 -8
  487. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  488. package/build-module/components/global-styles/navigation-button.js +15 -14
  489. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  490. package/build-module/components/global-styles/palette.js +11 -15
  491. package/build-module/components/global-styles/palette.js.map +1 -1
  492. package/build-module/components/global-styles/preview.js +42 -52
  493. package/build-module/components/global-styles/preview.js.map +1 -1
  494. package/build-module/components/global-styles/root-menu.js +1 -1
  495. package/build-module/components/global-styles/root-menu.js.map +1 -1
  496. package/build-module/components/global-styles/screen-block-list.js +5 -8
  497. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  498. package/build-module/components/global-styles/screen-block.js +10 -11
  499. package/build-module/components/global-styles/screen-block.js.map +1 -1
  500. package/build-module/components/global-styles/screen-color-palette.js +3 -4
  501. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  502. package/build-module/components/global-styles/screen-colors.js +1 -1
  503. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  504. package/build-module/components/global-styles/screen-css.js +1 -1
  505. package/build-module/components/global-styles/screen-css.js.map +1 -1
  506. package/build-module/components/global-styles/screen-layout.js +1 -1
  507. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  508. package/build-module/components/global-styles/screen-revisions/index.js +9 -9
  509. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  510. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +14 -19
  511. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  512. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +6 -11
  513. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  514. package/build-module/components/global-styles/screen-root.js +4 -4
  515. package/build-module/components/global-styles/screen-root.js.map +1 -1
  516. package/build-module/components/global-styles/screen-typography-element.js +3 -4
  517. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  518. package/build-module/components/global-styles/screen-typography.js +6 -7
  519. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  520. package/build-module/components/global-styles/style-variations-container.js +15 -8
  521. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  522. package/build-module/components/global-styles/subtitle.js +4 -5
  523. package/build-module/components/global-styles/subtitle.js.map +1 -1
  524. package/build-module/components/global-styles/typography-panel.js +5 -6
  525. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  526. package/build-module/components/global-styles/typography-preview.js +6 -7
  527. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  528. package/build-module/components/global-styles/ui.js +123 -50
  529. package/build-module/components/global-styles/ui.js.map +1 -1
  530. package/build-module/components/global-styles/variations-panel.js +5 -6
  531. package/build-module/components/global-styles/variations-panel.js.map +1 -1
  532. package/build-module/components/global-styles-renderer/index.js +1 -1
  533. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  534. package/build-module/components/header-edit-mode/document-actions/index.js +136 -25
  535. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  536. package/build-module/components/header-edit-mode/index.js +6 -12
  537. package/build-module/components/header-edit-mode/index.js.map +1 -1
  538. package/build-module/components/header-edit-mode/more-menu/index.js +49 -53
  539. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  540. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +4 -4
  541. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
  542. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +5 -13
  543. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  544. package/build-module/components/header-edit-mode/undo-redo/redo.js +2 -3
  545. package/build-module/components/header-edit-mode/undo-redo/redo.js.map +1 -1
  546. package/build-module/components/header-edit-mode/undo-redo/undo.js +2 -3
  547. package/build-module/components/header-edit-mode/undo-redo/undo.js.map +1 -1
  548. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  549. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  550. package/build-module/components/keyboard-shortcut-help-modal/index.js +40 -49
  551. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  552. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  553. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  554. package/build-module/components/keyboard-shortcuts/edit-mode.js +7 -2
  555. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  556. package/build-module/components/keyboard-shortcuts/index.js +7 -2
  557. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  558. package/build-module/components/keyboard-shortcuts/register.js +1 -1
  559. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  560. package/build-module/components/layout/hooks.js +21 -0
  561. package/build-module/components/layout/hooks.js.map +1 -1
  562. package/build-module/components/layout/index.js +37 -28
  563. package/build-module/components/layout/index.js.map +1 -1
  564. package/build-module/components/list/added-by.js +13 -23
  565. package/build-module/components/list/added-by.js.map +1 -1
  566. package/build-module/components/list/header.js +4 -7
  567. package/build-module/components/list/header.js.map +1 -1
  568. package/build-module/components/list/index.js +3 -5
  569. package/build-module/components/list/index.js.map +1 -1
  570. package/build-module/components/list/table.js +34 -39
  571. package/build-module/components/list/table.js.map +1 -1
  572. package/build-module/components/page/header.js +33 -0
  573. package/build-module/components/page/header.js.map +1 -0
  574. package/build-module/components/page/index.js +37 -0
  575. package/build-module/components/page/index.js.map +1 -0
  576. package/build-module/components/page-actions/delete-page-menu-item.js +58 -0
  577. package/build-module/components/page-actions/delete-page-menu-item.js.map +1 -0
  578. package/build-module/components/page-actions/index.js +30 -0
  579. package/build-module/components/page-actions/index.js.map +1 -0
  580. package/build-module/components/page-content-focus-manager/back-to-page-notification.js +53 -0
  581. package/build-module/components/page-content-focus-manager/back-to-page-notification.js.map +1 -0
  582. package/build-module/components/page-content-focus-manager/constants.js +2 -0
  583. package/build-module/components/page-content-focus-manager/constants.js.map +1 -0
  584. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +45 -0
  585. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -0
  586. package/build-module/components/page-content-focus-manager/edit-template-notification.js +110 -0
  587. package/build-module/components/page-content-focus-manager/edit-template-notification.js.map +1 -0
  588. package/build-module/components/page-content-focus-manager/index.js +23 -0
  589. package/build-module/components/page-content-focus-manager/index.js.map +1 -0
  590. package/build-module/components/page-library/grid-item.js +145 -0
  591. package/build-module/components/page-library/grid-item.js.map +1 -0
  592. package/build-module/components/page-library/grid.js +38 -0
  593. package/build-module/components/page-library/grid.js.map +1 -0
  594. package/build-module/components/page-library/index.js +43 -0
  595. package/build-module/components/page-library/index.js.map +1 -0
  596. package/build-module/components/page-library/no-patterns.js +12 -0
  597. package/build-module/components/page-library/no-patterns.js.map +1 -0
  598. package/build-module/components/page-library/patterns-list.js +87 -0
  599. package/build-module/components/page-library/patterns-list.js.map +1 -0
  600. package/build-module/components/page-library/search-items.js +156 -0
  601. package/build-module/components/page-library/search-items.js.map +1 -0
  602. package/build-module/components/page-library/use-library-settings.js +40 -0
  603. package/build-module/components/page-library/use-library-settings.js.map +1 -0
  604. package/build-module/components/page-library/use-patterns.js +176 -0
  605. package/build-module/components/page-library/use-patterns.js.map +1 -0
  606. package/build-module/components/page-library/utils.js +13 -0
  607. package/build-module/components/page-library/utils.js.map +1 -0
  608. package/build-module/components/page-main/index.js +32 -0
  609. package/build-module/components/page-main/index.js.map +1 -0
  610. package/build-module/components/page-templates/index.js +80 -0
  611. package/build-module/components/page-templates/index.js.map +1 -0
  612. package/build-module/components/preferences-modal/enable-feature.js +4 -4
  613. package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
  614. package/build-module/components/preferences-modal/index.js +4 -5
  615. package/build-module/components/preferences-modal/index.js.map +1 -1
  616. package/build-module/components/resizable-frame/index.js +24 -14
  617. package/build-module/components/resizable-frame/index.js.map +1 -1
  618. package/build-module/components/revisions/index.js +12 -14
  619. package/build-module/components/revisions/index.js.map +1 -1
  620. package/build-module/components/routes/link.js +14 -18
  621. package/build-module/components/routes/link.js.map +1 -1
  622. package/build-module/components/routes/use-title.js +2 -6
  623. package/build-module/components/routes/use-title.js.map +1 -1
  624. package/build-module/components/save-button/index.js +23 -13
  625. package/build-module/components/save-button/index.js.map +1 -1
  626. package/build-module/components/save-hub/index.js +95 -8
  627. package/build-module/components/save-hub/index.js.map +1 -1
  628. package/build-module/components/save-panel/index.js +62 -20
  629. package/build-module/components/save-panel/index.js.map +1 -1
  630. package/build-module/components/secondary-sidebar/inserter-sidebar.js +4 -5
  631. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  632. package/build-module/components/secondary-sidebar/list-view-sidebar.js +48 -8
  633. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  634. package/build-module/components/sidebar/index.js +11 -7
  635. package/build-module/components/sidebar/index.js.map +1 -1
  636. package/build-module/components/sidebar-button/index.js +2 -3
  637. package/build-module/components/sidebar-button/index.js.map +1 -1
  638. package/build-module/components/sidebar-edit-mode/default-sidebar.js +11 -12
  639. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  640. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +19 -6
  641. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  642. package/build-module/components/sidebar-edit-mode/index.js +14 -11
  643. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  644. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +71 -0
  645. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -0
  646. package/build-module/components/sidebar-edit-mode/page-panels/index.js +78 -0
  647. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -0
  648. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +23 -0
  649. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -0
  650. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +176 -0
  651. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -0
  652. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +33 -0
  653. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -0
  654. package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js +85 -0
  655. package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -0
  656. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +8 -9
  657. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  658. package/build-module/components/sidebar-edit-mode/settings-header/index.js +50 -23
  659. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  660. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +35 -0
  661. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -0
  662. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +4 -5
  663. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  664. package/build-module/components/sidebar-edit-mode/template-panel/index.js +72 -0
  665. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -0
  666. package/build-module/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +7 -8
  667. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -0
  668. package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +12 -16
  669. package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -0
  670. package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +15 -19
  671. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -0
  672. package/build-module/components/sidebar-navigation-item/index.js +17 -14
  673. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  674. package/build-module/components/sidebar-navigation-screen/index.js +39 -21
  675. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  676. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +27 -0
  677. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -0
  678. package/build-module/components/sidebar-navigation-screen-details-panel/index.js +30 -0
  679. package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -0
  680. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +14 -0
  681. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -0
  682. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +24 -0
  683. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -0
  684. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +14 -0
  685. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -0
  686. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +112 -21
  687. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  688. package/build-module/components/sidebar-navigation-screen-library/category-item.js +37 -0
  689. package/build-module/components/sidebar-navigation-screen-library/category-item.js.map +1 -0
  690. package/build-module/components/sidebar-navigation-screen-library/index.js +87 -0
  691. package/build-module/components/sidebar-navigation-screen-library/index.js.map +1 -0
  692. package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +25 -0
  693. package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +1 -0
  694. package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js +61 -0
  695. package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +1 -0
  696. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js +34 -0
  697. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +1 -0
  698. package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js +27 -0
  699. package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +1 -0
  700. package/build-module/components/sidebar-navigation-screen-main/index.js +13 -13
  701. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  702. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +4 -6
  703. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  704. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +33 -0
  705. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -0
  706. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +26 -0
  707. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -0
  708. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +47 -95
  709. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  710. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +70 -0
  711. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -0
  712. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +58 -0
  713. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -0
  714. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +46 -0
  715. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -0
  716. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +35 -0
  717. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -0
  718. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +151 -0
  719. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -0
  720. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  721. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  722. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +58 -26
  723. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  724. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +73 -28
  725. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  726. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +24 -53
  727. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  728. package/build-module/components/sidebar-navigation-screen-page/index.js +59 -14
  729. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  730. package/build-module/components/sidebar-navigation-screen-page/page-details.js +131 -0
  731. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -0
  732. package/build-module/components/sidebar-navigation-screen-page/status-label.js +98 -0
  733. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -0
  734. package/build-module/components/sidebar-navigation-screen-pages/index.js +130 -22
  735. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  736. package/build-module/components/sidebar-navigation-screen-pattern/index.js +46 -0
  737. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -0
  738. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +28 -0
  739. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -0
  740. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +22 -0
  741. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -0
  742. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +27 -0
  743. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -0
  744. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +34 -0
  745. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -0
  746. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +71 -0
  747. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -0
  748. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +64 -0
  749. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -0
  750. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +192 -0
  751. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -0
  752. package/build-module/components/sidebar-navigation-screen-template/index.js +40 -23
  753. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  754. package/build-module/components/sidebar-navigation-screen-templates/index.js +23 -27
  755. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  756. package/build-module/components/site-hub/index.js +28 -22
  757. package/build-module/components/site-hub/index.js.map +1 -1
  758. package/build-module/components/site-icon/index.js +4 -5
  759. package/build-module/components/site-icon/index.js.map +1 -1
  760. package/build-module/components/start-template-options/index.js +15 -21
  761. package/build-module/components/start-template-options/index.js.map +1 -1
  762. package/build-module/components/style-book/index.js +44 -48
  763. package/build-module/components/style-book/index.js.map +1 -1
  764. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +15 -5
  765. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  766. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
  767. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  768. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +20 -11
  769. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  770. package/build-module/components/table/index.js +21 -0
  771. package/build-module/components/table/index.js.map +1 -0
  772. package/build-module/components/{list/actions → template-actions}/index.js +34 -31
  773. package/build-module/components/template-actions/index.js.map +1 -0
  774. package/build-module/components/{list/actions → template-actions}/rename-menu-item.js +4 -5
  775. package/build-module/components/template-actions/rename-menu-item.js.map +1 -0
  776. package/build-module/components/template-part-converter/convert-to-regular.js +4 -5
  777. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  778. package/build-module/components/template-part-converter/convert-to-template-part.js +8 -26
  779. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  780. package/build-module/components/template-part-converter/index.js +12 -18
  781. package/build-module/components/template-part-converter/index.js.map +1 -1
  782. package/build-module/components/welcome-guide/editor.js +1 -1
  783. package/build-module/components/welcome-guide/editor.js.map +1 -1
  784. package/build-module/components/welcome-guide/image.js +4 -5
  785. package/build-module/components/welcome-guide/image.js.map +1 -1
  786. package/build-module/components/welcome-guide/styles.js +5 -3
  787. package/build-module/components/welcome-guide/styles.js.map +1 -1
  788. package/build-module/hooks/commands/use-common-commands.js +172 -0
  789. package/build-module/hooks/commands/use-common-commands.js.map +1 -0
  790. package/build-module/hooks/commands/use-edit-mode-commands.js +72 -30
  791. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  792. package/build-module/hooks/index.js +1 -0
  793. package/build-module/hooks/index.js.map +1 -1
  794. package/build-module/hooks/navigation-menu-edit.js +77 -0
  795. package/build-module/hooks/navigation-menu-edit.js.map +1 -0
  796. package/build-module/hooks/push-changes-to-global-styles/index.js +14 -9
  797. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  798. package/build-module/hooks/template-part-edit.js +10 -11
  799. package/build-module/hooks/template-part-edit.js.map +1 -1
  800. package/build-module/index.js +3 -6
  801. package/build-module/index.js.map +1 -1
  802. package/build-module/{private-apis.js → lock-unlock.js} +1 -1
  803. package/build-module/lock-unlock.js.map +1 -0
  804. package/build-module/store/actions.js +157 -126
  805. package/build-module/store/actions.js.map +1 -1
  806. package/build-module/store/index.js +1 -1
  807. package/build-module/store/index.js.map +1 -1
  808. package/build-module/store/private-actions.js +7 -10
  809. package/build-module/store/private-actions.js.map +1 -1
  810. package/build-module/store/reducer.js +31 -33
  811. package/build-module/store/reducer.js.map +1 -1
  812. package/build-module/store/selectors.js +62 -21
  813. package/build-module/store/selectors.js.map +1 -1
  814. package/build-module/store/utils.js +1 -3
  815. package/build-module/store/utils.js.map +1 -1
  816. package/build-module/utils/get-is-list-page.js +13 -7
  817. package/build-module/utils/get-is-list-page.js.map +1 -1
  818. package/build-module/utils/is-previewing-theme.js +2 -4
  819. package/build-module/utils/is-previewing-theme.js.map +1 -1
  820. package/build-module/utils/is-template-revertable.js +1 -1
  821. package/build-module/utils/is-template-revertable.js.map +1 -1
  822. package/build-module/utils/use-activate-theme.js +2 -2
  823. package/build-module/utils/use-activate-theme.js.map +1 -1
  824. package/build-module/utils/use-debounced-input.js +17 -0
  825. package/build-module/utils/use-debounced-input.js.map +1 -0
  826. package/build-style/style-rtl.css +587 -71
  827. package/build-style/style.css +587 -71
  828. package/package.json +44 -37
  829. package/src/components/add-new-page/index.js +105 -0
  830. package/src/components/add-new-pattern/index.js +94 -0
  831. package/src/components/add-new-template/add-custom-template-modal-content.js +1 -13
  832. package/src/components/add-new-template/index.js +0 -3
  833. package/src/components/add-new-template/new-template.js +3 -3
  834. package/src/components/app/index.js +1 -1
  835. package/src/components/block-editor/back-button.js +5 -2
  836. package/src/components/block-editor/constants.js +1 -0
  837. package/src/components/block-editor/editor-canvas.js +1 -1
  838. package/src/components/block-editor/get-block-editor-provider.js +29 -0
  839. package/src/components/block-editor/index.js +15 -188
  840. package/src/components/block-editor/providers/default-block-editor-provider.js +44 -0
  841. package/src/components/block-editor/providers/navigation-block-editor-provider.js +114 -0
  842. package/src/components/block-editor/site-editor-canvas.js +155 -0
  843. package/src/components/block-editor/style.scss +6 -0
  844. package/src/components/block-editor/use-site-editor-settings.js +91 -0
  845. package/src/components/canvas-spinner/index.js +11 -1
  846. package/src/components/create-pattern-modal/index.js +134 -0
  847. package/src/components/create-pattern-modal/style.scss +3 -0
  848. package/src/components/create-template-part-modal/index.js +63 -3
  849. package/src/components/editor/index.js +32 -17
  850. package/src/components/editor/style.scss +6 -11
  851. package/src/components/editor-canvas-container/index.js +21 -4
  852. package/src/components/global-styles/color-palette-panel.js +1 -1
  853. package/src/components/global-styles/dimensions-panel.js +1 -1
  854. package/src/components/global-styles/global-styles-provider.js +10 -14
  855. package/src/components/global-styles/gradients-palette-panel.js +1 -1
  856. package/src/components/global-styles/hooks.js +1 -1
  857. package/src/components/global-styles/palette.js +2 -2
  858. package/src/components/global-styles/preview.js +1 -1
  859. package/src/components/global-styles/root-menu.js +1 -1
  860. package/src/components/global-styles/screen-block-list.js +1 -1
  861. package/src/components/global-styles/screen-block.js +1 -1
  862. package/src/components/global-styles/screen-colors.js +1 -1
  863. package/src/components/global-styles/screen-css.js +1 -1
  864. package/src/components/global-styles/screen-layout.js +1 -1
  865. package/src/components/global-styles/screen-revisions/index.js +1 -1
  866. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +8 -6
  867. package/src/components/global-styles/screen-root.js +1 -1
  868. package/src/components/global-styles/screen-typography.js +1 -1
  869. package/src/components/global-styles/stories/index.js +1 -1
  870. package/src/components/global-styles/style-variations-container.js +13 -3
  871. package/src/components/global-styles/style.scss +11 -0
  872. package/src/components/global-styles/typography-panel.js +1 -1
  873. package/src/components/global-styles/typography-preview.js +1 -1
  874. package/src/components/global-styles/ui.js +132 -45
  875. package/src/components/global-styles-renderer/index.js +1 -1
  876. package/src/components/header-edit-mode/document-actions/index.js +155 -36
  877. package/src/components/header-edit-mode/document-actions/style.scss +72 -13
  878. package/src/components/header-edit-mode/index.js +4 -4
  879. package/src/components/header-edit-mode/tools-more-menu-group/index.js +1 -6
  880. package/src/components/keyboard-shortcuts/edit-mode.js +5 -1
  881. package/src/components/keyboard-shortcuts/index.js +5 -1
  882. package/src/components/keyboard-shortcuts/register.js +1 -1
  883. package/src/components/layout/hooks.js +21 -0
  884. package/src/components/layout/index.js +92 -70
  885. package/src/components/layout/style.scss +7 -0
  886. package/src/components/list/index.js +1 -1
  887. package/src/components/list/table.js +6 -2
  888. package/src/components/page/header.js +38 -0
  889. package/src/components/page/index.js +38 -0
  890. package/src/components/page/style.scss +38 -0
  891. package/src/components/page-actions/delete-page-menu-item.js +71 -0
  892. package/src/components/page-actions/index.js +36 -0
  893. package/src/components/page-content-focus-manager/back-to-page-notification.js +65 -0
  894. package/src/components/page-content-focus-manager/constants.js +5 -0
  895. package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +52 -0
  896. package/src/components/page-content-focus-manager/edit-template-notification.js +108 -0
  897. package/src/components/page-content-focus-manager/index.js +26 -0
  898. package/src/components/page-library/grid-item.js +179 -0
  899. package/src/components/page-library/grid.js +39 -0
  900. package/src/components/page-library/index.js +39 -0
  901. package/src/components/page-library/no-patterns.js +12 -0
  902. package/src/components/page-library/patterns-list.js +114 -0
  903. package/src/components/page-library/search-items.js +171 -0
  904. package/src/components/page-library/style.scss +105 -0
  905. package/src/components/page-library/use-library-settings.js +51 -0
  906. package/src/components/page-library/use-patterns.js +238 -0
  907. package/src/components/page-library/utils.js +21 -0
  908. package/src/components/page-main/index.js +27 -0
  909. package/src/components/page-templates/index.js +104 -0
  910. package/src/components/resizable-frame/index.js +18 -6
  911. package/src/components/resizable-frame/style.scss +20 -18
  912. package/src/components/revisions/index.js +7 -8
  913. package/src/components/routes/link.js +2 -2
  914. package/src/components/routes/use-title.js +1 -1
  915. package/src/components/save-button/index.js +16 -7
  916. package/src/components/save-hub/index.js +143 -38
  917. package/src/components/save-hub/style.scss +6 -0
  918. package/src/components/save-panel/index.js +63 -16
  919. package/src/components/secondary-sidebar/list-view-sidebar.js +56 -2
  920. package/src/components/sidebar/index.js +13 -7
  921. package/src/components/sidebar/style.scss +3 -4
  922. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +42 -29
  923. package/src/components/sidebar-edit-mode/index.js +16 -14
  924. package/src/components/sidebar-edit-mode/page-panels/edit-template.js +69 -0
  925. package/src/components/sidebar-edit-mode/page-panels/index.js +89 -0
  926. package/src/components/sidebar-edit-mode/page-panels/page-content.js +27 -0
  927. package/src/components/sidebar-edit-mode/page-panels/page-status.js +233 -0
  928. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +35 -0
  929. package/src/components/sidebar-edit-mode/page-panels/publish-date.js +94 -0
  930. package/src/components/sidebar-edit-mode/page-panels/style.scss +41 -0
  931. package/src/components/sidebar-edit-mode/settings-header/index.js +61 -29
  932. package/src/components/sidebar-edit-mode/sidebar-card/index.js +34 -0
  933. package/src/components/sidebar-edit-mode/sidebar-card/style.scss +34 -0
  934. package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -1
  935. package/src/components/sidebar-edit-mode/template-panel/index.js +65 -0
  936. package/src/components/sidebar-edit-mode/{template-card → template-panel}/style.scss +2 -32
  937. package/src/components/sidebar-navigation-item/index.js +6 -2
  938. package/src/components/sidebar-navigation-item/style.scss +7 -0
  939. package/src/components/sidebar-navigation-screen/index.js +89 -53
  940. package/src/components/sidebar-navigation-screen/style.scss +66 -5
  941. package/src/components/sidebar-navigation-screen-details-footer/index.js +45 -0
  942. package/src/components/sidebar-navigation-screen-details-footer/style.scss +5 -0
  943. package/src/components/sidebar-navigation-screen-details-panel/index.js +40 -0
  944. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +14 -0
  945. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +29 -0
  946. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +14 -0
  947. package/src/components/sidebar-navigation-screen-details-panel/style.scss +25 -0
  948. package/src/components/sidebar-navigation-screen-global-styles/index.js +126 -14
  949. package/src/components/sidebar-navigation-screen-global-styles/style.scss +12 -0
  950. package/src/components/sidebar-navigation-screen-library/category-item.js +43 -0
  951. package/src/components/sidebar-navigation-screen-library/index.js +136 -0
  952. package/src/components/sidebar-navigation-screen-library/style.scss +7 -0
  953. package/src/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +32 -0
  954. package/src/components/sidebar-navigation-screen-library/use-pattern-categories.js +64 -0
  955. package/src/components/sidebar-navigation-screen-library/use-template-part-areas.js +33 -0
  956. package/src/components/sidebar-navigation-screen-library/use-theme-patterns.js +44 -0
  957. package/src/components/sidebar-navigation-screen-main/index.js +11 -14
  958. package/src/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
  959. package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +45 -0
  960. package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +24 -0
  961. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +50 -96
  962. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +89 -0
  963. package/src/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +51 -0
  964. package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +51 -0
  965. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +39 -0
  966. package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +15 -0
  967. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +175 -0
  968. package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  969. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +43 -7
  970. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +61 -2
  971. package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +25 -47
  972. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +5 -1
  973. package/src/components/sidebar-navigation-screen-page/index.js +98 -24
  974. package/src/components/sidebar-navigation-screen-page/page-details.js +166 -0
  975. package/src/components/sidebar-navigation-screen-page/status-label.js +105 -0
  976. package/src/components/sidebar-navigation-screen-page/style.scss +63 -0
  977. package/src/components/sidebar-navigation-screen-pages/index.js +181 -44
  978. package/src/components/sidebar-navigation-screen-pattern/index.js +44 -0
  979. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +28 -0
  980. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +21 -0
  981. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +30 -0
  982. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +33 -0
  983. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +71 -0
  984. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +86 -0
  985. package/src/components/sidebar-navigation-screen-template/home-template-details.js +230 -0
  986. package/src/components/sidebar-navigation-screen-template/index.js +44 -27
  987. package/src/components/sidebar-navigation-screen-template/style.scss +23 -0
  988. package/src/components/sidebar-navigation-screen-templates/index.js +19 -26
  989. package/src/components/site-hub/index.js +26 -7
  990. package/src/components/site-hub/style.scss +26 -0
  991. package/src/components/style-book/index.js +1 -1
  992. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +16 -3
  993. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
  994. package/src/components/sync-state-with-url/use-sync-path-with-url.js +11 -1
  995. package/src/components/table/index.js +33 -0
  996. package/src/components/table/style.scss +37 -0
  997. package/src/components/{list/actions → template-actions}/index.js +19 -6
  998. package/src/components/template-part-converter/convert-to-template-part.js +4 -27
  999. package/src/components/welcome-guide/editor.js +1 -1
  1000. package/src/components/welcome-guide/styles.js +5 -3
  1001. package/src/hooks/commands/use-common-commands.js +167 -0
  1002. package/src/hooks/commands/use-edit-mode-commands.js +61 -25
  1003. package/src/hooks/index.js +1 -0
  1004. package/src/hooks/navigation-menu-edit.js +95 -0
  1005. package/src/hooks/push-changes-to-global-styles/index.js +14 -8
  1006. package/src/hooks/template-part-edit.js +1 -1
  1007. package/src/store/actions.js +52 -1
  1008. package/src/store/index.js +1 -1
  1009. package/src/store/reducer.js +21 -0
  1010. package/src/store/selectors.js +54 -5
  1011. package/src/store/test/actions.js +31 -0
  1012. package/src/store/test/reducer.js +44 -0
  1013. package/src/store/test/selectors.js +57 -0
  1014. package/src/style.scss +17 -4
  1015. package/src/utils/get-is-list-page.js +16 -4
  1016. package/src/utils/is-previewing-theme.js +2 -3
  1017. package/src/utils/use-activate-theme.js +3 -2
  1018. package/src/utils/use-debounced-input.js +17 -0
  1019. package/build/components/add-new-template/new-template-part.js +0 -116
  1020. package/build/components/add-new-template/new-template-part.js.map +0 -1
  1021. package/build/components/list/actions/index.js.map +0 -1
  1022. package/build/components/list/actions/rename-menu-item.js.map +0 -1
  1023. package/build/components/sidebar-edit-mode/template-card/index.js.map +0 -1
  1024. package/build/components/sidebar-edit-mode/template-card/template-actions.js.map +0 -1
  1025. package/build/components/sidebar-edit-mode/template-card/template-areas.js.map +0 -1
  1026. package/build/components/sidebar-edit-mode/template-revisions/index.js.map +0 -1
  1027. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -53
  1028. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +0 -1
  1029. package/build/components/sidebar-navigation-subtitle/index.js +0 -18
  1030. package/build/components/sidebar-navigation-subtitle/index.js.map +0 -1
  1031. package/build/private-apis.js.map +0 -1
  1032. package/build-module/components/add-new-template/new-template-part.js +0 -96
  1033. package/build-module/components/add-new-template/new-template-part.js.map +0 -1
  1034. package/build-module/components/list/actions/index.js.map +0 -1
  1035. package/build-module/components/list/actions/rename-menu-item.js.map +0 -1
  1036. package/build-module/components/sidebar-edit-mode/template-card/index.js +0 -68
  1037. package/build-module/components/sidebar-edit-mode/template-card/index.js.map +0 -1
  1038. package/build-module/components/sidebar-edit-mode/template-card/template-actions.js.map +0 -1
  1039. package/build-module/components/sidebar-edit-mode/template-card/template-areas.js.map +0 -1
  1040. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -40
  1041. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +0 -1
  1042. package/build-module/components/sidebar-navigation-subtitle/index.js +0 -10
  1043. package/build-module/components/sidebar-navigation-subtitle/index.js.map +0 -1
  1044. package/build-module/private-apis.js.map +0 -1
  1045. package/src/components/add-new-template/new-template-part.js +0 -109
  1046. package/src/components/sidebar-edit-mode/template-card/index.js +0 -59
  1047. package/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -47
  1048. package/src/components/sidebar-navigation-screen-pages/style.scss +0 -4
  1049. package/src/components/sidebar-navigation-screen-templates/style.scss +0 -4
  1050. package/src/components/sidebar-navigation-subtitle/index.js +0 -5
  1051. package/src/components/sidebar-navigation-subtitle/style.scss +0 -7
  1052. /package/src/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +0 -0
  1053. /package/src/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +0 -0
  1054. /package/src/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +0 -0
  1055. /package/src/components/{list/actions → template-actions}/rename-menu-item.js +0 -0
  1056. /package/src/{private-apis.js → lock-unlock.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-css.js"],"names":["__","ExternalLink","privateApis","blockEditorPrivateApis","unlock","ScreenHeader","useGlobalStyle","AdvancedPanel","StylesAdvancedPanel","ScreenCSS","description","style","undefined","shouldDecodeEncode","inheritedStyle","setStyle"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,YAAT,QAA6B,uBAA7B;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,OAAOC,YAAP,MAAyB,UAAzB;AAEA,MAAM;AAAEC,EAAAA,cAAF;AAAkBC,EAAAA,aAAa,EAAEC;AAAjC,IAAyDJ,MAAM,CACpED,sBADoE,CAArE;;AAIA,SAASM,SAAT,GAAqB;AACpB,QAAMC,WAAW,GAAGV,EAAE,CACrB,uEADqB,CAAtB;;AAGA,QAAM,CAAEW,KAAF,IAAYL,cAAc,CAAE,EAAF,EAAMM,SAAN,EAAiB,MAAjB,EAAyB;AACxDC,IAAAA,kBAAkB,EAAE;AADoC,GAAzB,CAAhC;AAGA,QAAM,CAAEC,cAAF,EAAkBC,QAAlB,IAA+BT,cAAc,CAAE,EAAF,EAAMM,SAAN,EAAiB,KAAjB,EAAwB;AAC1EC,IAAAA,kBAAkB,EAAE;AADsD,GAAxB,CAAnD;AAIA,SACC,8BACC,cAAC,YAAD;AACC,IAAA,KAAK,EAAGb,EAAE,CAAE,KAAF,CADX;AAEC,IAAA,WAAW,EACV,8BACGU,WADH,EAEC,cAAC,YAAD;AACC,MAAA,IAAI,EAAC,kDADN;AAEC,MAAA,SAAS,EAAC;AAFX,OAIGV,EAAE,CAAE,sBAAF,CAJL,CAFD;AAHF,IADD,EAeC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,mBAAD;AACC,IAAA,KAAK,EAAGW,KADT;AAEC,IAAA,QAAQ,EAAGI,QAFZ;AAGC,IAAA,cAAc,EAAGD;AAHlB,IADD,CAfD,CADD;AAyBA;;AAED,eAAeL,SAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ExternalLink } from '@wordpress/components';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\nimport ScreenHeader from './header';\n\nconst { useGlobalStyle, AdvancedPanel: StylesAdvancedPanel } = unlock(\n\tblockEditorPrivateApis\n);\n\nfunction ScreenCSS() {\n\tconst description = __(\n\t\t'Add your own CSS to customize the appearance and layout of your site.'\n\t);\n\tconst [ style ] = useGlobalStyle( '', undefined, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle( '', undefined, 'all', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'CSS' ) }\n\t\t\t\tdescription={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\thref=\"https://wordpress.org/documentation/article/css/\"\n\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-css-help-link\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Learn more about CSS' ) }\n\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t<div className=\"edit-site-global-styles-screen-css\">\n\t\t\t\t<StylesAdvancedPanel\n\t\t\t\t\tvalue={ style }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default ScreenCSS;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-css.js"],"names":["__","ExternalLink","privateApis","blockEditorPrivateApis","unlock","ScreenHeader","useGlobalStyle","AdvancedPanel","StylesAdvancedPanel","ScreenCSS","description","style","undefined","shouldDecodeEncode","inheritedStyle","setStyle"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,YAAT,QAA6B,uBAA7B;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,mBAAvB;AACA,OAAOC,YAAP,MAAyB,UAAzB;AAEA,MAAM;AAAEC,EAAAA,cAAF;AAAkBC,EAAAA,aAAa,EAAEC;AAAjC,IAAyDJ,MAAM,CACpED,sBADoE,CAArE;;AAIA,SAASM,SAAT,GAAqB;AACpB,QAAMC,WAAW,GAAGV,EAAE,CACrB,uEADqB,CAAtB;;AAGA,QAAM,CAAEW,KAAF,IAAYL,cAAc,CAAE,EAAF,EAAMM,SAAN,EAAiB,MAAjB,EAAyB;AACxDC,IAAAA,kBAAkB,EAAE;AADoC,GAAzB,CAAhC;AAGA,QAAM,CAAEC,cAAF,EAAkBC,QAAlB,IAA+BT,cAAc,CAAE,EAAF,EAAMM,SAAN,EAAiB,KAAjB,EAAwB;AAC1EC,IAAAA,kBAAkB,EAAE;AADsD,GAAxB,CAAnD;AAIA,SACC,8BACC,cAAC,YAAD;AACC,IAAA,KAAK,EAAGb,EAAE,CAAE,KAAF,CADX;AAEC,IAAA,WAAW,EACV,8BACGU,WADH,EAEC,cAAC,YAAD;AACC,MAAA,IAAI,EAAC,kDADN;AAEC,MAAA,SAAS,EAAC;AAFX,OAIGV,EAAE,CAAE,sBAAF,CAJL,CAFD;AAHF,IADD,EAeC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,mBAAD;AACC,IAAA,KAAK,EAAGW,KADT;AAEC,IAAA,QAAQ,EAAGI,QAFZ;AAGC,IAAA,cAAc,EAAGD;AAHlB,IADD,CAfD,CADD;AAyBA;;AAED,eAAeL,SAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ExternalLink } from '@wordpress/components';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport ScreenHeader from './header';\n\nconst { useGlobalStyle, AdvancedPanel: StylesAdvancedPanel } = unlock(\n\tblockEditorPrivateApis\n);\n\nfunction ScreenCSS() {\n\tconst description = __(\n\t\t'Add your own CSS to customize the appearance and layout of your site.'\n\t);\n\tconst [ style ] = useGlobalStyle( '', undefined, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle( '', undefined, 'all', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'CSS' ) }\n\t\t\t\tdescription={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\thref=\"https://wordpress.org/documentation/article/css/\"\n\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-css-help-link\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Learn more about CSS' ) }\n\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t<div className=\"edit-site-global-styles-screen-css\">\n\t\t\t\t<StylesAdvancedPanel\n\t\t\t\t\tvalue={ style }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default ScreenCSS;\n"]}
@@ -12,7 +12,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
12
12
  import DimensionsPanel from './dimensions-panel';
13
13
  import ScreenHeader from './header';
14
14
  import BlockPreviewPanel from './block-preview-panel';
15
- import { unlock } from '../../private-apis';
15
+ import { unlock } from '../../lock-unlock';
16
16
  const {
17
17
  useHasDimensionsPanel,
18
18
  useGlobalSetting,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-layout.js"],"names":["__","privateApis","blockEditorPrivateApis","DimensionsPanel","ScreenHeader","BlockPreviewPanel","unlock","useHasDimensionsPanel","useGlobalSetting","useSettingsForBlockElement","ScreenLayout","rawSettings","settings","hasDimensionsPanel"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AAAEC,EAAAA,qBAAF;AAAyBC,EAAAA,gBAAzB;AAA2CC,EAAAA;AAA3C,IACLH,MAAM,CAAEJ,sBAAF,CADP;;AAGA,SAASQ,YAAT,GAAwB;AACvB,QAAM,CAAEC,WAAF,IAAkBH,gBAAgB,CAAE,EAAF,CAAxC;AACA,QAAMI,QAAQ,GAAGH,0BAA0B,CAAEE,WAAF,CAA3C;AACA,QAAME,kBAAkB,GAAGN,qBAAqB,CAAEK,QAAF,CAAhD;AACA,SACC,8BACC,cAAC,YAAD;AAAc,IAAA,KAAK,EAAGZ,EAAE,CAAE,QAAF;AAAxB,IADD,EAEC,cAAC,iBAAD,OAFD,EAGGa,kBAAkB,IAAI,cAAC,eAAD,OAHzB,CADD;AAOA;;AAED,eAAeH,YAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport DimensionsPanel from './dimensions-panel';\nimport ScreenHeader from './header';\nimport BlockPreviewPanel from './block-preview-panel';\nimport { unlock } from '../../private-apis';\n\nconst { useHasDimensionsPanel, useGlobalSetting, useSettingsForBlockElement } =\n\tunlock( blockEditorPrivateApis );\n\nfunction ScreenLayout() {\n\tconst [ rawSettings ] = useGlobalSetting( '' );\n\tconst settings = useSettingsForBlockElement( rawSettings );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader title={ __( 'Layout' ) } />\n\t\t\t<BlockPreviewPanel />\n\t\t\t{ hasDimensionsPanel && <DimensionsPanel /> }\n\t\t</>\n\t);\n}\n\nexport default ScreenLayout;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-layout.js"],"names":["__","privateApis","blockEditorPrivateApis","DimensionsPanel","ScreenHeader","BlockPreviewPanel","unlock","useHasDimensionsPanel","useGlobalSetting","useSettingsForBlockElement","ScreenLayout","rawSettings","settings","hasDimensionsPanel"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,SAASC,MAAT,QAAuB,mBAAvB;AAEA,MAAM;AAAEC,EAAAA,qBAAF;AAAyBC,EAAAA,gBAAzB;AAA2CC,EAAAA;AAA3C,IACLH,MAAM,CAAEJ,sBAAF,CADP;;AAGA,SAASQ,YAAT,GAAwB;AACvB,QAAM,CAAEC,WAAF,IAAkBH,gBAAgB,CAAE,EAAF,CAAxC;AACA,QAAMI,QAAQ,GAAGH,0BAA0B,CAAEE,WAAF,CAA3C;AACA,QAAME,kBAAkB,GAAGN,qBAAqB,CAAEK,QAAF,CAAhD;AACA,SACC,8BACC,cAAC,YAAD;AAAc,IAAA,KAAK,EAAGZ,EAAE,CAAE,QAAF;AAAxB,IADD,EAEC,cAAC,iBAAD,OAFD,EAGGa,kBAAkB,IAAI,cAAC,eAAD,OAHzB,CADD;AAOA;;AAED,eAAeH,YAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport DimensionsPanel from './dimensions-panel';\nimport ScreenHeader from './header';\nimport BlockPreviewPanel from './block-preview-panel';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHasDimensionsPanel, useGlobalSetting, useSettingsForBlockElement } =\n\tunlock( blockEditorPrivateApis );\n\nfunction ScreenLayout() {\n\tconst [ rawSettings ] = useGlobalSetting( '' );\n\tconst settings = useSettingsForBlockElement( rawSettings );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader title={ __( 'Layout' ) } />\n\t\t\t<BlockPreviewPanel />\n\t\t\t{ hasDimensionsPanel && <DimensionsPanel /> }\n\t\t</>\n\t);\n}\n\nexport default ScreenLayout;\n"]}
@@ -13,7 +13,7 @@ import { privateApis as blockEditorPrivateApis, store as blockEditorStore } from
13
13
  */
14
14
 
15
15
  import ScreenHeader from '../header';
16
- import { unlock } from '../../../private-apis';
16
+ import { unlock } from '../../../lock-unlock';
17
17
  import Revisions from '../../revisions';
18
18
  import SidebarFixedBottom from '../../sidebar-edit-mode/sidebar-fixed-bottom';
19
19
  import { store as editSiteStore } from '../../../store';
@@ -65,8 +65,8 @@ function ScreenRevisions() {
65
65
 
66
66
  const restoreRevision = revision => {
67
67
  setUserConfig(() => ({
68
- styles: revision === null || revision === void 0 ? void 0 : revision.styles,
69
- settings: revision === null || revision === void 0 ? void 0 : revision.settings
68
+ styles: revision?.styles,
69
+ settings: revision?.settings
70
70
  }));
71
71
  setIsLoadingRevisionWithUnsavedChanges(false);
72
72
  onCloseRevisions();
@@ -74,14 +74,14 @@ function ScreenRevisions() {
74
74
 
75
75
  const selectRevision = revision => {
76
76
  setGlobalStylesRevision({
77
- styles: revision === null || revision === void 0 ? void 0 : revision.styles,
78
- settings: revision === null || revision === void 0 ? void 0 : revision.settings,
79
- id: revision === null || revision === void 0 ? void 0 : revision.id
77
+ styles: revision?.styles,
78
+ settings: revision?.settings,
79
+ id: revision?.id
80
80
  });
81
- setSelectedRevisionId(revision === null || revision === void 0 ? void 0 : revision.id);
81
+ setSelectedRevisionId(revision?.id);
82
82
  };
83
83
 
84
- const isLoadButtonEnabled = !!(globalStylesRevision !== null && globalStylesRevision !== void 0 && globalStylesRevision.id) && !areGlobalStyleConfigsEqual(globalStylesRevision, userConfig);
84
+ const isLoadButtonEnabled = !!globalStylesRevision?.id && !areGlobalStyleConfigsEqual(globalStylesRevision, userConfig);
85
85
  return createElement(Fragment, null, createElement(ScreenHeader, {
86
86
  title: __('Revisions'),
87
87
  description: __('Revisions are added to the timeline when style changes are saved.')
@@ -100,7 +100,7 @@ function ScreenRevisions() {
100
100
  }), isLoadButtonEnabled && createElement(SidebarFixedBottom, null, createElement(Button, {
101
101
  variant: "primary",
102
102
  className: "edit-site-global-styles-screen-revisions__button",
103
- disabled: !(globalStylesRevision !== null && globalStylesRevision !== void 0 && globalStylesRevision.id) || (globalStylesRevision === null || globalStylesRevision === void 0 ? void 0 : globalStylesRevision.id) === 'unsaved',
103
+ disabled: !globalStylesRevision?.id || globalStylesRevision?.id === 'unsaved',
104
104
  onClick: () => {
105
105
  if (hasUnsavedChanges) {
106
106
  setIsLoadingRevisionWithUnsavedChanges(true);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/index.js"],"names":["__","Button","__experimentalUseNavigator","useNavigator","__experimentalConfirmDialog","ConfirmDialog","Spinner","useSelect","useDispatch","useContext","useState","useEffect","privateApis","blockEditorPrivateApis","store","blockEditorStore","ScreenHeader","unlock","Revisions","SidebarFixedBottom","editSiteStore","useGlobalStylesRevisions","RevisionsButtons","GlobalStylesContext","areGlobalStyleConfigsEqual","ScreenRevisions","goBack","user","userConfig","setUserConfig","blocks","editorCanvasContainerView","select","getEditorCanvasContainerView","getBlocks","revisions","isLoading","hasUnsavedChanges","selectedRevisionId","setSelectedRevisionId","globalStylesRevision","setGlobalStylesRevision","isLoadingRevisionWithUnsavedChanges","setIsLoadingRevisionWithUnsavedChanges","setEditorCanvasContainerView","onCloseRevisions","restoreRevision","revision","styles","settings","selectRevision","id","isLoadButtonEnabled"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SACCC,MADD,EAECC,0BAA0B,IAAIC,YAF/B,EAGCC,2BAA2B,IAAIC,aAHhC,EAICC,OAJD,QAKO,uBALP;AAMA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,UAAT,EAAqBC,QAArB,EAA+BC,SAA/B,QAAgD,oBAAhD;AACA,SACCC,WAAW,IAAIC,sBADhB,EAECC,KAAK,IAAIC,gBAFV,QAGO,yBAHP;AAKA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,WAAzB;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,OAAOC,SAAP,MAAsB,iBAAtB;AACA,OAAOC,kBAAP,MAA+B,8CAA/B;AACA,SAASL,KAAK,IAAIM,aAAlB,QAAuC,gBAAvC;AACA,OAAOC,wBAAP,MAAqC,+BAArC;AACA,OAAOC,gBAAP,MAA6B,qBAA7B;AAEA,MAAM;AAAEC,EAAAA,mBAAF;AAAuBC,EAAAA;AAAvB,IAAsDP,MAAM,CACjEJ,sBADiE,CAAlE;;AAIA,SAASY,eAAT,G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,kBAAkB,EAAGZ,kBAFtB;AAGC,IAAA,aAAa,EAAGH;AAHjB,IADD,EAMGiB,mBAAmB,IACpB,cAAC,kBAAD,QACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,SAAS,EAAC,kDAFX;AAGC,IAAA,QAAQ,EACP,EAAEZ,oBAAF,aAAEA,oBAAF,eAAEA,oBAAoB,CAAEW,EAAxB,KACA,CAAAX,oBAAoB,SAApB,IAAAA,oBAAoB,WAApB,YAAAA,oBAAoB,CAAEW,EAAtB,MAA6B,SAL/B;AAOC,IAAA,OAAO,EAAG,MAAM;AACf,UAAKd,iBAAL,EAAyB;AACxBM,QAAAA,sCAAsC,CACrC,IADqC,CAAtC;AAGA,OAJD,MAIO;AACNG,QAAAA,eAAe,CAAEN,oBAAF,CAAf;AACA;AACD;AAfF,KAiBGxC,EAAE,CAAE,OAAF,CAjBL,CADD,CAPF,CAjBD,EA+CG0C,mCAAmC,IACpC,cAAC,aAAD;AACC,IAAA,KAAK,EAAG1C,EAAE,CACT,yDADS,CADX;AAIC,IAAA,MAAM,EAAG0C,mCAJV;AAKC,IAAA,iBAAiB,EAAG1C,EAAE,CAAE,0BAAF,CALvB;AAMC,IAAA,SAAS,EAAG,MAAM8C,eAAe,CAAEN,oBAAF,CANlC;AAOC,IAAA,QAAQ,EAAG,MACVG,sCAAsC,CAAE,KAAF;AARxC,KAWC,8BACC,0BACG3C,EAAE,CACH,yDADG,CADL,CADD,EAMC,yBACGA,EAAE,CACH,4DADG,CADL,CAND,CAXD,CAhDF,CADD;AA4EA;;AAED,eAAeyB,eAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\t__experimentalUseNavigator as useNavigator,\n\t__experimentalConfirmDialog as ConfirmDialog,\n\tSpinner,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useContext, useState, useEffect } from '@wordpress/element';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from '../header';\nimport { unlock } from '../../../private-apis';\nimport Revisions from '../../revisions';\nimport SidebarFixedBottom from '../../sidebar-edit-mode/sidebar-fixed-bottom';\nimport { store as editSiteStore } from '../../../store';\nimport useGlobalStylesRevisions from './use-global-styles-revisions';\nimport RevisionsButtons from './revisions-buttons';\n\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\n\nfunction ScreenRevisions() {\n\tconst { goBack } = useNavigator();\n\tconst { user: userConfig, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\n\tconst { blocks, editorCanvasContainerView } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\teditorCanvasContainerView: unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView(),\n\t\t\tblocks: select( blockEditorStore ).getBlocks(),\n\t\t};\n\t}, [] );\n\tconst { revisions, isLoading, hasUnsavedChanges } =\n\t\tuseGlobalStylesRevisions();\n\tconst [ selectedRevisionId, setSelectedRevisionId ] = useState();\n\tconst [ globalStylesRevision, setGlobalStylesRevision ] =\n\t\tuseState( userConfig );\n\tconst [\n\t\tisLoadingRevisionWithUnsavedChanges,\n\t\tsetIsLoadingRevisionWithUnsavedChanges,\n\t] = useState( false );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\tuseEffect( () => {\n\t\tif ( editorCanvasContainerView !== 'global-styles-revisions' ) {\n\t\t\tgoBack();\n\t\t\tsetEditorCanvasContainerView( editorCanvasContainerView );\n\t\t}\n\t}, [ editorCanvasContainerView ] );\n\n\tconst onCloseRevisions = () => {\n\t\tgoBack();\n\t};\n\n\tconst restoreRevision = ( revision ) => {\n\t\tsetUserConfig( () => ( {\n\t\t\tstyles: revision?.styles,\n\t\t\tsettings: revision?.settings,\n\t\t} ) );\n\t\tsetIsLoadingRevisionWithUnsavedChanges( false );\n\t\tonCloseRevisions();\n\t};\n\n\tconst selectRevision = ( revision ) => {\n\t\tsetGlobalStylesRevision( {\n\t\t\tstyles: revision?.styles,\n\t\t\tsettings: revision?.settings,\n\t\t\tid: revision?.id,\n\t\t} );\n\t\tsetSelectedRevisionId( revision?.id );\n\t};\n\n\tconst isLoadButtonEnabled =\n\t\t!! globalStylesRevision?.id &&\n\t\t! areGlobalStyleConfigsEqual( globalStylesRevision, userConfig );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Revisions' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Revisions are added to the timeline when style changes are saved.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t{ isLoading && (\n\t\t\t\t<Spinner className=\"edit-site-global-styles-screen-revisions__loading\" />\n\t\t\t) }\n\t\t\t{ ! isLoading && (\n\t\t\t\t<Revisions\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tuserConfig={ globalStylesRevision }\n\t\t\t\t\tonClose={ onCloseRevisions }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<div className=\"edit-site-global-styles-screen-revisions\">\n\t\t\t\t<RevisionsButtons\n\t\t\t\t\tonChange={ selectRevision }\n\t\t\t\t\tselectedRevisionId={ selectedRevisionId }\n\t\t\t\t\tuserRevisions={ revisions }\n\t\t\t\t/>\n\t\t\t\t{ isLoadButtonEnabled && (\n\t\t\t\t\t<SidebarFixedBottom>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__button\"\n\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t! globalStylesRevision?.id ||\n\t\t\t\t\t\t\t\tglobalStylesRevision?.id === 'unsaved'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tif ( hasUnsavedChanges ) {\n\t\t\t\t\t\t\t\t\tsetIsLoadingRevisionWithUnsavedChanges(\n\t\t\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trestoreRevision( globalStylesRevision );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Apply' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</SidebarFixedBottom>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t{ isLoadingRevisionWithUnsavedChanges && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\ttitle={ __(\n\t\t\t\t\t\t'Loading this revision will discard all unsaved changes.'\n\t\t\t\t\t) }\n\t\t\t\t\tisOpen={ isLoadingRevisionWithUnsavedChanges }\n\t\t\t\t\tconfirmButtonText={ __( ' Discard unsaved changes' ) }\n\t\t\t\t\tonConfirm={ () => restoreRevision( globalStylesRevision ) }\n\t\t\t\t\tonCancel={ () =>\n\t\t\t\t\t\tsetIsLoadingRevisionWithUnsavedChanges( false )\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<>\n\t\t\t\t\t\t<h2>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Loading this revision will discard all unsaved changes.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Do you want to replace your unsaved changes in the editor?'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</>\n\t\t\t\t</ConfirmDialog>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default ScreenRevisions;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/index.js"],"names":["__","Button","__experimentalUseNavigator","useNavigator","__experimentalConfirmDialog","ConfirmDialog","Spinner","useSelect","useDispatch","useContext","useState","useEffect","privateApis","blockEditorPrivateApis","store","blockEditorStore","ScreenHeader","unlock","Revisions","SidebarFixedBottom","editSiteStore","useGlobalStylesRevisions","RevisionsButtons","GlobalStylesContext","areGlobalStyleConfigsEqual","ScreenRevisions","goBack","user","userConfig","setUserConfig","blocks","editorCanvasContainerView","select","getEditorCanvasContainerView","getBlocks","revisions","isLoading","hasUnsavedChanges","selectedRevisionId","setSelectedRevisionId","globalStylesRevision","setGlobalStylesRevision","isLoadingRevisionWithUnsavedChanges","setIsLoadingRevisionWithUnsavedChanges","setEditorCanvasContainerView","onCloseRevisions","restoreRevision","revision","styles","settings","selectRevision","id","isLoadButtonEnabled"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SACCC,MADD,EAECC,0BAA0B,IAAIC,YAF/B,EAGCC,2BAA2B,IAAIC,aAHhC,EAICC,OAJD,QAKO,uBALP;AAMA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,UAAT,EAAqBC,QAArB,EAA+BC,SAA/B,QAAgD,oBAAhD;AACA,SACCC,WAAW,IAAIC,sBADhB,EAECC,KAAK,IAAIC,gBAFV,QAGO,yBAHP;AAKA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,WAAzB;AACA,SAASC,MAAT,QAAuB,sBAAvB;AACA,OAAOC,SAAP,MAAsB,iBAAtB;AACA,OAAOC,kBAAP,MAA+B,8CAA/B;AACA,SAASL,KAAK,IAAIM,aAAlB,QAAuC,gBAAvC;AACA,OAAOC,wBAAP,MAAqC,+BAArC;AACA,OAAOC,gBAAP,MAA6B,qBAA7B;AAEA,MAAM;AAAEC,EAAAA,mBAAF;AAAuBC,EAAAA;AAAvB,IAAsDP,MAAM,CACjEJ,sBADiE,CAAlE;;AAIA,SAASY,eAAT,GAA2B;AAC1B,QAAM;AAAEC,IAAAA;AAAF,MAAavB,YAAY,EAA/B;AACA,QAAM;AAAEwB,I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AAA,OAAO,EAAG,MAAM;AACf,UAAKd,iBAAL,EAAyB;AACxBM,QAAAA,sCAAsC,CACrC,IADqC,CAAtC;AAGA,OAJD,MAIO;AACNG,QAAAA,eAAe,CAAEN,oBAAF,CAAf;AACA;AACD;AAfF,KAiBGxC,EAAE,CAAE,OAAF,CAjBL,CADD,CAPF,CAjBD,EA+CG0C,mCAAmC,IACpC,cAAC,aAAD;AACC,IAAA,KAAK,EAAG1C,EAAE,CACT,yDADS,CADX;AAIC,IAAA,MAAM,EAAG0C,mCAJV;AAKC,IAAA,iBAAiB,EAAG1C,EAAE,CAAE,0BAAF,CALvB;AAMC,IAAA,SAAS,EAAG,MAAM8C,eAAe,CAAEN,oBAAF,CANlC;AAOC,IAAA,QAAQ,EAAG,MACVG,sCAAsC,CAAE,KAAF;AARxC,KAWC,8BACC,0BACG3C,EAAE,CACH,yDADG,CADL,CADD,EAMC,yBACGA,EAAE,CACH,4DADG,CADL,CAND,CAXD,CAhDF,CADD;AA4EA;;AAED,eAAeyB,eAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\t__experimentalUseNavigator as useNavigator,\n\t__experimentalConfirmDialog as ConfirmDialog,\n\tSpinner,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useContext, useState, useEffect } from '@wordpress/element';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from '../header';\nimport { unlock } from '../../../lock-unlock';\nimport Revisions from '../../revisions';\nimport SidebarFixedBottom from '../../sidebar-edit-mode/sidebar-fixed-bottom';\nimport { store as editSiteStore } from '../../../store';\nimport useGlobalStylesRevisions from './use-global-styles-revisions';\nimport RevisionsButtons from './revisions-buttons';\n\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\n\nfunction ScreenRevisions() {\n\tconst { goBack } = useNavigator();\n\tconst { user: userConfig, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\n\tconst { blocks, editorCanvasContainerView } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\teditorCanvasContainerView: unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView(),\n\t\t\tblocks: select( blockEditorStore ).getBlocks(),\n\t\t};\n\t}, [] );\n\tconst { revisions, isLoading, hasUnsavedChanges } =\n\t\tuseGlobalStylesRevisions();\n\tconst [ selectedRevisionId, setSelectedRevisionId ] = useState();\n\tconst [ globalStylesRevision, setGlobalStylesRevision ] =\n\t\tuseState( userConfig );\n\tconst [\n\t\tisLoadingRevisionWithUnsavedChanges,\n\t\tsetIsLoadingRevisionWithUnsavedChanges,\n\t] = useState( false );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\tuseEffect( () => {\n\t\tif ( editorCanvasContainerView !== 'global-styles-revisions' ) {\n\t\t\tgoBack();\n\t\t\tsetEditorCanvasContainerView( editorCanvasContainerView );\n\t\t}\n\t}, [ editorCanvasContainerView ] );\n\n\tconst onCloseRevisions = () => {\n\t\tgoBack();\n\t};\n\n\tconst restoreRevision = ( revision ) => {\n\t\tsetUserConfig( () => ( {\n\t\t\tstyles: revision?.styles,\n\t\t\tsettings: revision?.settings,\n\t\t} ) );\n\t\tsetIsLoadingRevisionWithUnsavedChanges( false );\n\t\tonCloseRevisions();\n\t};\n\n\tconst selectRevision = ( revision ) => {\n\t\tsetGlobalStylesRevision( {\n\t\t\tstyles: revision?.styles,\n\t\t\tsettings: revision?.settings,\n\t\t\tid: revision?.id,\n\t\t} );\n\t\tsetSelectedRevisionId( revision?.id );\n\t};\n\n\tconst isLoadButtonEnabled =\n\t\t!! globalStylesRevision?.id &&\n\t\t! areGlobalStyleConfigsEqual( globalStylesRevision, userConfig );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Revisions' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Revisions are added to the timeline when style changes are saved.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t{ isLoading && (\n\t\t\t\t<Spinner className=\"edit-site-global-styles-screen-revisions__loading\" />\n\t\t\t) }\n\t\t\t{ ! isLoading && (\n\t\t\t\t<Revisions\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tuserConfig={ globalStylesRevision }\n\t\t\t\t\tonClose={ onCloseRevisions }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<div className=\"edit-site-global-styles-screen-revisions\">\n\t\t\t\t<RevisionsButtons\n\t\t\t\t\tonChange={ selectRevision }\n\t\t\t\t\tselectedRevisionId={ selectedRevisionId }\n\t\t\t\t\tuserRevisions={ revisions }\n\t\t\t\t/>\n\t\t\t\t{ isLoadButtonEnabled && (\n\t\t\t\t\t<SidebarFixedBottom>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__button\"\n\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t! globalStylesRevision?.id ||\n\t\t\t\t\t\t\t\tglobalStylesRevision?.id === 'unsaved'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tif ( hasUnsavedChanges ) {\n\t\t\t\t\t\t\t\t\tsetIsLoadingRevisionWithUnsavedChanges(\n\t\t\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trestoreRevision( globalStylesRevision );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Apply' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</SidebarFixedBottom>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t{ isLoadingRevisionWithUnsavedChanges && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\ttitle={ __(\n\t\t\t\t\t\t'Loading this revision will discard all unsaved changes.'\n\t\t\t\t\t) }\n\t\t\t\t\tisOpen={ isLoadingRevisionWithUnsavedChanges }\n\t\t\t\t\tconfirmButtonText={ __( ' Discard unsaved changes' ) }\n\t\t\t\t\tonConfirm={ () => restoreRevision( globalStylesRevision ) }\n\t\t\t\t\tonCancel={ () =>\n\t\t\t\t\t\tsetIsLoadingRevisionWithUnsavedChanges( false )\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<>\n\t\t\t\t\t\t<h2>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Loading this revision will discard all unsaved changes.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Do you want to replace your unsaved changes in the editor?'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</>\n\t\t\t\t</ConfirmDialog>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default ScreenRevisions;\n"]}
@@ -19,11 +19,9 @@ import { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';
19
19
  */
20
20
 
21
21
  function getRevisionLabel(revision) {
22
- var _revision$author;
22
+ const authorDisplayName = revision?.author?.name || __('User');
23
23
 
24
- const authorDisplayName = (revision === null || revision === void 0 ? void 0 : (_revision$author = revision.author) === null || _revision$author === void 0 ? void 0 : _revision$author.name) || __('User');
25
-
26
- if ('unsaved' === (revision === null || revision === void 0 ? void 0 : revision.id)) {
24
+ if ('unsaved' === revision?.id) {
27
25
  return sprintf(
28
26
  /* translators: %(name)s author display name */
29
27
  __('Unsaved changes by %(name)s'), {
@@ -31,8 +29,8 @@ function getRevisionLabel(revision) {
31
29
  });
32
30
  }
33
31
 
34
- const formattedDate = dateI18n(getSettings().formats.datetimeAbbreviated, getDate(revision === null || revision === void 0 ? void 0 : revision.modified));
35
- return revision !== null && revision !== void 0 && revision.isLatest ? sprintf(
32
+ const formattedDate = dateI18n(getSettings().formats.datetimeAbbreviated, getDate(revision?.modified));
33
+ return revision?.isLatest ? sprintf(
36
34
  /* translators: %(name)s author display name, %(date)s: revision creation date */
37
35
  __('Changes saved by %(name)s on %(date)s (current)'), {
38
36
  name: authorDisplayName,
@@ -57,30 +55,27 @@ function getRevisionLabel(revision) {
57
55
  */
58
56
 
59
57
 
60
- function RevisionsButtons(_ref) {
61
- let {
62
- userRevisions,
63
- selectedRevisionId,
64
- onChange
65
- } = _ref;
58
+ function RevisionsButtons({
59
+ userRevisions,
60
+ selectedRevisionId,
61
+ onChange
62
+ }) {
66
63
  return createElement("ol", {
67
64
  className: "edit-site-global-styles-screen-revisions__revisions-list",
68
65
  "aria-label": __('Global styles revisions'),
69
66
  role: "group"
70
67
  }, userRevisions.map((revision, index) => {
71
- var _author$avatar_urls;
72
-
73
68
  const {
74
69
  id,
75
70
  author,
76
71
  modified
77
72
  } = revision;
78
73
 
79
- const authorDisplayName = (author === null || author === void 0 ? void 0 : author.name) || __('User');
74
+ const authorDisplayName = author?.name || __('User');
80
75
 
81
- const authorAvatar = author === null || author === void 0 ? void 0 : (_author$avatar_urls = author.avatar_urls) === null || _author$avatar_urls === void 0 ? void 0 : _author$avatar_urls['48'];
82
- const isUnsaved = 'unsaved' === (revision === null || revision === void 0 ? void 0 : revision.id);
83
- const isSelected = selectedRevisionId ? selectedRevisionId === (revision === null || revision === void 0 ? void 0 : revision.id) : index === 0;
76
+ const authorAvatar = author?.avatar_urls?.['48'];
77
+ const isUnsaved = 'unsaved' === revision?.id;
78
+ const isSelected = selectedRevisionId ? selectedRevisionId === revision?.id : index === 0;
84
79
  return createElement("li", {
85
80
  className: classnames('edit-site-global-styles-screen-revisions__revision-item', {
86
81
  'is-selected': isSelected
@@ -108,7 +103,7 @@ function RevisionsButtons(_ref) {
108
103
  __('Changes saved by %(name)s'), {
109
104
  name: authorDisplayName
110
105
  }), createElement("img", {
111
- alt: author === null || author === void 0 ? void 0 : author.name,
106
+ alt: author?.name,
112
107
  src: authorAvatar
113
108
  })))));
114
109
  }));
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/revisions-buttons.js"],"names":["classnames","__","sprintf","Button","dateI18n","getDate","humanTimeDiff","getSettings","getRevisionLabel","revision","authorDisplayName","author","name","id","formattedDate","formats","datetimeAbbreviated","modified","isLatest","date","RevisionsButtons","userRevisions","selectedRevisionId","onChange","map","index","authorAvatar","avatar_urls","isUnsaved","isSelected"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,QAAT,EAAmBC,OAAnB,EAA4BC,aAA5B,EAA2CC,WAA3C,QAA8D,iBAA9D;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,gBAAT,CAA2BC,QAA3B,EAAsC;AAAA;;AACrC,QAAMC,iBAAiB,GAAG,CAAAD,QAAQ,SAAR,IAAAA,QAAQ,WAAR,gCAAAA,QAAQ,CAAEE,MAAV,sEAAkBC,IAAlB,KAA0BX,EAAE,CAAE,MAAF,CAAtD;;AAEA,MAAK,eAAcQ,QAAd,aAAcA,QAAd,uBAAcA,QAAQ,CAAEI,EAAxB,CAAL,EAAkC;AACjC,WAAOX,OAAO;AACb;AACAD,IAAAA,EAAE,CAAE,6BAAF,CAFW,EAGb;AACCW,MAAAA,IAAI,EAAEF;AADP,KAHa,CAAd;AAOA;;AACD,QAAMI,aAAa,GAAGV,QAAQ,CAC7BG,WAAW,GAAGQ,OAAd,CAAsBC,mBADO,EAE7BX,OAAO,CAAEI,QAAF,aAAEA,QAAF,uBAAEA,QAAQ,CAAEQ,QAAZ,CA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AEI,EAAf,CADgB,GAElCY,KAAK,KAAK,CAFb;AAIA,WACC;AACC,MAAA,SAAS,EAAGzB,UAAU,CACrB,yDADqB,EAErB;AACC,uBAAe6B;AADhB,OAFqB,CADvB;AAOC,MAAA,GAAG,EAAGhB;AAPP,OASC,cAAC,MAAD;AACC,MAAA,SAAS,EAAC,2DADX;AAEC,MAAA,QAAQ,EAAGgB,UAFZ;AAGC,MAAA,OAAO,EAAG,MAAM;AACfN,QAAAA,QAAQ,CAAEd,QAAF,CAAR;AACA,OALF;AAMC,MAAA,KAAK,EAAGD,gBAAgB,CAAEC,QAAF;AANzB,OAQC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACC;AAAM,MAAA,QAAQ,EAAGQ;AAAjB,OACGX,aAAa,CAAEW,QAAF,CADhB,CADD,EAIC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACGW,SAAS,GACR1B,OAAO;AACP;AACAD,IAAAA,EAAE,CACD,6BADC,CAFK,EAKP;AACCW,MAAAA,IAAI,EAAEF;AADP,KALO,CADC,GAURR,OAAO;AACP;AACAD,IAAAA,EAAE,CACD,2BADC,CAFK,EAKP;AACCW,MAAAA,IAAI,EAAEF;AADP,KALO,CAXX,EAqBC;AACC,MAAA,GAAG,EAAGC,MAAH,aAAGA,MAAH,uBAAGA,MAAM,CAAEC,IADf;AAEC,MAAA,GAAG,EAAGc;AAFP,MArBD,CAJD,CARD,CATD,CADD;AAoDA,GA7DC,CALH,CADD;AAsEA;;AAED,eAAeN,gBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';\n\n/**\n * Returns a button label for the revision.\n *\n * @param {Object} revision A revision object.\n * @return {string} Translated label.\n */\nfunction getRevisionLabel( revision ) {\n\tconst authorDisplayName = revision?.author?.name || __( 'User' );\n\n\tif ( 'unsaved' === revision?.id ) {\n\t\treturn sprintf(\n\t\t\t/* translators: %(name)s author display name */\n\t\t\t__( 'Unsaved changes by %(name)s' ),\n\t\t\t{\n\t\t\t\tname: authorDisplayName,\n\t\t\t}\n\t\t);\n\t}\n\tconst formattedDate = dateI18n(\n\t\tgetSettings().formats.datetimeAbbreviated,\n\t\tgetDate( revision?.modified )\n\t);\n\n\treturn revision?.isLatest\n\t\t? sprintf(\n\t\t\t\t/* translators: %(name)s author display name, %(date)s: revision creation date */\n\t\t\t\t__( 'Changes saved by %(name)s on %(date)s (current)' ),\n\t\t\t\t{\n\t\t\t\t\tname: authorDisplayName,\n\t\t\t\t\tdate: formattedDate,\n\t\t\t\t}\n\t\t )\n\t\t: sprintf(\n\t\t\t\t/* translators: %(name)s author display name, %(date)s: revision creation date */\n\t\t\t\t__( 'Changes saved by %(name)s on %(date)s' ),\n\t\t\t\t{\n\t\t\t\t\tname: authorDisplayName,\n\t\t\t\t\tdate: formattedDate,\n\t\t\t\t}\n\t\t );\n}\n\n/**\n * Returns a rendered list of revisions buttons.\n *\n * @typedef {Object} props\n * @property {Array<Object>} userRevisions A collection of user revisions.\n * @property {number} selectedRevisionId The id of the currently-selected revision.\n * @property {Function} onChange Callback fired when a revision is selected.\n *\n * @param {props} Component props.\n * @return {JSX.Element} The modal component.\n */\nfunction RevisionsButtons( { userRevisions, selectedRevisionId, onChange } ) {\n\treturn (\n\t\t<ol\n\t\t\tclassName=\"edit-site-global-styles-screen-revisions__revisions-list\"\n\t\t\taria-label={ __( 'Global styles revisions' ) }\n\t\t\trole=\"group\"\n\t\t>\n\t\t\t{ userRevisions.map( ( revision, index ) => {\n\t\t\t\tconst { id, author, modified } = revision;\n\t\t\t\tconst authorDisplayName = author?.name || __( 'User' );\n\t\t\t\tconst authorAvatar = author?.avatar_urls?.[ '48' ];\n\t\t\t\tconst isUnsaved = 'unsaved' === revision?.id;\n\t\t\t\tconst isSelected = selectedRevisionId\n\t\t\t\t\t? selectedRevisionId === revision?.id\n\t\t\t\t\t: index === 0;\n\n\t\t\t\treturn (\n\t\t\t\t\t<li\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'edit-site-global-styles-screen-revisions__revision-item',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'is-selected': isSelected,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__revision-button\"\n\t\t\t\t\t\t\tdisabled={ isSelected }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonChange( revision );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ getRevisionLabel( revision ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__description\">\n\t\t\t\t\t\t\t\t<time dateTime={ modified }>\n\t\t\t\t\t\t\t\t\t{ humanTimeDiff( modified ) }\n\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__meta\">\n\t\t\t\t\t\t\t\t\t{ isUnsaved\n\t\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %(name)s author display name */\n\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Unsaved changes by %(name)s'\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tname: authorDisplayName,\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %(name)s author display name */\n\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Changes saved by %(name)s'\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tname: authorDisplayName,\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t ) }\n\n\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\talt={ author?.name }\n\t\t\t\t\t\t\t\t\t\tsrc={ authorAvatar }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</li>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ol>\n\t);\n}\n\nexport default RevisionsButtons;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/revisions-buttons.js"],"names":["classnames","__","sprintf","Button","dateI18n","getDate","humanTimeDiff","getSettings","getRevisionLabel","revision","authorDisplayName","author","name","id","formattedDate","formats","datetimeAbbreviated","modified","isLatest","date","RevisionsButtons","userRevisions","selectedRevisionId","onChange","map","index","authorAvatar","avatar_urls","isUnsaved","isSelected"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,QAAT,EAAmBC,OAAnB,EAA4BC,aAA5B,EAA2CC,WAA3C,QAA8D,iBAA9D;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,gBAAT,CAA2BC,QAA3B,EAAsC;AACrC,QAAMC,iBAAiB,GAAGD,QAAQ,EAAEE,MAAV,EAAkBC,IAAlB,IAA0BX,EAAE,CAAE,MAAF,CAAtD;;AAEA,MAAK,cAAcQ,QAAQ,EAAEI,EAA7B,EAAkC;AACjC,WAAOX,OAAO;AACb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AkB,KAAKb,QAAQ,EAAEI,EADC,GAElCY,KAAK,KAAK,CAFb;AAIA,WACC;AACC,MAAA,SAAS,EAAGzB,UAAU,CACrB,yDADqB,EAErB;AACC,uBAAe6B;AADhB,OAFqB,CADvB;AAOC,MAAA,GAAG,EAAGhB;AAPP,OASC,cAAC,MAAD;AACC,MAAA,SAAS,EAAC,2DADX;AAEC,MAAA,QAAQ,EAAGgB,UAFZ;AAGC,MAAA,OAAO,EAAG,MAAM;AACfN,QAAAA,QAAQ,CAAEd,QAAF,CAAR;AACA,OALF;AAMC,MAAA,KAAK,EAAGD,gBAAgB,CAAEC,QAAF;AANzB,OAQC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACC;AAAM,MAAA,QAAQ,EAAGQ;AAAjB,OACGX,aAAa,CAAEW,QAAF,CADhB,CADD,EAIC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACGW,SAAS,GACR1B,OAAO;AACP;AACAD,IAAAA,EAAE,CACD,6BADC,CAFK,EAKP;AACCW,MAAAA,IAAI,EAAEF;AADP,KALO,CADC,GAURR,OAAO;AACP;AACAD,IAAAA,EAAE,CACD,2BADC,CAFK,EAKP;AACCW,MAAAA,IAAI,EAAEF;AADP,KALO,CAXX,EAqBC;AACC,MAAA,GAAG,EAAGC,MAAM,EAAEC,IADf;AAEC,MAAA,GAAG,EAAGc;AAFP,MArBD,CAJD,CARD,CATD,CADD;AAoDA,GA7DC,CALH,CADD;AAsEA;;AAED,eAAeN,gBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';\n\n/**\n * Returns a button label for the revision.\n *\n * @param {Object} revision A revision object.\n * @return {string} Translated label.\n */\nfunction getRevisionLabel( revision ) {\n\tconst authorDisplayName = revision?.author?.name || __( 'User' );\n\n\tif ( 'unsaved' === revision?.id ) {\n\t\treturn sprintf(\n\t\t\t/* translators: %(name)s author display name */\n\t\t\t__( 'Unsaved changes by %(name)s' ),\n\t\t\t{\n\t\t\t\tname: authorDisplayName,\n\t\t\t}\n\t\t);\n\t}\n\tconst formattedDate = dateI18n(\n\t\tgetSettings().formats.datetimeAbbreviated,\n\t\tgetDate( revision?.modified )\n\t);\n\n\treturn revision?.isLatest\n\t\t? sprintf(\n\t\t\t\t/* translators: %(name)s author display name, %(date)s: revision creation date */\n\t\t\t\t__( 'Changes saved by %(name)s on %(date)s (current)' ),\n\t\t\t\t{\n\t\t\t\t\tname: authorDisplayName,\n\t\t\t\t\tdate: formattedDate,\n\t\t\t\t}\n\t\t )\n\t\t: sprintf(\n\t\t\t\t/* translators: %(name)s author display name, %(date)s: revision creation date */\n\t\t\t\t__( 'Changes saved by %(name)s on %(date)s' ),\n\t\t\t\t{\n\t\t\t\t\tname: authorDisplayName,\n\t\t\t\t\tdate: formattedDate,\n\t\t\t\t}\n\t\t );\n}\n\n/**\n * Returns a rendered list of revisions buttons.\n *\n * @typedef {Object} props\n * @property {Array<Object>} userRevisions A collection of user revisions.\n * @property {number} selectedRevisionId The id of the currently-selected revision.\n * @property {Function} onChange Callback fired when a revision is selected.\n *\n * @param {props} Component props.\n * @return {JSX.Element} The modal component.\n */\nfunction RevisionsButtons( { userRevisions, selectedRevisionId, onChange } ) {\n\treturn (\n\t\t<ol\n\t\t\tclassName=\"edit-site-global-styles-screen-revisions__revisions-list\"\n\t\t\taria-label={ __( 'Global styles revisions' ) }\n\t\t\trole=\"group\"\n\t\t>\n\t\t\t{ userRevisions.map( ( revision, index ) => {\n\t\t\t\tconst { id, author, modified } = revision;\n\t\t\t\tconst authorDisplayName = author?.name || __( 'User' );\n\t\t\t\tconst authorAvatar = author?.avatar_urls?.[ '48' ];\n\t\t\t\tconst isUnsaved = 'unsaved' === revision?.id;\n\t\t\t\tconst isSelected = selectedRevisionId\n\t\t\t\t\t? selectedRevisionId === revision?.id\n\t\t\t\t\t: index === 0;\n\n\t\t\t\treturn (\n\t\t\t\t\t<li\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'edit-site-global-styles-screen-revisions__revision-item',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'is-selected': isSelected,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__revision-button\"\n\t\t\t\t\t\t\tdisabled={ isSelected }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonChange( revision );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ getRevisionLabel( revision ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__description\">\n\t\t\t\t\t\t\t\t<time dateTime={ modified }>\n\t\t\t\t\t\t\t\t\t{ humanTimeDiff( modified ) }\n\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__meta\">\n\t\t\t\t\t\t\t\t\t{ isUnsaved\n\t\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %(name)s author display name */\n\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Unsaved changes by %(name)s'\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tname: authorDisplayName,\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %(name)s author display name */\n\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Changes saved by %(name)s'\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tname: authorDisplayName,\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t ) }\n\n\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\talt={ author?.name }\n\t\t\t\t\t\t\t\t\t\tsrc={ authorAvatar }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</li>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ol>\n\t);\n}\n\nexport default RevisionsButtons;\n"]}
@@ -5,16 +5,11 @@ import { useSelect } from '@wordpress/data';
5
5
  import { store as coreStore } from '@wordpress/core-data';
6
6
  import { useContext, useMemo } from '@wordpress/element';
7
7
  import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
8
- /**
9
- * External dependencies
10
- */
11
-
12
- import { isEmpty } from 'lodash';
13
8
  /**
14
9
  * Internal dependencies
15
10
  */
16
11
 
17
- import { unlock } from '../../../private-apis';
12
+ import { unlock } from '../../../lock-unlock';
18
13
  const SITE_EDITOR_AUTHORS_QUERY = {
19
14
  per_page: -1,
20
15
  _fields: 'id,name,avatar_urls',
@@ -82,14 +77,14 @@ export default function useGlobalStylesRevisions() {
82
77
  } // Adds an item for unsaved changes.
83
78
 
84
79
 
85
- if (isDirty && !isEmpty(userConfig) && currentUser) {
80
+ if (isDirty && userConfig && Object.keys(userConfig).length > 0 && currentUser) {
86
81
  const unsavedRevision = {
87
82
  id: 'unsaved',
88
- styles: userConfig === null || userConfig === void 0 ? void 0 : userConfig.styles,
89
- settings: userConfig === null || userConfig === void 0 ? void 0 : userConfig.settings,
83
+ styles: userConfig?.styles,
84
+ settings: userConfig?.settings,
90
85
  author: {
91
- name: currentUser === null || currentUser === void 0 ? void 0 : currentUser.name,
92
- avatar_urls: currentUser === null || currentUser === void 0 ? void 0 : currentUser.avatar_urls
86
+ name: currentUser?.name,
87
+ avatar_urls: currentUser?.avatar_urls
93
88
  },
94
89
  modified: new Date()
95
90
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/use-global-styles-revisions.js"],"names":["useSelect","store","coreStore","useContext","useMemo","privateApis","blockEditorPrivateApis","isEmpty","unlock","SITE_EDITOR_AUTHORS_QUERY","per_page","_fields","context","capabilities","EMPTY_ARRAY","GlobalStylesContext","useGlobalStylesRevisions","user","userConfig","authors","currentUser","isDirty","revisions","select","__experimentalGetDirtyEntityRecords","getCurrentUser","getUsers","getCurrentThemeGlobalStylesRevisions","dirtyEntityRecords","_currentUser","_isDirty","length","globalStylesRevisions","_authors","_modifiedRevisions","hasUnsavedChanges","isLoading","map","revision","author","find","id","isLatest","unsavedRevision","styles","settings","name","avatar_urls","modified","Date","unshift"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,UAAT,EAAqBC,OAArB,QAAoC,oBAApC;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AACA;AACA;AACA;;AACA,SAASC,OAAT,QAAwB,QAAxB;AACA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,uBAAvB;AAEA,MAAMC,yBAAyB,GAAG;AACjCC,EAAAA,QAAQ,EAAE,CAAC,CADsB;AAEjCC,EAAAA,OAAO,EAAE,qBAFwB;AAGjCC,EAAAA,OAAO,EAAE,MAHwB;AAIjCC,EAAAA,YAAY,EAAE,CAAE,oBAAF;AAJmB,CAAlC;AAMA,MAAMC,WAAW,GAAG,EAApB;AACA,MAAM;AAAEC,EAAAA;AAAF,IAA0BP,MAAM,CAAEF,sBAAF,CAAtC;AACA,eAAe,SAASU,wBAAT,GAAo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AAR,CACLD,MAAF,IAAcA,MAAM,CAACE,EAAP,KAAcH,QAAQ,CAACC,MAD9B;AAFF,OAAP;AAMA,KAPoB,CAArB,CAXqB,CAoBrB;;AACA,QAAKL,kBAAkB,CAAE,CAAF,CAAlB,CAAwBO,EAAxB,KAA+B,SAApC,EAAgD;AAC/CP,MAAAA,kBAAkB,CAAE,CAAF,CAAlB,CAAwBQ,QAAxB,GAAmC,IAAnC;AACA,KAvBoB,CAyBrB;;;AACA,QAAKrB,OAAO,IAAI,CAAEd,OAAO,CAAEW,UAAF,CAApB,IAAsCE,WAA3C,EAAyD;AACxD,YAAMuB,eAAe,GAAG;AACvBF,QAAAA,EAAE,EAAE,SADmB;AAEvBG,QAAAA,MAAM,EAAE1B,UAAF,aAAEA,UAAF,uBAAEA,UAAU,CAAE0B,MAFG;AAGvBC,QAAAA,QAAQ,EAAE3B,UAAF,aAAEA,UAAF,uBAAEA,UAAU,CAAE2B,QAHC;AAIvBN,QAAAA,MAAM,EAAE;AACPO,UAAAA,IAAI,EAAE1B,WAAF,aAAEA,WAAF,uBAAEA,WAAW,CAAE0B,IADZ;AAEPC,UAAAA,WAAW,EAAE3B,WAAF,aAAEA,WAAF,uBAAEA,WAAW,CAAE2B;AAFnB,SAJe;AAQvBC,QAAAA,QAAQ,EAAE,IAAIC,IAAJ;AARa,OAAxB;;AAWAf,MAAAA,kBAAkB,CAACgB,OAAnB,CAA4BP,eAA5B;AACA;;AAED,WAAO;AACNrB,MAAAA,SAAS,EAAEY,kBADL;AAENC,MAAAA,iBAAiB,EAAEd,OAFb;AAGNe,MAAAA,SAAS,EAAE;AAHL,KAAP;AAKA,GA9Ca,EA8CX,CAAEf,OAAF,EAAWC,SAAX,EAAsBF,WAAtB,EAAmCD,OAAnC,EAA4CD,UAA5C,CA9CW,CAAd;AA+CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../private-apis';\n\nconst SITE_EDITOR_AUTHORS_QUERY = {\n\tper_page: -1,\n\t_fields: 'id,name,avatar_urls',\n\tcontext: 'view',\n\tcapabilities: [ 'edit_theme_options' ],\n};\nconst EMPTY_ARRAY = [];\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\nexport default function useGlobalStylesRevisions() {\n\tconst { user: userConfig } = useContext( GlobalStylesContext );\n\tconst { authors, currentUser, isDirty, revisions } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tgetCurrentUser,\n\t\t\t\tgetUsers,\n\t\t\t\tgetCurrentThemeGlobalStylesRevisions,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst _currentUser = getCurrentUser();\n\t\t\tconst _isDirty = dirtyEntityRecords.length > 0;\n\t\t\tconst globalStylesRevisions =\n\t\t\t\tgetCurrentThemeGlobalStylesRevisions() || EMPTY_ARRAY;\n\t\t\tconst _authors =\n\t\t\t\tgetUsers( SITE_EDITOR_AUTHORS_QUERY ) || EMPTY_ARRAY;\n\n\t\t\treturn {\n\t\t\t\tauthors: _authors,\n\t\t\t\tcurrentUser: _currentUser,\n\t\t\t\tisDirty: _isDirty,\n\t\t\t\trevisions: globalStylesRevisions,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\treturn useMemo( () => {\n\t\tlet _modifiedRevisions = [];\n\t\tif ( ! authors.length || ! revisions.length ) {\n\t\t\treturn {\n\t\t\t\trevisions: _modifiedRevisions,\n\t\t\t\thasUnsavedChanges: isDirty,\n\t\t\t\tisLoading: true,\n\t\t\t};\n\t\t}\n\n\t\t// Adds author details to each revision.\n\t\t_modifiedRevisions = revisions.map( ( revision ) => {\n\t\t\treturn {\n\t\t\t\t...revision,\n\t\t\t\tauthor: authors.find(\n\t\t\t\t\t( author ) => author.id === revision.author\n\t\t\t\t),\n\t\t\t};\n\t\t} );\n\n\t\t// Flags the most current saved revision.\n\t\tif ( _modifiedRevisions[ 0 ].id !== 'unsaved' ) {\n\t\t\t_modifiedRevisions[ 0 ].isLatest = true;\n\t\t}\n\n\t\t// Adds an item for unsaved changes.\n\t\tif ( isDirty && ! isEmpty( userConfig ) && currentUser ) {\n\t\t\tconst unsavedRevision = {\n\t\t\t\tid: 'unsaved',\n\t\t\t\tstyles: userConfig?.styles,\n\t\t\t\tsettings: userConfig?.settings,\n\t\t\t\tauthor: {\n\t\t\t\t\tname: currentUser?.name,\n\t\t\t\t\tavatar_urls: currentUser?.avatar_urls,\n\t\t\t\t},\n\t\t\t\tmodified: new Date(),\n\t\t\t};\n\n\t\t\t_modifiedRevisions.unshift( unsavedRevision );\n\t\t}\n\n\t\treturn {\n\t\t\trevisions: _modifiedRevisions,\n\t\t\thasUnsavedChanges: isDirty,\n\t\t\tisLoading: false,\n\t\t};\n\t}, [ isDirty, revisions, currentUser, authors, userConfig ] );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/use-global-styles-revisions.js"],"names":["useSelect","store","coreStore","useContext","useMemo","privateApis","blockEditorPrivateApis","unlock","SITE_EDITOR_AUTHORS_QUERY","per_page","_fields","context","capabilities","EMPTY_ARRAY","GlobalStylesContext","useGlobalStylesRevisions","user","userConfig","authors","currentUser","isDirty","revisions","select","__experimentalGetDirtyEntityRecords","getCurrentUser","getUsers","getCurrentThemeGlobalStylesRevisions","dirtyEntityRecords","_currentUser","_isDirty","length","globalStylesRevisions","_authors","_modifiedRevisions","hasUnsavedChanges","isLoading","map","revision","author","find","id","isLatest","Object","keys","unsavedRevision","styles","settings","name","avatar_urls","modified","Date","unshift"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA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AQ,EAAE,IAAIC,IAAJ;AARa,OAAxB;;AAWAjB,MAAAA,kBAAkB,CAACkB,OAAnB,CAA4BP,eAA5B;AACA;;AAED,WAAO;AACNvB,MAAAA,SAAS,EAAEY,kBADL;AAENC,MAAAA,iBAAiB,EAAEd,OAFb;AAGNe,MAAAA,SAAS,EAAE;AAHL,KAAP;AAKA,GAnDa,EAmDX,CAAEf,OAAF,EAAWC,SAAX,EAAsBF,WAAtB,EAAmCD,OAAnC,EAA4CD,UAA5C,CAnDW,CAAd;AAoDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst SITE_EDITOR_AUTHORS_QUERY = {\n\tper_page: -1,\n\t_fields: 'id,name,avatar_urls',\n\tcontext: 'view',\n\tcapabilities: [ 'edit_theme_options' ],\n};\nconst EMPTY_ARRAY = [];\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\nexport default function useGlobalStylesRevisions() {\n\tconst { user: userConfig } = useContext( GlobalStylesContext );\n\tconst { authors, currentUser, isDirty, revisions } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tgetCurrentUser,\n\t\t\t\tgetUsers,\n\t\t\t\tgetCurrentThemeGlobalStylesRevisions,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst _currentUser = getCurrentUser();\n\t\t\tconst _isDirty = dirtyEntityRecords.length > 0;\n\t\t\tconst globalStylesRevisions =\n\t\t\t\tgetCurrentThemeGlobalStylesRevisions() || EMPTY_ARRAY;\n\t\t\tconst _authors =\n\t\t\t\tgetUsers( SITE_EDITOR_AUTHORS_QUERY ) || EMPTY_ARRAY;\n\n\t\t\treturn {\n\t\t\t\tauthors: _authors,\n\t\t\t\tcurrentUser: _currentUser,\n\t\t\t\tisDirty: _isDirty,\n\t\t\t\trevisions: globalStylesRevisions,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\treturn useMemo( () => {\n\t\tlet _modifiedRevisions = [];\n\t\tif ( ! authors.length || ! revisions.length ) {\n\t\t\treturn {\n\t\t\t\trevisions: _modifiedRevisions,\n\t\t\t\thasUnsavedChanges: isDirty,\n\t\t\t\tisLoading: true,\n\t\t\t};\n\t\t}\n\n\t\t// Adds author details to each revision.\n\t\t_modifiedRevisions = revisions.map( ( revision ) => {\n\t\t\treturn {\n\t\t\t\t...revision,\n\t\t\t\tauthor: authors.find(\n\t\t\t\t\t( author ) => author.id === revision.author\n\t\t\t\t),\n\t\t\t};\n\t\t} );\n\n\t\t// Flags the most current saved revision.\n\t\tif ( _modifiedRevisions[ 0 ].id !== 'unsaved' ) {\n\t\t\t_modifiedRevisions[ 0 ].isLatest = true;\n\t\t}\n\n\t\t// Adds an item for unsaved changes.\n\t\tif (\n\t\t\tisDirty &&\n\t\t\tuserConfig &&\n\t\t\tObject.keys( userConfig ).length > 0 &&\n\t\t\tcurrentUser\n\t\t) {\n\t\t\tconst unsavedRevision = {\n\t\t\t\tid: 'unsaved',\n\t\t\t\tstyles: userConfig?.styles,\n\t\t\t\tsettings: userConfig?.settings,\n\t\t\t\tauthor: {\n\t\t\t\t\tname: currentUser?.name,\n\t\t\t\t\tavatar_urls: currentUser?.avatar_urls,\n\t\t\t\t},\n\t\t\t\tmodified: new Date(),\n\t\t\t};\n\n\t\t\t_modifiedRevisions.unshift( unsavedRevision );\n\t\t}\n\n\t\treturn {\n\t\t\trevisions: _modifiedRevisions,\n\t\t\thasUnsavedChanges: isDirty,\n\t\t\tisLoading: false,\n\t\t};\n\t}, [ isDirty, revisions, currentUser, authors, userConfig ] );\n}\n"]}
@@ -17,7 +17,7 @@ import { IconWithCurrentColor } from './icon-with-current-color';
17
17
  import { NavigationButtonAsItem } from './navigation-button';
18
18
  import RootMenu from './root-menu';
19
19
  import StylesPreview from './preview';
20
- import { unlock } from '../../private-apis';
20
+ import { unlock } from '../../lock-unlock';
21
21
 
22
22
  function ScreenRoot() {
23
23
  const {
@@ -28,7 +28,7 @@ function ScreenRoot() {
28
28
  hasVariations,
29
29
  canEditCSS
30
30
  } = useSelect(select => {
31
- var _experimentalGetCurr, _globalStyles$_links$, _globalStyles$_links;
31
+ var _globalStyles$_links$;
32
32
 
33
33
  const {
34
34
  getEntityRecord,
@@ -40,8 +40,8 @@ function ScreenRoot() {
40
40
 
41
41
  const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
42
42
  return {
43
- hasVariations: !!((_experimentalGetCurr = __experimentalGetCurrentThemeGlobalStylesVariations()) !== null && _experimentalGetCurr !== void 0 && _experimentalGetCurr.length),
44
- 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
43
+ hasVariations: !!__experimentalGetCurrentThemeGlobalStylesVariations()?.length,
44
+ canEditCSS: (_globalStyles$_links$ = !!globalStyles?._links?.['wp:action-edit-css']) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : false
45
45
  };
46
46
  }, []);
47
47
  return createElement(Card, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"names":["__experimentalItemGroup","ItemGroup","__experimentalHStack","HStack","__experimentalSpacer","Spacer","__experimentalVStack","VStack","FlexItem","CardBody","Card","CardDivider","CardMedia","isRTL","__","chevronLeft","chevronRight","useSelect","store","coreStore","privateApis","blockEditorPrivateApis","IconWithCurrentColor","NavigationButtonAsItem","RootMenu","StylesPreview","unlock","ScreenRoot","useGlobalStyle","customCSS","hasVariations","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","__experimentalGetCurrentThemeGlobalStylesVariations","globalStylesId","globalStyles","undefined","length","_links"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAD5B,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,oBAAoB,IAAIC,MAJzB,EAKCC,QALD,EAMCC,QAND,EAOCC,IAPD,EAQCC,WARD,EASCC,SATD,QAUO,uBAVP;AAWA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBAA1B;AACA,SAASC,WAAT,EAAsBC,YAAtB,QAA0C,kBAA1C;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASC,oBAAT,QAAqC,2BAArC;AACA,SAASC,sBAAT,QAAuC,qBAAvC;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,aAAP,MAA0B,WAA1B;AACA,SAASC,MAAT,QAAuB,oBAAvB;;AAEA,SAASC,UAAT,GAAsB;AACrB,QAAM;AAAEC,IAAAA;AAAF,MAAqBF,MAAM,CAAEL,sBAAF,CAAjC;AACA,QAAM,CAAEQ,SAAF,IAAgBD,cAAc,CAAE,KAAF,CAApC;AAEA,QAAM;AAAEE,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,MAAgCd,SAAS,CAAIe,MAAF,IAAc;AAAA;;AAC9D,UAAM;AACLC,MAAAA,eADK;AAELC,MAAAA,sCAFK;AAGLC,MAAAA;AAHK,QAIFH,MAAM,CAAEb,SAAF,CAJV;;AAMA,UAAMiB,cAAc,GAAGF,sCAAsC,EAA7D;;AACA,UAAMG,YAAY,GAAGD,cAAc,GAChCH,eAAe,CAAE,MAAF,EAAU,cAAV,EAA0BG,cAA1B,CADiB,GAEhCE,SA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C;AAAhB,KACC,cAAC,QAAD,QAAYA,EAAE,CAAE,QAAF,CAAd,CADD,EAEC,cAAC,oBAAD;AACC,IAAA,IAAI,EAAGD,KAAK,KAAKE,WAAL,GAAmBC;AADhC,IAFD,CAJD,CADD,CAhBD,CAjCD,EAgEGe,UAAU,IAAI,CAAC,CAAEF,SAAjB,IACD,8BACC,cAAC,WAAD,OADD,EAEC,cAAC,QAAD,QACC,cAAC,MAAD;AACC,IAAA,EAAE,EAAC,GADJ;AAEC,IAAA,UAAU,EAAG,CAFd;AAGC,IAAA,QAAQ,EAAC,MAHV;AAIC,IAAA,YAAY,EAAG;AAJhB,KAMGf,EAAE,CACH,uEADG,CANL,CADD,EAWC,cAAC,SAAD,QACC,cAAC,sBAAD;AACC,IAAA,IAAI,EAAC,MADN;AAEC,kBAAaA,EAAE,CAAE,gBAAF;AAFhB,KAIC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,cAAC,QAAD,QACGA,EAAE,CAAE,gBAAF,CADL,CADD,EAIC,cAAC,oBAAD;AACC,IAAA,IAAI,EACHD,KAAK,KAAKE,WAAL,GAAmBC;AAF1B,IAJD,CAJD,CADD,CAXD,CAFD,CAjEF,CADD;AAqGA;;AAED,eAAeW,UAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalVStack as VStack,\n\tFlexItem,\n\tCardBody,\n\tCard,\n\tCardDivider,\n\tCardMedia,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronLeft, chevronRight } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { IconWithCurrentColor } from './icon-with-current-color';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport RootMenu from './root-menu';\nimport StylesPreview from './preview';\nimport { unlock } from '../../private-apis';\n\nfunction ScreenRoot() {\n\tconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\tconst [ customCSS ] = useGlobalStyle( 'css' );\n\n\tconst { hasVariations, canEditCSS } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEntityRecord,\n\t\t\t__experimentalGetCurrentGlobalStylesId,\n\t\t\t__experimentalGetCurrentThemeGlobalStylesVariations,\n\t\t} = select( 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\thasVariations:\n\t\t\t\t!! __experimentalGetCurrentThemeGlobalStylesVariations()\n\t\t\t\t\t?.length,\n\t\t\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Card size=\"small\" className=\"edit-site-global-styles-screen-root\">\n\t\t\t<CardBody>\n\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t<Card>\n\t\t\t\t\t\t<CardMedia>\n\t\t\t\t\t\t\t<StylesPreview />\n\t\t\t\t\t\t</CardMedia>\n\t\t\t\t\t</Card>\n\t\t\t\t\t{ hasVariations && (\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\tpath=\"/variations\"\n\t\t\t\t\t\t\t\taria-label={ __( 'Browse styles' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Browse styles' ) }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t) }\n\t\t\t\t\t<RootMenu />\n\t\t\t\t</VStack>\n\t\t\t</CardBody>\n\n\t\t\t<CardDivider />\n\n\t\t\t<CardBody>\n\t\t\t\t<Spacer\n\t\t\t\t\tas=\"p\"\n\t\t\t\t\tpaddingTop={ 2 }\n\t\t\t\t\t/*\n\t\t\t\t\t * 13px matches the text inset of the NavigationButton (12px padding, plus the width of the button's border).\n\t\t\t\t\t * This is an ad hoc override for this instance and the Addtional CSS option below. Other options for matching the\n\t\t\t\t\t * the nav button inset should be looked at before reusing further.\n\t\t\t\t\t */\n\t\t\t\t\tpaddingX=\"13px\"\n\t\t\t\t\tmarginBottom={ 4 }\n\t\t\t\t>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Customize the appearance of specific blocks for the whole site.'\n\t\t\t\t\t) }\n\t\t\t\t</Spacer>\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tpath=\"/blocks\"\n\t\t\t\t\t\taria-label={ __( 'Blocks styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t<FlexItem>{ __( 'Blocks' ) }</FlexItem>\n\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\ticon={ isRTL() ? chevronLeft : chevronRight }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t</ItemGroup>\n\t\t\t</CardBody>\n\n\t\t\t{ canEditCSS && !! customCSS && (\n\t\t\t\t<>\n\t\t\t\t\t<CardDivider />\n\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t<Spacer\n\t\t\t\t\t\t\tas=\"p\"\n\t\t\t\t\t\t\tpaddingTop={ 2 }\n\t\t\t\t\t\t\tpaddingX=\"13px\"\n\t\t\t\t\t\t\tmarginBottom={ 4 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Add your own CSS to customize the appearance and layout of your site.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\tpath=\"/css\"\n\t\t\t\t\t\t\t\taria-label={ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</CardBody>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</Card>\n\t);\n}\n\nexport default ScreenRoot;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"names":["__experimentalItemGroup","ItemGroup","__experimentalHStack","HStack","__experimentalSpacer","Spacer","__experimentalVStack","VStack","FlexItem","CardBody","Card","CardDivider","CardMedia","isRTL","__","chevronLeft","chevronRight","useSelect","store","coreStore","privateApis","blockEditorPrivateApis","IconWithCurrentColor","NavigationButtonAsItem","RootMenu","StylesPreview","unlock","ScreenRoot","useGlobalStyle","customCSS","hasVariations","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","__experimentalGetCurrentThemeGlobalStylesVariations","globalStylesId","globalStyles","undefined","length","_links"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAD5B,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,oBAAoB,IAAIC,MAJzB,EAKCC,QALD,EAMCC,QAND,EAOCC,IAPD,EAQCC,WARD,EASCC,SATD,QAUO,uBAVP;AAWA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBAA1B;AACA,SAASC,WAAT,EAAsBC,YAAtB,QAA0C,kBAA1C;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASC,oBAAT,QAAqC,2BAArC;AACA,SAASC,sBAAT,QAAuC,qBAAvC;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,aAAP,MAA0B,WAA1B;AACA,SAASC,MAAT,QAAuB,mBAAvB;;AAEA,SAASC,UAAT,GAAsB;AACrB,QAAM;AAAEC,IAAAA;AAAF,MAAqBF,MAAM,CAAEL,sBAAF,CAAjC;AACA,QAAM,CAAEQ,SAAF,IAAgBD,cAAc,CAAE,KAAF,CAApC;AAEA,QAAM;AAAEE,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,MAAgCd,SAAS,CAAIe,MAAF,IAAc;AAAA;;AAC9D,UAAM;AACLC,MAAAA,eADK;AAELC,MAAAA,sCAFK;AAGLC,MAAAA;AAHK,QAIFH,MAAM,CAAEb,SAAF,CAJV;;AAMA,UAAMiB,cAAc,GAAGF,sCAAsC,EAA7D;;AACA,UAAMG,YAAY,GAAGD,cAAc,GAChCH,eAAe,CAAE,MAAF,EAAU,cAAV,EAA0BG,cAA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E,QAAF,CAAd,CADD,EAEC,cAAC,oBAAD;AACC,IAAA,IAAI,EAAGD,KAAK,KAAKE,WAAL,GAAmBC;AADhC,IAFD,CAJD,CADD,CAhBD,CAjCD,EAgEGe,UAAU,IAAI,CAAC,CAAEF,SAAjB,IACD,8BACC,cAAC,WAAD,OADD,EAEC,cAAC,QAAD,QACC,cAAC,MAAD;AACC,IAAA,EAAE,EAAC,GADJ;AAEC,IAAA,UAAU,EAAG,CAFd;AAGC,IAAA,QAAQ,EAAC,MAHV;AAIC,IAAA,YAAY,EAAG;AAJhB,KAMGf,EAAE,CACH,uEADG,CANL,CADD,EAWC,cAAC,SAAD,QACC,cAAC,sBAAD;AACC,IAAA,IAAI,EAAC,MADN;AAEC,kBAAaA,EAAE,CAAE,gBAAF;AAFhB,KAIC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,cAAC,QAAD,QACGA,EAAE,CAAE,gBAAF,CADL,CADD,EAIC,cAAC,oBAAD;AACC,IAAA,IAAI,EACHD,KAAK,KAAKE,WAAL,GAAmBC;AAF1B,IAJD,CAJD,CADD,CAXD,CAFD,CAjEF,CADD;AAqGA;;AAED,eAAeW,UAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalVStack as VStack,\n\tFlexItem,\n\tCardBody,\n\tCard,\n\tCardDivider,\n\tCardMedia,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronLeft, chevronRight } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { IconWithCurrentColor } from './icon-with-current-color';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport RootMenu from './root-menu';\nimport StylesPreview from './preview';\nimport { unlock } from '../../lock-unlock';\n\nfunction ScreenRoot() {\n\tconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\tconst [ customCSS ] = useGlobalStyle( 'css' );\n\n\tconst { hasVariations, canEditCSS } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEntityRecord,\n\t\t\t__experimentalGetCurrentGlobalStylesId,\n\t\t\t__experimentalGetCurrentThemeGlobalStylesVariations,\n\t\t} = select( 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\thasVariations:\n\t\t\t\t!! __experimentalGetCurrentThemeGlobalStylesVariations()\n\t\t\t\t\t?.length,\n\t\t\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Card size=\"small\" className=\"edit-site-global-styles-screen-root\">\n\t\t\t<CardBody>\n\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t<Card>\n\t\t\t\t\t\t<CardMedia>\n\t\t\t\t\t\t\t<StylesPreview />\n\t\t\t\t\t\t</CardMedia>\n\t\t\t\t\t</Card>\n\t\t\t\t\t{ hasVariations && (\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\tpath=\"/variations\"\n\t\t\t\t\t\t\t\taria-label={ __( 'Browse styles' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Browse styles' ) }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t) }\n\t\t\t\t\t<RootMenu />\n\t\t\t\t</VStack>\n\t\t\t</CardBody>\n\n\t\t\t<CardDivider />\n\n\t\t\t<CardBody>\n\t\t\t\t<Spacer\n\t\t\t\t\tas=\"p\"\n\t\t\t\t\tpaddingTop={ 2 }\n\t\t\t\t\t/*\n\t\t\t\t\t * 13px matches the text inset of the NavigationButton (12px padding, plus the width of the button's border).\n\t\t\t\t\t * This is an ad hoc override for this instance and the Addtional CSS option below. Other options for matching the\n\t\t\t\t\t * the nav button inset should be looked at before reusing further.\n\t\t\t\t\t */\n\t\t\t\t\tpaddingX=\"13px\"\n\t\t\t\t\tmarginBottom={ 4 }\n\t\t\t\t>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Customize the appearance of specific blocks for the whole site.'\n\t\t\t\t\t) }\n\t\t\t\t</Spacer>\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tpath=\"/blocks\"\n\t\t\t\t\t\taria-label={ __( 'Blocks styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t<FlexItem>{ __( 'Blocks' ) }</FlexItem>\n\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\ticon={ isRTL() ? chevronLeft : chevronRight }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t</ItemGroup>\n\t\t\t</CardBody>\n\n\t\t\t{ canEditCSS && !! customCSS && (\n\t\t\t\t<>\n\t\t\t\t\t<CardDivider />\n\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t<Spacer\n\t\t\t\t\t\t\tas=\"p\"\n\t\t\t\t\t\t\tpaddingTop={ 2 }\n\t\t\t\t\t\t\tpaddingX=\"13px\"\n\t\t\t\t\t\t\tmarginBottom={ 4 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Add your own CSS to customize the appearance and layout of your site.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\tpath=\"/css\"\n\t\t\t\t\t\t\t\taria-label={ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</CardBody>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</Card>\n\t);\n}\n\nexport default ScreenRoot;\n"]}
@@ -36,10 +36,9 @@ const elements = {
36
36
  }
37
37
  };
38
38
 
39
- function ScreenTypographyElement(_ref) {
40
- let {
41
- element
42
- } = _ref;
39
+ function ScreenTypographyElement({
40
+ element
41
+ }) {
43
42
  const [headingLevel, setHeadingLevel] = useState('heading');
44
43
  return createElement(Fragment, null, createElement(ScreenHeader, {
45
44
  title: elements[element].title,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography-element.js"],"names":["__","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","__experimentalSpacer","Spacer","useState","TypographyPanel","ScreenHeader","TypographyPreview","elements","text","description","title","link","heading","caption","button","ScreenTypographyElement","element","headingLevel","setHeadingLevel"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SACCC,gCAAgC,IAAIC,kBADrC,EAECC,sCAAsC,IAAIC,wBAF3C,EAGCC,oBAAoB,IAAIC,MAHzB,QAIO,uBAJP;AAKA,SAASC,QAAT,QAAyB,oBAAzB;AAEA;AACA;AACA;;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,OAAOC,iBAAP,MAA8B,sBAA9B;AAEA,MAAMC,QAAQ,GAAG;AAChBC,EAAAA,IAAI,EAAE;AACLC,IAAAA,WAAW,EAAEb,EAAE,CAAE,oCAAF,CADV;AAELc,IAAAA,KAAK,EAAEd,EAAE,CAAE,MAAF;AAFJ,GADU;AAKhBe,EAAAA,IAAI,EAAE;AACLF,IAAAA,WAAW,EAAEb,EAAE,CAAE,oDAAF,CADV;AAELc,IAAAA,KAAK,EAAEd,EAAE,CAAE,OAAF;AAFJ,GALU;AAShBgB,EAAAA,OAAO,EAAE;AACRH,IAAAA,WAAW,EAAEb,EAAE,CAAE,mDAAF,CADP;AAERc,IAAAA,KAAK,EAAEd,EAAE,CAAE,UAAF;AAFD,GATO;AAahBiB,EAAAA,OAAO,EAAE;AACRJ,IAAAA,WAAW,EAAEb,EAAE,CAAE,mDAAF,CADP;AAERc,IAAAA,KAAK,EAAEd,EAAE,CAAE,UAAF;AAFD,GAbO;AAiBhBkB,EAAAA,MAAM,EAAE;AACPL,IAAAA,WAAW,EAAEb,EAAE,CAAE,kDAAF,CADR;AAEPc,IAAAA,KAAK,EAAEd,EAAE,CAAE,SAAF;AAFF;AAjBQ,CAAjB;;AAuBA,SAASmB,uBAAT,OAAgD;AAAA,MAAd;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EC,IAAA,KAAK,EAAGA,EAAE,CAAE,IAAF;AAFX,IA3BD,EA+BC,cAAC,wBAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAGA,EAAE,CAAE,IAAF;AAFX,IA/BD,EAmCC,cAAC,wBAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAGA,EAAE,CAAE,IAAF;AAFX,IAnCD,CADD,CAZF,EAuDC,cAAC,eAAD;AACC,IAAA,OAAO,EAAGoB,OADX;AAEC,IAAA,YAAY,EAAGC;AAFhB,IAvDD,CADD;AA8DA;;AAED,eAAeF,uBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalSpacer as Spacer,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport TypographyPanel from './typography-panel';\nimport ScreenHeader from './header';\nimport TypographyPreview from './typography-preview';\n\nconst elements = {\n\ttext: {\n\t\tdescription: __( 'Manage the fonts used on the site.' ),\n\t\ttitle: __( 'Text' ),\n\t},\n\tlink: {\n\t\tdescription: __( 'Manage the fonts and typography used on the links.' ),\n\t\ttitle: __( 'Links' ),\n\t},\n\theading: {\n\t\tdescription: __( 'Manage the fonts and typography used on headings.' ),\n\t\ttitle: __( 'Headings' ),\n\t},\n\tcaption: {\n\t\tdescription: __( 'Manage the fonts and typography used on captions.' ),\n\t\ttitle: __( 'Captions' ),\n\t},\n\tbutton: {\n\t\tdescription: __( 'Manage the fonts and typography used on buttons.' ),\n\t\ttitle: __( 'Buttons' ),\n\t},\n};\n\nfunction ScreenTypographyElement( { element } ) {\n\tconst [ headingLevel, setHeadingLevel ] = useState( 'heading' );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ elements[ element ].title }\n\t\t\t\tdescription={ elements[ element ].description }\n\t\t\t/>\n\t\t\t<Spacer marginX={ 4 }>\n\t\t\t\t<TypographyPreview\n\t\t\t\t\telement={ element }\n\t\t\t\t\theadingLevel={ headingLevel }\n\t\t\t\t/>\n\t\t\t</Spacer>\n\t\t\t{ element === 'heading' && (\n\t\t\t\t<Spacer marginX={ 4 } marginBottom=\"1em\">\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\tlabel={ __( 'Select heading level' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tvalue={ headingLevel }\n\t\t\t\t\t\tonChange={ setHeadingLevel }\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"heading\"\n\t\t\t\t\t\t\t/* translators: 'All' refers to selecting all heading levels \n\t\t\t\t\t\t\tand applying the same style to h1-h6. */\n\t\t\t\t\t\t\tlabel={ __( 'All' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h1\"\n\t\t\t\t\t\t\tlabel={ __( 'H1' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h2\"\n\t\t\t\t\t\t\tlabel={ __( 'H2' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h3\"\n\t\t\t\t\t\t\tlabel={ __( 'H3' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h4\"\n\t\t\t\t\t\t\tlabel={ __( 'H4' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h5\"\n\t\t\t\t\t\t\tlabel={ __( 'H5' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h6\"\n\t\t\t\t\t\t\tlabel={ __( 'H6' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t</Spacer>\n\t\t\t) }\n\t\t\t<TypographyPanel\n\t\t\t\telement={ element }\n\t\t\t\theadingLevel={ headingLevel }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenTypographyElement;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography-element.js"],"names":["__","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","__experimentalSpacer","Spacer","useState","TypographyPanel","ScreenHeader","TypographyPreview","elements","text","description","title","link","heading","caption","button","ScreenTypographyElement","element","headingLevel","setHeadingLevel"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SACCC,gCAAgC,IAAIC,kBADrC,EAECC,sCAAsC,IAAIC,wBAF3C,EAGCC,oBAAoB,IAAIC,MAHzB,QAIO,uBAJP;AAKA,SAASC,QAAT,QAAyB,oBAAzB;AAEA;AACA;AACA;;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,OAAOC,iBAAP,MAA8B,sBAA9B;AAEA,MAAMC,QAAQ,GAAG;AAChBC,EAAAA,IAAI,EAAE;AACLC,IAAAA,WAAW,EAAEb,EAAE,CAAE,oCAAF,CADV;AAELc,IAAAA,KAAK,EAAEd,EAAE,CAAE,MAAF;AAFJ,GADU;AAKhBe,EAAAA,IAAI,EAAE;AACLF,IAAAA,WAAW,EAAEb,EAAE,CAAE,oDAAF,CADV;AAELc,IAAAA,KAAK,EAAEd,EAAE,CAAE,OAAF;AAFJ,GALU;AAShBgB,EAAAA,OAAO,EAAE;AACRH,IAAAA,WAA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IAAA,KAAK,EAAGtB,EAAE,CAAE,KAAF;AAJX,IATD,EAeC,cAAC,wBAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAGA,EAAE,CAAE,IAAF;AAFX,IAfD,EAmBC,cAAC,wBAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAGA,EAAE,CAAE,IAAF;AAFX,IAnBD,EAuBC,cAAC,wBAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAGA,EAAE,CAAE,IAAF;AAFX,IAvBD,EA2BC,cAAC,wBAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAGA,EAAE,CAAE,IAAF;AAFX,IA3BD,EA+BC,cAAC,wBAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAGA,EAAE,CAAE,IAAF;AAFX,IA/BD,EAmCC,cAAC,wBAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAGA,EAAE,CAAE,IAAF;AAFX,IAnCD,CADD,CAZF,EAuDC,cAAC,eAAD;AACC,IAAA,OAAO,EAAGoB,OADX;AAEC,IAAA,YAAY,EAAGC;AAFhB,IAvDD,CADD;AA8DA;;AAED,eAAeF,uBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalSpacer as Spacer,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport TypographyPanel from './typography-panel';\nimport ScreenHeader from './header';\nimport TypographyPreview from './typography-preview';\n\nconst elements = {\n\ttext: {\n\t\tdescription: __( 'Manage the fonts used on the site.' ),\n\t\ttitle: __( 'Text' ),\n\t},\n\tlink: {\n\t\tdescription: __( 'Manage the fonts and typography used on the links.' ),\n\t\ttitle: __( 'Links' ),\n\t},\n\theading: {\n\t\tdescription: __( 'Manage the fonts and typography used on headings.' ),\n\t\ttitle: __( 'Headings' ),\n\t},\n\tcaption: {\n\t\tdescription: __( 'Manage the fonts and typography used on captions.' ),\n\t\ttitle: __( 'Captions' ),\n\t},\n\tbutton: {\n\t\tdescription: __( 'Manage the fonts and typography used on buttons.' ),\n\t\ttitle: __( 'Buttons' ),\n\t},\n};\n\nfunction ScreenTypographyElement( { element } ) {\n\tconst [ headingLevel, setHeadingLevel ] = useState( 'heading' );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ elements[ element ].title }\n\t\t\t\tdescription={ elements[ element ].description }\n\t\t\t/>\n\t\t\t<Spacer marginX={ 4 }>\n\t\t\t\t<TypographyPreview\n\t\t\t\t\telement={ element }\n\t\t\t\t\theadingLevel={ headingLevel }\n\t\t\t\t/>\n\t\t\t</Spacer>\n\t\t\t{ element === 'heading' && (\n\t\t\t\t<Spacer marginX={ 4 } marginBottom=\"1em\">\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\tlabel={ __( 'Select heading level' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tvalue={ headingLevel }\n\t\t\t\t\t\tonChange={ setHeadingLevel }\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"heading\"\n\t\t\t\t\t\t\t/* translators: 'All' refers to selecting all heading levels \n\t\t\t\t\t\t\tand applying the same style to h1-h6. */\n\t\t\t\t\t\t\tlabel={ __( 'All' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h1\"\n\t\t\t\t\t\t\tlabel={ __( 'H1' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h2\"\n\t\t\t\t\t\t\tlabel={ __( 'H2' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h3\"\n\t\t\t\t\t\t\tlabel={ __( 'H3' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h4\"\n\t\t\t\t\t\t\tlabel={ __( 'H4' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h5\"\n\t\t\t\t\t\t\tlabel={ __( 'H5' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h6\"\n\t\t\t\t\t\t\tlabel={ __( 'H6' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t</Spacer>\n\t\t\t) }\n\t\t\t<TypographyPanel\n\t\t\t\telement={ element }\n\t\t\t\theadingLevel={ headingLevel }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenTypographyElement;\n"]}
@@ -14,17 +14,16 @@ import ScreenHeader from './header';
14
14
  import { NavigationButtonAsItem } from './navigation-button';
15
15
  import Subtitle from './subtitle';
16
16
  import BlockPreviewPanel from './block-preview-panel';
17
- import { unlock } from '../../private-apis';
17
+ import { unlock } from '../../lock-unlock';
18
18
  const {
19
19
  useGlobalStyle
20
20
  } = unlock(blockEditorPrivateApis);
21
21
 
22
- function Item(_ref) {
23
- let {
24
- parentMenu,
25
- element,
26
- label
27
- } = _ref;
22
+ function Item({
23
+ parentMenu,
24
+ element,
25
+ label
26
+ }) {
28
27
  const prefix = element === 'text' || !element ? '' : `elements.${element}.`;
29
28
  const extraStyles = element === 'link' ? {
30
29
  textDecoration: 'underline'
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography.js"],"names":["__","sprintf","__experimentalItemGroup","ItemGroup","__experimentalVStack","VStack","__experimentalHStack","HStack","FlexItem","privateApis","blockEditorPrivateApis","ScreenHeader","NavigationButtonAsItem","Subtitle","BlockPreviewPanel","unlock","useGlobalStyle","Item","parentMenu","element","label","prefix","extraStyles","textDecoration","fontFamily","fontStyle","fontWeight","letterSpacing","backgroundColor","gradientValue","color","navigationButtonLabel","background","ScreenTypography"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SACCC,uBAAuB,IAAIC,SAD5B,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,QAJD,QAKO,uBALP;AAMA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,SAASC,sBAAT,QAAuC,qBAAvC;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAqBD,MAAM,CAAEL,sBAAF,CAAjC;;AAEA,SAASO,IAAT,OAAgD;AAAA,MAAjC;AAAEC,IAAAA,UAAF;AAAcC,IAAAA,OAAd;AAAuBC,IAAAA;AAAvB,GAAiC;AAC/C,QAAMC,MAAM,GACXF,OAAO,KAAK,MAAZ,IAAsB,CAAEA,OAAxB,GAAkC,EAAlC,GAAwC,YAAYA,OAAS,GAD9D;AAEA,QAAMG,WAAW,GAChBH,OAAO,KAAK,MAAZ,GACG;AACAI,IAAAA,cAAc,EAAE;AADhB,GADH,GAIG,EALJ;AAMA,QAAM,CAAEC,UAAF,IAAiBR,cAAc,CAAEK,MAAM,GAAG,uBAAX,CAArC;AACA,QAAM,CAAEI,SAAF,IAAgBT,cAAc,CAAEK,MAAM,GAAG,sBAAX,CAAp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QC,cAAC,iBAAD,OARD,EAUC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,QAAD;AAAU,IAAA,KAAK,EAAG;AAAlB,KAAwBA,EAAE,CAAE,UAAF,CAA1B,CADD,EAEC,cAAC,SAAD;AAAW,IAAA,UAAU,MAArB;AAAsB,IAAA,WAAW;AAAjC,KACC,cAAC,IAAD;AACC,IAAA,UAAU,EAAGkB,UADd;AAEC,IAAA,OAAO,EAAC,MAFT;AAGC,IAAA,KAAK,EAAGlB,EAAE,CAAE,MAAF;AAHX,IADD,EAMC,cAAC,IAAD;AACC,IAAA,UAAU,EAAGkB,UADd;AAEC,IAAA,OAAO,EAAC,MAFT;AAGC,IAAA,KAAK,EAAGlB,EAAE,CAAE,OAAF;AAHX,IAND,EAWC,cAAC,IAAD;AACC,IAAA,UAAU,EAAGkB,UADd;AAEC,IAAA,OAAO,EAAC,SAFT;AAGC,IAAA,KAAK,EAAGlB,EAAE,CAAE,UAAF;AAHX,IAXD,EAgBC,cAAC,IAAD;AACC,IAAA,UAAU,EAAGkB,UADd;AAEC,IAAA,OAAO,EAAC,SAFT;AAGC,IAAA,KAAK,EAAGlB,EAAE,CAAE,UAAF;AAHX,IAhBD,EAqBC,cAAC,IAAD;AACC,IAAA,UAAU,EAAGkB,UADd;AAEC,IAAA,OAAO,EAAC,QAFT;AAGC,IAAA,KAAK,EAAGlB,EAAE,CAAE,SAAF;AAHX,IArBD,CAFD,CADD,CAVD,CADD;AA6CA;;AAED,eAAeiC,gBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tFlexItem,\n} from '@wordpress/components';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport Subtitle from './subtitle';\nimport BlockPreviewPanel from './block-preview-panel';\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction Item( { parentMenu, element, label } ) {\n\tconst prefix =\n\t\telement === 'text' || ! element ? '' : `elements.${ element }.`;\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\tconst [ fontFamily ] = useGlobalStyle( prefix + 'typography.fontFamily' );\n\tconst [ fontStyle ] = useGlobalStyle( prefix + 'typography.fontStyle' );\n\tconst [ fontWeight ] = useGlobalStyle( prefix + 'typography.fontWeight' );\n\tconst [ letterSpacing ] = useGlobalStyle(\n\t\tprefix + 'typography.letterSpacing'\n\t);\n\tconst [ backgroundColor ] = useGlobalStyle( prefix + 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient' );\n\tconst [ color ] = useGlobalStyle( prefix + 'color.text' );\n\n\tconst navigationButtonLabel = sprintf(\n\t\t// translators: %s: is a subset of Typography, e.g., 'text' or 'links'.\n\t\t__( 'Typography %s styles' ),\n\t\tlabel\n\t);\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ parentMenu + '/typography/' + element }\n\t\t\taria-label={ navigationButtonLabel }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem\n\t\t\t\t\tclassName=\"edit-site-global-styles-screen-typography__indicator\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tfontFamily: fontFamily ?? 'serif',\n\t\t\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tfontStyle,\n\t\t\t\t\t\tfontWeight,\n\t\t\t\t\t\tletterSpacing,\n\t\t\t\t\t\t...extraStyles,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Aa' ) }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ label }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction ScreenTypography() {\n\tconst parentMenu = '';\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Manage the typography settings for different elements.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<BlockPreviewPanel />\n\n\t\t\t<div className=\"edit-site-global-styles-screen-typography\">\n\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t<Subtitle level={ 3 }>{ __( 'Elements' ) }</Subtitle>\n\t\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"text\"\n\t\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"link\"\n\t\t\t\t\t\t\tlabel={ __( 'Links' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"heading\"\n\t\t\t\t\t\t\tlabel={ __( 'Headings' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"caption\"\n\t\t\t\t\t\t\tlabel={ __( 'Captions' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"button\"\n\t\t\t\t\t\t\tlabel={ __( 'Buttons' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t</VStack>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default ScreenTypography;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography.js"],"names":["__","sprintf","__experimentalItemGroup","ItemGroup","__experimentalVStack","VStack","__experimentalHStack","HStack","FlexItem","privateApis","blockEditorPrivateApis","ScreenHeader","NavigationButtonAsItem","Subtitle","BlockPreviewPanel","unlock","useGlobalStyle","Item","parentMenu","element","label","prefix","extraStyles","textDecoration","fontFamily","fontStyle","fontWeight","letterSpacing","backgroundColor","gradientValue","color","navigationButtonLabel","background","ScreenTypography"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SACCC,uBAAuB,IAAIC,SAD5B,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,QAJD,QAKO,uBALP;AAMA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,SAASC,sBAAT,QAAuC,qBAAvC;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,SAASC,MAAT,QAAuB,mBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAqBD,MAAM,CAAEL,sBAAF,CAAjC;;AAEA,SAASO,IAAT,CAAe;AAAEC,EAAAA,UAAF;AAAcC,EAAAA,OAAd;AAAuBC,EAAAA;AAAvB,CAAf,EAAgD;AAC/C,QAAMC,MAAM,GACXF,OAAO,KAAK,MAAZ,IAAsB,CAAEA,OAAxB,GAAkC,EAAlC,GAAwC,YAAYA,OAAS,GAD9D;AAEA,QAAMG,WAAW,GAChBH,OAAO,KAAK,MAAZ,GACG;AACAI,IAAAA,cAAc,EAAE;AADhB,GADH,GAIG,EALJ;AAMA,QAAM,CAAEC,UAAF,IAAiBR,cAAc,CAAEK,MAAM,GAAG,uBAAX,C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CAAE,YAAF,CADX;AAEC,IAAA,WAAW,EAAGA,EAAE,CACf,wDADe;AAFjB,IADD,EAQC,cAAC,iBAAD,OARD,EAUC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,QAAD;AAAU,IAAA,KAAK,EAAG;AAAlB,KAAwBA,EAAE,CAAE,UAAF,CAA1B,CADD,EAEC,cAAC,SAAD;AAAW,IAAA,UAAU,MAArB;AAAsB,IAAA,WAAW;AAAjC,KACC,cAAC,IAAD;AACC,IAAA,UAAU,EAAGkB,UADd;AAEC,IAAA,OAAO,EAAC,MAFT;AAGC,IAAA,KAAK,EAAGlB,EAAE,CAAE,MAAF;AAHX,IADD,EAMC,cAAC,IAAD;AACC,IAAA,UAAU,EAAGkB,UADd;AAEC,IAAA,OAAO,EAAC,MAFT;AAGC,IAAA,KAAK,EAAGlB,EAAE,CAAE,OAAF;AAHX,IAND,EAWC,cAAC,IAAD;AACC,IAAA,UAAU,EAAGkB,UADd;AAEC,IAAA,OAAO,EAAC,SAFT;AAGC,IAAA,KAAK,EAAGlB,EAAE,CAAE,UAAF;AAHX,IAXD,EAgBC,cAAC,IAAD;AACC,IAAA,UAAU,EAAGkB,UADd;AAEC,IAAA,OAAO,EAAC,SAFT;AAGC,IAAA,KAAK,EAAGlB,EAAE,CAAE,UAAF;AAHX,IAhBD,EAqBC,cAAC,IAAD;AACC,IAAA,UAAU,EAAGkB,UADd;AAEC,IAAA,OAAO,EAAC,QAFT;AAGC,IAAA,KAAK,EAAGlB,EAAE,CAAE,SAAF;AAHX,IArBD,CAFD,CADD,CAVD,CADD;AA6CA;;AAED,eAAeiC,gBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tFlexItem,\n} from '@wordpress/components';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport Subtitle from './subtitle';\nimport BlockPreviewPanel from './block-preview-panel';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction Item( { parentMenu, element, label } ) {\n\tconst prefix =\n\t\telement === 'text' || ! element ? '' : `elements.${ element }.`;\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\tconst [ fontFamily ] = useGlobalStyle( prefix + 'typography.fontFamily' );\n\tconst [ fontStyle ] = useGlobalStyle( prefix + 'typography.fontStyle' );\n\tconst [ fontWeight ] = useGlobalStyle( prefix + 'typography.fontWeight' );\n\tconst [ letterSpacing ] = useGlobalStyle(\n\t\tprefix + 'typography.letterSpacing'\n\t);\n\tconst [ backgroundColor ] = useGlobalStyle( prefix + 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient' );\n\tconst [ color ] = useGlobalStyle( prefix + 'color.text' );\n\n\tconst navigationButtonLabel = sprintf(\n\t\t// translators: %s: is a subset of Typography, e.g., 'text' or 'links'.\n\t\t__( 'Typography %s styles' ),\n\t\tlabel\n\t);\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ parentMenu + '/typography/' + element }\n\t\t\taria-label={ navigationButtonLabel }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem\n\t\t\t\t\tclassName=\"edit-site-global-styles-screen-typography__indicator\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tfontFamily: fontFamily ?? 'serif',\n\t\t\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tfontStyle,\n\t\t\t\t\t\tfontWeight,\n\t\t\t\t\t\tletterSpacing,\n\t\t\t\t\t\t...extraStyles,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Aa' ) }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ label }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction ScreenTypography() {\n\tconst parentMenu = '';\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Manage the typography settings for different elements.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<BlockPreviewPanel />\n\n\t\t\t<div className=\"edit-site-global-styles-screen-typography\">\n\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t<Subtitle level={ 3 }>{ __( 'Elements' ) }</Subtitle>\n\t\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"text\"\n\t\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"link\"\n\t\t\t\t\t\t\tlabel={ __( 'Links' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"heading\"\n\t\t\t\t\t\t\tlabel={ __( 'Headings' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"caption\"\n\t\t\t\t\t\t\tlabel={ __( 'Captions' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"button\"\n\t\t\t\t\t\t\tlabel={ __( 'Buttons' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t</VStack>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default ScreenTypography;\n"]}
@@ -13,7 +13,7 @@ import { useSelect } from '@wordpress/data';
13
13
  import { useMemo, useContext, useState } from '@wordpress/element';
14
14
  import { ENTER } from '@wordpress/keycodes';
15
15
  import { __experimentalGrid as Grid } from '@wordpress/components';
16
- import { __ } from '@wordpress/i18n';
16
+ import { __, sprintf } from '@wordpress/i18n';
17
17
  import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
18
18
  /**
19
19
  * Internal dependencies
@@ -21,16 +21,15 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
21
21
 
22
22
  import { mergeBaseAndUserConfigs } from './global-styles-provider';
23
23
  import StylesPreview from './preview';
24
- import { unlock } from '../../private-apis';
24
+ import { unlock } from '../../lock-unlock';
25
25
  const {
26
26
  GlobalStylesContext,
27
27
  areGlobalStyleConfigsEqual
28
28
  } = unlock(blockEditorPrivateApis);
29
29
 
30
- function Variation(_ref) {
31
- let {
32
- variation
33
- } = _ref;
30
+ function Variation({
31
+ variation
32
+ }) {
34
33
  const [isFocused, setIsFocused] = useState(false);
35
34
  const {
36
35
  base,
@@ -70,6 +69,14 @@ function Variation(_ref) {
70
69
  const isActive = useMemo(() => {
71
70
  return areGlobalStyleConfigsEqual(user, variation);
72
71
  }, [user, variation]);
72
+ let label = variation?.title;
73
+
74
+ if (variation?.description) {
75
+ label = sprintf(
76
+ /* translators: %1$s: variation title. %2$s variation description. */
77
+ __('%1$s (%2$s)'), variation?.title, variation?.description);
78
+ }
79
+
73
80
  return createElement(GlobalStylesContext.Provider, {
74
81
  value: context
75
82
  }, createElement("div", {
@@ -80,14 +87,14 @@ function Variation(_ref) {
80
87
  onClick: selectVariation,
81
88
  onKeyDown: selectOnEnter,
82
89
  tabIndex: "0",
83
- "aria-label": variation === null || variation === void 0 ? void 0 : variation.title,
90
+ "aria-label": label,
84
91
  "aria-current": isActive,
85
92
  onFocus: () => setIsFocused(true),
86
93
  onBlur: () => setIsFocused(false)
87
94
  }, createElement("div", {
88
95
  className: "edit-site-global-styles-variations_item-preview"
89
96
  }, createElement(StylesPreview, {
90
- label: variation === null || variation === void 0 ? void 0 : variation.title,
97
+ label: variation?.title,
91
98
  isFocused: isFocused,
92
99
  withHoverView: true
93
100
  }))));