@wordpress/edit-site 6.9.0 → 6.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (675) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-post/index.js +1 -1
  3. package/build/components/add-new-post/index.js.map +1 -1
  4. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  5. package/build/components/add-new-template/index.js +1 -1
  6. package/build/components/add-new-template/index.js.map +1 -1
  7. package/build/components/add-new-template/utils.js +8 -8
  8. package/build/components/add-new-template/utils.js.map +1 -1
  9. package/build/components/app/index.js +3 -1
  10. package/build/components/app/index.js.map +1 -1
  11. package/build/components/block-editor/use-editor-iframe-props.js +29 -20
  12. package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
  13. package/build/components/block-editor/use-site-editor-settings.js +10 -8
  14. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  15. package/build/components/editor/index.js +23 -11
  16. package/build/components/editor/index.js.map +1 -1
  17. package/build/components/editor/use-adapt-editor-to-canvas.js +49 -0
  18. package/build/components/editor/use-adapt-editor-to-canvas.js.map +1 -0
  19. package/build/components/editor/use-editor-title.js +2 -2
  20. package/build/components/editor/use-editor-title.js.map +1 -1
  21. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  22. package/build/components/global-styles/font-families.js +41 -25
  23. package/build/components/global-styles/font-families.js.map +1 -1
  24. package/build/components/global-styles/font-family-item.js +1 -1
  25. package/build/components/global-styles/font-family-item.js.map +1 -1
  26. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  27. package/build/components/global-styles/font-library-modal/context.js +1 -0
  28. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  29. package/build/components/global-styles/font-library-modal/font-card.js +1 -1
  30. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
  31. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  32. package/build/components/global-styles/font-library-modal/installed-fonts.js +4 -3
  33. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  34. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  35. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  36. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  37. package/build/components/global-styles/font-library-modal/upload-fonts.js +1 -0
  38. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  39. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  40. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  41. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  42. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +1 -1
  43. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +1 -1
  44. package/build/components/global-styles/font-sizes/font-size.js +14 -15
  45. package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
  46. package/build/components/global-styles/font-sizes/font-sizes-count.js +1 -2
  47. package/build/components/global-styles/font-sizes/font-sizes-count.js.map +1 -1
  48. package/build/components/global-styles/font-sizes/font-sizes.js +4 -4
  49. package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -1
  50. package/build/components/global-styles/highlighted-colors.js.map +1 -1
  51. package/build/components/global-styles/palette.js +16 -13
  52. package/build/components/global-styles/palette.js.map +1 -1
  53. package/build/components/global-styles/preset-colors.js.map +1 -1
  54. package/build/components/global-styles/root-menu.js +0 -4
  55. package/build/components/global-styles/root-menu.js.map +1 -1
  56. package/build/components/global-styles/screen-block-list.js +2 -6
  57. package/build/components/global-styles/screen-block-list.js.map +1 -1
  58. package/build/components/global-styles/screen-css.js +1 -1
  59. package/build/components/global-styles/screen-css.js.map +1 -1
  60. package/build/components/global-styles/screen-revisions/index.js +3 -8
  61. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  62. package/build/components/global-styles/screen-revisions/revisions-buttons.js +3 -3
  63. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  64. package/build/components/global-styles/screen-root.js +0 -3
  65. package/build/components/global-styles/screen-root.js.map +1 -1
  66. package/build/components/global-styles/screen-style-variations.js +14 -3
  67. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  68. package/build/components/global-styles/shadow-utils.js.map +1 -1
  69. package/build/components/global-styles/shadows-edit-panel.js +26 -15
  70. package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
  71. package/build/components/global-styles/shadows-panel.js +1 -4
  72. package/build/components/global-styles/shadows-panel.js.map +1 -1
  73. package/build/components/global-styles/style-variations-container.js +1 -5
  74. package/build/components/global-styles/style-variations-container.js.map +1 -1
  75. package/build/components/global-styles/typography-elements.js +1 -4
  76. package/build/components/global-styles/typography-elements.js.map +1 -1
  77. package/build/components/global-styles/typography-preview.js.map +1 -1
  78. package/build/components/global-styles/ui.js +27 -14
  79. package/build/components/global-styles/ui.js.map +1 -1
  80. package/build/components/global-styles/utils.js.map +1 -1
  81. package/build/components/global-styles/variations/variation.js +2 -2
  82. package/build/components/global-styles/variations/variation.js.map +1 -1
  83. package/build/components/global-styles/variations/variations-panel.js +0 -1
  84. package/build/components/global-styles/variations/variations-panel.js.map +1 -1
  85. package/build/components/global-styles-sidebar/default-sidebar.js +0 -1
  86. package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -1
  87. package/build/components/global-styles-sidebar/index.js +43 -36
  88. package/build/components/global-styles-sidebar/index.js.map +1 -1
  89. package/build/components/layout/animation.js +1 -3
  90. package/build/components/layout/animation.js.map +1 -1
  91. package/build/components/layout/index.js +23 -47
  92. package/build/components/layout/index.js.map +1 -1
  93. package/build/components/layout/router.js +17 -140
  94. package/build/components/layout/router.js.map +1 -1
  95. package/build/components/page-patterns/delete-category-menu-item.js +3 -3
  96. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  97. package/build/components/page-patterns/fields.js.map +1 -1
  98. package/build/components/page-patterns/header.js +1 -1
  99. package/build/components/page-patterns/header.js.map +1 -1
  100. package/build/components/page-patterns/index.js +4 -2
  101. package/build/components/page-patterns/index.js.map +1 -1
  102. package/build/components/page-patterns/use-pattern-settings.js +1 -1
  103. package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
  104. package/build/components/page-templates/index.js +2 -2
  105. package/build/components/page-templates/index.js.map +1 -1
  106. package/build/components/pagination/index.js +1 -1
  107. package/build/components/pagination/index.js.map +1 -1
  108. package/build/components/post-edit/index.js +8 -4
  109. package/build/components/post-edit/index.js.map +1 -1
  110. package/build/components/post-fields/index.js +8 -54
  111. package/build/components/post-fields/index.js.map +1 -1
  112. package/build/components/post-list/index.js +1 -1
  113. package/build/components/post-list/index.js.map +1 -1
  114. package/build/components/posts-app/index.js.map +1 -1
  115. package/build/components/posts-app/router.js +4 -4
  116. package/build/components/posts-app/router.js.map +1 -1
  117. package/build/components/resizable-frame/index.js +21 -9
  118. package/build/components/resizable-frame/index.js.map +1 -1
  119. package/build/components/revisions/index.js +1 -1
  120. package/build/components/revisions/index.js.map +1 -1
  121. package/build/components/routes/use-title.js +1 -1
  122. package/build/components/routes/use-title.js.map +1 -1
  123. package/build/components/save-button/index.js +3 -3
  124. package/build/components/save-button/index.js.map +1 -1
  125. package/build/components/save-keyboard-shortcut/index.js +78 -0
  126. package/build/components/save-keyboard-shortcut/index.js.map +1 -0
  127. package/build/components/save-panel/index.js +17 -6
  128. package/build/components/save-panel/index.js.map +1 -1
  129. package/build/components/sidebar-button/index.js +1 -1
  130. package/build/components/sidebar-button/index.js.map +1 -1
  131. package/build/components/sidebar-dataviews/default-views.js +2 -5
  132. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  133. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  134. package/build/components/sidebar-navigation-screen/index.js +2 -1
  135. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  136. package/build/components/sidebar-navigation-screen-details-footer/index.js +1 -1
  137. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  138. package/build/components/sidebar-navigation-screen-global-styles/index.js +30 -10
  139. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  140. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  141. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +5 -5
  142. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  143. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +3 -3
  144. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  145. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +7 -12
  146. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  147. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +2 -2
  148. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  149. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  150. package/build/components/site-editor-routes/home-edit.js +26 -0
  151. package/build/components/site-editor-routes/home-edit.js.map +1 -0
  152. package/build/components/site-editor-routes/home-view.js +25 -0
  153. package/build/components/site-editor-routes/home-view.js.map +1 -0
  154. package/build/components/site-editor-routes/index.js +49 -0
  155. package/build/components/site-editor-routes/index.js.map +1 -0
  156. package/build/components/site-editor-routes/navigation-edit.js +29 -0
  157. package/build/components/site-editor-routes/navigation-edit.js.map +1 -0
  158. package/build/components/site-editor-routes/navigation-item-edit.js +31 -0
  159. package/build/components/site-editor-routes/navigation-item-edit.js.map +1 -0
  160. package/build/components/site-editor-routes/navigation-item-view.js +30 -0
  161. package/build/components/site-editor-routes/navigation-item-view.js.map +1 -0
  162. package/build/components/site-editor-routes/navigation-view.js +28 -0
  163. package/build/components/site-editor-routes/navigation-view.js.map +1 -0
  164. package/build/components/site-editor-routes/pages-edit.js +43 -0
  165. package/build/components/site-editor-routes/pages-edit.js.map +1 -0
  166. package/build/components/site-editor-routes/pages-list-view-quick-edit.js +64 -0
  167. package/build/components/site-editor-routes/pages-list-view-quick-edit.js.map +1 -0
  168. package/build/components/site-editor-routes/pages-list-view.js +47 -0
  169. package/build/components/site-editor-routes/pages-list-view.js.map +1 -0
  170. package/build/components/site-editor-routes/pages-view-quick-edit.js +61 -0
  171. package/build/components/site-editor-routes/pages-view-quick-edit.js.map +1 -0
  172. package/build/components/site-editor-routes/pages-view.js +42 -0
  173. package/build/components/site-editor-routes/pages-view.js.map +1 -0
  174. package/build/components/site-editor-routes/patterns-edit.js +31 -0
  175. package/build/components/site-editor-routes/patterns-edit.js.map +1 -0
  176. package/build/components/site-editor-routes/patterns-view.js +29 -0
  177. package/build/components/site-editor-routes/patterns-view.js.map +1 -0
  178. package/build/components/site-editor-routes/styles-edit.js +28 -0
  179. package/build/components/site-editor-routes/styles-edit.js.map +1 -0
  180. package/build/components/site-editor-routes/styles-view.js +27 -0
  181. package/build/components/site-editor-routes/styles-view.js.map +1 -0
  182. package/build/components/site-editor-routes/templates-edit.js +31 -0
  183. package/build/components/site-editor-routes/templates-edit.js.map +1 -0
  184. package/build/components/site-editor-routes/templates-list-view.js +34 -0
  185. package/build/components/site-editor-routes/templates-list-view.js.map +1 -0
  186. package/build/components/site-editor-routes/templates-view.js +29 -0
  187. package/build/components/site-editor-routes/templates-view.js.map +1 -0
  188. package/build/components/site-hub/index.js +3 -2
  189. package/build/components/site-hub/index.js.map +1 -1
  190. package/build/components/style-book/color-examples.js +46 -0
  191. package/build/components/style-book/color-examples.js.map +1 -0
  192. package/build/components/style-book/constants.js +75 -10
  193. package/build/components/style-book/constants.js.map +1 -1
  194. package/build/components/style-book/duotone-examples.js +55 -0
  195. package/build/components/style-book/duotone-examples.js.map +1 -0
  196. package/build/components/style-book/examples.js +46 -3
  197. package/build/components/style-book/examples.js.map +1 -1
  198. package/build/components/style-book/index.js +92 -36
  199. package/build/components/style-book/index.js.map +1 -1
  200. package/build/components/style-book/types.js.map +1 -1
  201. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +6 -1
  202. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  203. package/build/deprecated.js.map +1 -1
  204. package/build/hooks/commands/use-common-commands.js +46 -30
  205. package/build/hooks/commands/use-common-commands.js.map +1 -1
  206. package/build/hooks/commands/use-edit-mode-commands.js +15 -11
  207. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  208. package/build/hooks/commands/use-set-command-context.js +12 -15
  209. package/build/hooks/commands/use-set-command-context.js.map +1 -1
  210. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  211. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
  212. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  213. package/build/index.js +2 -4
  214. package/build/index.js.map +1 -1
  215. package/build/posts.js +1 -1
  216. package/build/posts.js.map +1 -1
  217. package/build/store/actions.js.map +1 -1
  218. package/build/store/private-actions.js +8 -61
  219. package/build/store/private-actions.js.map +1 -1
  220. package/build/store/private-selectors.js +4 -12
  221. package/build/store/private-selectors.js.map +1 -1
  222. package/build/store/reducer.js +9 -18
  223. package/build/store/reducer.js.map +1 -1
  224. package/build/store/selectors.js.map +1 -1
  225. package/build/utils/get-filtered-template-parts.js.map +1 -1
  226. package/build-module/components/add-new-pattern/index.js +1 -3
  227. package/build-module/components/add-new-pattern/index.js.map +1 -1
  228. package/build-module/components/add-new-post/index.js +2 -3
  229. package/build-module/components/add-new-post/index.js.map +1 -1
  230. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +1 -2
  231. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  232. package/build-module/components/add-new-template/add-custom-template-modal-content.js +1 -3
  233. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  234. package/build-module/components/add-new-template/index.js +2 -4
  235. package/build-module/components/add-new-template/index.js.map +1 -1
  236. package/build-module/components/add-new-template/utils.js +9 -9
  237. package/build-module/components/add-new-template/utils.js.map +1 -1
  238. package/build-module/components/app/index.js +6 -5
  239. package/build-module/components/app/index.js.map +1 -1
  240. package/build-module/components/block-editor/use-editor-iframe-props.js +30 -21
  241. package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
  242. package/build-module/components/block-editor/use-site-editor-settings.js +10 -8
  243. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  244. package/build-module/components/editor/index.js +24 -14
  245. package/build-module/components/editor/index.js.map +1 -1
  246. package/build-module/components/editor/use-adapt-editor-to-canvas.js +42 -0
  247. package/build-module/components/editor/use-adapt-editor-to-canvas.js.map +1 -0
  248. package/build-module/components/editor/use-editor-title.js +3 -3
  249. package/build-module/components/editor/use-editor-title.js.map +1 -1
  250. package/build-module/components/editor-canvas-container/index.js +1 -2
  251. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  252. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  253. package/build-module/components/global-styles/color-palette-panel.js +1 -2
  254. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  255. package/build-module/components/global-styles/font-families.js +45 -31
  256. package/build-module/components/global-styles/font-families.js.map +1 -1
  257. package/build-module/components/global-styles/font-family-item.js +2 -3
  258. package/build-module/components/global-styles/font-family-item.js.map +1 -1
  259. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +1 -2
  260. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  261. package/build-module/components/global-styles/font-library-modal/context.js +1 -0
  262. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  263. package/build-module/components/global-styles/font-library-modal/font-card.js +2 -3
  264. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
  265. package/build-module/components/global-styles/font-library-modal/font-collection.js +1 -3
  266. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  267. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +1 -2
  268. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  269. package/build-module/components/global-styles/font-library-modal/index.js +1 -2
  270. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  271. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +5 -6
  272. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  273. package/build-module/components/global-styles/font-library-modal/library-font-details.js +1 -3
  274. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  275. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +1 -2
  276. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  277. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  278. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +2 -2
  279. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  280. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  281. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  282. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  283. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +1 -1
  284. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +1 -1
  285. package/build-module/components/global-styles/font-sizes/font-size.js +15 -18
  286. package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -1
  287. package/build-module/components/global-styles/font-sizes/font-sizes-count.js +2 -4
  288. package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +1 -1
  289. package/build-module/components/global-styles/font-sizes/font-sizes.js +5 -7
  290. package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
  291. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js +1 -2
  292. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js.map +1 -1
  293. package/build-module/components/global-styles/gradients-palette-panel.js +1 -2
  294. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  295. package/build-module/components/global-styles/header.js +1 -2
  296. package/build-module/components/global-styles/header.js.map +1 -1
  297. package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
  298. package/build-module/components/global-styles/navigation-button.js +1 -2
  299. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  300. package/build-module/components/global-styles/palette.js +17 -15
  301. package/build-module/components/global-styles/palette.js.map +1 -1
  302. package/build-module/components/global-styles/preset-colors.js.map +1 -1
  303. package/build-module/components/global-styles/preview-iframe.js +1 -3
  304. package/build-module/components/global-styles/preview-iframe.js.map +1 -1
  305. package/build-module/components/global-styles/preview-styles.js +1 -2
  306. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  307. package/build-module/components/global-styles/root-menu.js +1 -7
  308. package/build-module/components/global-styles/root-menu.js.map +1 -1
  309. package/build-module/components/global-styles/screen-background.js +1 -3
  310. package/build-module/components/global-styles/screen-background.js.map +1 -1
  311. package/build-module/components/global-styles/screen-block-list.js +3 -9
  312. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  313. package/build-module/components/global-styles/screen-block.js +1 -3
  314. package/build-module/components/global-styles/screen-block.js.map +1 -1
  315. package/build-module/components/global-styles/screen-color-palette.js +1 -3
  316. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  317. package/build-module/components/global-styles/screen-colors.js +1 -3
  318. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  319. package/build-module/components/global-styles/screen-css.js +2 -4
  320. package/build-module/components/global-styles/screen-css.js.map +1 -1
  321. package/build-module/components/global-styles/screen-layout.js +1 -3
  322. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  323. package/build-module/components/global-styles/screen-revisions/index.js +5 -12
  324. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  325. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +4 -5
  326. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  327. package/build-module/components/global-styles/screen-root.js +1 -6
  328. package/build-module/components/global-styles/screen-root.js.map +1 -1
  329. package/build-module/components/global-styles/screen-style-variations.js +15 -6
  330. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  331. package/build-module/components/global-styles/screen-typography-element.js +1 -3
  332. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  333. package/build-module/components/global-styles/screen-typography.js +1 -3
  334. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  335. package/build-module/components/global-styles/shadow-utils.js.map +1 -1
  336. package/build-module/components/global-styles/shadows-edit-panel.js +28 -19
  337. package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
  338. package/build-module/components/global-styles/shadows-panel.js +2 -7
  339. package/build-module/components/global-styles/shadows-panel.js.map +1 -1
  340. package/build-module/components/global-styles/size-control/index.js +1 -2
  341. package/build-module/components/global-styles/size-control/index.js.map +1 -1
  342. package/build-module/components/global-styles/style-variations-container.js +2 -6
  343. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  344. package/build-module/components/global-styles/typeset.js +3 -5
  345. package/build-module/components/global-styles/typeset.js.map +1 -1
  346. package/build-module/components/global-styles/typography-elements.js +3 -7
  347. package/build-module/components/global-styles/typography-elements.js.map +1 -1
  348. package/build-module/components/global-styles/typography-example.js +1 -2
  349. package/build-module/components/global-styles/typography-example.js.map +1 -1
  350. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  351. package/build-module/components/global-styles/ui.js +28 -17
  352. package/build-module/components/global-styles/ui.js.map +1 -1
  353. package/build-module/components/global-styles/utils.js.map +1 -1
  354. package/build-module/components/global-styles/variations/variation.js +3 -3
  355. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  356. package/build-module/components/global-styles/variations/variations-color.js +1 -2
  357. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  358. package/build-module/components/global-styles/variations/variations-panel.js +0 -1
  359. package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
  360. package/build-module/components/global-styles/variations/variations-typography.js +1 -2
  361. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  362. package/build-module/components/global-styles-sidebar/default-sidebar.js +1 -4
  363. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -1
  364. package/build-module/components/global-styles-sidebar/index.js +45 -39
  365. package/build-module/components/global-styles-sidebar/index.js.map +1 -1
  366. package/build-module/components/layout/animation.js +1 -3
  367. package/build-module/components/layout/animation.js.map +1 -1
  368. package/build-module/components/layout/index.js +24 -50
  369. package/build-module/components/layout/index.js.map +1 -1
  370. package/build-module/components/layout/router.js +17 -139
  371. package/build-module/components/layout/router.js.map +1 -1
  372. package/build-module/components/more-menu/index.js +1 -3
  373. package/build-module/components/more-menu/index.js.map +1 -1
  374. package/build-module/components/page/header.js +1 -2
  375. package/build-module/components/page/header.js.map +1 -1
  376. package/build-module/components/page/index.js +1 -2
  377. package/build-module/components/page/index.js.map +1 -1
  378. package/build-module/components/page-patterns/delete-category-menu-item.js +5 -7
  379. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  380. package/build-module/components/page-patterns/fields.js +1 -2
  381. package/build-module/components/page-patterns/fields.js.map +1 -1
  382. package/build-module/components/page-patterns/header.js +2 -3
  383. package/build-module/components/page-patterns/header.js.map +1 -1
  384. package/build-module/components/page-patterns/index.js +5 -4
  385. package/build-module/components/page-patterns/index.js.map +1 -1
  386. package/build-module/components/page-patterns/rename-category-menu-item.js +1 -3
  387. package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
  388. package/build-module/components/page-patterns/use-pattern-settings.js +1 -1
  389. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
  390. package/build-module/components/page-templates/fields.js +1 -2
  391. package/build-module/components/page-templates/fields.js.map +1 -1
  392. package/build-module/components/page-templates/index.js +2 -2
  393. package/build-module/components/page-templates/index.js.map +1 -1
  394. package/build-module/components/pagination/index.js +2 -3
  395. package/build-module/components/pagination/index.js.map +1 -1
  396. package/build-module/components/post-edit/index.js +9 -6
  397. package/build-module/components/post-edit/index.js.map +1 -1
  398. package/build-module/components/post-fields/index.js +10 -55
  399. package/build-module/components/post-fields/index.js.map +1 -1
  400. package/build-module/components/post-list/index.js +2 -4
  401. package/build-module/components/post-list/index.js.map +1 -1
  402. package/build-module/components/posts-app/index.js +3 -4
  403. package/build-module/components/posts-app/index.js.map +1 -1
  404. package/build-module/components/posts-app/router.js +3 -3
  405. package/build-module/components/posts-app/router.js.map +1 -1
  406. package/build-module/components/resizable-frame/index.js +21 -12
  407. package/build-module/components/resizable-frame/index.js.map +1 -1
  408. package/build-module/components/revisions/index.js +2 -3
  409. package/build-module/components/revisions/index.js.map +1 -1
  410. package/build-module/components/routes/use-title.js +1 -1
  411. package/build-module/components/routes/use-title.js.map +1 -1
  412. package/build-module/components/save-button/index.js +3 -3
  413. package/build-module/components/save-button/index.js.map +1 -1
  414. package/build-module/components/save-keyboard-shortcut/index.js +71 -0
  415. package/build-module/components/save-keyboard-shortcut/index.js.map +1 -0
  416. package/build-module/components/save-panel/index.js +18 -8
  417. package/build-module/components/save-panel/index.js.map +1 -1
  418. package/build-module/components/sidebar-button/index.js +1 -1
  419. package/build-module/components/sidebar-button/index.js.map +1 -1
  420. package/build-module/components/sidebar-dataviews/add-new-view.js +1 -3
  421. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  422. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +1 -3
  423. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  424. package/build-module/components/sidebar-dataviews/dataview-item.js +1 -2
  425. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  426. package/build-module/components/sidebar-dataviews/default-views.js +2 -5
  427. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  428. package/build-module/components/sidebar-dataviews/index.js +1 -3
  429. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  430. package/build-module/components/sidebar-navigation-item/index.js +1 -2
  431. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  432. package/build-module/components/sidebar-navigation-screen/index.js +3 -4
  433. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  434. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +2 -3
  435. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  436. package/build-module/components/sidebar-navigation-screen-details-panel/index.js +1 -2
  437. package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  438. package/build-module/components/sidebar-navigation-screen-global-styles/content.js +1 -2
  439. package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
  440. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +31 -13
  441. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  442. package/build-module/components/sidebar-navigation-screen-main/index.js +1 -3
  443. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  444. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  445. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -3
  446. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  447. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -2
  448. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  449. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -2
  450. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  451. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +6 -6
  452. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  453. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +4 -4
  454. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  455. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +8 -13
  456. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  457. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +3 -5
  458. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  459. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +1 -3
  460. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  461. package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -3
  462. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  463. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +1 -2
  464. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  465. package/build-module/components/site-editor-routes/home-edit.js +18 -0
  466. package/build-module/components/site-editor-routes/home-edit.js.map +1 -0
  467. package/build-module/components/site-editor-routes/home-view.js +17 -0
  468. package/build-module/components/site-editor-routes/home-view.js.map +1 -0
  469. package/build-module/components/site-editor-routes/index.js +42 -0
  470. package/build-module/components/site-editor-routes/index.js.map +1 -0
  471. package/build-module/components/site-editor-routes/navigation-edit.js +21 -0
  472. package/build-module/components/site-editor-routes/navigation-edit.js.map +1 -0
  473. package/build-module/components/site-editor-routes/navigation-item-edit.js +23 -0
  474. package/build-module/components/site-editor-routes/navigation-item-edit.js.map +1 -0
  475. package/build-module/components/site-editor-routes/navigation-item-view.js +22 -0
  476. package/build-module/components/site-editor-routes/navigation-item-view.js.map +1 -0
  477. package/build-module/components/site-editor-routes/navigation-view.js +20 -0
  478. package/build-module/components/site-editor-routes/navigation-view.js.map +1 -0
  479. package/build-module/components/site-editor-routes/pages-edit.js +35 -0
  480. package/build-module/components/site-editor-routes/pages-edit.js.map +1 -0
  481. package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js +56 -0
  482. package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js.map +1 -0
  483. package/build-module/components/site-editor-routes/pages-list-view.js +39 -0
  484. package/build-module/components/site-editor-routes/pages-list-view.js.map +1 -0
  485. package/build-module/components/site-editor-routes/pages-view-quick-edit.js +53 -0
  486. package/build-module/components/site-editor-routes/pages-view-quick-edit.js.map +1 -0
  487. package/build-module/components/site-editor-routes/pages-view.js +34 -0
  488. package/build-module/components/site-editor-routes/pages-view.js.map +1 -0
  489. package/build-module/components/site-editor-routes/patterns-edit.js +23 -0
  490. package/build-module/components/site-editor-routes/patterns-edit.js.map +1 -0
  491. package/build-module/components/site-editor-routes/patterns-view.js +21 -0
  492. package/build-module/components/site-editor-routes/patterns-view.js.map +1 -0
  493. package/build-module/components/site-editor-routes/styles-edit.js +20 -0
  494. package/build-module/components/site-editor-routes/styles-edit.js.map +1 -0
  495. package/build-module/components/site-editor-routes/styles-view.js +19 -0
  496. package/build-module/components/site-editor-routes/styles-view.js.map +1 -0
  497. package/build-module/components/site-editor-routes/templates-edit.js +23 -0
  498. package/build-module/components/site-editor-routes/templates-edit.js.map +1 -0
  499. package/build-module/components/site-editor-routes/templates-list-view.js +26 -0
  500. package/build-module/components/site-editor-routes/templates-list-view.js.map +1 -0
  501. package/build-module/components/site-editor-routes/templates-view.js +21 -0
  502. package/build-module/components/site-editor-routes/templates-view.js.map +1 -0
  503. package/build-module/components/site-hub/index.js +4 -4
  504. package/build-module/components/site-hub/index.js.map +1 -1
  505. package/build-module/components/style-book/color-examples.js +38 -0
  506. package/build-module/components/style-book/color-examples.js.map +1 -0
  507. package/build-module/components/style-book/constants.js +74 -9
  508. package/build-module/components/style-book/constants.js.map +1 -1
  509. package/build-module/components/style-book/duotone-examples.js +48 -0
  510. package/build-module/components/style-book/duotone-examples.js.map +1 -0
  511. package/build-module/components/style-book/examples.js +47 -3
  512. package/build-module/components/style-book/examples.js.map +1 -1
  513. package/build-module/components/style-book/index.js +95 -40
  514. package/build-module/components/style-book/index.js.map +1 -1
  515. package/build-module/components/style-book/types.js.map +1 -1
  516. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +6 -1
  517. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  518. package/build-module/components/welcome-guide/editor.js +1 -3
  519. package/build-module/components/welcome-guide/editor.js.map +1 -1
  520. package/build-module/components/welcome-guide/image.js +1 -2
  521. package/build-module/components/welcome-guide/image.js.map +1 -1
  522. package/build-module/components/welcome-guide/index.js +1 -3
  523. package/build-module/components/welcome-guide/index.js.map +1 -1
  524. package/build-module/components/welcome-guide/page.js +1 -3
  525. package/build-module/components/welcome-guide/page.js.map +1 -1
  526. package/build-module/components/welcome-guide/styles.js +1 -3
  527. package/build-module/components/welcome-guide/styles.js.map +1 -1
  528. package/build-module/components/welcome-guide/template.js +1 -3
  529. package/build-module/components/welcome-guide/template.js.map +1 -1
  530. package/build-module/deprecated.js.map +1 -1
  531. package/build-module/hooks/commands/use-common-commands.js +46 -30
  532. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  533. package/build-module/hooks/commands/use-edit-mode-commands.js +15 -11
  534. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  535. package/build-module/hooks/commands/use-set-command-context.js +12 -15
  536. package/build-module/hooks/commands/use-set-command-context.js.map +1 -1
  537. package/build-module/hooks/push-changes-to-global-styles/index.js +1 -3
  538. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  539. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
  540. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  541. package/build-module/index.js +2 -4
  542. package/build-module/index.js.map +1 -1
  543. package/build-module/posts.js +1 -1
  544. package/build-module/posts.js.map +1 -1
  545. package/build-module/store/actions.js.map +1 -1
  546. package/build-module/store/private-actions.js +6 -59
  547. package/build-module/store/private-actions.js.map +1 -1
  548. package/build-module/store/private-selectors.js +3 -11
  549. package/build-module/store/private-selectors.js.map +1 -1
  550. package/build-module/store/reducer.js +9 -18
  551. package/build-module/store/reducer.js.map +1 -1
  552. package/build-module/store/selectors.js.map +1 -1
  553. package/build-module/utils/get-filtered-template-parts.js.map +1 -1
  554. package/build-style/posts-rtl.css +39 -45
  555. package/build-style/posts.css +39 -45
  556. package/build-style/style-rtl.css +160 -60
  557. package/build-style/style.css +160 -60
  558. package/package.json +44 -42
  559. package/src/components/add-new-post/index.js +1 -1
  560. package/src/components/add-new-template/index.js +1 -1
  561. package/src/components/add-new-template/utils.js +12 -9
  562. package/src/components/app/index.js +4 -2
  563. package/src/components/block-editor/use-editor-iframe-props.js +22 -18
  564. package/src/components/block-editor/use-site-editor-settings.js +12 -10
  565. package/src/components/editor/index.js +34 -14
  566. package/src/components/editor/use-adapt-editor-to-canvas.js +53 -0
  567. package/src/components/editor/use-editor-title.js +3 -3
  568. package/src/components/global-styles/font-families.js +51 -35
  569. package/src/components/global-styles/font-sizes/font-size.js +20 -21
  570. package/src/components/global-styles/font-sizes/font-sizes-count.js +1 -4
  571. package/src/components/global-styles/font-sizes/font-sizes.js +7 -9
  572. package/src/components/global-styles/palette.js +21 -18
  573. package/src/components/global-styles/root-menu.js +3 -16
  574. package/src/components/global-styles/screen-block-list.js +1 -8
  575. package/src/components/global-styles/screen-css.js +1 -0
  576. package/src/components/global-styles/screen-revisions/index.js +2 -11
  577. package/src/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  578. package/src/components/global-styles/screen-root.js +3 -12
  579. package/src/components/global-styles/screen-style-variations.js +11 -3
  580. package/src/components/global-styles/shadows-edit-panel.js +33 -18
  581. package/src/components/global-styles/shadows-panel.js +0 -4
  582. package/src/components/global-styles/style-variations-container.js +2 -7
  583. package/src/components/global-styles/typography-elements.js +3 -11
  584. package/src/components/global-styles/ui.js +29 -12
  585. package/src/components/global-styles/variations/variation.js +3 -3
  586. package/src/components/global-styles/variations/variations-panel.js +0 -1
  587. package/src/components/global-styles-sidebar/default-sidebar.js +0 -1
  588. package/src/components/global-styles-sidebar/index.js +86 -75
  589. package/src/components/global-styles-sidebar/style.scss +6 -0
  590. package/src/components/layout/animation.js +0 -1
  591. package/src/components/layout/index.js +17 -51
  592. package/src/components/layout/router.js +18 -133
  593. package/src/components/layout/style.scss +2 -2
  594. package/src/components/page-patterns/delete-category-menu-item.js +4 -4
  595. package/src/components/page-patterns/index.js +3 -2
  596. package/src/components/page-patterns/use-pattern-settings.js +1 -1
  597. package/src/components/page-templates/index.js +0 -1
  598. package/src/components/pagination/index.js +1 -1
  599. package/src/components/post-edit/index.js +35 -4
  600. package/src/components/post-fields/index.js +7 -54
  601. package/src/components/post-fields/style.scss +3 -0
  602. package/src/components/post-list/index.js +1 -1
  603. package/src/components/post-list/style.scss +1 -1
  604. package/src/components/posts-app/index.js +2 -2
  605. package/src/components/posts-app/router.js +3 -3
  606. package/src/components/resizable-frame/index.js +19 -10
  607. package/src/components/revisions/index.js +4 -1
  608. package/src/components/save-keyboard-shortcut/index.js +69 -0
  609. package/src/components/save-panel/index.js +30 -32
  610. package/src/components/sidebar-button/index.js +1 -1
  611. package/src/components/sidebar-button/style.scss +2 -2
  612. package/src/components/sidebar-dataviews/default-views.js +2 -5
  613. package/src/components/sidebar-navigation-screen/index.js +2 -1
  614. package/src/components/sidebar-navigation-screen/style.scss +5 -1
  615. package/src/components/sidebar-navigation-screen-global-styles/index.js +47 -29
  616. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
  617. package/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +4 -4
  618. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +11 -13
  619. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +1 -1
  620. package/src/components/site-editor-routes/README.md +20 -0
  621. package/src/components/site-editor-routes/home-edit.js +17 -0
  622. package/src/components/site-editor-routes/home-view.js +16 -0
  623. package/src/components/site-editor-routes/index.js +60 -0
  624. package/src/components/site-editor-routes/navigation-edit.js +22 -0
  625. package/src/components/site-editor-routes/navigation-item-edit.js +26 -0
  626. package/src/components/site-editor-routes/navigation-item-view.js +25 -0
  627. package/src/components/site-editor-routes/navigation-view.js +21 -0
  628. package/src/components/site-editor-routes/pages-edit.js +35 -0
  629. package/src/components/site-editor-routes/pages-list-view-quick-edit.js +56 -0
  630. package/src/components/site-editor-routes/pages-list-view.js +44 -0
  631. package/src/components/site-editor-routes/pages-view-quick-edit.js +53 -0
  632. package/src/components/site-editor-routes/pages-view.js +39 -0
  633. package/src/components/site-editor-routes/patterns-edit.js +24 -0
  634. package/src/components/site-editor-routes/patterns-view.js +22 -0
  635. package/src/components/site-editor-routes/styles-edit.js +17 -0
  636. package/src/components/site-editor-routes/styles-view.js +16 -0
  637. package/src/components/site-editor-routes/templates-edit.js +22 -0
  638. package/src/components/site-editor-routes/templates-list-view.js +28 -0
  639. package/src/components/site-editor-routes/templates-view.js +22 -0
  640. package/src/components/site-hub/index.js +2 -2
  641. package/src/components/site-hub/style.scss +4 -0
  642. package/src/components/style-book/color-examples.tsx +44 -0
  643. package/src/components/style-book/constants.ts +83 -10
  644. package/src/components/style-book/duotone-examples.tsx +53 -0
  645. package/src/components/style-book/examples.tsx +113 -0
  646. package/src/components/style-book/index.js +149 -52
  647. package/src/components/style-book/style.scss +12 -14
  648. package/src/components/style-book/test/categories.js +0 -5
  649. package/src/components/style-book/types.ts +34 -1
  650. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +11 -1
  651. package/src/hooks/commands/use-common-commands.js +60 -40
  652. package/src/hooks/commands/use-edit-mode-commands.js +14 -18
  653. package/src/hooks/commands/use-set-command-context.js +7 -9
  654. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
  655. package/src/index.js +1 -5
  656. package/src/store/private-actions.js +7 -82
  657. package/src/store/private-selectors.js +4 -11
  658. package/src/store/reducer.js +10 -18
  659. package/src/style.scss +3 -0
  660. package/build/components/keyboard-shortcuts/global.js +0 -53
  661. package/build/components/keyboard-shortcuts/global.js.map +0 -1
  662. package/build/components/keyboard-shortcuts/register.js +0 -34
  663. package/build/components/keyboard-shortcuts/register.js.map +0 -1
  664. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -69
  665. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +0 -1
  666. package/build-module/components/keyboard-shortcuts/global.js +0 -46
  667. package/build-module/components/keyboard-shortcuts/global.js.map +0 -1
  668. package/build-module/components/keyboard-shortcuts/register.js +0 -27
  669. package/build-module/components/keyboard-shortcuts/register.js.map +0 -1
  670. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -62
  671. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +0 -1
  672. package/src/components/keyboard-shortcuts/global.js +0 -47
  673. package/src/components/keyboard-shortcuts/register.js +0 -27
  674. package/src/components/style-book/examples.ts +0 -63
  675. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -73
@@ -1 +1 @@
1
- {"version":3,"names":["_hooks","require","_jsxRuntime","PresetColors","paletteColors","useStylesPreviewColors","slice","map","slug","color","index","jsx","style","flexGrow","height","background"],"sources":["@wordpress/edit-site/src/components/global-styles/preset-colors.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { useStylesPreviewColors } from './hooks';\n\nexport default function PresetColors() {\n\tconst { paletteColors } = useStylesPreviewColors();\n\treturn paletteColors.slice( 0, 4 ).map( ( { slug, color }, index ) => (\n\t\t<div\n\t\t\tkey={ `${ slug }-${ index }` }\n\t\t\tstyle={ {\n\t\t\t\tflexGrow: 1,\n\t\t\t\theight: '100%',\n\t\t\t\tbackground: color,\n\t\t\t} }\n\t\t/>\n\t) );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAAiD,IAAAC,WAAA,GAAAD,OAAA;AAHjD;AACA;AACA;;AAGe,SAASE,YAAYA,CAAA,EAAG;EACtC,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,6BAAsB,EAAC,CAAC;EAClD,OAAOD,aAAa,CAACE,KAAK,CAAE,CAAC,EAAE,CAAE,CAAC,CAACC,GAAG,CAAE,CAAE;IAAEC,IAAI;IAAEC;EAAM,CAAC,EAAEC,KAAK,kBAC/D,IAAAR,WAAA,CAAAS,GAAA;IAECC,KAAK,EAAG;MACPC,QAAQ,EAAE,CAAC;MACXC,MAAM,EAAE,MAAM;MACdC,UAAU,EAAEN;IACb;EAAG,GALI,GAAGD,IAAM,IAAIE,KAAO,EAM3B,CACA,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["_hooks","require","_jsxRuntime","PresetColors","paletteColors","useStylesPreviewColors","slice","map","slug","color","index","jsx","style","flexGrow","height","background"],"sources":["@wordpress/edit-site/src/components/global-styles/preset-colors.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { useStylesPreviewColors } from './hooks';\n\nexport default function PresetColors() {\n\tconst { paletteColors } = useStylesPreviewColors();\n\treturn paletteColors.slice( 0, 4 ).map( ( { slug, color }, index ) => (\n\t\t<div\n\t\t\tkey={ `${ slug }-${ index }` }\n\t\t\tstyle={ {\n\t\t\t\tflexGrow: 1,\n\t\t\t\theight: '100%',\n\t\t\t\tbackground: color,\n\t\t\t} }\n\t\t/>\n\t) );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAAiD,IAAAC,WAAA,GAAAD,OAAA;AAHjD;AACA;AACA;;AAGe,SAASE,YAAYA,CAAA,EAAG;EACtC,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,6BAAsB,EAAC,CAAC;EAClD,OAAOD,aAAa,CAACE,KAAK,CAAE,CAAC,EAAE,CAAE,CAAC,CAACC,GAAG,CAAE,CAAE;IAAEC,IAAI;IAAEC;EAAM,CAAC,EAAEC,KAAK,kBAC/D,IAAAR,WAAA,CAAAS,GAAA;IAECC,KAAK,EAAG;MACPC,QAAQ,EAAE,CAAC;MACXC,MAAM,EAAE,MAAM;MACdC,UAAU,EAAEN;IACb;EAAG,GALG,GAAID,IAAI,IAAME,KAAK,EAMzB,CACA,CAAC;AACJ","ignoreList":[]}
@@ -45,12 +45,10 @@ function RootMenu() {
45
45
  children: [hasTypographyPanel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationButton.NavigationButtonAsItem, {
46
46
  icon: _icons.typography,
47
47
  path: "/typography",
48
- "aria-label": (0, _i18n.__)('Typography styles'),
49
48
  children: (0, _i18n.__)('Typography')
50
49
  }), hasColorPanel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationButton.NavigationButtonAsItem, {
51
50
  icon: _icons.color,
52
51
  path: "/colors",
53
- "aria-label": (0, _i18n.__)('Colors styles'),
54
52
  children: (0, _i18n.__)('Colors')
55
53
  }), hasBackgroundPanel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationButton.NavigationButtonAsItem, {
56
54
  icon: _icons.background,
@@ -60,12 +58,10 @@ function RootMenu() {
60
58
  }), hasShadowPanel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationButton.NavigationButtonAsItem, {
61
59
  icon: _icons.shadow,
62
60
  path: "/shadows",
63
- "aria-label": (0, _i18n.__)('Shadow styles'),
64
61
  children: (0, _i18n.__)('Shadows')
65
62
  }), hasLayoutPanel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationButton.NavigationButtonAsItem, {
66
63
  icon: _icons.layout,
67
64
  path: "/layout",
68
- "aria-label": (0, _i18n.__)('Layout styles'),
69
65
  children: (0, _i18n.__)('Layout')
70
66
  })]
71
67
  })
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_icons","_i18n","_blockEditor","_navigationButton","_lockUnlock","_jsxRuntime","useHasDimensionsPanel","useHasTypographyPanel","useHasColorPanel","useGlobalSetting","useSettingsForBlockElement","useHasBackgroundPanel","unlock","blockEditorPrivateApis","RootMenu","rawSettings","settings","hasBackgroundPanel","hasTypographyPanel","hasColorPanel","hasShadowPanel","hasDimensionsPanel","hasLayoutPanel","jsx","Fragment","children","jsxs","__experimentalItemGroup","NavigationButtonAsItem","icon","typography","path","__","color","background","shadowIcon","layout","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/global-styles/root-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport {\n\tbackground,\n\ttypography,\n\tcolor,\n\tlayout,\n\tshadow as shadowIcon,\n} from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tuseHasDimensionsPanel,\n\tuseHasTypographyPanel,\n\tuseHasColorPanel,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tuseHasBackgroundPanel,\n} = unlock( blockEditorPrivateApis );\n\nfunction RootMenu() {\n\tconst [ rawSettings ] = useGlobalSetting( '' );\n\tconst settings = useSettingsForBlockElement( rawSettings );\n\t/*\n\t * Use the raw settings to determine if the background panel should be displayed,\n\t * as the background panel is not dependent on the block element settings.\n\t */\n\tconst hasBackgroundPanel = useHasBackgroundPanel( rawSettings );\n\tconst hasTypographyPanel = useHasTypographyPanel( settings );\n\tconst hasColorPanel = useHasColorPanel( settings );\n\tconst hasShadowPanel = true; // useHasShadowPanel( settings );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\tconst hasLayoutPanel = hasDimensionsPanel;\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ hasTypographyPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ typography }\n\t\t\t\t\t\tpath=\"/typography\"\n\t\t\t\t\t\taria-label={ __( 'Typography styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Typography' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasColorPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ color }\n\t\t\t\t\t\tpath=\"/colors\"\n\t\t\t\t\t\taria-label={ __( 'Colors styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Colors' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasBackgroundPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ background }\n\t\t\t\t\t\tpath=\"/background\"\n\t\t\t\t\t\taria-label={ __( 'Background styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Background' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasShadowPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ shadowIcon }\n\t\t\t\t\t\tpath=\"/shadows\"\n\t\t\t\t\t\taria-label={ __( 'Shadow styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Shadows' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasLayoutPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t\tpath=\"/layout\"\n\t\t\t\t\t\taria-label={ __( 'Layout styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Layout' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t</ItemGroup>\n\t\t</>\n\t);\n}\n\nexport default RootMenu;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAOA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAA2C,IAAAM,WAAA,GAAAN,OAAA;AAlB3C;AACA;AACA;;AAYA;AACA;AACA;;AAIA,MAAM;EACLO,qBAAqB;EACrBC,qBAAqB;EACrBC,gBAAgB;EAChBC,gBAAgB;EAChBC,0BAA0B;EAC1BC;AACD,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEpC,SAASC,QAAQA,CAAA,EAAG;EACnB,MAAM,CAAEC,WAAW,CAAE,GAAGN,gBAAgB,CAAE,EAA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,QAAE,EAAE,YAAa;MAAC,CACG,CACxB,EACCZ,cAAc,iBACf,IAAAf,WAAA,CAAAkB,GAAA,EAACpB,iBAAA,CAAAyB,sBAAsB;QACtBC,IAAI,EAAGM,aAAY;QACnBJ,IAAI,EAAC,UAAU;QACf,cAAa,IAAAC,QAAE,EAAE,eAAgB,CAAG;QAAAP,QAAA,EAElC,IAAAO,QAAE,EAAE,SAAU;MAAC,CACM,CACxB,EACCV,cAAc,iBACf,IAAAjB,WAAA,CAAAkB,GAAA,EAACpB,iBAAA,CAAAyB,sBAAsB;QACtBC,IAAI,EAAGO,aAAQ;QACfL,IAAI,EAAC,SAAS;QACd,cAAa,IAAAC,QAAE,EAAE,eAAgB,CAAG;QAAAP,QAAA,EAElC,IAAAO,QAAE,EAAE,QAAS;MAAC,CACO,CACxB;IAAA,CACS;EAAC,CACX,CAAC;AAEL;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEczB,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_icons","_i18n","_blockEditor","_navigationButton","_lockUnlock","_jsxRuntime","useHasDimensionsPanel","useHasTypographyPanel","useHasColorPanel","useGlobalSetting","useSettingsForBlockElement","useHasBackgroundPanel","unlock","blockEditorPrivateApis","RootMenu","rawSettings","settings","hasBackgroundPanel","hasTypographyPanel","hasColorPanel","hasShadowPanel","hasDimensionsPanel","hasLayoutPanel","jsx","Fragment","children","jsxs","__experimentalItemGroup","NavigationButtonAsItem","icon","typography","path","__","color","background","shadowIcon","layout","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/global-styles/root-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport {\n\tbackground,\n\ttypography,\n\tcolor,\n\tlayout,\n\tshadow as shadowIcon,\n} from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tuseHasDimensionsPanel,\n\tuseHasTypographyPanel,\n\tuseHasColorPanel,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tuseHasBackgroundPanel,\n} = unlock( blockEditorPrivateApis );\n\nfunction RootMenu() {\n\tconst [ rawSettings ] = useGlobalSetting( '' );\n\tconst settings = useSettingsForBlockElement( rawSettings );\n\t/*\n\t * Use the raw settings to determine if the background panel should be displayed,\n\t * as the background panel is not dependent on the block element settings.\n\t */\n\tconst hasBackgroundPanel = useHasBackgroundPanel( rawSettings );\n\tconst hasTypographyPanel = useHasTypographyPanel( settings );\n\tconst hasColorPanel = useHasColorPanel( settings );\n\tconst hasShadowPanel = true; // useHasShadowPanel( settings );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\tconst hasLayoutPanel = hasDimensionsPanel;\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ hasTypographyPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ typography }\n\t\t\t\t\t\tpath=\"/typography\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Typography' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasColorPanel && (\n\t\t\t\t\t<NavigationButtonAsItem icon={ color } path=\"/colors\">\n\t\t\t\t\t\t{ __( 'Colors' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasBackgroundPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ background }\n\t\t\t\t\t\tpath=\"/background\"\n\t\t\t\t\t\taria-label={ __( 'Background styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Background' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasShadowPanel && (\n\t\t\t\t\t<NavigationButtonAsItem icon={ shadowIcon } path=\"/shadows\">\n\t\t\t\t\t\t{ __( 'Shadows' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasLayoutPanel && (\n\t\t\t\t\t<NavigationButtonAsItem icon={ layout } path=\"/layout\">\n\t\t\t\t\t\t{ __( 'Layout' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t</ItemGroup>\n\t\t</>\n\t);\n}\n\nexport default RootMenu;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAOA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAA2C,IAAAM,WAAA,GAAAN,OAAA;AAlB3C;AACA;AACA;;AAYA;AACA;AACA;;AAIA,MAAM;EACLO,qBAAqB;EACrBC,qBAAqB;EACrBC,gBAAgB;EAChBC,gBAAgB;EAChBC,0BAA0B;EAC1BC;AACD,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEpC,SAASC,QAAQA,CAAA,EAAG;EACnB,MAAM,CAAEC,WAAW,CAAE,GAAGN,gBAAgB,CAAE,EAAG,CAAC;EAC9C,MAAMO,QAAQ,GAAGN,0BAA0B,CAAEK,WAAY,CAAC;EAC1D;AACD;AACA;AACA;EACC,MAAME,kBAAkB,GAAGN,qBAAqB,CAAEI,WAAY,CAAC;EAC/D,MAAMG,kBAAkB,GAAGX,qBAAqB,CAAES,QAAS,CAAC;EAC5D,MAAMG,aAAa,GAAGX,gBAAgB,CAAEQ,QAAS,CAAC;EAClD,MAAMI,cAAc,GAAG,IAAI,CAAC,CAAC;EAC7B,MAAMC,kBAAkB,GAAGf,qBAAqB,CAAEU,QAAS,CAAC;EAC5D,MAAMM,cA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,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEczB,QAAQ","ignoreList":[]}
@@ -79,12 +79,8 @@ function BlockMenuItem({
79
79
  if (!hasBlockMenuItem) {
80
80
  return null;
81
81
  }
82
- const navigationButtonLabel = (0, _i18n.sprintf)(
83
- // translators: %s: is the name of a block e.g., 'Image' or 'Table'.
84
- (0, _i18n.__)('%s block styles'), block.title);
85
82
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationButton.NavigationButtonAsItem, {
86
83
  path: '/blocks/' + encodeURIComponent(block.name),
87
- "aria-label": navigationButtonLabel,
88
84
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
89
85
  justify: "flex-start",
90
86
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockIcon, {
@@ -120,7 +116,7 @@ function BlockList({
120
116
  // which is now one.
121
117
  // @see https://github.com/WordPress/gutenberg/pull/39117#discussion_r816022116
122
118
  const count = blockTypesListRef.current.childElementCount;
123
- const resultsFoundMessage = (0, _i18n.sprintf)( /* translators: %d: number of results. */
119
+ const resultsFoundMessage = (0, _i18n.sprintf)(/* translators: %d: number of results. */
124
120
  (0, _i18n._n)('%d result found.', '%d results found.', count), count);
125
121
  debouncedSpeak(resultsFoundMessage, count);
126
122
  }, [filterValue, debouncedSpeak]);
@@ -145,7 +141,7 @@ function ScreenBlockList() {
145
141
  className: "edit-site-block-types-search",
146
142
  onChange: setFilterValue,
147
143
  value: filterValue,
148
- label: (0, _i18n.__)('Search for blocks'),
144
+ label: (0, _i18n.__)('Search'),
149
145
  placeholder: (0, _i18n.__)('Search')
150
146
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(MemoizedBlockList, {
151
147
  filterValue: deferredFilterValue
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_i18n","_components","_data","_element","_blockEditor","_compose","_a11y","_variationsPanel","_header","_interopRequireDefault","_navigationButton","_lockUnlock","_jsxRuntime","useHasDimensionsPanel","useHasTypographyPanel","useHasBorderPanel","useGlobalSetting","useSettingsForBlockElement","useHasColorPanel","unlock","blockEditorPrivateApis","useSortedBlockTypes","blockItems","useSelect","select","blocksStore","getBlockTypes","groupByType","blocks","block","core","noncore","type","name","startsWith","push","coreItems","nonCoreItems","reduce","useBlockHasGlobalStyles","blockName","rawSettings","settings","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel","hasVariationsPanel","useBlockVariations","length","hasGlobalStyles","BlockMenuItem","hasBlockMenuItem","navigationButtonLabel","sprintf","__","title","jsx","NavigationButtonAsItem","path","encodeURIComponent","children","jsxs","__experimentalHStack","justify","BlockIcon","icon","FlexItem","BlockList","filterValue","sortedBlockTypes","debouncedSpeak","useDebounce","speak","isMatchingSearchTerm","filteredBlockTypes","filter","blockType","blockTypesListRef","useRef","useEffect","count","current","childElementCount","resultsFoundMessage","_n","ref","className","map","MemoizedBlockList","memo","ScreenBlockList","setFilterValue","useState","deferredFilterValue","useDeferredValue","Fragment","default","description","SearchControl","__nextHasNoMarginBottom","onChange","value","label","placeholder","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-block-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport {\n\tFlexItem,\n\tSearchControl,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tuseDeferredValue,\n\tmemo,\n} from '@wordpress/element';\nimport {\n\tBlockIcon,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useDebounce } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { useBlockVariations } from './variations/variations-panel';\nimport ScreenHeader from './header';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tuseHasDimensionsPanel,\n\tuseHasTypographyPanel,\n\tuseHasBorderPanel,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tuseHasColorPanel,\n} = unlock( blockEditorPrivateApis );\n\nfunction useSortedBlockTypes() {\n\tconst blockItems = useSelect(\n\t\t( select ) => select( blocksStore ).getBlockTypes(),\n\t\t[]\n\t);\n\t// Ensure core blocks are prioritized in the returned results,\n\t// because third party blocks can be registered earlier than\n\t// the core blocks (usually by using the `init` action),\n\t// thus affecting the display order.\n\t// We don't sort reusable blocks as they are handled differently.\n\tconst groupByType = ( blocks, block ) => {\n\t\tconst { core, noncore } = blocks;\n\t\tconst type = block.name.startsWith( 'core/' ) ? core : noncore;\n\t\ttype.push( block );\n\t\treturn blocks;\n\t};\n\tconst { core: coreItems, noncore: nonCoreItems } = blockItems.reduce(\n\t\tgroupByType,\n\t\t{ core: [], noncore: [] }\n\t);\n\treturn [ ...coreItems, ...nonCoreItems ];\n}\n\nexport function useBlockHasGlobalStyles( blockName ) {\n\tconst [ rawSettings ] = useGlobalSetting( '', blockName );\n\tconst settings = useSettingsForBlockElement( rawSettings, blockName );\n\tconst hasTypographyPanel = useHasTypographyPanel( settings );\n\tconst hasColorPanel = useHasColorPanel( settings );\n\tconst hasBorderPanel = useHasBorderPanel( settings );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\tconst hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;\n\tconst hasVariationsPanel = !! useBlockVariations( blockName )?.length;\n\tconst hasGlobalStyles =\n\t\thasTypographyPanel ||\n\t\thasColorPanel ||\n\t\thasLayoutPanel ||\n\t\thasVariationsPanel;\n\treturn hasGlobalStyles;\n}\n\nfunction BlockMenuItem( { block } ) {\n\tconst hasBlockMenuItem = useBlockHasGlobalStyles( block.name );\n\tif ( ! hasBlockMenuItem ) {\n\t\treturn null;\n\t}\n\n\tconst navigationButtonLabel = sprintf(\n\t\t// translators: %s: is the name of a block e.g., 'Image' or 'Table'.\n\t\t__( '%s block styles' ),\n\t\tblock.title\n\t);\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\taria-label={ navigationButtonLabel }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<BlockIcon icon={ block.icon } />\n\t\t\t\t<FlexItem>{ block.title }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction BlockList( { filterValue } ) {\n\tconst sortedBlockTypes = useSortedBlockTypes();\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst { isMatchingSearchTerm } = useSelect( blocksStore );\n\n\tconst filteredBlockTypes = ! filterValue\n\t\t? sortedBlockTypes\n\t\t: sortedBlockTypes.filter( ( blockType ) =>\n\t\t\t\tisMatchingSearchTerm( blockType, filterValue )\n\t\t );\n\n\tconst blockTypesListRef = useRef();\n\n\t// Announce search results on change\n\tuseEffect( () => {\n\t\tif ( ! filterValue ) {\n\t\t\treturn;\n\t\t}\n\t\t// We extract the results from the wrapper div's `ref` because\n\t\t// filtered items can contain items that will eventually not\n\t\t// render and there is no reliable way to detect when a child\n\t\t// will return `null`.\n\t\t// TODO: We should find a better way of handling this as it's\n\t\t// fragile and depends on the number of rendered elements of `BlockMenuItem`,\n\t\t// which is now one.\n\t\t// @see https://github.com/WordPress/gutenberg/pull/39117#discussion_r816022116\n\t\tconst count = blockTypesListRef.current.childElementCount;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage, count );\n\t}, [ filterValue, debouncedSpeak ] );\n\n\treturn (\n\t\t<div\n\t\t\tref={ blockTypesListRef }\n\t\t\tclassName=\"edit-site-block-types-item-list\"\n\t\t>\n\t\t\t{ filteredBlockTypes.map( ( block ) => (\n\t\t\t\t<BlockMenuItem\n\t\t\t\t\tblock={ block }\n\t\t\t\t\tkey={ 'menu-itemblock-' + block.name }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</div>\n\t);\n}\n\nconst MemoizedBlockList = memo( BlockList );\n\nfunction ScreenBlockList() {\n\tconst [ filterValue, setFilterValue ] = useState( '' );\n\tconst deferredFilterValue = useDeferredValue( filterValue );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Blocks' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Customize the appearance of specific blocks and for the whole site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tclassName=\"edit-site-block-types-search\"\n\t\t\t\tonChange={ setFilterValue }\n\t\t\t\tvalue={ filterValue }\n\t\t\t\tlabel={ __( 'Search for blocks' ) }\n\t\t\t\tplaceholder={ __( 'Search' ) }\n\t\t\t/>\n\t\t\t<MemoizedBlockList filterValue={ deferredFilterValue } />\n\t\t</>\n\t);\n}\n\nexport default ScreenBlockList;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAOA,IAAAK,YAAA,GAAAL,OAAA;AAIA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AAKA,IAAAQ,gBAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,iBAAA,GAAAX,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AAA2C,IAAAa,WAAA,GAAAb,OAAA;AA/B3C;AACA;AACA;;AAuBA;AACA;AACA;;AAMA,MAAM;EACLc,qBAAqB;EACrBC,qBAAqB;EACrBC,iBAAiB;EACjBC,g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G,IAAAC,yBAAgB,EAAE1B,WAAY,CAAC;EAE3D,oBACC,IAAA1D,WAAA,CAAAmD,IAAA,EAAAnD,WAAA,CAAAqF,QAAA;IAAAnC,QAAA,gBACC,IAAAlD,WAAA,CAAA8C,GAAA,EAAClD,OAAA,CAAA0F,OAAY;MACZzC,KAAK,EAAG,IAAAD,QAAE,EAAE,QAAS,CAAG;MACxB2C,WAAW,EAAG,IAAA3C,QAAE,EACf,qEACD;IAAG,CACH,CAAC,eACF,IAAA5C,WAAA,CAAA8C,GAAA,EAACzD,WAAA,CAAAmG,aAAa;MACbC,uBAAuB;MACvBb,SAAS,EAAC,8BAA8B;MACxCc,QAAQ,EAAGT,cAAgB;MAC3BU,KAAK,EAAGjC,WAAa;MACrBkC,KAAK,EAAG,IAAAhD,QAAE,EAAE,mBAAoB,CAAG;MACnCiD,WAAW,EAAG,IAAAjD,QAAE,EAAE,QAAS;IAAG,CAC9B,CAAC,eACF,IAAA5C,WAAA,CAAA8C,GAAA,EAACgC,iBAAiB;MAACpB,WAAW,EAAGyB;IAAqB,CAAE,CAAC;EAAA,CACxD,CAAC;AAEL;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAT,OAAA,GAEcN,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["_blocks","require","_i18n","_components","_data","_element","_blockEditor","_compose","_a11y","_variationsPanel","_header","_interopRequireDefault","_navigationButton","_lockUnlock","_jsxRuntime","useHasDimensionsPanel","useHasTypographyPanel","useHasBorderPanel","useGlobalSetting","useSettingsForBlockElement","useHasColorPanel","unlock","blockEditorPrivateApis","useSortedBlockTypes","blockItems","useSelect","select","blocksStore","getBlockTypes","groupByType","blocks","block","core","noncore","type","name","startsWith","push","coreItems","nonCoreItems","reduce","useBlockHasGlobalStyles","blockName","rawSettings","settings","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel","hasVariationsPanel","useBlockVariations","length","hasGlobalStyles","BlockMenuItem","hasBlockMenuItem","jsx","NavigationButtonAsItem","path","encodeURIComponent","children","jsxs","__experimentalHStack","justify","BlockIcon","icon","FlexItem","title","BlockList","filterValue","sortedBlockTypes","debouncedSpeak","useDebounce","speak","isMatchingSearchTerm","filteredBlockTypes","filter","blockType","blockTypesListRef","useRef","useEffect","count","current","childElementCount","resultsFoundMessage","sprintf","_n","ref","className","map","MemoizedBlockList","memo","ScreenBlockList","setFilterValue","useState","deferredFilterValue","useDeferredValue","Fragment","default","__","description","SearchControl","__nextHasNoMarginBottom","onChange","value","label","placeholder","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-block-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport {\n\tFlexItem,\n\tSearchControl,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tuseDeferredValue,\n\tmemo,\n} from '@wordpress/element';\nimport {\n\tBlockIcon,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useDebounce } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { useBlockVariations } from './variations/variations-panel';\nimport ScreenHeader from './header';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tuseHasDimensionsPanel,\n\tuseHasTypographyPanel,\n\tuseHasBorderPanel,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tuseHasColorPanel,\n} = unlock( blockEditorPrivateApis );\n\nfunction useSortedBlockTypes() {\n\tconst blockItems = useSelect(\n\t\t( select ) => select( blocksStore ).getBlockTypes(),\n\t\t[]\n\t);\n\t// Ensure core blocks are prioritized in the returned results,\n\t// because third party blocks can be registered earlier than\n\t// the core blocks (usually by using the `init` action),\n\t// thus affecting the display order.\n\t// We don't sort reusable blocks as they are handled differently.\n\tconst groupByType = ( blocks, block ) => {\n\t\tconst { core, noncore } = blocks;\n\t\tconst type = block.name.startsWith( 'core/' ) ? core : noncore;\n\t\ttype.push( block );\n\t\treturn blocks;\n\t};\n\tconst { core: coreItems, noncore: nonCoreItems } = blockItems.reduce(\n\t\tgroupByType,\n\t\t{ core: [], noncore: [] }\n\t);\n\treturn [ ...coreItems, ...nonCoreItems ];\n}\n\nexport function useBlockHasGlobalStyles( blockName ) {\n\tconst [ rawSettings ] = useGlobalSetting( '', blockName );\n\tconst settings = useSettingsForBlockElement( rawSettings, blockName );\n\tconst hasTypographyPanel = useHasTypographyPanel( settings );\n\tconst hasColorPanel = useHasColorPanel( settings );\n\tconst hasBorderPanel = useHasBorderPanel( settings );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\tconst hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;\n\tconst hasVariationsPanel = !! useBlockVariations( blockName )?.length;\n\tconst hasGlobalStyles =\n\t\thasTypographyPanel ||\n\t\thasColorPanel ||\n\t\thasLayoutPanel ||\n\t\thasVariationsPanel;\n\treturn hasGlobalStyles;\n}\n\nfunction BlockMenuItem( { block } ) {\n\tconst hasBlockMenuItem = useBlockHasGlobalStyles( block.name );\n\tif ( ! hasBlockMenuItem ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<BlockIcon icon={ block.icon } />\n\t\t\t\t<FlexItem>{ block.title }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction BlockList( { filterValue } ) {\n\tconst sortedBlockTypes = useSortedBlockTypes();\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst { isMatchingSearchTerm } = useSelect( blocksStore );\n\n\tconst filteredBlockTypes = ! filterValue\n\t\t? sortedBlockTypes\n\t\t: sortedBlockTypes.filter( ( blockType ) =>\n\t\t\t\tisMatchingSearchTerm( blockType, filterValue )\n\t\t );\n\n\tconst blockTypesListRef = useRef();\n\n\t// Announce search results on change\n\tuseEffect( () => {\n\t\tif ( ! filterValue ) {\n\t\t\treturn;\n\t\t}\n\t\t// We extract the results from the wrapper div's `ref` because\n\t\t// filtered items can contain items that will eventually not\n\t\t// render and there is no reliable way to detect when a child\n\t\t// will return `null`.\n\t\t// TODO: We should find a better way of handling this as it's\n\t\t// fragile and depends on the number of rendered elements of `BlockMenuItem`,\n\t\t// which is now one.\n\t\t// @see https://github.com/WordPress/gutenberg/pull/39117#discussion_r816022116\n\t\tconst count = blockTypesListRef.current.childElementCount;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage, count );\n\t}, [ filterValue, debouncedSpeak ] );\n\n\treturn (\n\t\t<div\n\t\t\tref={ blockTypesListRef }\n\t\t\tclassName=\"edit-site-block-types-item-list\"\n\t\t>\n\t\t\t{ filteredBlockTypes.map( ( block ) => (\n\t\t\t\t<BlockMenuItem\n\t\t\t\t\tblock={ block }\n\t\t\t\t\tkey={ 'menu-itemblock-' + block.name }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</div>\n\t);\n}\n\nconst MemoizedBlockList = memo( BlockList );\n\nfunction ScreenBlockList() {\n\tconst [ filterValue, setFilterValue ] = useState( '' );\n\tconst deferredFilterValue = useDeferredValue( filterValue );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Blocks' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Customize the appearance of specific blocks and for the whole site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tclassName=\"edit-site-block-types-search\"\n\t\t\t\tonChange={ setFilterValue }\n\t\t\t\tvalue={ filterValue }\n\t\t\t\tlabel={ __( 'Search' ) }\n\t\t\t\tplaceholder={ __( 'Search' ) }\n\t\t\t/>\n\t\t\t<MemoizedBlockList filterValue={ deferredFilterValue } />\n\t\t</>\n\t);\n}\n\nexport default ScreenBlockList;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAOA,IAAAK,YAAA,GAAAL,OAAA;AAIA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AAKA,IAAAQ,gBAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,iBAAA,GAAAX,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AAA2C,IAAAa,WAAA,GAAAb,OAAA;AA/B3C;AACA;AACA;;AAuBA;AACA;AACA;;AAMA,MAAM;EACLc,qBAAqB;EACrBC,qBAAqB;EACrBC,iBAAiB;EACjBC,gBAAgB;EAChBC,0BAA0B;EAC1BC;AACD,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEpC,SAASC,mBAAmBA,CAAA,EAAG;EAC9B,MAAMC,UAAU,GAAG,IAAAC,eAAS,EACzBC,MAAM,IAAMA,MAAM,CAAEC,aAAY,CAAC,CAACC,aAAa,CAAC,CAAC,EACnD,EACD,CAAC;EACD;EACA;EACA;EACA;EACA;EACA,MAAMC,WAAW,GAAGA,CAAEC,MAAM,EAAEC,KAAK,KAAM;IACxC,MAAM;MAAEC,IAAI;MAAEC;IAAQ,CAAC,GAAGH,MAAM;IAChC,MAAMI,IAAI,GAAGH,KAAK,CAACI,IAAI,CAACC,UAAU,CAAE,OAAQ,CAAC,GAAGJ,IAAI,GAAGC,OAAO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AAW,EAAG0B;IAAqB,CAAE,CAAC;EAAA,CACxD,CAAC;AAEL;AAAC,IAAAY,QAAA,GAAAC,OAAA,CAAAV,OAAA,GAEcN,eAAe","ignoreList":[]}
@@ -35,7 +35,7 @@ function ScreenCSS() {
35
35
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_header.default, {
36
36
  title: (0, _i18n.__)('CSS'),
37
37
  description: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
38
- children: [description, /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ExternalLink, {
38
+ children: [description, /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ExternalLink, {
39
39
  href: (0, _i18n.__)('https://developer.wordpress.org/advanced-administration/wordpress/css/'),
40
40
  className: "edit-site-global-styles-screen-css-help-link",
41
41
  children: (0, _i18n.__)('Learn more about CSS')
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_blockEditor","_lockUnlock","_header","_interopRequireDefault","_jsxRuntime","useGlobalStyle","AdvancedPanel","StylesAdvancedPanel","unlock","blockEditorPrivateApis","ScreenCSS","description","__","style","undefined","shouldDecodeEncode","inheritedStyle","setStyle","jsxs","Fragment","children","jsx","default","title","ExternalLink","href","className","value","onChange","inheritedValue","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-css.js"],"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={ __(\n\t\t\t\t\t\t\t\t'https://developer.wordpress.org/advanced-administration/wordpress/css/'\n\t\t\t\t\t\t\t) }\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"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAoC,IAAAM,WAAA,GAAAN,OAAA;AAXpC;AACA;AACA;;AAKA;AACA;AACA;;AAIA,MAAM;EAAEO,cAAc;EAAEC,aAAa,EAAEC;AAAoB,CAAC,GAAG,IAAAC,kBAAM,EACpEC,wBACD,CAAC;AAED,SAASC,SAASA,CAAA,EAAG;EACpB,MAAMC,WAAW,GAAG,IAAAC,QAAE,EACrB,uEACD,CAAC;EACD,MAAM,CAAEC,KAAK,CAAE,GAAGR,cAAc,CAAE,EAAE,EAAES,SAAS,EAAE,MAAM,EAAE;IACxDC,kBAAkB,EAAE;EACrB,CAAE,CAAC;EACH,MAAM,CAAEC,cAAc,EAAEC,QAAQ,CAAE,GAAGZ,cAAc,CAAE,EAAE,EAAES,SAAS,EAAE,KAAK,EAAE;IAC1EC,kBAAkB,EAAE;EACrB,CAAE,CAAC;EAEH,oBACC,IAAAX,WAAA,CAAAc,IAAA,EAAAd,WAAA,CAAAe,QAAA;IAAAC,QAAA,gBACC,IAAAhB,WAAA,CAAAiB,GAAA,EAACnB,OAAA,CAAAoB,OAAY;MACZC,KAAK,EAAG,IAAAX,QAAE,EAAE,KAAM,CAAG;MACrBD,WAAW,eACV,IAAAP,WAAA,CAAAc,IAAA,EAAAd,WAAA,CAAAe,QAAA;QAAAC,QAAA,GACGT,WAAW,eACb,IAAAP,WAAA,CAAAiB,GAAA,EAACtB,WAAA,CAAAyB,YAAY;UACZC,IAAI,EAAG,IAAAb,QAAE,EACR,wEACD,CAAG;UACHc,SAAS,EAAC,8CAA8C;UAAAN,QAAA,EAEtD,IAAAR,QAAE,EAAE,sBAAuB;QAAC,CACjB,CAAC;MAAA,CACd;IACF,CACD,CAAC,eACF,IAAAR,WAAA,CAAAiB,GAAA;MAAKK,SAAS,EAAC,oCAAoC;MAAAN,QAAA,eAClD,IAAAhB,WAAA,CAAAiB,GAAA,EAACd,mBAAmB;QACnBoB,KAAK,EAAGd,KAAO;QACfe,QAAQ,EAAGX,QAAU;QACrBY,cAAc,EAAGb;MAAgB,CACjC;IAAC,CACE,CAAC;EAAA,CACL,CAAC;AAEL;AAAC,IAAAc,QAAA,GAAAC,OAAA,CAAAT,OAAA,GAEcZ,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_components","_blockEditor","_lockUnlock","_header","_interopRequireDefault","_jsxRuntime","useGlobalStyle","AdvancedPanel","StylesAdvancedPanel","unlock","blockEditorPrivateApis","ScreenCSS","description","__","style","undefined","shouldDecodeEncode","inheritedStyle","setStyle","jsxs","Fragment","children","jsx","default","title","ExternalLink","href","className","value","onChange","inheritedValue","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-css.js"],"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<br />\n\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t'https://developer.wordpress.org/advanced-administration/wordpress/css/'\n\t\t\t\t\t\t\t) }\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\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A,EAEtD,IAAAR,QAAE,EAAE,sBAAuB;QAAC,CACjB,CAAC;MAAA,CACd;IACF,CACD,CAAC,eACF,IAAAR,WAAA,CAAAiB,GAAA;MAAKK,SAAS,EAAC,oCAAoC;MAAAN,QAAA,eAClD,IAAAhB,WAAA,CAAAiB,GAAA,EAACd,mBAAmB;QACnBoB,KAAK,EAAGd,KAAO;QACfe,QAAQ,EAAGX,QAAU;QACrBY,cAAc,EAAGb;MAAgB,CACjC;IAAC,CACE,CAAC;EAAA,CACL,CAAC;AAEL;AAAC,IAAAc,QAAA,GAAAC,OAAA,CAAAT,OAAA,GAEcZ,SAAS","ignoreList":[]}
@@ -33,9 +33,6 @@ const {
33
33
  } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
34
34
  const PAGE_SIZE = 10;
35
35
  function ScreenRevisions() {
36
- const {
37
- goTo
38
- } = (0, _components.useNavigator)();
39
36
  const {
40
37
  user: currentEditorGlobalStyles,
41
38
  setUserConfig
@@ -67,6 +64,9 @@ function ScreenRevisions() {
67
64
  setEditorCanvasContainerView
68
65
  } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
69
66
  const selectedRevisionMatchesEditorStyles = areGlobalStyleConfigsEqual(currentlySelectedRevision, currentEditorGlobalStyles);
67
+
68
+ // The actual code that triggers the revisions screen to navigate back
69
+ // to the home screen in in `packages/edit-site/src/components/global-styles/ui.js`.
70
70
  const onCloseRevisions = () => {
71
71
  const canvasContainerView = editorCanvasContainerView === 'global-styles-revisions:style-book' ? 'style-book' : undefined;
72
72
  setEditorCanvasContainerView(canvasContainerView);
@@ -76,11 +76,6 @@ function ScreenRevisions() {
76
76
  setIsLoadingRevisionWithUnsavedChanges(false);
77
77
  onCloseRevisions();
78
78
  };
79
- (0, _element.useEffect)(() => {
80
- if (!editorCanvasContainerView || !editorCanvasContainerView.startsWith('global-styles-revisions')) {
81
- goTo('/'); // Return to global styles main panel.
82
- }
83
- }, [editorCanvasContainerView]);
84
79
  (0, _element.useEffect)(() => {
85
80
  if (!isLoading && revisions.length) {
86
81
  setCurrentRevisions(revisions);
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_data","_element","_blockEditor","_header","_interopRequireDefault","_lockUnlock","_revisions","_store","_useGlobalStylesRevisions","_revisionsButtons","_styleBook","_pagination","_jsxRuntime","GlobalStylesContext","areGlobalStyleConfigsEqual","unlock","blockEditorPrivateApis","PAGE_SIZE","ScreenRevisions","goTo","useNavigator","user","currentEditorGlobalStyles","setUserConfig","useContext","blocks","editorCanvasContainerView","useSelect","select","editSiteStore","getEditorCanvasContainerView","blockEditorStore","getBlocks","currentPage","setCurrentPage","useState","currentRevisions","setCurrentRevisions","revisions","isLoading","hasUnsavedChanges","revisionsCount","useGlobalStylesRevisions","query","per_page","page","numPages","Math","ceil","currentlySelectedRevision","setCurrentlySelectedRevision","isLoadingRevisionWithUnsavedChanges","setIsLoadingRevisionWithUnsavedChanges","setEditorCanvasContainerView","useDispatch","selectedRevisionMatchesEditorStyles","onCloseRevisions","canvasContainerView","undefined","restoreRevision","revision","useEffect","startsWith","length","firstRevision","currentlySelectedRevisionId","id","shouldSelectFirstItem","isLoadButtonEnabled","hasRevisions","jsxs","Fragment","children","jsx","default","title","sprintf","__","description","onBack","Spinner","className","userConfig","isSelected","onClose","closeButtonLabel","onChange","selectedRevisionId","userRevisions","canApplyRevision","onApplyRevision","changePage","totalItems","disabled","label","__experimentalConfirmDialog","isOpen","confirmButtonText","onConfirm","onCancel","size","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tuseNavigator,\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 { store as editSiteStore } from '../../../store';\nimport useGlobalStylesRevisions from './use-global-styles-revisions';\nimport RevisionsButtons from './revisions-buttons';\nimport StyleBook from '../../style-book';\nimport Pagination from '../../pagination';\n\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\n\nconst PAGE_SIZE = 10;\n\nfunction ScreenRevisions() {\n\tconst { goTo } = useNavigator();\n\tconst { user: currentEditorGlobalStyles, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\n\tconst { blocks, editorCanvasContainerView } = useSelect(\n\t\t( select ) => ( {\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\t[]\n\t);\n\tconst [ currentPage, setCurrentPage ] = useState( 1 );\n\tconst [ currentRevisions, setCurrentRevisions ] = useState( [] );\n\tconst { revisions, isLoading, hasUnsavedChanges, revisionsCount } =\n\t\tuseGlobalStylesRevisions( {\n\t\t\tquery: {\n\t\t\t\tper_page: PAGE_SIZE,\n\t\t\t\tpage: currentPage,\n\t\t\t},\n\t\t} );\n\n\tconst numPages = Math.ceil( revisionsCount / PAGE_SIZE );\n\n\tconst [ currentlySelectedRevision, setCurrentlySelectedRevision ] =\n\t\tuseState( currentEditorGlobalStyles );\n\tconst [\n\t\tisLoadingRevisionWithUnsavedChanges,\n\t\tsetIsLoadingRevisionWithUnsavedChanges,\n\t] = useState( false );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst selectedRevisionMatchesEditorStyles = areGlobalStyleConfigsEqual(\n\t\tcurrentlySelectedRevision,\n\t\tcurrentEditorGlobalStyles\n\t);\n\n\tconst onCloseRevisions = () => {\n\t\tconst canvasContainerView =\n\t\t\teditorCanvasContainerView === 'global-styles-revisions:style-book'\n\t\t\t\t? 'style-book'\n\t\t\t\t: undefined;\n\t\tsetEditorCanvasContainerView( canvasContainerView );\n\t};\n\n\tconst restoreRevision = ( revision ) => {\n\t\tsetUserConfig( () => revision );\n\t\tsetIsLoadingRevisionWithUnsavedChanges( false );\n\t\tonCloseRevisions();\n\t};\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! editorCanvasContainerView ||\n\t\t\t! editorCanvasContainerView.startsWith( 'global-styles-revisions' )\n\t\t) {\n\t\t\tgoTo( '/' ); // Return to global styles main panel.\n\t\t}\n\t}, [ editorCanvasContainerView ] );\n\n\tuseEffect( () => {\n\t\tif ( ! isLoading && revisions.length ) {\n\t\t\tsetCurrentRevisions( revisions );\n\t\t}\n\t}, [ revisions, isLoading ] );\n\n\tconst firstRevision = revisions[ 0 ];\n\tconst currentlySelectedRevisionId = currentlySelectedRevision?.id;\n\tconst shouldSelectFirstItem =\n\t\t!! firstRevision?.id &&\n\t\t! selectedRevisionMatchesEditorStyles &&\n\t\t! currentlySelectedRevisionId;\n\n\tuseEffect( () => {\n\t\t/*\n\t\t * Ensure that the first item is selected and loaded into the preview pane\n\t\t * when no revision is selected and the selected styles don't match the current editor styles.\n\t\t * This is required in case editor styles are changed outside the revisions panel,\n\t\t * e.g., via the reset styles function of useGlobalStylesReset().\n\t\t * See: https://github.com/WordPress/gutenberg/issues/55866\n\t\t */\n\t\tif ( shouldSelectFirstItem ) {\n\t\t\tsetCurrentlySelectedRevision( firstRevision );\n\t\t}\n\t}, [ shouldSelectFirstItem, firstRevision ] );\n\n\t// Only display load button if there is a revision to load,\n\t// and it is different from the current editor styles.\n\tconst isLoadButtonEnabled =\n\t\t!! currentlySelectedRevisionId &&\n\t\tcurrentlySelectedRevisionId !== 'unsaved' &&\n\t\t! selectedRevisionMatchesEditorStyles;\n\tconst hasRevisions = !! currentRevisions.length;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={\n\t\t\t\t\trevisionsCount &&\n\t\t\t\t\t// translators: %s: number of revisions.\n\t\t\t\t\tsprintf( __( 'Revisions (%s)' ), revisionsCount )\n\t\t\t\t}\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Click on previously saved styles to preview them. To restore a selected version to the editor, hit \"Apply.\" When you\\'re ready, use the Save button to save your changes.'\n\t\t\t\t) }\n\t\t\t\tonBack={ onCloseRevisions }\n\t\t\t/>\n\t\t\t{ ! hasRevisions && (\n\t\t\t\t<Spinner className=\"edit-site-global-styles-screen-revisions__loading\" />\n\t\t\t) }\n\t\t\t{ hasRevisions &&\n\t\t\t\t( editorCanvasContainerView ===\n\t\t\t\t'global-styles-revisions:style-book' ? (\n\t\t\t\t\t<StyleBook\n\t\t\t\t\t\tuserConfig={ currentlySelectedRevision }\n\t\t\t\t\t\tisSelected={ () => {} }\n\t\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t'global-styles-revisions'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<Revisions\n\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\tuserConfig={ currentlySelectedRevision }\n\t\t\t\t\t\tcloseButtonLabel={ __( 'Close revisions' ) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t<RevisionsButtons\n\t\t\t\tonChange={ setCurrentlySelectedRevision }\n\t\t\t\tselectedRevisionId={ currentlySelectedRevisionId }\n\t\t\t\tuserRevisions={ currentRevisions }\n\t\t\t\tcanApplyRevision={ isLoadButtonEnabled }\n\t\t\t\tonApplyRevision={ () =>\n\t\t\t\t\thasUnsavedChanges\n\t\t\t\t\t\t? setIsLoadingRevisionWithUnsavedChanges( true )\n\t\t\t\t\t\t: restoreRevision( currentlySelectedRevision )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ numPages > 1 && (\n\t\t\t\t<div className=\"edit-site-global-styles-screen-revisions__footer\">\n\t\t\t\t\t<Pagination\n\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__pagination\"\n\t\t\t\t\t\tcurrentPage={ currentPage }\n\t\t\t\t\t\tnumPages={ numPages }\n\t\t\t\t\t\tchangePage={ setCurrentPage }\n\t\t\t\t\t\ttotalItems={ revisionsCount }\n\t\t\t\t\t\tdisabled={ isLoading }\n\t\t\t\t\t\tlabel={ __( 'Global Styles pagination navigation' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ isLoadingRevisionWithUnsavedChanges && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\tisOpen={ isLoadingRevisionWithUnsavedChanges }\n\t\t\t\t\tconfirmButtonText={ __( 'Apply' ) }\n\t\t\t\t\tonConfirm={ () =>\n\t\t\t\t\t\trestoreRevision( currentlySelectedRevision )\n\t\t\t\t\t}\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\tsize=\"medium\"\n\t\t\t\t>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Are you sure you want to apply this revision? Any unsaved changes will be lost.'\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"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAQA,IAAAK,OAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAF,sBAAA,CAAAN,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IA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AAE,KAAM,CAC9C;MACDgD,IAAI,EAAC,QAAQ;MAAA5B,QAAA,EAEX,IAAAK,QAAE,EACH,iFACD;IAAC,CACa,CACf;EAAA,CACA,CAAC;AAEL;AAAC,IAAAwB,QAAA,GAAAC,OAAA,CAAA5B,OAAA,GAEcxD,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_components","_data","_element","_blockEditor","_header","_interopRequireDefault","_lockUnlock","_revisions","_store","_useGlobalStylesRevisions","_revisionsButtons","_styleBook","_pagination","_jsxRuntime","GlobalStylesContext","areGlobalStyleConfigsEqual","unlock","blockEditorPrivateApis","PAGE_SIZE","ScreenRevisions","user","currentEditorGlobalStyles","setUserConfig","useContext","blocks","editorCanvasContainerView","useSelect","select","editSiteStore","getEditorCanvasContainerView","blockEditorStore","getBlocks","currentPage","setCurrentPage","useState","currentRevisions","setCurrentRevisions","revisions","isLoading","hasUnsavedChanges","revisionsCount","useGlobalStylesRevisions","query","per_page","page","numPages","Math","ceil","currentlySelectedRevision","setCurrentlySelectedRevision","isLoadingRevisionWithUnsavedChanges","setIsLoadingRevisionWithUnsavedChanges","setEditorCanvasContainerView","useDispatch","selectedRevisionMatchesEditorStyles","onCloseRevisions","canvasContainerView","undefined","restoreRevision","revision","useEffect","length","firstRevision","currentlySelectedRevisionId","id","shouldSelectFirstItem","isLoadButtonEnabled","hasRevisions","jsxs","Fragment","children","jsx","default","title","sprintf","__","description","onBack","Spinner","className","userConfig","isSelected","onClose","closeButtonLabel","onChange","selectedRevisionId","userRevisions","canApplyRevision","onApplyRevision","changePage","totalItems","disabled","label","__experimentalConfirmDialog","isOpen","confirmButtonText","onConfirm","onCancel","size","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\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 { store as editSiteStore } from '../../../store';\nimport useGlobalStylesRevisions from './use-global-styles-revisions';\nimport RevisionsButtons from './revisions-buttons';\nimport StyleBook from '../../style-book';\nimport Pagination from '../../pagination';\n\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\n\nconst PAGE_SIZE = 10;\n\nfunction ScreenRevisions() {\n\tconst { user: currentEditorGlobalStyles, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\n\tconst { blocks, editorCanvasContainerView } = useSelect(\n\t\t( select ) => ( {\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\t[]\n\t);\n\tconst [ currentPage, setCurrentPage ] = useState( 1 );\n\tconst [ currentRevisions, setCurrentRevisions ] = useState( [] );\n\tconst { revisions, isLoading, hasUnsavedChanges, revisionsCount } =\n\t\tuseGlobalStylesRevisions( {\n\t\t\tquery: {\n\t\t\t\tper_page: PAGE_SIZE,\n\t\t\t\tpage: currentPage,\n\t\t\t},\n\t\t} );\n\n\tconst numPages = Math.ceil( revisionsCount / PAGE_SIZE );\n\n\tconst [ currentlySelectedRevision, setCurrentlySelectedRevision ] =\n\t\tuseState( currentEditorGlobalStyles );\n\tconst [\n\t\tisLoadingRevisionWithUnsavedChanges,\n\t\tsetIsLoadingRevisionWithUnsavedChanges,\n\t] = useState( false );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst selectedRevisionMatchesEditorStyles = areGlobalStyleConfigsEqual(\n\t\tcurrentlySelectedRevision,\n\t\tcurrentEditorGlobalStyles\n\t);\n\n\t// The actual code that triggers the revisions screen to navigate back\n\t// to the home screen in in `packages/edit-site/src/components/global-styles/ui.js`.\n\tconst onCloseRevisions = () => {\n\t\tconst canvasContainerView =\n\t\t\teditorCanvasContainerView === 'global-styles-revisions:style-book'\n\t\t\t\t? 'style-book'\n\t\t\t\t: undefined;\n\t\tsetEditorCanvasContainerView( canvasContainerView );\n\t};\n\n\tconst restoreRevision = ( revision ) => {\n\t\tsetUserConfig( () => revision );\n\t\tsetIsLoadingRevisionWithUnsavedChanges( false );\n\t\tonCloseRevisions();\n\t};\n\n\tuseEffect( () => {\n\t\tif ( ! isLoading && revisions.length ) {\n\t\t\tsetCurrentRevisions( revisions );\n\t\t}\n\t}, [ revisions, isLoading ] );\n\n\tconst firstRevision = revisions[ 0 ];\n\tconst currentlySelectedRevisionId = currentlySelectedRevision?.id;\n\tconst shouldSelectFirstItem =\n\t\t!! firstRevision?.id &&\n\t\t! selectedRevisionMatchesEditorStyles &&\n\t\t! currentlySelectedRevisionId;\n\n\tuseEffect( () => {\n\t\t/*\n\t\t * Ensure that the first item is selected and loaded into the preview pane\n\t\t * when no revision is selected and the selected styles don't match the current editor styles.\n\t\t * This is required in case editor styles are changed outside the revisions panel,\n\t\t * e.g., via the reset styles function of useGlobalStylesReset().\n\t\t * See: https://github.com/WordPress/gutenberg/issues/55866\n\t\t */\n\t\tif ( shouldSelectFirstItem ) {\n\t\t\tsetCurrentlySelectedRevision( firstRevision );\n\t\t}\n\t}, [ shouldSelectFirstItem, firstRevision ] );\n\n\t// Only display load button if there is a revision to load,\n\t// and it is different from the current editor styles.\n\tconst isLoadButtonEnabled =\n\t\t!! currentlySelectedRevisionId &&\n\t\tcurrentlySelectedRevisionId !== 'unsaved' &&\n\t\t! selectedRevisionMatchesEditorStyles;\n\tconst hasRevisions = !! currentRevisions.length;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={\n\t\t\t\t\trevisionsCount &&\n\t\t\t\t\t// translators: %s: number of revisions.\n\t\t\t\t\tsprintf( __( 'Revisions (%s)' ), revisionsCount )\n\t\t\t\t}\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Click on previously saved styles to preview them. To restore a selected version to the editor, hit \"Apply.\" When you\\'re ready, use the Save button to save your changes.'\n\t\t\t\t) }\n\t\t\t\tonBack={ onCloseRevisions }\n\t\t\t/>\n\t\t\t{ ! hasRevisions && (\n\t\t\t\t<Spinner className=\"edit-site-global-styles-screen-revisions__loading\" />\n\t\t\t) }\n\t\t\t{ hasRevisions &&\n\t\t\t\t( editorCanvasContainerView ===\n\t\t\t\t'global-styles-revisions:style-book' ? (\n\t\t\t\t\t<StyleBook\n\t\t\t\t\t\tuserConfig={ currentlySelectedRevision }\n\t\t\t\t\t\tisSelected={ () => {} }\n\t\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t'global-styles-revisions'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<Revisions\n\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\tuserConfig={ currentlySelectedRevision }\n\t\t\t\t\t\tcloseButtonLabel={ __( 'Close revisions' ) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t<RevisionsButtons\n\t\t\t\tonChange={ setCurrentlySelectedRevision }\n\t\t\t\tselectedRevisionId={ currentlySelectedRevisionId }\n\t\t\t\tuserRevisions={ currentRevisions }\n\t\t\t\tcanApplyRevision={ isLoadButtonEnabled }\n\t\t\t\tonApplyRevision={ () =>\n\t\t\t\t\thasUnsavedChanges\n\t\t\t\t\t\t? setIsLoadingRevisionWithUnsavedChanges( true )\n\t\t\t\t\t\t: restoreRevision( currentlySelectedRevision )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ numPages > 1 && (\n\t\t\t\t<div className=\"edit-site-global-styles-screen-revisions__footer\">\n\t\t\t\t\t<Pagination\n\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__pagination\"\n\t\t\t\t\t\tcurrentPage={ currentPage }\n\t\t\t\t\t\tnumPages={ numPages }\n\t\t\t\t\t\tchangePage={ setCurrentPage }\n\t\t\t\t\t\ttotalItems={ revisionsCount }\n\t\t\t\t\t\tdisabled={ isLoading }\n\t\t\t\t\t\tlabel={ __( 'Global Styles pagination navigation' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ isLoadingRevisionWithUnsavedChanges && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\tisOpen={ isLoadingRevisionWithUnsavedChanges }\n\t\t\t\t\tconfirmButtonText={ __( 'Apply' ) }\n\t\t\t\t\tonConfirm={ () =>\n\t\t\t\t\t\trestoreRevision( currentlySelectedRevision )\n\t\t\t\t\t}\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\tsize=\"medium\"\n\t\t\t\t>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Are you sure you want to apply this revision? Any unsaved changes will be lost.'\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"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAIA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAQA,IAAAK,OAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAF,sBAAA,CAAAN,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,yBAAA,GAAAJ,sBAA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C,4BAA8B;MACzCoC,kBAAkB,EAAGtB,2BAA6B;MAClDuB,aAAa,EAAGnD,gBAAkB;MAClCoD,gBAAgB,EAAGrB,mBAAqB;MACxCsB,eAAe,EAAGA,CAAA,KACjBjD,iBAAiB,GACdY,sCAAsC,CAAE,IAAK,CAAC,GAC9CO,eAAe,CAAEV,yBAA0B;IAC9C,CACD,CAAC,EACAH,QAAQ,GAAG,CAAC,iBACb,IAAAhC,WAAA,CAAA0D,GAAA;MAAKQ,SAAS,EAAC,kDAAkD;MAAAT,QAAA,eAChE,IAAAzD,WAAA,CAAA0D,GAAA,EAAC3D,WAAA,CAAA4D,OAAU;QACVO,SAAS,EAAC,sDAAsD;QAChE/C,WAAW,EAAGA,WAAa;QAC3Ba,QAAQ,EAAGA,QAAU;QACrB4C,UAAU,EAAGxD,cAAgB;QAC7ByD,UAAU,EAAGlD,cAAgB;QAC7BmD,QAAQ,EAAGrD,SAAW;QACtBsD,KAAK,EAAG,IAAAjB,QAAE,EAAE,qCAAsC;MAAG,CACrD;IAAC,CACE,CACL,EACCzB,mCAAmC,iBACpC,IAAArC,WAAA,CAAA0D,GAAA,EAACvE,WAAA,CAAA6F,2BAAa;MACbC,MAAM,EAAG5C,mCAAqC;MAC9C6C,iBAAiB,EAAG,IAAApB,QAAE,EAAE,OAAQ,CAAG;MACnCqB,SAAS,EAAGA,CAAA,KACXtC,eAAe,CAAEV,yBAA0B,CAC3C;MACDiD,QAAQ,EAAGA,CAAA,KACV9C,sCAAsC,CAAE,KAAM,CAC9C;MACD+C,IAAI,EAAC,QAAQ;MAAA5B,QAAA,EAEX,IAAAK,QAAE,EACH,iFACD;IAAC,CACa,CACf;EAAA,CACA,CAAC;AAEL;AAAC,IAAAwB,QAAA,GAAAC,OAAA,CAAA5B,OAAA,GAEcrD,eAAe","ignoreList":[]}
@@ -63,13 +63,13 @@ function getRevisionLabel(id, authorDisplayName, formattedModifiedDate, areStyle
63
63
  return (0, _i18n.__)('Reset the styles to the theme defaults');
64
64
  }
65
65
  if ('unsaved' === id) {
66
- return (0, _i18n.sprintf)( /* translators: %s: author display name */
66
+ return (0, _i18n.sprintf)(/* translators: %s: author display name */
67
67
  (0, _i18n.__)('Unsaved changes by %s'), authorDisplayName);
68
68
  }
69
69
  return areStylesEqual ? (0, _i18n.sprintf)(
70
- // translators: %1$s: author display name, %2$s: revision creation date.
70
+ // translators: 1: author display name. 2: revision creation date.
71
71
  (0, _i18n.__)('Changes saved by %1$s on %2$s. This revision matches current editor styles.'), authorDisplayName, formattedModifiedDate) : (0, _i18n.sprintf)(
72
- // translators: %1$s: author display name, %2$s: revision creation date.
72
+ // translators: 1: author display name. 2: revision creation date.
73
73
  (0, _i18n.__)('Changes saved by %1$s on %2$s'), authorDisplayName, formattedModifiedDate);
74
74
  }
75
75
 
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_components","_date","_coreData","_data","_blockEditor","_lockUnlock","_jsxRuntime","DAY_IN_MILLISECONDS","getGlobalStylesChanges","unlock","blockEditorPrivateApis","ChangesSummary","revision","previousRevision","changes","maxResults","length","jsx","className","children","map","change","getRevisionLabel","id","authorDisplayName","formattedModifiedDate","areStylesEqual","__","sprintf","RevisionsButtons","userRevisions","selectedRevisionId","onChange","canApplyRevision","onApplyRevision","currentThemeName","currentUser","useSelect","select","getCurrentTheme","getCurrentUser","coreStore","currentTheme","name","rendered","stylesheet","dateNowInMs","getDate","getTime","datetimeAbbreviated","getSettings","formats","role","index","author","modified","isUnsaved","revisionAuthor","authorAvatar","avatar_urls","isFirstItem","isSelected","isReset","modifiedDate","displayDate","dateI18n","humanTimeDiff","revisionLabel","jsxs","clsx","Button","__next40pxDefaultSize","accessibleWhenDisabled","disabled","onClick","dateTime","alt","src","size","variant","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/revisions-buttons.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst DAY_IN_MILLISECONDS = 60 * 60 * 1000 * 24;\nconst { getGlobalStylesChanges } = unlock( blockEditorPrivateApis );\n\nfunction ChangesSummary( { revision, previousRevision } ) {\n\tconst changes = getGlobalStylesChanges( revision, previousRevision, {\n\t\tmaxResults: 7,\n\t} );\n\n\tif ( ! changes.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ul\n\t\t\tdata-testid=\"global-styles-revision-changes\"\n\t\t\tclassName=\"edit-site-global-styles-screen-revisions__changes\"\n\t\t>\n\t\t\t{ changes.map( ( change ) => (\n\t\t\t\t<li key={ change }>{ change }</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n\n/**\n * Returns a button label for the revision.\n *\n * @param {string|number} id A revision object.\n * @param {string} authorDisplayName Author name.\n * @param {string} formattedModifiedDate Revision modified date formatted.\n * @param {boolean} areStylesEqual Whether the revision matches the current editor styles.\n * @return {string} Translated label.\n */\nfunction getRevisionLabel(\n\tid,\n\tauthorDisplayName,\n\tformattedModifiedDate,\n\tareStylesEqual\n) {\n\tif ( 'parent' === id ) {\n\t\treturn __( 'Reset the styles to the theme defaults' );\n\t}\n\n\tif ( 'unsaved' === id ) {\n\t\treturn sprintf(\n\t\t\t/* translators: %s: author display name */\n\t\t\t__( 'Unsaved changes by %s' ),\n\t\t\tauthorDisplayName\n\t\t);\n\t}\n\n\treturn areStylesEqual\n\t\t? sprintf(\n\t\t\t\t// translators: %1$s: author display name, %2$s: revision creation date.\n\t\t\t\t__(\n\t\t\t\t\t'Changes saved by %1$s on %2$s. This revision matches current editor styles.'\n\t\t\t\t),\n\t\t\t\tauthorDisplayName,\n\t\t\t\tformattedModifiedDate\n\t\t )\n\t\t: sprintf(\n\t\t\t\t// translators: %1$s: author display name, %2$s: revision creation date.\n\t\t\t\t__( 'Changes saved by %1$s on %2$s' ),\n\t\t\t\tauthorDisplayName,\n\t\t\t\tformattedModifiedDate\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( {\n\tuserRevisions,\n\tselectedRevisionId,\n\tonChange,\n\tcanApplyRevision,\n\tonApplyRevision,\n} ) {\n\tconst { currentThemeName, currentUser } = useSelect( ( select ) => {\n\t\tconst { getCurrentTheme, getCurrentUser } = select( coreStore );\n\t\tconst currentTheme = getCurrentTheme();\n\t\treturn {\n\t\t\tcurrentThemeName:\n\t\t\t\tcurrentTheme?.name?.rendered || currentTheme?.stylesheet,\n\t\t\tcurrentUser: getCurrentUser(),\n\t\t};\n\t}, [] );\n\tconst dateNowInMs = getDate().getTime();\n\tconst { datetimeAbbreviated } = getSettings().formats;\n\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 list' ) }\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 isUnsaved = 'unsaved' === id;\n\t\t\t\t// Unsaved changes are created by the current user.\n\t\t\t\tconst revisionAuthor = isUnsaved ? currentUser : author;\n\t\t\t\tconst authorDisplayName = revisionAuthor?.name || __( 'User' );\n\t\t\t\tconst authorAvatar = revisionAuthor?.avatar_urls?.[ '48' ];\n\t\t\t\tconst isFirstItem = index === 0;\n\t\t\t\tconst isSelected = selectedRevisionId\n\t\t\t\t\t? selectedRevisionId === id\n\t\t\t\t\t: isFirstItem;\n\t\t\t\tconst areStylesEqual = ! canApplyRevision && isSelected;\n\t\t\t\tconst isReset = 'parent' === id;\n\t\t\t\tconst modifiedDate = getDate( modified );\n\t\t\t\tconst displayDate =\n\t\t\t\t\tmodified &&\n\t\t\t\t\tdateNowInMs - modifiedDate.getTime() > DAY_IN_MILLISECONDS\n\t\t\t\t\t\t? dateI18n( datetimeAbbreviated, modifiedDate )\n\t\t\t\t\t\t: humanTimeDiff( modified );\n\t\t\t\tconst revisionLabel = getRevisionLabel(\n\t\t\t\t\tid,\n\t\t\t\t\tauthorDisplayName,\n\t\t\t\t\tdateI18n( datetimeAbbreviated, modifiedDate ),\n\t\t\t\t\tareStylesEqual\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<li\n\t\t\t\t\t\tclassName={ clsx(\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\t'is-active': areStylesEqual,\n\t\t\t\t\t\t\t\t'is-reset': isReset,\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\taria-current={ isSelected }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__revision-button\"\n\t\t\t\t\t\t\taccessibleWhenDisabled\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\taria-label={ revisionLabel }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ isReset ? (\n\t\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\t{ __( 'Default styles' ) }\n\t\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\t{ currentThemeName }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) : (\n\t\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\t{ isUnsaved ? (\n\t\t\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__date\">\n\t\t\t\t\t\t\t\t\t\t\t{ __( '(Unsaved)' ) }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<time\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__date\"\n\t\t\t\t\t\t\t\t\t\t\tdateTime={ modified }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ displayDate }\n\t\t\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t\t) }\n\t\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\t<img\n\t\t\t\t\t\t\t\t\t\t\talt={ authorDisplayName }\n\t\t\t\t\t\t\t\t\t\t\tsrc={ authorAvatar }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{ authorDisplayName }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{ isSelected && (\n\t\t\t\t\t\t\t\t\t\t<ChangesSummary\n\t\t\t\t\t\t\t\t\t\t\trevision={ revision }\n\t\t\t\t\t\t\t\t\t\t\tpreviousRevision={\n\t\t\t\t\t\t\t\t\t\t\t\tindex < userRevisions.length\n\t\t\t\t\t\t\t\t\t\t\t\t\t? userRevisions[ index + 1 ]\n\t\t\t\t\t\t\t\t\t\t\t\t\t: {}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t{ isSelected &&\n\t\t\t\t\t\t\t( areStylesEqual ? (\n\t\t\t\t\t\t\t\t<p className=\"edit-site-global-styles-screen-revisions__applied-text\">\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'These styles are already applied to your site.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__apply-button\"\n\t\t\t\t\t\t\t\t\tonClick={ onApplyRevision }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ isReset\n\t\t\t\t\t\t\t\t\t\t? __( 'Reset to defaults' )\n\t\t\t\t\t\t\t\t\t\t: __( 'Apply' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t) ) }\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"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AAA8C,IAAAQ,WAAA,GAAAR,OAAA;AAlB9C;AACA;AACA;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C,wDAAwD;UAClEwD,OAAO,EAAGxC,eAAiB;UAAAf,QAAA,EAEzB2C,OAAO,GACN,IAAAnC,QAAE,EAAE,mBAAoB,CAAC,GACzB,IAAAA,QAAE,EAAE,OAAQ;QAAC,CACT,CACR,CAAE;MAAA,GAxEEJ,EAyEH,CAAC;IAEP,CAAE;EAAC,CACA,CAAC;AAEP;AAAC,IAAAyD,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcrD,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_components","_date","_coreData","_data","_blockEditor","_lockUnlock","_jsxRuntime","DAY_IN_MILLISECONDS","getGlobalStylesChanges","unlock","blockEditorPrivateApis","ChangesSummary","revision","previousRevision","changes","maxResults","length","jsx","className","children","map","change","getRevisionLabel","id","authorDisplayName","formattedModifiedDate","areStylesEqual","__","sprintf","RevisionsButtons","userRevisions","selectedRevisionId","onChange","canApplyRevision","onApplyRevision","currentThemeName","currentUser","useSelect","select","getCurrentTheme","getCurrentUser","coreStore","currentTheme","name","rendered","stylesheet","dateNowInMs","getDate","getTime","datetimeAbbreviated","getSettings","formats","role","index","author","modified","isUnsaved","revisionAuthor","authorAvatar","avatar_urls","isFirstItem","isSelected","isReset","modifiedDate","displayDate","dateI18n","humanTimeDiff","revisionLabel","jsxs","clsx","Button","__next40pxDefaultSize","accessibleWhenDisabled","disabled","onClick","dateTime","alt","src","size","variant","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/revisions-buttons.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst DAY_IN_MILLISECONDS = 60 * 60 * 1000 * 24;\nconst { getGlobalStylesChanges } = unlock( blockEditorPrivateApis );\n\nfunction ChangesSummary( { revision, previousRevision } ) {\n\tconst changes = getGlobalStylesChanges( revision, previousRevision, {\n\t\tmaxResults: 7,\n\t} );\n\n\tif ( ! changes.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ul\n\t\t\tdata-testid=\"global-styles-revision-changes\"\n\t\t\tclassName=\"edit-site-global-styles-screen-revisions__changes\"\n\t\t>\n\t\t\t{ changes.map( ( change ) => (\n\t\t\t\t<li key={ change }>{ change }</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n\n/**\n * Returns a button label for the revision.\n *\n * @param {string|number} id A revision object.\n * @param {string} authorDisplayName Author name.\n * @param {string} formattedModifiedDate Revision modified date formatted.\n * @param {boolean} areStylesEqual Whether the revision matches the current editor styles.\n * @return {string} Translated label.\n */\nfunction getRevisionLabel(\n\tid,\n\tauthorDisplayName,\n\tformattedModifiedDate,\n\tareStylesEqual\n) {\n\tif ( 'parent' === id ) {\n\t\treturn __( 'Reset the styles to the theme defaults' );\n\t}\n\n\tif ( 'unsaved' === id ) {\n\t\treturn sprintf(\n\t\t\t/* translators: %s: author display name */\n\t\t\t__( 'Unsaved changes by %s' ),\n\t\t\tauthorDisplayName\n\t\t);\n\t}\n\n\treturn areStylesEqual\n\t\t? sprintf(\n\t\t\t\t// translators: 1: author display name. 2: revision creation date.\n\t\t\t\t__(\n\t\t\t\t\t'Changes saved by %1$s on %2$s. This revision matches current editor styles.'\n\t\t\t\t),\n\t\t\t\tauthorDisplayName,\n\t\t\t\tformattedModifiedDate\n\t\t )\n\t\t: sprintf(\n\t\t\t\t// translators: 1: author display name. 2: revision creation date.\n\t\t\t\t__( 'Changes saved by %1$s on %2$s' ),\n\t\t\t\tauthorDisplayName,\n\t\t\t\tformattedModifiedDate\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( {\n\tuserRevisions,\n\tselectedRevisionId,\n\tonChange,\n\tcanApplyRevision,\n\tonApplyRevision,\n} ) {\n\tconst { currentThemeName, currentUser } = useSelect( ( select ) => {\n\t\tconst { getCurrentTheme, getCurrentUser } = select( coreStore );\n\t\tconst currentTheme = getCurrentTheme();\n\t\treturn {\n\t\t\tcurrentThemeName:\n\t\t\t\tcurrentTheme?.name?.rendered || currentTheme?.stylesheet,\n\t\t\tcurrentUser: getCurrentUser(),\n\t\t};\n\t}, [] );\n\tconst dateNowInMs = getDate().getTime();\n\tconst { datetimeAbbreviated } = getSettings().formats;\n\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 list' ) }\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 isUnsaved = 'unsaved' === id;\n\t\t\t\t// Unsaved changes are created by the current user.\n\t\t\t\tconst revisionAuthor = isUnsaved ? currentUser : author;\n\t\t\t\tconst authorDisplayName = revisionAuthor?.name || __( 'User' );\n\t\t\t\tconst authorAvatar = revisionAuthor?.avatar_urls?.[ '48' ];\n\t\t\t\tconst isFirstItem = index === 0;\n\t\t\t\tconst isSelected = selectedRevisionId\n\t\t\t\t\t? selectedRevisionId === id\n\t\t\t\t\t: isFirstItem;\n\t\t\t\tconst areStylesEqual = ! canApplyRevision && isSelected;\n\t\t\t\tconst isReset = 'parent' === id;\n\t\t\t\tconst modifiedDate = getDate( modified );\n\t\t\t\tconst displayDate =\n\t\t\t\t\tmodified &&\n\t\t\t\t\tdateNowInMs - modifiedDate.getTime() > DAY_IN_MILLISECONDS\n\t\t\t\t\t\t? dateI18n( datetimeAbbreviated, modifiedDate )\n\t\t\t\t\t\t: humanTimeDiff( modified );\n\t\t\t\tconst revisionLabel = getRevisionLabel(\n\t\t\t\t\tid,\n\t\t\t\t\tauthorDisplayName,\n\t\t\t\t\tdateI18n( datetimeAbbreviated, modifiedDate ),\n\t\t\t\t\tareStylesEqual\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<li\n\t\t\t\t\t\tclassName={ clsx(\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\t'is-active': areStylesEqual,\n\t\t\t\t\t\t\t\t'is-reset': isReset,\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\taria-current={ isSelected }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__revision-button\"\n\t\t\t\t\t\t\taccessibleWhenDisabled\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\taria-label={ revisionLabel }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ isReset ? (\n\t\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\t{ __( 'Default styles' ) }\n\t\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\t{ currentThemeName }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) : (\n\t\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\t{ isUnsaved ? (\n\t\t\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__date\">\n\t\t\t\t\t\t\t\t\t\t\t{ __( '(Unsaved)' ) }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<time\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__date\"\n\t\t\t\t\t\t\t\t\t\t\tdateTime={ modified }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ displayDate }\n\t\t\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t\t) }\n\t\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\t<img\n\t\t\t\t\t\t\t\t\t\t\talt={ authorDisplayName }\n\t\t\t\t\t\t\t\t\t\t\tsrc={ authorAvatar }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{ authorDisplayName }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{ isSelected && (\n\t\t\t\t\t\t\t\t\t\t<ChangesSummary\n\t\t\t\t\t\t\t\t\t\t\trevision={ revision }\n\t\t\t\t\t\t\t\t\t\t\tpreviousRevision={\n\t\t\t\t\t\t\t\t\t\t\t\tindex < userRevisions.length\n\t\t\t\t\t\t\t\t\t\t\t\t\t? userRevisions[ index + 1 ]\n\t\t\t\t\t\t\t\t\t\t\t\t\t: {}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t{ isSelected &&\n\t\t\t\t\t\t\t( areStylesEqual ? (\n\t\t\t\t\t\t\t\t<p className=\"edit-site-global-styles-screen-revisions__applied-text\">\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'These styles are already applied to your site.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__apply-button\"\n\t\t\t\t\t\t\t\t\tonClick={ onApplyRevision }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ isReset\n\t\t\t\t\t\t\t\t\t\t? __( 'Reset to defaults' )\n\t\t\t\t\t\t\t\t\t\t: __( 'Apply' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t) ) }\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"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AAA8C,IAAAQ,WAAA,GAAAR,OAAA;AAlB9C;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;;AAGA,MAAMS,mBAAmB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE;AAC/C,MAAM;EAAEC;AAAuB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEnE,SAASC,cAAcA,CAAE;EAAEC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A,CAAC;AAEP;AAAC,IAAAyD,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcrD,gBAAgB","ignoreList":[]}
@@ -62,7 +62,6 @@ function ScreenRoot() {
62
62
  }), hasVariations && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalItemGroup, {
63
63
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationButton.NavigationButtonAsItem, {
64
64
  path: "/variations",
65
- "aria-label": (0, _i18n.__)('Browse styles'),
66
65
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
67
66
  justify: "space-between",
68
67
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
@@ -89,7 +88,6 @@ function ScreenRoot() {
89
88
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalItemGroup, {
90
89
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationButton.NavigationButtonAsItem, {
91
90
  path: "/blocks",
92
- "aria-label": (0, _i18n.__)('Blocks styles'),
93
91
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
94
92
  justify: "space-between",
95
93
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
@@ -111,7 +109,6 @@ function ScreenRoot() {
111
109
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalItemGroup, {
112
110
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationButton.NavigationButtonAsItem, {
113
111
  path: "/css",
114
- "aria-label": (0, _i18n.__)('Additional CSS'),
115
112
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
116
113
  justify: "space-between",
117
114
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_icons","_data","_coreData","_blockEditor","_iconWithCurrentColor","_navigationButton","_rootMenu","_interopRequireDefault","_previewStyles","_lockUnlock","_jsxRuntime","useGlobalStyle","unlock","blockEditorPrivateApis","ScreenRoot","customCSS","hasVariations","canEditCSS","useSelect","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","__experimentalGetCurrentThemeGlobalStylesVariations","coreStore","globalStylesId","globalStyles","undefined","length","_links","jsxs","Card","size","className","isRounded","children","jsx","CardBody","__experimentalVStack","spacing","CardMedia","default","__experimentalItemGroup","NavigationButtonAsItem","path","__","__experimentalHStack","justify","FlexItem","IconWithCurrentColor","icon","isRTL","chevronLeft","chevronRight","CardDivider","__experimentalSpacer","as","paddingTop","paddingX","marginBottom","Fragment","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"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 PreviewStyles from './preview-styles';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction ScreenRoot() {\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: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Card\n\t\t\tsize=\"small\"\n\t\t\tclassName=\"edit-site-global-styles-screen-root\"\n\t\t\tisRounded={ false }\n\t\t>\n\t\t\t<CardBody>\n\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t<Card className=\"edit-site-global-styles-screen-root__active-style-tile\">\n\t\t\t\t\t\t<CardMedia className=\"edit-site-global-styles-screen-root__active-style-tile-preview\">\n\t\t\t\t\t\t\t<PreviewStyles />\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"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAWA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,qBAAA,GAAAN,OAAA;AACA,IAAAO,iBAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,cAAA,GAAAD,sBAAA,CAAAT,OAAA;AACA,IAAAW,WAAA,GAAAX,OAAA;AAA2C,IAAAY,WAAA,GAAAZ,OAAA;AA3B3C;AACA;AACA;;AAkBA;AACA;AACA;;AAOA,MAAM;EAAEa;AAAe,CAAC,GAAG,IAAAC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CAAAyB,GAAA,EAAC9B,iBAAA,CAAAqC,sBAAsB;YACtBC,IAAI,EAAC,MAAM;YACX,cAAa,IAAAC,QAAE,EAAE,gBAAiB,CAAG;YAAAV,QAAA,eAErC,IAAAxB,WAAA,CAAAmB,IAAA,EAAChC,WAAA,CAAAgD,oBAAM;cAACC,OAAO,EAAC,eAAe;cAAAZ,QAAA,gBAC9B,IAAAxB,WAAA,CAAAyB,GAAA,EAACtC,WAAA,CAAAkD,QAAQ;gBAAAb,QAAA,EACN,IAAAU,QAAE,EAAE,gBAAiB;cAAC,CACf,CAAC,eACX,IAAAlC,WAAA,CAAAyB,GAAA,EAAC/B,qBAAA,CAAA4C,oBAAoB;gBACpBC,IAAI,EACH,IAAAC,WAAK,EAAC,CAAC,GAAGC,kBAAW,GAAGC;cACxB,CACD,CAAC;YAAA,CACK;UAAC,CACc;QAAC,CACf,CAAC;MAAA,CACH,CAAC;IAAA,CACV,CACF;EAAA,CACI,CAAC;AAET;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAArB,OAAA,GAEc1B,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_icons","_data","_coreData","_blockEditor","_iconWithCurrentColor","_navigationButton","_rootMenu","_interopRequireDefault","_previewStyles","_lockUnlock","_jsxRuntime","useGlobalStyle","unlock","blockEditorPrivateApis","ScreenRoot","customCSS","hasVariations","canEditCSS","useSelect","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","__experimentalGetCurrentThemeGlobalStylesVariations","coreStore","globalStylesId","globalStyles","undefined","length","_links","jsxs","Card","size","className","isRounded","children","jsx","CardBody","__experimentalVStack","spacing","CardMedia","default","__experimentalItemGroup","NavigationButtonAsItem","path","__experimentalHStack","justify","FlexItem","__","IconWithCurrentColor","icon","isRTL","chevronLeft","chevronRight","CardDivider","__experimentalSpacer","as","paddingTop","paddingX","marginBottom","Fragment","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"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 PreviewStyles from './preview-styles';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction ScreenRoot() {\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: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Card\n\t\t\tsize=\"small\"\n\t\t\tclassName=\"edit-site-global-styles-screen-root\"\n\t\t\tisRounded={ false }\n\t\t>\n\t\t\t<CardBody>\n\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t<Card className=\"edit-site-global-styles-screen-root__active-style-tile\">\n\t\t\t\t\t\t<CardMedia className=\"edit-site-global-styles-screen-root__active-style-tile-preview\">\n\t\t\t\t\t\t\t<PreviewStyles />\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 path=\"/variations\">\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 path=\"/blocks\">\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 path=\"/css\">\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\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AACtC,WAAA,CAAAwD,WAAW,IAAE,CAAC,eACf,IAAA3C,WAAA,CAAAmB,IAAA,EAAChC,WAAA,CAAAuC,QAAQ;QAAAF,QAAA,gBACR,IAAAxB,WAAA,CAAAyB,GAAA,EAACtC,WAAA,CAAAyD,oBAAM;UACNC,EAAE,EAAC,GAAG;UACNC,UAAU,EAAG,CAAG;UAChBC,QAAQ,EAAC,MAAM;UACfC,YAAY,EAAG,CAAG;UAAAxB,QAAA,EAEhB,IAAAa,QAAE,EACH,uEACD;QAAC,CACM,CAAC,eACT,IAAArC,WAAA,CAAAyB,GAAA,EAACtC,WAAA,CAAA4C,uBAAS;UAAAP,QAAA,eACT,IAAAxB,WAAA,CAAAyB,GAAA,EAAC9B,iBAAA,CAAAqC,sBAAsB;YAACC,IAAI,EAAC,MAAM;YAAAT,QAAA,eAClC,IAAAxB,WAAA,CAAAmB,IAAA,EAAChC,WAAA,CAAA+C,oBAAM;cAACC,OAAO,EAAC,eAAe;cAAAX,QAAA,gBAC9B,IAAAxB,WAAA,CAAAyB,GAAA,EAACtC,WAAA,CAAAiD,QAAQ;gBAAAZ,QAAA,EACN,IAAAa,QAAE,EAAE,gBAAiB;cAAC,CACf,CAAC,eACX,IAAArC,WAAA,CAAAyB,GAAA,EAAC/B,qBAAA,CAAA4C,oBAAoB;gBACpBC,IAAI,EACH,IAAAC,WAAK,EAAC,CAAC,GAAGC,kBAAW,GAAGC;cACxB,CACD,CAAC;YAAA,CACK;UAAC,CACc;QAAC,CACf,CAAC;MAAA,CACH,CAAC;IAAA,CACV,CACF;EAAA,CACI,CAAC;AAET;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAArB,OAAA,GAEc1B,UAAU","ignoreList":[]}
@@ -8,8 +8,11 @@ exports.default = void 0;
8
8
  var _components = require("@wordpress/components");
9
9
  var _i18n = require("@wordpress/i18n");
10
10
  var _blockEditor = require("@wordpress/block-editor");
11
+ var _data = require("@wordpress/data");
12
+ var _editor = require("@wordpress/editor");
11
13
  var _header = _interopRequireDefault(require("./header"));
12
14
  var _content = _interopRequireDefault(require("../sidebar-navigation-screen-global-styles/content"));
15
+ var _lockUnlock = require("../../lock-unlock");
13
16
  var _jsxRuntime = require("react/jsx-runtime");
14
17
  /**
15
18
  * WordPress dependencies
@@ -19,10 +22,18 @@ var _jsxRuntime = require("react/jsx-runtime");
19
22
  * Internal dependencies
20
23
  */
21
24
 
25
+ const {
26
+ useZoomOut
27
+ } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
22
28
  function ScreenStyleVariations() {
23
- // Move to zoom out mode when this component is mounted
24
- // and back to the previous mode when unmounted.
25
- (0, _blockEditor.useZoomOut)();
29
+ // Style Variations should only be previewed in with
30
+ // - a "zoomed out" editor
31
+ // - "Desktop" device preview
32
+ const {
33
+ setDeviceType
34
+ } = (0, _data.useDispatch)(_editor.store);
35
+ useZoomOut();
36
+ setDeviceType('desktop');
26
37
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
27
38
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_header.default, {
28
39
  title: (0, _i18n.__)('Browse styles'),
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_blockEditor","_header","_interopRequireDefault","_content","_jsxRuntime","ScreenStyleVariations","useZoomOut","jsxs","Fragment","children","jsx","default","title","__","description","Card","size","isBorderless","className","CardBody","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-style-variations.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Card, CardBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useZoomOut } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport SidebarNavigationScreenGlobalStylesContent from '../sidebar-navigation-screen-global-styles/content';\n\nfunction ScreenStyleVariations() {\n\t// Move to zoom out mode when this component is mounted\n\t// and back to the previous mode when unmounted.\n\tuseZoomOut();\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Browse styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a variation to change the look of the site.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<Card\n\t\t\t\tsize=\"small\"\n\t\t\t\tisBorderless\n\t\t\t\tclassName=\"edit-site-global-styles-screen-style-variations\"\n\t\t\t>\n\t\t\t\t<CardBody>\n\t\t\t\t\t<SidebarNavigationScreenGlobalStylesContent />\n\t\t\t\t</CardBody>\n\t\t\t</Card>\n\t\t</>\n\t);\n}\n\nexport default ScreenStyleVariations;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAA4G,IAAAM,WAAA,GAAAN,OAAA;AAX5G;AACA;AACA;;AAKA;AACA;AACA;;AAIA,SAASO,qBAAqBA,CAAA,EAAG;EAChC;EACA;EACA,IAAAC,uBAAU,EAAC,CAAC;EAEZ,oBACC,IAAAF,WAAA,CAAAG,IAAA,EAAAH,WAAA,CAAAI,QAAA;IAAAC,QAAA,gBACC,IAAAL,WAAA,CAAAM,GAAA,EAACT,OAAA,CAAAU,OAAY;MACZC,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAgB,CAAG;MAC/BC,WAAW,EAAG,IAAAD,QAAE,EACf,oDACD;IAAG,CACH,CAAC,eAEF,IAAAT,WAAA,CAAAM,GAAA,EAACb,WAAA,CAAAkB,IAAI;MACJC,IAAI,EAAC,OAAO;MACZC,YAAY;MACZC,SAAS,EAAC,iDAAiD;MAAAT,QAAA,eAE3D,IAAAL,WAAA,CAAAM,GAAA,EAACb,WAAA,CAAAsB,QAAQ;QAAAV,QAAA,eACR,IAAAL,WAAA,CAAAM,GAAA,EAACP,QAAA,CAAAQ,OAA0C,IAAE;MAAC,CACrC;IAAC,CACN,CAAC;EAAA,CACN,CAAC;AAEL;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAV,OAAA,GAEcN,qBAAqB","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_blockEditor","_data","_editor","_header","_interopRequireDefault","_content","_lockUnlock","_jsxRuntime","useZoomOut","unlock","blockEditorPrivateApis","ScreenStyleVariations","setDeviceType","useDispatch","editorStore","jsxs","Fragment","children","jsx","default","title","__","description","Card","size","isBorderless","className","CardBody","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-style-variations.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Card, CardBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport SidebarNavigationScreenGlobalStylesContent from '../sidebar-navigation-screen-global-styles/content';\nimport { unlock } from '../../lock-unlock';\n\nconst { useZoomOut } = unlock( blockEditorPrivateApis );\n\nfunction ScreenStyleVariations() {\n\t// Style Variations should only be previewed in with\n\t// - a \"zoomed out\" editor\n\t// - \"Desktop\" device preview\n\tconst { setDeviceType } = useDispatch( editorStore );\n\tuseZoomOut();\n\tsetDeviceType( 'desktop' );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Browse styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a variation to change the look of the site.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<Card\n\t\t\t\tsize=\"small\"\n\t\t\t\tisBorderless\n\t\t\t\tclassName=\"edit-site-global-styles-screen-style-variations\"\n\t\t\t>\n\t\t\t\t<CardBody>\n\t\t\t\t\t<SidebarNavigationScreenGlobalStylesContent />\n\t\t\t\t</CardBody>\n\t\t\t</Card>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C;AAEL;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAV,OAAA,GAEcR,qBAAqB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["CUSTOM_VALUE_SETTINGS","exports","px","max","step","vw","vh","em","rm","svw","lvw","dvw","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","getShadowParts","shadow","shadowValues","match","map","value","trim","shadowStringToObject","shadowValue","defaultShadow","x","y","blur","spread","color","inset","includes","lengthsRegex","matches","length","lengths","split","filter","insets","hasInset","colorString","replace","colorRegex","colorMatches","shadowObjectToString","shadowObj","shadowString"],"sources":["@wordpress/edit-site/src/components/global-styles/shadow-utils.js"],"sourcesContent":["export const CUSTOM_VALUE_SETTINGS = {\n\tpx: { max: 20, step: 1 },\n\t'%': { max: 100, step: 1 },\n\tvw: { max: 100, step: 1 },\n\tvh: { max: 100, step: 1 },\n\tem: { max: 10, step: 0.1 },\n\trm: { max: 10, step: 0.1 },\n\tsvw: { max: 100, step: 1 },\n\tlvw: { max: 100, step: 1 },\n\tdvw: { max: 100, step: 1 },\n\tsvh: { max: 100, step: 1 },\n\tlvh: { max: 100, step: 1 },\n\tdvh: { max: 100, step: 1 },\n\tvi: { max: 100, step: 1 },\n\tsvi: { max: 100, step: 1 },\n\tlvi: { max: 100, step: 1 },\n\tdvi: { max: 100, step: 1 },\n\tvb: { max: 100, step: 1 },\n\tsvb: { max: 100, step: 1 },\n\tlvb: { max: 100, step: 1 },\n\tdvb: { max: 100, step: 1 },\n\tvmin: { max: 100, step: 1 },\n\tsvmin: { max: 100, step: 1 },\n\tlvmin: { max: 100, step: 1 },\n\tdvmin: { max: 100, step: 1 },\n\tvmax: { max: 100, step: 1 },\n\tsvmax: { max: 100, step: 1 },\n\tlvmax: { max: 100, step: 1 },\n\tdvmax: { max: 100, step: 1 },\n};\n\nexport function getShadowParts( shadow ) {\n\tconst shadowValues = shadow.match( /(?:[^,(]|\\([^)]*\\))+/g ) || [];\n\treturn shadowValues.map( ( value ) => value.trim() );\n}\n\nexport function shadowStringToObject( shadowValue ) {\n\t/*\n\t * Shadow spec: https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow\n\t * Shadow string format: <offset-x> <offset-y> <blur-radius> <spread-radius> <color> [inset]\n\t *\n\t * A shadow to be valid it must satisfy the following.\n\t *\n\t * 1. Should not contain \"none\" keyword.\n\t * 2. Values x, y, blur, spread should be in the order. Color and inset can be anywhere in the string except in between x, y, blur, spread values.\n\t * 3. Should not contain more than one set of x, y, blur, spread values.\n\t * 4. Should contain at least x and y values. Others are optional.\n\t * 5. Should not contain more than one \"inset\" (case insensitive) keyword.\n\t * 6. Should not contain more than one color value.\n\t */\n\n\tconst defaultShadow = {\n\t\tx: '0',\n\t\ty: '0',\n\t\tblur: '0',\n\t\tspread: '0',\n\t\tcolor: '#000',\n\t\tinset: false,\n\t};\n\n\tif ( ! shadowValue ) {\n\t\treturn defaultShadow;\n\t}\n\n\t// Rule 1: Should not contain \"none\" keyword.\n\t// if the shadow has \"none\" keyword, it is not a valid shadow string\n\tif ( shadowValue.includes( 'none' ) ) {\n\t\treturn defaultShadow;\n\t}\n\n\t// Rule 2: Values x, y, blur, spread should be in the order.\n\t//\t\t Color and inset can be anywhere in the string except in between x, y, blur, spread values.\n\t// Extract length values (x, y, blur, spread) from shadow string\n\t// Regex match groups of 1 to 4 length values.\n\tconst lengthsRegex =\n\t\t/((?:^|\\s+)(-?\\d*\\.?\\d+(?:px|%|in|cm|mm|em|rem|ex|pt|pc|vh|vw|vmin|vmax|ch|lh)?)(?=\\s|$)(?![^(]*\\))){1,4}/g;\n\tconst matches = shadowValue.match( lengthsRegex ) || [];\n\n\t// Rule 3: Should not contain more than one set of x, y, blur, spread values.\n\t// if the string doesn't contain exactly 1 set of x, y, blur, spread values,\n\t// it is not a valid shadow string\n\tif ( matches.length !== 1 ) {\n\t\treturn defaultShadow;\n\t}\n\n\t// Extract length values (x, y, blur, spread) from shadow string\n\tconst lengths = matches[ 0 ]\n\t\t.split( ' ' )\n\t\t.map( ( value ) => value.trim() )\n\t\t.filter( ( value ) => value );\n\n\t// Rule 4: Should contain at least x and y values. Others are optional.\n\tif ( lengths.length < 2 ) {\n\t\treturn defaultShadow;\n\t}\n\n\t// Rule 5: Should not contain more than one \"inset\" (case insensitive) keyword.\n\t// check if the shadow string contains \"inset\" keyword\n\tconst insets = shadowValue.match( /inset/gi ) || [];\n\tif ( insets.length > 1 ) {\n\t\treturn defaultShadow;\n\t}\n\n\t// Strip lengths and inset from shadow string, leaving just color.\n\tconst hasInset = insets.length === 1;\n\tlet colorString = shadowValue.replace( lengthsRegex, '' ).trim();\n\tif ( hasInset ) {\n\t\tcolorString = colorString\n\t\t\t.replace( 'inset', '' )\n\t\t\t.replace( 'INSET', '' )\n\t\t\t.trim();\n\t}\n\n\t// Rule 6: Should not contain more than one color value.\n\t// validate color string with regular expression\n\t// check if color has matching hex, rgb or hsl values\n\tconst colorRegex =\n\t\t/^#([0-9a-f]{3}){1,2}$|^#([0-9a-f]{4}){1,2}$|^(?:rgb|hsl)a?\\(?[\\d*\\.?\\d+%?,?\\/?\\s]*\\)$/gi;\n\tlet colorMatches = ( colorString.match( colorRegex ) || [] )\n\t\t.map( ( value ) => value?.trim() )\n\t\t.filter( ( value ) => value );\n\n\t// If color string has more than one color values, it is not a valid\n\tif ( colorMatches.length > 1 ) {\n\t\treturn defaultShadow;\n\t} else if ( colorMatches.length === 0 ) {\n\t\t// check if color string has multiple named color values separated by space\n\t\tcolorMatches = colorString\n\t\t\t.trim()\n\t\t\t.split( ' ' )\n\t\t\t.filter( ( value ) => value );\n\t\t// If color string has more than one color values, it is not a valid\n\t\tif ( colorMatches.length > 1 ) {\n\t\t\treturn defaultShadow;\n\t\t}\n\t}\n\n\t// Return parsed shadow object.\n\tconst [ x, y, blur, spread ] = lengths;\n\treturn {\n\t\tx,\n\t\ty,\n\t\tblur: blur || defaultShadow.blur,\n\t\tspread: spread || defaultShadow.spread,\n\t\tinset: hasInset,\n\t\tcolor: colorString || defaultShadow.color,\n\t};\n}\n\nexport function shadowObjectToString( shadowObj ) {\n\tconst shadowString = `${ shadowObj.x || '0px' } ${ shadowObj.y || '0px' } ${\n\t\tshadowObj.blur || '0px'\n\t} ${ shadowObj.spread || '0px' }`;\n\n\treturn `${ shadowObj.inset ? 'inset' : '' } ${ shadowString } ${\n\t\tshadowObj.color || ''\n\t}`.trim();\n}\n"],"mappings":";;;;;;;;;AAAO,MAAMA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG;EACpCE,EAAE,EAAE;IAAEC,GAAG,EAAE,EAAE;IAAEC,IAAI,EAAE;EAAE,CAAC;EACxB,GAAG,EAAE;IAAED,GAAG,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAE,CAAC;EAC1BC,EAAE,EAAE;IAAEF,GAAG,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAE,CAAC;EACzBE,EAAE,EAAE;IAAEH,GAAG,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAE,CAAC;EACzBG,EAAE,EAAE;IAAEJ,GAAG,EAAE,EAAE;IAAEC,IAAI,EAAE;EAAI,CAAC;EAC1BI,EAAE,EAAE;IAAEL,GAAG,EAAE,EAAE;IAAEC,IAAI,EAAE;EAAI,CAAC;EAC1BK,GAAG,EAAE;IAAEN,GAAG,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAE,CAAC;EAC1BM,GAAG,EAAE;IAAEP,GAAG,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAE,CAAC;EAC1BO,GAAG,EAAE;IAAER,GAAG,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAE,CAAC;EAC1BQ,GAAG,EAAE;IAAET,GAAG,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAE,CAAC;EAC1BS,GAAG,EAAE;IAAEV,GAAG,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAE,CAAC;EAC1BU,GAAG,EAAE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;IACNV,CAAC;IACDC,CAAC;IACDC,IAAI,EAAEA,IAAI,IAAIH,aAAa,CAACG,IAAI;IAChCC,MAAM,EAAEA,MAAM,IAAIJ,aAAa,CAACI,MAAM;IACtCE,KAAK,EAAES,QAAQ;IACfV,KAAK,EAAEW,WAAW,IAAIhB,aAAa,CAACK;EACrC,CAAC;AACF;AAEO,SAASe,oBAAoBA,CAAEC,SAAS,EAAG;EACjD,MAAMC,YAAY,GAAI,GAAGD,SAAS,CAACpB,CAAC,IAAI,KAAO,IAAIoB,SAAS,CAACnB,CAAC,IAAI,KAAO,IACxEmB,SAAS,CAAClB,IAAI,IAAI,KAClB,IAAIkB,SAAS,CAACjB,MAAM,IAAI,KAAO,EAAC;EAEjC,OAAQ,GAAGiB,SAAS,CAACf,KAAK,GAAG,OAAO,GAAG,EAAI,IAAIgB,YAAc,IAC5DD,SAAS,CAAChB,KAAK,IAAI,EACnB,EAAC,CAACR,IAAI,CAAC,CAAC;AACV","ignoreList":[]}
1
+ {"version":3,"names":["CUSTOM_VALUE_SETTINGS","exports","px","max","step","vw","vh","em","rm","svw","lvw","dvw","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","getShadowParts","shadow","shadowValues","match","map","value","trim","shadowStringToObject","shadowValue","defaultShadow","x","y","blur","spread","color","inset","includes","lengthsRegex","matches","length","lengths","split","filter","insets","hasInset","colorString","replace","colorRegex","colorMatches","shadowObjectToString","shadowObj","shadowString"],"sources":["@wordpress/edit-site/src/components/global-styles/shadow-utils.js"],"sourcesContent":["export const CUSTOM_VALUE_SETTINGS = {\n\tpx: { max: 20, step: 1 },\n\t'%': { max: 100, step: 1 },\n\tvw: { max: 100, step: 1 },\n\tvh: { max: 100, step: 1 },\n\tem: { max: 10, step: 0.1 },\n\trm: { max: 10, step: 0.1 },\n\tsvw: { max: 100, step: 1 },\n\tlvw: { max: 100, step: 1 },\n\tdvw: { max: 100, step: 1 },\n\tsvh: { max: 100, step: 1 },\n\tlvh: { max: 100, step: 1 },\n\tdvh: { max: 100, step: 1 },\n\tvi: { max: 100, step: 1 },\n\tsvi: { max: 100, step: 1 },\n\tlvi: { max: 100, step: 1 },\n\tdvi: { max: 100, step: 1 },\n\tvb: { max: 100, step: 1 },\n\tsvb: { max: 100, step: 1 },\n\tlvb: { max: 100, step: 1 },\n\tdvb: { max: 100, step: 1 },\n\tvmin: { max: 100, step: 1 },\n\tsvmin: { max: 100, step: 1 },\n\tlvmin: { max: 100, step: 1 },\n\tdvmin: { max: 100, step: 1 },\n\tvmax: { max: 100, step: 1 },\n\tsvmax: { max: 100, step: 1 },\n\tlvmax: { max: 100, step: 1 },\n\tdvmax: { max: 100, step: 1 },\n};\n\nexport function getShadowParts( shadow ) {\n\tconst shadowValues = shadow.match( /(?:[^,(]|\\([^)]*\\))+/g ) || [];\n\treturn shadowValues.map( ( value ) => value.trim() );\n}\n\nexport function shadowStringToObject( shadowValue ) {\n\t/*\n\t * Shadow spec: https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow\n\t * Shadow string format: <offset-x> <offset-y> <blur-radius> <spread-radius> <color> [inset]\n\t *\n\t * A shadow to be valid it must satisfy the following.\n\t *\n\t * 1. Should not contain \"none\" keyword.\n\t * 2. Values x, y, blur, spread should be in the order. Color and inset can be anywhere in the string except in between x, y, blur, spread values.\n\t * 3. Should not contain more than one set of x, y, blur, spread values.\n\t * 4. Should contain at least x and y values. Others are optional.\n\t * 5. Should not contain more than one \"inset\" (case insensitive) keyword.\n\t * 6. Should not contain more than one color value.\n\t */\n\n\tconst defaultShadow = {\n\t\tx: '0',\n\t\ty: '0',\n\t\tblur: '0',\n\t\tspread: '0',\n\t\tcolor: '#000',\n\t\tinset: false,\n\t};\n\n\tif ( ! shadowValue ) {\n\t\treturn defaultShadow;\n\t}\n\n\t// Rule 1: Should not contain \"none\" keyword.\n\t// if the shadow has \"none\" keyword, it is not a valid shadow string\n\tif ( shadowValue.includes( 'none' ) ) {\n\t\treturn defaultShadow;\n\t}\n\n\t// Rule 2: Values x, y, blur, spread should be in the order.\n\t//\t\t Color and inset can be anywhere in the string except in between x, y, blur, spread values.\n\t// Extract length values (x, y, blur, spread) from shadow string\n\t// Regex match groups of 1 to 4 length values.\n\tconst lengthsRegex =\n\t\t/((?:^|\\s+)(-?\\d*\\.?\\d+(?:px|%|in|cm|mm|em|rem|ex|pt|pc|vh|vw|vmin|vmax|ch|lh)?)(?=\\s|$)(?![^(]*\\))){1,4}/g;\n\tconst matches = shadowValue.match( lengthsRegex ) || [];\n\n\t// Rule 3: Should not contain more than one set of x, y, blur, spread values.\n\t// if the string doesn't contain exactly 1 set of x, y, blur, spread values,\n\t// it is not a valid shadow string\n\tif ( matches.length !== 1 ) {\n\t\treturn defaultShadow;\n\t}\n\n\t// Extract length values (x, y, blur, spread) from shadow string\n\tconst lengths = matches[ 0 ]\n\t\t.split( ' ' )\n\t\t.map( ( value ) => value.trim() )\n\t\t.filter( ( value ) => value );\n\n\t// Rule 4: Should contain at least x and y values. Others are optional.\n\tif ( lengths.length < 2 ) {\n\t\treturn defaultShadow;\n\t}\n\n\t// Rule 5: Should not contain more than one \"inset\" (case insensitive) keyword.\n\t// check if the shadow string contains \"inset\" keyword\n\tconst insets = shadowValue.match( /inset/gi ) || [];\n\tif ( insets.length > 1 ) {\n\t\treturn defaultShadow;\n\t}\n\n\t// Strip lengths and inset from shadow string, leaving just color.\n\tconst hasInset = insets.length === 1;\n\tlet colorString = shadowValue.replace( lengthsRegex, '' ).trim();\n\tif ( hasInset ) {\n\t\tcolorString = colorString\n\t\t\t.replace( 'inset', '' )\n\t\t\t.replace( 'INSET', '' )\n\t\t\t.trim();\n\t}\n\n\t// Rule 6: Should not contain more than one color value.\n\t// validate color string with regular expression\n\t// check if color has matching hex, rgb or hsl values\n\tconst colorRegex =\n\t\t/^#([0-9a-f]{3}){1,2}$|^#([0-9a-f]{4}){1,2}$|^(?:rgb|hsl)a?\\(?[\\d*\\.?\\d+%?,?\\/?\\s]*\\)$/gi;\n\tlet colorMatches = ( colorString.match( colorRegex ) || [] )\n\t\t.map( ( value ) => value?.trim() )\n\t\t.filter( ( value ) => value );\n\n\t// If color string has more than one color values, it is not a valid\n\tif ( colorMatches.length > 1 ) {\n\t\treturn defaultShadow;\n\t} else if ( colorMatches.length === 0 ) {\n\t\t// check if color string has multiple named color values separated by space\n\t\tcolorMatches = colorString\n\t\t\t.trim()\n\t\t\t.split( ' ' )\n\t\t\t.filter( ( value ) => value );\n\t\t// If color string has more than one color values, it is not a valid\n\t\tif ( colorMatches.length > 1 ) {\n\t\t\treturn defaultShadow;\n\t\t}\n\t}\n\n\t// Return parsed shadow object.\n\tconst [ x, y, blur, spread ] = lengths;\n\treturn {\n\t\tx,\n\t\ty,\n\t\tblur: blur || defaultShadow.blur,\n\t\tspread: spread || defaultShadow.spread,\n\t\tinset: hasInset,\n\t\tcolor: colorString || defaultShadow.color,\n\t};\n}\n\nexport function shadowObjectToString( shadowObj ) {\n\tconst shadowString = `${ shadowObj.x || '0px' } ${ shadowObj.y || '0px' } ${\n\t\tshadowObj.blur || '0px'\n\t} ${ shadowObj.spread || '0px' }`;\n\n\treturn `${ shadowObj.inset ? 'inset' : '' } ${ shadowString } ${\n\t\tshadowObj.color || ''\n\t}`.trim();\n}\n"],"mappings":";;;;;;;;;AAAO,MAAMA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG;EACpCE,EAAE,EAAE;IAAEC,GAAG,EAAE,EAAE;IAAEC,IAAI,EAAE;EAAE,CAAC;EACxB,GAAG,EAAE;IAAED,GAAG,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAE,CAAC;EAC1BC,EAAE,EAAE;IAAEF,GAAG,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAE,CAAC;EACzBE,EAAE,EAAE;IAAEH,GAAG,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAE,CAAC;EACzBG,EAAE,EAAE;IAAEJ,GAAG,EAAE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