@wordpress/edit-site 6.11.0 → 6.12.1-next.082ed6819.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 (346) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-template/utils.js +1 -2
  3. package/build/components/add-new-template/utils.js.map +1 -1
  4. package/build/components/app/index.js +0 -5
  5. package/build/components/app/index.js.map +1 -1
  6. package/build/components/block-editor/use-editor-iframe-props.js +6 -8
  7. package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
  8. package/build/components/block-editor/use-site-editor-settings.js +4 -12
  9. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  10. package/build/components/editor/index.js +23 -27
  11. package/build/components/editor/index.js.map +1 -1
  12. package/build/components/editor/use-editor-title.js +37 -12
  13. package/build/components/editor/use-editor-title.js.map +1 -1
  14. package/build/components/editor/use-resolve-edited-entity.js +133 -0
  15. package/build/components/editor/use-resolve-edited-entity.js.map +1 -0
  16. package/build/components/editor-canvas-container/index.js +1 -1
  17. package/build/components/editor-canvas-container/index.js.map +1 -1
  18. package/build/components/global-styles/block-preview-panel.js +8 -10
  19. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  20. package/build/components/global-styles/screen-block.js +18 -5
  21. package/build/components/global-styles/screen-block.js.map +1 -1
  22. package/build/components/global-styles/screen-revisions/revisions-buttons.js +24 -22
  23. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  24. package/build/components/global-styles/screen-style-variations.js +11 -5
  25. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  26. package/build/components/global-styles/shadows-edit-panel.js +2 -3
  27. package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
  28. package/build/components/global-styles/ui.js +42 -2
  29. package/build/components/global-styles/ui.js.map +1 -1
  30. package/build/components/global-styles-renderer/index.js +6 -8
  31. package/build/components/global-styles-renderer/index.js.map +1 -1
  32. package/build/components/global-styles-sidebar/index.js +17 -1
  33. package/build/components/global-styles-sidebar/index.js.map +1 -1
  34. package/build/components/layout/hooks.js +1 -10
  35. package/build/components/layout/hooks.js.map +1 -1
  36. package/build/components/layout/index.js +1 -0
  37. package/build/components/layout/index.js.map +1 -1
  38. package/build/components/page-patterns/fields.js +3 -7
  39. package/build/components/page-patterns/fields.js.map +1 -1
  40. package/build/components/page-patterns/header.js +2 -2
  41. package/build/components/page-patterns/header.js.map +1 -1
  42. package/build/components/page-patterns/use-patterns.js +4 -8
  43. package/build/components/page-patterns/use-patterns.js.map +1 -1
  44. package/build/components/page-templates/fields.js +1 -2
  45. package/build/components/page-templates/fields.js.map +1 -1
  46. package/build/components/post-edit/index.js +15 -11
  47. package/build/components/post-edit/index.js.map +1 -1
  48. package/build/components/post-list/index.js +13 -3
  49. package/build/components/post-list/index.js.map +1 -1
  50. package/build/components/posts-app/index.js +3 -4
  51. package/build/components/posts-app/index.js.map +1 -1
  52. package/build/components/posts-app-routes/home.js +48 -0
  53. package/build/components/posts-app-routes/home.js.map +1 -0
  54. package/build/components/posts-app-routes/index.js +37 -0
  55. package/build/components/posts-app-routes/index.js.map +1 -0
  56. package/build/components/posts-app-routes/posts-edit.js +44 -0
  57. package/build/components/posts-app-routes/posts-edit.js.map +1 -0
  58. package/build/components/posts-app-routes/posts-list-view-quick-edit.js +63 -0
  59. package/build/components/posts-app-routes/posts-list-view-quick-edit.js.map +1 -0
  60. package/build/components/posts-app-routes/posts-list-view.js +48 -0
  61. package/build/components/posts-app-routes/posts-list-view.js.map +1 -0
  62. package/build/components/posts-app-routes/posts-view-quick-edit.js +60 -0
  63. package/build/components/posts-app-routes/posts-view-quick-edit.js.map +1 -0
  64. package/build/components/posts-app-routes/posts-view.js +41 -0
  65. package/build/components/posts-app-routes/posts-view.js.map +1 -0
  66. package/build/components/sidebar/index.js +11 -3
  67. package/build/components/sidebar/index.js.map +1 -1
  68. package/build/components/sidebar-global-styles-wrapper/index.js +129 -0
  69. package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -0
  70. package/build/components/sidebar-navigation-screen-details-footer/index.js +17 -23
  71. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  72. package/build/components/sidebar-navigation-screen-global-styles/index.js +18 -90
  73. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  74. package/build/components/sidebar-navigation-screen-main/index.js +43 -42
  75. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  76. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
  77. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  78. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +2 -3
  79. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  80. package/build/components/site-editor-routes/index.js +1 -2
  81. package/build/components/site-editor-routes/index.js.map +1 -1
  82. package/build/components/site-editor-routes/styles-view.js +8 -2
  83. package/build/components/site-editor-routes/styles-view.js.map +1 -1
  84. package/build/components/site-hub/index.js +19 -6
  85. package/build/components/site-hub/index.js.map +1 -1
  86. package/build/components/style-book/constants.js +10 -3
  87. package/build/components/style-book/constants.js.map +1 -1
  88. package/build/components/style-book/examples.js +94 -2
  89. package/build/components/style-book/examples.js.map +1 -1
  90. package/build/components/style-book/index.js +70 -11
  91. package/build/components/style-book/index.js.map +1 -1
  92. package/build/components/welcome-guide/index.js +4 -2
  93. package/build/components/welcome-guide/index.js.map +1 -1
  94. package/build/components/welcome-guide/page.js +1 -9
  95. package/build/components/welcome-guide/page.js.map +1 -1
  96. package/build/components/welcome-guide/template.js +1 -12
  97. package/build/components/welcome-guide/template.js.map +1 -1
  98. package/build/hooks/commands/use-common-commands.js +15 -15
  99. package/build/hooks/commands/use-common-commands.js.map +1 -1
  100. package/build/index.js +1 -9
  101. package/build/index.js.map +1 -1
  102. package/build/posts.js +1 -0
  103. package/build/posts.js.map +1 -1
  104. package/build/store/actions.js +13 -0
  105. package/build/store/actions.js.map +1 -1
  106. package/build/store/selectors.js +21 -1
  107. package/build/store/selectors.js.map +1 -1
  108. package/build-module/components/add-new-template/utils.js +1 -2
  109. package/build-module/components/add-new-template/utils.js.map +1 -1
  110. package/build-module/components/app/index.js +0 -5
  111. package/build-module/components/app/index.js.map +1 -1
  112. package/build-module/components/block-editor/use-editor-iframe-props.js +6 -8
  113. package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
  114. package/build-module/components/block-editor/use-site-editor-settings.js +4 -12
  115. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  116. package/build-module/components/editor/index.js +23 -27
  117. package/build-module/components/editor/index.js.map +1 -1
  118. package/build-module/components/editor/use-editor-title.js +37 -12
  119. package/build-module/components/editor/use-editor-title.js.map +1 -1
  120. package/build-module/components/editor/use-resolve-edited-entity.js +125 -0
  121. package/build-module/components/editor/use-resolve-edited-entity.js.map +1 -0
  122. package/build-module/components/editor-canvas-container/index.js +1 -1
  123. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  124. package/build-module/components/global-styles/block-preview-panel.js +8 -10
  125. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  126. package/build-module/components/global-styles/screen-block.js +18 -5
  127. package/build-module/components/global-styles/screen-block.js.map +1 -1
  128. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +25 -23
  129. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  130. package/build-module/components/global-styles/screen-style-variations.js +11 -5
  131. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  132. package/build-module/components/global-styles/shadows-edit-panel.js +2 -3
  133. package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
  134. package/build-module/components/global-styles/ui.js +42 -2
  135. package/build-module/components/global-styles/ui.js.map +1 -1
  136. package/build-module/components/global-styles-renderer/index.js +6 -8
  137. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  138. package/build-module/components/global-styles-sidebar/index.js +18 -2
  139. package/build-module/components/global-styles-sidebar/index.js.map +1 -1
  140. package/build-module/components/layout/hooks.js +1 -9
  141. package/build-module/components/layout/hooks.js.map +1 -1
  142. package/build-module/components/layout/index.js +1 -0
  143. package/build-module/components/layout/index.js.map +1 -1
  144. package/build-module/components/page-patterns/fields.js +4 -8
  145. package/build-module/components/page-patterns/fields.js.map +1 -1
  146. package/build-module/components/page-patterns/header.js +2 -2
  147. package/build-module/components/page-patterns/header.js.map +1 -1
  148. package/build-module/components/page-patterns/use-patterns.js +4 -8
  149. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  150. package/build-module/components/page-templates/fields.js +1 -2
  151. package/build-module/components/page-templates/fields.js.map +1 -1
  152. package/build-module/components/post-edit/index.js +14 -10
  153. package/build-module/components/post-edit/index.js.map +1 -1
  154. package/build-module/components/post-list/index.js +13 -3
  155. package/build-module/components/post-list/index.js.map +1 -1
  156. package/build-module/components/posts-app/index.js +3 -4
  157. package/build-module/components/posts-app/index.js.map +1 -1
  158. package/build-module/components/posts-app-routes/home.js +40 -0
  159. package/build-module/components/posts-app-routes/home.js.map +1 -0
  160. package/build-module/components/posts-app-routes/index.js +30 -0
  161. package/build-module/components/posts-app-routes/index.js.map +1 -0
  162. package/build-module/components/posts-app-routes/posts-edit.js +36 -0
  163. package/build-module/components/posts-app-routes/posts-edit.js.map +1 -0
  164. package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js +55 -0
  165. package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js.map +1 -0
  166. package/build-module/components/posts-app-routes/posts-list-view.js +40 -0
  167. package/build-module/components/posts-app-routes/posts-list-view.js.map +1 -0
  168. package/build-module/components/posts-app-routes/posts-view-quick-edit.js +52 -0
  169. package/build-module/components/posts-app-routes/posts-view-quick-edit.js.map +1 -0
  170. package/build-module/components/posts-app-routes/posts-view.js +33 -0
  171. package/build-module/components/posts-app-routes/posts-view.js.map +1 -0
  172. package/build-module/components/sidebar/index.js +11 -3
  173. package/build-module/components/sidebar/index.js.map +1 -1
  174. package/build-module/components/sidebar-global-styles-wrapper/index.js +121 -0
  175. package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -0
  176. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +20 -26
  177. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  178. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +19 -91
  179. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  180. package/build-module/components/sidebar-navigation-screen-main/index.js +43 -43
  181. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  182. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
  183. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  184. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +3 -4
  185. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  186. package/build-module/components/site-editor-routes/index.js +1 -2
  187. package/build-module/components/site-editor-routes/index.js.map +1 -1
  188. package/build-module/components/site-editor-routes/styles-view.js +8 -2
  189. package/build-module/components/site-editor-routes/styles-view.js.map +1 -1
  190. package/build-module/components/site-hub/index.js +19 -6
  191. package/build-module/components/site-hub/index.js.map +1 -1
  192. package/build-module/components/style-book/constants.js +10 -3
  193. package/build-module/components/style-book/constants.js.map +1 -1
  194. package/build-module/components/style-book/examples.js +94 -2
  195. package/build-module/components/style-book/examples.js.map +1 -1
  196. package/build-module/components/style-book/index.js +71 -12
  197. package/build-module/components/style-book/index.js.map +1 -1
  198. package/build-module/components/welcome-guide/index.js +4 -2
  199. package/build-module/components/welcome-guide/index.js.map +1 -1
  200. package/build-module/components/welcome-guide/page.js +1 -9
  201. package/build-module/components/welcome-guide/page.js.map +1 -1
  202. package/build-module/components/welcome-guide/template.js +1 -11
  203. package/build-module/components/welcome-guide/template.js.map +1 -1
  204. package/build-module/hooks/commands/use-common-commands.js +15 -15
  205. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  206. package/build-module/index.js +2 -10
  207. package/build-module/index.js.map +1 -1
  208. package/build-module/posts.js +1 -0
  209. package/build-module/posts.js.map +1 -1
  210. package/build-module/store/actions.js +13 -0
  211. package/build-module/store/actions.js.map +1 -1
  212. package/build-module/store/selectors.js +21 -1
  213. package/build-module/store/selectors.js.map +1 -1
  214. package/build-style/posts-rtl.css +106 -16
  215. package/build-style/posts.css +106 -16
  216. package/build-style/style-rtl.css +176 -78
  217. package/build-style/style.css +176 -78
  218. package/package.json +39 -40
  219. package/src/components/add-new-template/utils.js +2 -2
  220. package/src/components/app/index.js +0 -5
  221. package/src/components/block-editor/use-editor-iframe-props.js +2 -3
  222. package/src/components/block-editor/use-site-editor-settings.js +7 -21
  223. package/src/components/editor/index.js +31 -30
  224. package/src/components/editor/use-editor-title.js +50 -13
  225. package/src/components/editor/use-resolve-edited-entity.js +132 -0
  226. package/src/components/editor-canvas-container/index.js +1 -1
  227. package/src/components/editor-canvas-container/style.scss +0 -1
  228. package/src/components/global-styles/block-preview-panel.js +10 -10
  229. package/src/components/global-styles/screen-block.js +26 -8
  230. package/src/components/global-styles/screen-revisions/revisions-buttons.js +28 -31
  231. package/src/components/global-styles/screen-revisions/style.scss +11 -17
  232. package/src/components/global-styles/screen-style-variations.js +14 -5
  233. package/src/components/global-styles/shadows-edit-panel.js +4 -2
  234. package/src/components/global-styles/ui.js +41 -1
  235. package/src/components/global-styles-renderer/index.js +4 -10
  236. package/src/components/global-styles-sidebar/index.js +16 -2
  237. package/src/components/layout/hooks.js +1 -7
  238. package/src/components/layout/index.js +6 -1
  239. package/src/components/page-patterns/fields.js +6 -12
  240. package/src/components/page-patterns/header.js +3 -2
  241. package/src/components/page-patterns/style.scss +0 -5
  242. package/src/components/page-patterns/use-patterns.js +9 -7
  243. package/src/components/page-templates/fields.js +2 -3
  244. package/src/components/page-templates/style.scss +1 -0
  245. package/src/components/post-edit/index.js +37 -32
  246. package/src/components/post-edit/style.scss +7 -0
  247. package/src/components/post-list/index.js +10 -5
  248. package/src/components/post-list/style.scss +29 -3
  249. package/src/components/posts-app/index.js +3 -4
  250. package/src/components/posts-app-routes/home.js +36 -0
  251. package/src/components/posts-app-routes/index.js +36 -0
  252. package/src/components/posts-app-routes/posts-edit.js +31 -0
  253. package/src/components/posts-app-routes/posts-list-view-quick-edit.js +52 -0
  254. package/src/components/posts-app-routes/posts-list-view.js +40 -0
  255. package/src/components/posts-app-routes/posts-view-quick-edit.js +49 -0
  256. package/src/components/posts-app-routes/posts-view.js +35 -0
  257. package/src/components/sidebar/index.js +23 -7
  258. package/src/components/sidebar-global-styles-wrapper/index.js +150 -0
  259. package/src/components/sidebar-global-styles-wrapper/style.scss +35 -0
  260. package/src/components/sidebar-navigation-item/style.scss +2 -2
  261. package/src/components/sidebar-navigation-screen/style.scss +7 -2
  262. package/src/components/sidebar-navigation-screen-details-footer/index.js +27 -38
  263. package/src/components/sidebar-navigation-screen-details-footer/style.scss +0 -4
  264. package/src/components/sidebar-navigation-screen-global-styles/index.js +19 -103
  265. package/src/components/sidebar-navigation-screen-main/index.js +46 -45
  266. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +8 -0
  267. package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
  268. package/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +4 -4
  269. package/src/components/site-editor-routes/README.md +2 -2
  270. package/src/components/site-editor-routes/index.js +0 -2
  271. package/src/components/site-editor-routes/styles-view.js +11 -1
  272. package/src/components/site-hub/index.js +33 -16
  273. package/src/components/site-hub/style.scss +1 -1
  274. package/src/components/site-icon/style.scss +16 -0
  275. package/src/components/style-book/constants.ts +11 -3
  276. package/src/components/style-book/examples.tsx +128 -2
  277. package/src/components/style-book/index.js +86 -8
  278. package/src/components/welcome-guide/index.js +3 -3
  279. package/src/components/welcome-guide/page.js +1 -7
  280. package/src/components/welcome-guide/template.js +1 -8
  281. package/src/hooks/commands/use-common-commands.js +253 -246
  282. package/src/index.js +2 -13
  283. package/src/posts.js +1 -0
  284. package/src/store/actions.js +15 -0
  285. package/src/store/selectors.js +24 -1
  286. package/src/style.scss +2 -5
  287. package/build/components/async/index.js +0 -51
  288. package/build/components/async/index.js.map +0 -1
  289. package/build/components/post-fields/index.js +0 -290
  290. package/build/components/post-fields/index.js.map +0 -1
  291. package/build/components/posts-app/router.js +0 -85
  292. package/build/components/posts-app/router.js.map +0 -1
  293. package/build/components/sidebar-navigation-screen-details-panel/index.js +0 -54
  294. package/build/components/sidebar-navigation-screen-details-panel/index.js.map +0 -1
  295. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +0 -21
  296. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +0 -1
  297. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +0 -33
  298. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +0 -1
  299. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +0 -21
  300. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +0 -1
  301. package/build/components/site-editor-routes/styles-edit.js +0 -28
  302. package/build/components/site-editor-routes/styles-edit.js.map +0 -1
  303. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -219
  304. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +0 -1
  305. package/build/components/use-edited-entity-record/index.js +0 -60
  306. package/build/components/use-edited-entity-record/index.js.map +0 -1
  307. package/build/hooks/commands/use-edit-mode-commands.js +0 -179
  308. package/build/hooks/commands/use-edit-mode-commands.js.map +0 -1
  309. package/build-module/components/async/index.js +0 -44
  310. package/build-module/components/async/index.js.map +0 -1
  311. package/build-module/components/post-fields/index.js +0 -283
  312. package/build-module/components/post-fields/index.js.map +0 -1
  313. package/build-module/components/posts-app/router.js +0 -77
  314. package/build-module/components/posts-app/router.js.map +0 -1
  315. package/build-module/components/sidebar-navigation-screen-details-panel/index.js +0 -29
  316. package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +0 -1
  317. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +0 -14
  318. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +0 -1
  319. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +0 -25
  320. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +0 -1
  321. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +0 -14
  322. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +0 -1
  323. package/build-module/components/site-editor-routes/styles-edit.js +0 -20
  324. package/build-module/components/site-editor-routes/styles-edit.js.map +0 -1
  325. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -212
  326. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +0 -1
  327. package/build-module/components/use-edited-entity-record/index.js +0 -53
  328. package/build-module/components/use-edited-entity-record/index.js.map +0 -1
  329. package/build-module/hooks/commands/use-edit-mode-commands.js +0 -171
  330. package/build-module/hooks/commands/use-edit-mode-commands.js.map +0 -1
  331. package/src/components/async/index.js +0 -43
  332. package/src/components/post-fields/index.js +0 -361
  333. package/src/components/post-fields/style.scss +0 -3
  334. package/src/components/posts-app/router.js +0 -69
  335. package/src/components/sidebar-navigation-screen-details-panel/index.js +0 -40
  336. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +0 -14
  337. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +0 -31
  338. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +0 -14
  339. package/src/components/sidebar-navigation-screen-details-panel/style.scss +0 -26
  340. package/src/components/site-editor-routes/styles-edit.js +0 -17
  341. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -267
  342. package/src/components/use-edited-entity-record/index.js +0 -58
  343. package/src/hooks/commands/use-edit-mode-commands.js +0 -168
  344. package/src/store/test/actions.js +0 -83
  345. package/src/store/test/reducer.js +0 -69
  346. package/src/store/test/selectors.js +0 -41
@@ -1 +1 @@
1
- {"version":3,"names":["getBlockType","privateApis","blockEditorPrivateApis","useMemo","useSelect","store","coreStore","PanelBody","__experimentalVStack","VStack","__experimentalHasSplitBorders","hasSplitBorders","__","sprintf","ScreenHeader","BlockPreviewPanel","unlock","Subtitle","useBlockVariations","VariationsPanel","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","BACKGROUND_BLOCK_DEFAULT_VALUES","backgroundSize","backgroundPosition","applyFallbackStyle","border","hasColorOrWidth","color","width","style","undefined","applyAllFallbackStyles","top","right","bottom","left","useHasDimensionsPanel","useHasTypographyPanel","useHasBorderPanel","useGlobalSetting","useSettingsForBlockElement","useHasColorPanel","useHasFiltersPanel","useHasImageSettingsPanel","useGlobalStyle","useHasBackgroundPanel","BackgroundPanel","StylesBackgroundPanel","BorderPanel","StylesBorderPanel","ColorPanel","StylesColorPanel","TypographyPanel","StylesTypographyPanel","DimensionsPanel","StylesDimensionsPanel","FiltersPanel","StylesFiltersPanel","ImageSettingsPanel","AdvancedPanel","StylesAdvancedPanel","ScreenBlock","name","variation","prefixParts","concat","prefix","join","shouldDecodeEncode","inheritedStyle","setStyle","userSettings","rawSettings","setSettings","settings","blockType","spacing","blockGap","supports","__experimentalSkipSerialization","some","spacingType","dimensions","aspectRatio","blockVariations","hasBackgroundPanel","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasFiltersPanel","hasImageSettingsPanel","hasVariationsPanel","length","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","_links","currentBlockStyle","find","s","inheritedStyleWithLayout","layout","styleWithLayout","onChangeDimensions","newStyle","updatedStyle","onChangeLightbox","newSetting","lightbox","onChangeBorders","radius","newBorder","updatedBorder","children","title","label","className","inheritedValue","value","onChange","defaultValues","includeLayoutControls","initialOpen"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-block.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tPanelBody,\n\t__experimentalVStack as VStack,\n\t__experimentalHasSplitBorders as hasSplitBorders,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport BlockPreviewPanel from './block-preview-panel';\nimport { unlock } from '../../lock-unlock';\nimport Subtitle from './subtitle';\nimport {\n\tuseBlockVariations,\n\tVariationsPanel,\n} from './variations/variations-panel';\n\n// Initial control values.\nconst BACKGROUND_BLOCK_DEFAULT_VALUES = {\n\tbackgroundSize: 'cover',\n\tbackgroundPosition: '50% 50%', // used only when backgroundSize is 'contain'.\n};\n\nfunction applyFallbackStyle( border ) {\n\tif ( ! border ) {\n\t\treturn border;\n\t}\n\n\tconst hasColorOrWidth = border.color || border.width;\n\n\tif ( ! border.style && hasColorOrWidth ) {\n\t\treturn { ...border, style: 'solid' };\n\t}\n\n\tif ( border.style && ! hasColorOrWidth ) {\n\t\treturn undefined;\n\t}\n\n\treturn border;\n}\n\nfunction applyAllFallbackStyles( border ) {\n\tif ( ! border ) {\n\t\treturn border;\n\t}\n\n\tif ( hasSplitBorders( border ) ) {\n\t\treturn {\n\t\t\ttop: applyFallbackStyle( border.top ),\n\t\t\tright: applyFallbackStyle( border.right ),\n\t\t\tbottom: applyFallbackStyle( border.bottom ),\n\t\t\tleft: applyFallbackStyle( border.left ),\n\t\t};\n\t}\n\n\treturn applyFallbackStyle( border );\n}\n\nconst {\n\tuseHasDimensionsPanel,\n\tuseHasTypographyPanel,\n\tuseHasBorderPanel,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tuseHasColorPanel,\n\tuseHasFiltersPanel,\n\tuseHasImageSettingsPanel,\n\tuseGlobalStyle,\n\tuseHasBackgroundPanel,\n\tBackgroundPanel: StylesBackgroundPanel,\n\tBorderPanel: StylesBorderPanel,\n\tColorPanel: StylesColorPanel,\n\tTypographyPanel: StylesTypographyPanel,\n\tDimensionsPanel: StylesDimensionsPanel,\n\tFiltersPanel: StylesFiltersPanel,\n\tImageSettingsPanel,\n\tAdvancedPanel: StylesAdvancedPanel,\n} = unlock( blockEditorPrivateApis );\n\nfunction ScreenBlock( { name, variation } ) {\n\tlet prefixParts = [];\n\tif ( variation ) {\n\t\tprefixParts = [ 'variations', variation ].concat( prefixParts );\n\t}\n\tconst prefix = prefixParts.join( '.' );\n\n\tconst [ style ] = useGlobalStyle( prefix, name, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle( prefix, name, 'all', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ userSettings ] = useGlobalSetting( '', name, 'user' );\n\tconst [ rawSettings, setSettings ] = useGlobalSetting( '', name );\n\tconst settings = useSettingsForBlockElement( rawSettings, name );\n\tconst blockType = getBlockType( name );\n\n\t// Only allow `blockGap` support if serialization has not been skipped, to be sure global spacing can be applied.\n\tif (\n\t\tsettings?.spacing?.blockGap &&\n\t\tblockType?.supports?.spacing?.blockGap &&\n\t\t( blockType?.supports?.spacing?.__experimentalSkipSerialization ===\n\t\t\ttrue ||\n\t\t\tblockType?.supports?.spacing?.__experimentalSkipSerialization?.some?.(\n\t\t\t\t( spacingType ) => spacingType === 'blockGap'\n\t\t\t) )\n\t) {\n\t\tsettings.spacing.blockGap = false;\n\t}\n\n\t// Only allow `aspectRatio` support if the block is not the grouping block.\n\t// The grouping block allows the user to use Group, Row and Stack variations,\n\t// and it is highly likely that the user will not want to set an aspect ratio\n\t// for all three at once. Until there is the ability to set a different aspect\n\t// ratio for each variation, we disable the aspect ratio controls for the\n\t// grouping block in global styles.\n\tif ( settings?.dimensions?.aspectRatio && name === 'core/group' ) {\n\t\tsettings.dimensions.aspectRatio = false;\n\t}\n\n\tconst blockVariations = useBlockVariations( name );\n\tconst hasBackgroundPanel = useHasBackgroundPanel( settings );\n\tconst hasTypographyPanel = useHasTypographyPanel( settings );\n\tconst hasColorPanel = useHasColorPanel( settings );\n\tconst hasBorderPanel = useHasBorderPanel( settings );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\tconst hasFiltersPanel = useHasFiltersPanel( settings );\n\tconst hasImageSettingsPanel = useHasImageSettingsPanel(\n\t\tname,\n\t\tuserSettings,\n\t\tsettings\n\t);\n\tconst hasVariationsPanel = !! blockVariations?.length && ! variation;\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\tconst currentBlockStyle = variation\n\t\t? blockVariations.find( ( s ) => s.name === variation )\n\t\t: null;\n\n\t// These intermediary objects are needed because the \"layout\" property is stored\n\t// in settings rather than styles.\n\tconst inheritedStyleWithLayout = useMemo( () => {\n\t\treturn {\n\t\t\t...inheritedStyle,\n\t\t\tlayout: settings.layout,\n\t\t};\n\t}, [ inheritedStyle, settings.layout ] );\n\tconst styleWithLayout = useMemo( () => {\n\t\treturn {\n\t\t\t...style,\n\t\t\tlayout: userSettings.layout,\n\t\t};\n\t}, [ style, userSettings.layout ] );\n\tconst onChangeDimensions = ( newStyle ) => {\n\t\tconst updatedStyle = { ...newStyle };\n\t\tdelete updatedStyle.layout;\n\t\tsetStyle( updatedStyle );\n\n\t\tif ( newStyle.layout !== userSettings.layout ) {\n\t\t\tsetSettings( {\n\t\t\t\t...userSettings,\n\t\t\t\tlayout: newStyle.layout,\n\t\t\t} );\n\t\t}\n\t};\n\tconst onChangeLightbox = ( newSetting ) => {\n\t\t// If the newSetting is undefined, this means that the user has deselected\n\t\t// (reset) the lightbox setting.\n\t\tif ( newSetting === undefined ) {\n\t\t\tsetSettings( {\n\t\t\t\t...rawSettings,\n\t\t\t\tlightbox: undefined,\n\t\t\t} );\n\n\t\t\t// Otherwise, we simply set the lightbox setting to the new value but\n\t\t\t// taking care of not overriding the other lightbox settings.\n\t\t} else {\n\t\t\tsetSettings( {\n\t\t\t\t...rawSettings,\n\t\t\t\tlightbox: {\n\t\t\t\t\t...rawSettings.lightbox,\n\t\t\t\t\t...newSetting,\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\t};\n\tconst onChangeBorders = ( newStyle ) => {\n\t\tif ( ! newStyle?.border ) {\n\t\t\tsetStyle( newStyle );\n\t\t\treturn;\n\t\t}\n\n\t\t// As Global Styles can't conditionally generate styles based on if\n\t\t// other style properties have been set, we need to force split\n\t\t// border definitions for user set global border styles. Border\n\t\t// radius is derived from the same property i.e. `border.radius` if\n\t\t// it is a string that is used. The longhand border radii styles are\n\t\t// only generated if that property is an object.\n\t\t//\n\t\t// For borders (color, style, and width) those are all properties on\n\t\t// the `border` style property. This means if the theme.json defined\n\t\t// split borders and the user condenses them into a flat border or\n\t\t// vice-versa we'd get both sets of styles which would conflict.\n\t\tconst { radius, ...newBorder } = newStyle.border;\n\t\tconst border = applyAllFallbackStyles( newBorder );\n\t\tconst updatedBorder = ! hasSplitBorders( border )\n\t\t\t? {\n\t\t\t\t\ttop: border,\n\t\t\t\t\tright: border,\n\t\t\t\t\tbottom: border,\n\t\t\t\t\tleft: border,\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tcolor: null,\n\t\t\t\t\tstyle: null,\n\t\t\t\t\twidth: null,\n\t\t\t\t\t...border,\n\t\t\t };\n\n\t\tsetStyle( { ...newStyle, border: { ...updatedBorder, radius } } );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ variation ? currentBlockStyle?.label : blockType.title }\n\t\t\t/>\n\t\t\t<BlockPreviewPanel name={ name } variation={ variation } />\n\t\t\t{ hasVariationsPanel && (\n\t\t\t\t<div className=\"edit-site-global-styles-screen-variations\">\n\t\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t\t<Subtitle>{ __( 'Style Variations' ) }</Subtitle>\n\t\t\t\t\t\t<VariationsPanel name={ name } />\n\t\t\t\t\t</VStack>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ hasColorPanel && (\n\t\t\t\t<StylesColorPanel\n\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t\tvalue={ style }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasBackgroundPanel && (\n\t\t\t\t<StylesBackgroundPanel\n\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t\tvalue={ style }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tdefaultValues={ BACKGROUND_BLOCK_DEFAULT_VALUES }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasTypographyPanel && (\n\t\t\t\t<StylesTypographyPanel\n\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t\tvalue={ style }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasDimensionsPanel && (\n\t\t\t\t<StylesDimensionsPanel\n\t\t\t\t\tinheritedValue={ inheritedStyleWithLayout }\n\t\t\t\t\tvalue={ styleWithLayout }\n\t\t\t\t\tonChange={ onChangeDimensions }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tincludeLayoutControls\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasBorderPanel && (\n\t\t\t\t<StylesBorderPanel\n\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t\tvalue={ style }\n\t\t\t\t\tonChange={ onChangeBorders }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasFiltersPanel && (\n\t\t\t\t<StylesFiltersPanel\n\t\t\t\t\tinheritedValue={ inheritedStyleWithLayout }\n\t\t\t\t\tvalue={ styleWithLayout }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tincludeLayoutControls\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasImageSettingsPanel && (\n\t\t\t\t<ImageSettingsPanel\n\t\t\t\t\tonChange={ onChangeLightbox }\n\t\t\t\t\tvalue={ userSettings }\n\t\t\t\t\tinheritedValue={ settings }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t{ canEditCSS && (\n\t\t\t\t<PanelBody title={ __( 'Advanced' ) } initialOpen={ false }>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t// translators: %s: is the name of a block e.g., 'Image' or 'Table'.\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 of the %s block. You do not need to include a CSS selector, just add the property and value.'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tblockType?.title\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t\t<StylesAdvancedPanel\n\t\t\t\t\t\tvalue={ style }\n\t\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default ScreenBlock;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,mBAAmB;A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lockType","privateApis","blockEditorPrivateApis","useMemo","useSelect","store","coreStore","PanelBody","__experimentalVStack","VStack","__experimentalHasSplitBorders","hasSplitBorders","__","sprintf","ScreenHeader","BlockPreviewPanel","unlock","Subtitle","useBlockVariations","VariationsPanel","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","BACKGROUND_BLOCK_DEFAULT_VALUES","backgroundSize","backgroundPosition","applyFallbackStyle","border","hasColorOrWidth","color","width","style","undefined","applyAllFallbackStyles","top","right","bottom","left","useHasDimensionsPanel","useHasTypographyPanel","useHasBorderPanel","useGlobalSetting","useSettingsForBlockElement","useHasColorPanel","useHasFiltersPanel","useHasImageSettingsPanel","useGlobalStyle","useHasBackgroundPanel","BackgroundPanel","StylesBackgroundPanel","BorderPanel","StylesBorderPanel","ColorPanel","StylesColorPanel","TypographyPanel","StylesTypographyPanel","DimensionsPanel","StylesDimensionsPanel","FiltersPanel","StylesFiltersPanel","ImageSettingsPanel","AdvancedPanel","StylesAdvancedPanel","ScreenBlock","name","variation","prefixParts","concat","prefix","join","shouldDecodeEncode","inheritedStyle","setStyle","userSettings","rawSettings","setSettings","settingsForBlockElement","blockType","disableBlockGap","spacing","blockGap","supports","skipSerialization","some","spacingType","disableAspectRatio","dimensions","aspectRatio","settings","updatedSettings","structuredClone","blockVariations","hasBackgroundPanel","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasFiltersPanel","hasImageSettingsPanel","hasVariationsPanel","length","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","_links","currentBlockStyle","find","s","inheritedStyleWithLayout","layout","styleWithLayout","onChangeDimensions","newStyle","updatedStyle","onChangeLightbox","newSetting","lightbox","onChangeBorders","radius","newBorder","updatedBorder","children","title","label","className","inheritedValue","value","onChange","defaultValues","includeLayoutControls","initialOpen"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-block.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tPanelBody,\n\t__experimentalVStack as VStack,\n\t__experimentalHasSplitBorders as hasSplitBorders,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport BlockPreviewPanel from './block-preview-panel';\nimport { unlock } from '../../lock-unlock';\nimport Subtitle from './subtitle';\nimport {\n\tuseBlockVariations,\n\tVariationsPanel,\n} from './variations/variations-panel';\n\n// Initial control values.\nconst BACKGROUND_BLOCK_DEFAULT_VALUES = {\n\tbackgroundSize: 'cover',\n\tbackgroundPosition: '50% 50%', // used only when backgroundSize is 'contain'.\n};\n\nfunction applyFallbackStyle( border ) {\n\tif ( ! border ) {\n\t\treturn border;\n\t}\n\n\tconst hasColorOrWidth = border.color || border.width;\n\n\tif ( ! border.style && hasColorOrWidth ) {\n\t\treturn { ...border, style: 'solid' };\n\t}\n\n\tif ( border.style && ! hasColorOrWidth ) {\n\t\treturn undefined;\n\t}\n\n\treturn border;\n}\n\nfunction applyAllFallbackStyles( border ) {\n\tif ( ! border ) {\n\t\treturn border;\n\t}\n\n\tif ( hasSplitBorders( border ) ) {\n\t\treturn {\n\t\t\ttop: applyFallbackStyle( border.top ),\n\t\t\tright: applyFallbackStyle( border.right ),\n\t\t\tbottom: applyFallbackStyle( border.bottom ),\n\t\t\tleft: applyFallbackStyle( border.left ),\n\t\t};\n\t}\n\n\treturn applyFallbackStyle( border );\n}\n\nconst {\n\tuseHasDimensionsPanel,\n\tuseHasTypographyPanel,\n\tuseHasBorderPanel,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tuseHasColorPanel,\n\tuseHasFiltersPanel,\n\tuseHasImageSettingsPanel,\n\tuseGlobalStyle,\n\tuseHasBackgroundPanel,\n\tBackgroundPanel: StylesBackgroundPanel,\n\tBorderPanel: StylesBorderPanel,\n\tColorPanel: StylesColorPanel,\n\tTypographyPanel: StylesTypographyPanel,\n\tDimensionsPanel: StylesDimensionsPanel,\n\tFiltersPanel: StylesFiltersPanel,\n\tImageSettingsPanel,\n\tAdvancedPanel: StylesAdvancedPanel,\n} = unlock( blockEditorPrivateApis );\n\nfunction ScreenBlock( { name, variation } ) {\n\tlet prefixParts = [];\n\tif ( variation ) {\n\t\tprefixParts = [ 'variations', variation ].concat( prefixParts );\n\t}\n\tconst prefix = prefixParts.join( '.' );\n\n\tconst [ style ] = useGlobalStyle( prefix, name, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle( prefix, name, 'all', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ userSettings ] = useGlobalSetting( '', name, 'user' );\n\tconst [ rawSettings, setSettings ] = useGlobalSetting( '', name );\n\tconst settingsForBlockElement = useSettingsForBlockElement(\n\t\trawSettings,\n\t\tname\n\t);\n\tconst blockType = getBlockType( name );\n\n\t// Only allow `blockGap` support if serialization has not been skipped, to be sure global spacing can be applied.\n\tlet disableBlockGap = false;\n\tif (\n\t\tsettingsForBlockElement?.spacing?.blockGap &&\n\t\tblockType?.supports?.spacing?.blockGap &&\n\t\t( blockType?.supports?.spacing?.skipSerialization === true ||\n\t\t\tblockType?.supports?.spacing?.skipSerialization?.some?.(\n\t\t\t\t( spacingType ) => spacingType === 'blockGap'\n\t\t\t) )\n\t) {\n\t\tdisableBlockGap = true;\n\t}\n\n\t// Only allow `aspectRatio` support if the block is not the grouping block.\n\t// The grouping block allows the user to use Group, Row and Stack variations,\n\t// and it is highly likely that the user will not want to set an aspect ratio\n\t// for all three at once. Until there is the ability to set a different aspect\n\t// ratio for each variation, we disable the aspect ratio controls for the\n\t// grouping block in global styles.\n\tlet disableAspectRatio = false;\n\tif (\n\t\tsettingsForBlockElement?.dimensions?.aspectRatio &&\n\t\tname === 'core/group'\n\t) {\n\t\tdisableAspectRatio = true;\n\t}\n\n\tconst settings = useMemo( () => {\n\t\tconst updatedSettings = structuredClone( settingsForBlockElement );\n\t\tif ( disableBlockGap ) {\n\t\t\tupdatedSettings.spacing.blockGap = false;\n\t\t}\n\t\tif ( disableAspectRatio ) {\n\t\t\tupdatedSettings.dimensions.aspectRatio = false;\n\t\t}\n\t\treturn updatedSettings;\n\t}, [ settingsForBlockElement, disableBlockGap, disableAspectRatio ] );\n\n\tconst blockVariations = useBlockVariations( name );\n\tconst hasBackgroundPanel = useHasBackgroundPanel( settings );\n\tconst hasTypographyPanel = useHasTypographyPanel( settings );\n\tconst hasColorPanel = useHasColorPanel( settings );\n\tconst hasBorderPanel = useHasBorderPanel( settings );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\tconst hasFiltersPanel = useHasFiltersPanel( settings );\n\tconst hasImageSettingsPanel = useHasImageSettingsPanel(\n\t\tname,\n\t\tuserSettings,\n\t\tsettings\n\t);\n\tconst hasVariationsPanel = !! blockVariations?.length && ! variation;\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\tconst currentBlockStyle = variation\n\t\t? blockVariations.find( ( s ) => s.name === variation )\n\t\t: null;\n\n\t// These intermediary objects are needed because the \"layout\" property is stored\n\t// in settings rather than styles.\n\tconst inheritedStyleWithLayout = useMemo( () => {\n\t\treturn {\n\t\t\t...inheritedStyle,\n\t\t\tlayout: settings.layout,\n\t\t};\n\t}, [ inheritedStyle, settings.layout ] );\n\tconst styleWithLayout = useMemo( () => {\n\t\treturn {\n\t\t\t...style,\n\t\t\tlayout: userSettings.layout,\n\t\t};\n\t}, [ style, userSettings.layout ] );\n\tconst onChangeDimensions = ( newStyle ) => {\n\t\tconst updatedStyle = { ...newStyle };\n\t\tdelete updatedStyle.layout;\n\t\tsetStyle( updatedStyle );\n\n\t\tif ( newStyle.layout !== userSettings.layout ) {\n\t\t\tsetSettings( {\n\t\t\t\t...userSettings,\n\t\t\t\tlayout: newStyle.layout,\n\t\t\t} );\n\t\t}\n\t};\n\tconst onChangeLightbox = ( newSetting ) => {\n\t\t// If the newSetting is undefined, this means that the user has deselected\n\t\t// (reset) the lightbox setting.\n\t\tif ( newSetting === undefined ) {\n\t\t\tsetSettings( {\n\t\t\t\t...rawSettings,\n\t\t\t\tlightbox: undefined,\n\t\t\t} );\n\n\t\t\t// Otherwise, we simply set the lightbox setting to the new value but\n\t\t\t// taking care of not overriding the other lightbox settings.\n\t\t} else {\n\t\t\tsetSettings( {\n\t\t\t\t...rawSettings,\n\t\t\t\tlightbox: {\n\t\t\t\t\t...rawSettings.lightbox,\n\t\t\t\t\t...newSetting,\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\t};\n\tconst onChangeBorders = ( newStyle ) => {\n\t\tif ( ! newStyle?.border ) {\n\t\t\tsetStyle( newStyle );\n\t\t\treturn;\n\t\t}\n\n\t\t// As Global Styles can't conditionally generate styles based on if\n\t\t// other style properties have been set, we need to force split\n\t\t// border definitions for user set global border styles. Border\n\t\t// radius is derived from the same property i.e. `border.radius` if\n\t\t// it is a string that is used. The longhand border radii styles are\n\t\t// only generated if that property is an object.\n\t\t//\n\t\t// For borders (color, style, and width) those are all properties on\n\t\t// the `border` style property. This means if the theme.json defined\n\t\t// split borders and the user condenses them into a flat border or\n\t\t// vice-versa we'd get both sets of styles which would conflict.\n\t\tconst { radius, ...newBorder } = newStyle.border;\n\t\tconst border = applyAllFallbackStyles( newBorder );\n\t\tconst updatedBorder = ! hasSplitBorders( border )\n\t\t\t? {\n\t\t\t\t\ttop: border,\n\t\t\t\t\tright: border,\n\t\t\t\t\tbottom: border,\n\t\t\t\t\tleft: border,\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tcolor: null,\n\t\t\t\t\tstyle: null,\n\t\t\t\t\twidth: null,\n\t\t\t\t\t...border,\n\t\t\t };\n\n\t\tsetStyle( { ...newStyle, border: { ...updatedBorder, radius } } );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ variation ? currentBlockStyle?.label : blockType.title }\n\t\t\t/>\n\t\t\t<BlockPreviewPanel name={ name } variation={ variation } />\n\t\t\t{ hasVariationsPanel && (\n\t\t\t\t<div className=\"edit-site-global-styles-screen-variations\">\n\t\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t\t<Subtitle>{ __( 'Style Variations' ) }</Subtitle>\n\t\t\t\t\t\t<VariationsPanel name={ name } />\n\t\t\t\t\t</VStack>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ hasColorPanel && (\n\t\t\t\t<StylesColorPanel\n\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t\tvalue={ style }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasBackgroundPanel && (\n\t\t\t\t<StylesBackgroundPanel\n\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t\tvalue={ style }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tdefaultValues={ BACKGROUND_BLOCK_DEFAULT_VALUES }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasTypographyPanel && (\n\t\t\t\t<StylesTypographyPanel\n\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t\tvalue={ style }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasDimensionsPanel && (\n\t\t\t\t<StylesDimensionsPanel\n\t\t\t\t\tinheritedValue={ inheritedStyleWithLayout }\n\t\t\t\t\tvalue={ styleWithLayout }\n\t\t\t\t\tonChange={ onChangeDimensions }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tincludeLayoutControls\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasBorderPanel && (\n\t\t\t\t<StylesBorderPanel\n\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t\tvalue={ style }\n\t\t\t\t\tonChange={ onChangeBorders }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasFiltersPanel && (\n\t\t\t\t<StylesFiltersPanel\n\t\t\t\t\tinheritedValue={ inheritedStyleWithLayout }\n\t\t\t\t\tvalue={ styleWithLayout }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tincludeLayoutControls\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasImageSettingsPanel && (\n\t\t\t\t<ImageSettingsPanel\n\t\t\t\t\tonChange={ onChangeLightbox }\n\t\t\t\t\tvalue={ userSettings }\n\t\t\t\t\tinheritedValue={ settings }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t{ canEditCSS && (\n\t\t\t\t<PanelBody title={ __( 'Advanced' ) } initialOpen={ false }>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t// translators: %s: is the name of a block e.g., 'Image' or 'Table'.\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 of the %s block. You do not need to include a CSS selector, just add the property and value.'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tblockType?.title\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t\t<StylesAdvancedPanel\n\t\t\t\t\t\tvalue={ style }\n\t\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\t\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AkB;MAC7BY,KAAK,EAAGxD,YAAc;MACtBuD,cAAc,EAAGxC;IAAU,CAC3B,CACD,EAECa,UAAU,iBACXjF,KAAA,CAAChB,SAAS;MAACyH,KAAK,EAAGpH,EAAE,CAAE,UAAW,CAAG;MAAC4H,WAAW,EAAG,KAAO;MAAAT,QAAA,gBAC1D1G,IAAA;QAAA0G,QAAA,EACGlH,OAAO;QACR;QACAD,EAAE,CACD,2IACD,CAAC,EACDoE,SAAS,EAAEgD,KACZ;MAAC,CACC,CAAC,eACJ3G,IAAA,CAAC4C,mBAAmB;QACnBmE,KAAK,EAAGlG,KAAO;QACfmG,QAAQ,EAAG1D,QAAU;QACrBwD,cAAc,EAAGzD;MAAgB,CACjC,CAAC;IAAA,CACQ,CACX;EAAA,CACA,CAAC;AAEL;AAEA,eAAeR,WAAW","ignoreList":[]}
@@ -1,18 +1,13 @@
1
- /**
2
- * External dependencies
3
- */
4
- import clsx from 'clsx';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
9
4
  import { __, sprintf } from '@wordpress/i18n';
10
- import { Button } from '@wordpress/components';
5
+ import { Button, Composite } from '@wordpress/components';
11
6
  import { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';
12
7
  import { store as coreStore } from '@wordpress/core-data';
13
8
  import { useSelect } from '@wordpress/data';
14
9
  import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
15
-
10
+ import { ENTER, SPACE } from '@wordpress/keycodes';
16
11
  /**
17
12
  * Internal dependencies
18
13
  */
@@ -101,10 +96,11 @@ function RevisionsButtons({
101
96
  const {
102
97
  datetimeAbbreviated
103
98
  } = getSettings().formats;
104
- return /*#__PURE__*/_jsx("ol", {
99
+ return /*#__PURE__*/_jsx(Composite, {
100
+ orientation: "vertical",
105
101
  className: "edit-site-global-styles-screen-revisions__revisions-list",
106
102
  "aria-label": __('Global styles revisions list'),
107
- role: "group",
103
+ role: "listbox",
108
104
  children: userRevisions.map((revision, index) => {
109
105
  const {
110
106
  id,
@@ -123,22 +119,27 @@ function RevisionsButtons({
123
119
  const modifiedDate = getDate(modified);
124
120
  const displayDate = modified && dateNowInMs - modifiedDate.getTime() > DAY_IN_MILLISECONDS ? dateI18n(datetimeAbbreviated, modifiedDate) : humanTimeDiff(modified);
125
121
  const revisionLabel = getRevisionLabel(id, authorDisplayName, dateI18n(datetimeAbbreviated, modifiedDate), areStylesEqual);
126
- return /*#__PURE__*/_jsxs("li", {
127
- className: clsx('edit-site-global-styles-screen-revisions__revision-item', {
128
- 'is-selected': isSelected,
129
- 'is-active': areStylesEqual,
130
- 'is-reset': isReset
131
- }),
122
+ return /*#__PURE__*/_jsxs(Composite.Item, {
123
+ className: "edit-site-global-styles-screen-revisions__revision-item",
132
124
  "aria-current": isSelected,
133
- children: [/*#__PURE__*/_jsx(Button, {
134
- __next40pxDefaultSize: true,
135
- className: "edit-site-global-styles-screen-revisions__revision-button",
136
- accessibleWhenDisabled: true,
137
- disabled: isSelected,
138
- onClick: () => {
125
+ role: "option",
126
+ onKeyDown: event => {
127
+ const {
128
+ keyCode
129
+ } = event;
130
+ if (keyCode === ENTER || keyCode === SPACE) {
139
131
  onChange(revision);
140
- },
141
- "aria-label": revisionLabel,
132
+ }
133
+ },
134
+ onClick: event => {
135
+ event.preventDefault();
136
+ onChange(revision);
137
+ },
138
+ "aria-selected": isSelected,
139
+ "aria-label": revisionLabel,
140
+ render: /*#__PURE__*/_jsx("div", {}),
141
+ children: [/*#__PURE__*/_jsx("span", {
142
+ className: "edit-site-global-styles-screen-revisions__revision-item-wrapper",
142
143
  children: isReset ? /*#__PURE__*/_jsxs("span", {
143
144
  className: "edit-site-global-styles-screen-revisions__description",
144
145
  children: [__('Default styles'), /*#__PURE__*/_jsx("span", {
@@ -173,6 +174,7 @@ function RevisionsButtons({
173
174
  variant: "primary",
174
175
  className: "edit-site-global-styles-screen-revisions__apply-button",
175
176
  onClick: onApplyRevision,
177
+ "aria-label": __('Apply the selected revision to your site.'),
176
178
  children: isReset ? __('Reset to defaults') : __('Apply')
177
179
  }))]
178
180
  }, id);
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","__","sprintf","Button","dateI18n","getDate","humanTimeDiff","getSettings","store","coreStore","useSelect","privateApis","blockEditorPrivateApis","unlock","jsx","_jsx","jsxs","_jsxs","DAY_IN_MILLISECONDS","getGlobalStylesChanges","ChangesSummary","revision","previousRevision","changes","maxResults","length","className","children","map","change","getRevisionLabel","id","authorDisplayName","formattedModifiedDate","areStylesEqual","RevisionsButtons","userRevisions","selectedRevisionId","onChange","canApplyRevision","onApplyRevision","currentThemeName","currentUser","select","getCurrentTheme","getCurrentUser","currentTheme","name","rendered","stylesheet","dateNowInMs","getTime","datetimeAbbreviated","formats","role","index","author","modified","isUnsaved","revisionAuthor","authorAvatar","avatar_urls","isFirstItem","isSelected","isReset","modifiedDate","displayDate","revisionLabel","__next40pxDefaultSize","accessibleWhenDisabled","disabled","onClick","dateTime","alt","src","size","variant"],"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":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,QAAQ,EAAEC,OAAO,EAAEC,aAAa,EAAEC,WAAW,QAAQ,iBAAiB;AAC/E,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE9C,MAAMC,mBAAmB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE;AAC/C,MAAM;EAAEC;AAAuB,CAAC,GAAGN,MAAM,CAAED,sBAAuB,CAAC;AAEnE,SAASQ,cAAcA,CAAE;EAAEC,QAAQ;EAAEC;AAAiB,CAAC,EAAG;EACzD,MAAMC,OAAO,GAAGJ,sBAAsB,CAAEE,QAAQ,EAAEC,gBAAgB,EAAE;IACnEE,UAAU,EAAE;EACb,CAAE,CAAC;EAEH,IAAK,CAAED,OAAO,CAACE,MAAM,EAAG;IACvB,OAAO,IAAI;EACZ;E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AGA,QAAU;cACrBC,gBAAgB,EACfiC,KAAK,GAAGnB,aAAa,CAACX,MAAM,GACzBW,aAAa,CAAEmB,KAAK,GAAG,CAAC,CAAE,GAC1B,CAAC;YACJ,CACD,CACD;UAAA,CACI;QACN,CACM,CAAC,EACPQ,UAAU,KACT7B,cAAc,gBACfnB,IAAA;UAAGW,SAAS,EAAC,wDAAwD;UAAAC,QAAA,EAClE1B,EAAE,CACH,gDACD;QAAC,CACC,CAAC,gBAEJc,IAAA,CAACZ,MAAM;UACNwE,IAAI,EAAC,SAAS;UACdC,OAAO,EAAC,SAAS;UACjBlD,SAAS,EAAC,wDAAwD;UAClE6C,OAAO,EAAG/B,eAAiB;UAAAb,QAAA,EAEzBqC,OAAO,GACN/D,EAAE,CAAE,mBAAoB,CAAC,GACzBA,EAAE,CAAE,OAAQ;QAAC,CACT,CACR,CAAE;MAAA,GAxEE8B,EAyEH,CAAC;IAEP,CAAE;EAAC,CACA,CAAC;AAEP;AAEA,eAAeI,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["__","sprintf","Button","Composite","dateI18n","getDate","humanTimeDiff","getSettings","store","coreStore","useSelect","privateApis","blockEditorPrivateApis","ENTER","SPACE","unlock","jsx","_jsx","jsxs","_jsxs","DAY_IN_MILLISECONDS","getGlobalStylesChanges","ChangesSummary","revision","previousRevision","changes","maxResults","length","className","children","map","change","getRevisionLabel","id","authorDisplayName","formattedModifiedDate","areStylesEqual","RevisionsButtons","userRevisions","selectedRevisionId","onChange","canApplyRevision","onApplyRevision","currentThemeName","currentUser","select","getCurrentTheme","getCurrentUser","currentTheme","name","rendered","stylesheet","dateNowInMs","getTime","datetimeAbbreviated","formats","orientation","role","index","author","modified","isUnsaved","revisionAuthor","authorAvatar","avatar_urls","isFirstItem","isSelected","isReset","modifiedDate","displayDate","revisionLabel","Item","onKeyDown","event","keyCode","onClick","preventDefault","render","dateTime","alt","src","size","variant"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/revisions-buttons.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button, Composite } 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';\nimport { ENTER, SPACE } from '@wordpress/keycodes';\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<Composite\n\t\t\torientation=\"vertical\"\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=\"listbox\"\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<Composite.Item\n\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__revision-item\"\n\t\t\t\t\t\taria-current={ isSelected }\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\tconst { keyCode } = event;\n\t\t\t\t\t\t\tif ( keyCode === ENTER || keyCode === SPACE ) {\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} }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tonChange( revision );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\taria-selected={ isSelected }\n\t\t\t\t\t\taria-label={ revisionLabel }\n\t\t\t\t\t\trender={ <div /> }\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__revision-item-wrapper\">\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</span>\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\taria-label={ __(\n\t\t\t\t\t\t\t\t\t\t'Apply the selected revision to your site.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\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</Composite.Item>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Composite>\n\t);\n}\n\nexport default RevisionsButtons;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,MAAM,EAAEC,SAAS,QAAQ,uBAAuB;AACzD,SAASC,QAAQ,EAAEC,OAAO,EAAE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CAACf,MAAM;UACN+E,IAAI,EAAC,SAAS;UACdC,OAAO,EAAC,SAAS;UACjBtD,SAAS,EAAC,wDAAwD;UAClE+C,OAAO,EAAGjC,eAAiB;UAC3B,cAAa1C,EAAE,CACd,2CACD,CAAG;UAAA6B,QAAA,EAEDsC,OAAO,GACNnE,EAAE,CAAE,mBAAoB,CAAC,GACzBA,EAAE,CAAE,OAAQ;QAAC,CACT,CACR,CAAE;MAAA,GAjFEiC,EAkFS,CAAC;IAEnB,CAAE;EAAC,CACO,CAAC;AAEd;AAEA,eAAeI,gBAAgB","ignoreList":[]}
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
+ import { privateApis as blockEditorPrivateApis, store as blockEditorStore } from '@wordpress/block-editor';
4
5
  import { Card, CardBody } from '@wordpress/components';
6
+ import { useSelect, useDispatch } from '@wordpress/data';
5
7
  import { __ } from '@wordpress/i18n';
6
- import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
7
- import { useDispatch } from '@wordpress/data';
8
8
  import { store as editorStore } from '@wordpress/editor';
9
+ import { useEffect } from '@wordpress/element';
9
10
 
10
11
  /**
11
12
  * Internal dependencies
@@ -19,13 +20,18 @@ const {
19
20
  } = unlock(blockEditorPrivateApis);
20
21
  function ScreenStyleVariations() {
21
22
  // Style Variations should only be previewed in with
22
- // - a "zoomed out" editor
23
+ // - a "zoomed out" editor (but not when in preview mode)
23
24
  // - "Desktop" device preview
25
+ const isPreviewMode = useSelect(select => {
26
+ return select(blockEditorStore).getSettings().isPreviewMode;
27
+ }, []);
24
28
  const {
25
29
  setDeviceType
26
30
  } = useDispatch(editorStore);
27
- useZoomOut();
28
- setDeviceType('desktop');
31
+ useZoomOut(!isPreviewMode);
32
+ useEffect(() => {
33
+ setDeviceType('desktop');
34
+ }, [setDeviceType]);
29
35
  return /*#__PURE__*/_jsxs(_Fragment, {
30
36
  children: [/*#__PURE__*/_jsx(ScreenHeader, {
31
37
  title: __('Browse styles'),
@@ -1 +1 @@
1
- {"version":3,"names":["Card","CardBody","__","privateApis","blockEditorPrivateApis","useDispatch","store","editorStore","ScreenHeader","SidebarNavigationScreenGlobalStylesContent","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","useZoomOut","ScreenStyleVariations","setDeviceType","children","title","description","size","isBorderless","className"],"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>\n\t\t</>\n\t);\n}\n\nexport default ScreenStyleVariations;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,QAAQ,QAAQ,uBAAuB;AACtD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,OAAOC,YAAY,MAAM,UAAU;AACnC,OAAOC,0CAA0C,MAAM,oDAAoD;AAC3G,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE3C,MAAM;EAAEC;AAAW,CAAC,GAAGP,MAAM,CAAEN,sBAAuB,CAAC;AAEvD,SAASc,qBAAqBA,CAAA,EAAG;EAChC;EACA;EACA;EACA,MAAM;IAAEC;EAAc,CAAC,GAAGd,WAAW,CAAEE,WAAY,CAAC;EACpDU,UAAU,CAAC,CAAC;EACZE,aAAa,CAAE,SAAU,CAAC;EAE1B,oBACCH,KAAA,CAAAF,SAAA;IAAAM,QAAA,gBACCR,IAAA,CAACJ,YAAY;MACZa,KAAK,EAAGnB,EAAE,CAAE,eAAgB,CAAG;MAC/BoB,WAAW,EAAGpB,EAAE,CACf,oDACD;IAAG,CACH,CAAC,eAEFU,IAAA,CAACZ,IAAI;MACJuB,IAAI,EAAC,OAAO;MACZC,YAAY;MACZC,SAAS,EAAC,iDAAiD;MAAAL,QAAA,eAE3DR,IAAA,CAACX,QAAQ;QAAAmB,QAAA,eACRR,IAAA,CAACH,0CAA0C,IAAE;MAAC,CACrC;IAAC,CACN,CAAC;EAAA,CACN,CAAC;AAEL;AAEA,eAAeS,qBAAqB","ignoreList":[]}
1
+ {"version":3,"names":["privateApis","blockEditorPrivateApis","store","blockEditorStore","Card","CardBody","useSelect","useDispatch","__","editorStore","useEffect","ScreenHeader","SidebarNavigationScreenGlobalStylesContent","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","useZoomOut","ScreenStyleVariations","isPreviewMode","select","getSettings","setDeviceType","children","title","description","size","isBorderless","className"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-style-variations.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { Card, CardBody } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useEffect } from '@wordpress/element';\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 (but not when in preview mode)\n\t// - \"Desktop\" device preview\n\tconst isPreviewMode = useSelect( ( select ) => {\n\t\treturn select( blockEditorStore ).getSettings().isPreviewMode;\n\t}, [] );\n\tconst { setDeviceType } = useDispatch( editorStore );\n\tuseZoomOut( ! isPreviewMode );\n\tuseEffect( () => {\n\t\tsetDeviceType( 'desktop' );\n\t}, [ setDeviceType ] );\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":"AAAA;AACA;AACA;AACA,SACCA,WAAW,IAAIC,sBAAsB,EACrCC,KAAK,IAAI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AAQ;QAAAqB,QAAA,eACRX,IAAA,CAACH,0CAA0C,IAAE;MAAC,CACrC;IAAC,CACN,CAAC;EAAA,CACN,CAAC;AAEL;AAEA,eAAeS,qBAAqB","ignoreList":[]}
@@ -156,9 +156,8 @@ export default function ShadowsEditPanel() {
156
156
  },
157
157
  confirmButtonText: __('Delete'),
158
158
  size: "medium",
159
- children: sprintf(
160
- // translators: %s: name of the shadow
161
- 'Are you sure you want to delete "%s"?', selectedShadow.name)
159
+ children: sprintf(/* translators: %s: Name of the shadow preset. */
160
+ __('Are you sure you want to delete "%s" shadow preset?'), selectedShadow.name)
162
161
  }), isRenameModalVisible && /*#__PURE__*/_jsx(Modal, {
163
162
  title: __('Rename'),
164
163
  onRequestClose: () => setIsRenameModalVisible(false),
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalSpacer","Spacer","__experimentalItemGroup","ItemGroup","__experimentalInputControl","InputControl","__experimentalUnitControl","UnitControl","__experimentalGrid","Grid","__experimentalDropdownContentWrapper","DropdownContentWrapper","useNavigator","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","__experimentalConfirmDialog","ConfirmDialog","Dropdown","Button","Flex","FlexItem","ColorPalette","Modal","privateApis","componentsPrivateApis","__","sprintf","blockEditorPrivateApis","plus","shadow","shadowIcon","reset","moreVertical","useState","useMemo","useEffect","unlock","Subtitle","ScreenHeader","defaultShadow","getShadowParts","shadowStringToObject","shadowObjectToString","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useGlobalSetting","Menu","customShadowMenuItems","label","action","presetShadowMenuItems","ShadowsEditPanel","goBack","params","category","slug","shadows","setShadows","hasCurrentShadow","some","baseShadows","undefined","selectedShadow","setSelectedShadow","find","baseSelectedShadow","b","isConfirmDialogVisible","setIsConfirmDialogVisible","isRenameModalVisible","setIsRenameModalVisible","shadowName","setShadowName","name","onShadowChange","updatedShadows","map","s","onMenuClick","handleShadowDelete","filter","handleShadowRename","newName","title","children","justify","marginTop","marginBottom","paddingX","trigger","size","icon","item","Item","onClick","disabled","ItemLabel","className","ShadowsPreview","ShadowEditor","onChange","isOpen","onConfirm","onCancel","confirmButtonText","onRequestClose","onSubmit","event","preventDefault","__next40pxDefaultSize","autoComplete","placeholder","value","expanded","variant","type","shadowStyle","boxShadow","align","style","shadowParts","onChangeShadowPart","index","part","newShadowParts","join","onAddShadowPart","onRemoveShadowPart","p","i","spacing","level","isBordered","isSeparated","ShadowItem","canRemove","length","onRemove","popoverProps","placement","offset","shift","shadowObj","newShadow","renderToggle","onToggle","toggleProps","removeButtonProps","flexGrow","inset","renderContent","paddingSize","ShadowPopover","__experimentalIsRenderedInSidebar","enableAlpha","key","clearable","color","__nextHasNoMarginBottom","isBlock","hideLabelFromVision","columns","gap","ShadowInputControl","x","y","blur","spread","onValueChange","next","isNumeric","isNaN","parseFloat","nextValue"],"sources":["@wordpress/edit-site/src/components/global-styles/shadows-edit-panel.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalInputControl as InputControl,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalGrid as Grid,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\tuseNavigator,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalConfirmDialog as ConfirmDialog,\n\tDropdown,\n\tButton,\n\tFlex,\n\tFlexItem,\n\tColorPalette,\n\tModal,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport {\n\tplus,\n\tshadow as shadowIcon,\n\treset,\n\tmoreVertical,\n} from '@wordpress/icons';\nimport { useState, useMemo, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport Subtitle from './subtitle';\nimport ScreenHeader from './header';\nimport { defaultShadow } from './shadows-panel';\nimport {\n\tgetShadowParts,\n\tshadowStringToObject,\n\tshadowObjectToString,\n} from './shadow-utils';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\nconst { Menu } = unlock( componentsPrivateApis );\n\nconst customShadowMenuItems = [\n\t{\n\t\tlabel: __( 'Rename' ),\n\t\taction: 'rename',\n\t},\n\t{\n\t\tlabel: __( 'Delete' ),\n\t\taction: 'delete',\n\t},\n];\n\nconst presetShadowMenuItems = [\n\t{\n\t\tlabel: __( 'Reset' ),\n\t\taction: 'reset',\n\t},\n];\n\nexport default function ShadowsEditPanel() {\n\tconst {\n\t\tgoBack,\n\t\tparams: { category, slug },\n\t} = useNavigator();\n\tconst [ shadows, setShadows ] = useGlobalSetting(\n\t\t`shadow.presets.${ category }`\n\t);\n\n\tuseEffect( () => {\n\t\tconst hasCurrentShadow = shadows?.some(\n\t\t\t( shadow ) => shadow.slug === slug\n\t\t);\n\t\t// If the shadow being edited doesn't exist anymore in the global styles setting, navigate back\n\t\t// to prevent the user from editing a non-existent shadow entry.\n\t\t// This can happen, for example:\n\t\t// - when the user deletes the shadow\n\t\t// - when the user resets the styles while editing a custom shadow\n\t\t//\n\t\t// The check on the slug is necessary to prevent a double back navigation when the user triggers\n\t\t// a backward navigation by interacting with the screen's UI.\n\t\tif ( !! slug && ! hasCurrentShadow ) {\n\t\t\tgoBack();\n\t\t}\n\t}, [ shadows, slug, goBack ] );\n\n\tconst [ baseShadows ] = useGlobalSetting(\n\t\t`shadow.presets.${ category }`,\n\t\tundefined,\n\t\t'base'\n\t);\n\tconst [ selectedShadow, setSelectedShadow ] = useState( () =>\n\t\t( shadows || [] ).find( ( shadow ) => shadow.slug === slug )\n\t);\n\tconst baseSelectedShadow = useMemo(\n\t\t() => ( baseShadows || [] ).find( ( b ) => b.slug === slug ),\n\t\t[ baseShadows, slug ]\n\t);\n\tconst [ isConfirmDialogVisible, setIsConfirmDialogVisible ] =\n\t\tuseState( false );\n\tconst [ isRenameModalVisible, setIsRenameModalVisible ] = useState( false );\n\tconst [ shadowName, setShadowName ] = useState( selectedShadow.name );\n\n\tif ( ! category || ! slug ) {\n\t\treturn null;\n\t}\n\n\tconst onShadowChange = ( shadow ) => {\n\t\tsetSelectedShadow( { ...selectedShadow, shadow } );\n\t\tconst updatedShadows = shadows.map( ( s ) =>\n\t\t\ts.slug === slug ? { ...selectedShadow, shadow } : s\n\t\t);\n\t\tsetShadows( updatedShadows );\n\t};\n\n\tconst onMenuClick = ( action ) => {\n\t\tif ( action === 'reset' ) {\n\t\t\tconst updatedShadows = shadows.map( ( s ) =>\n\t\t\t\ts.slug === slug ? baseSelectedShadow : s\n\t\t\t);\n\t\t\tsetSelectedShadow( baseSelectedShadow );\n\t\t\tsetShadows( updatedShadows );\n\t\t} else if ( action === 'delete' ) {\n\t\t\tsetIsConfirmDialogVisible( true );\n\t\t} else if ( action === 'rename' ) {\n\t\t\tsetIsRenameModalVisible( true );\n\t\t}\n\t};\n\n\tconst handleShadowDelete = () => {\n\t\tsetShadows( shadows.filter( ( s ) => s.slug !== slug ) );\n\t};\n\n\tconst handleShadowRename = ( newName ) => {\n\t\tif ( ! newName ) {\n\t\t\treturn;\n\t\t}\n\t\tconst updatedShadows = shadows.map( ( s ) =>\n\t\t\ts.slug === slug ? { ...selectedShadow, name: newName } : s\n\t\t);\n\t\tsetSelectedShadow( { ...selectedShadow, name: newName } );\n\t\tsetShadows( updatedShadows );\n\t};\n\n\treturn ! selectedShadow ? (\n\t\t<ScreenHeader title=\"\" />\n\t) : (\n\t\t<>\n\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t<ScreenHeader title={ selectedShadow.name } />\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Spacer marginTop={ 2 } marginBottom={ 0 } paddingX={ 4 }>\n\t\t\t\t\t\t<Menu\n\t\t\t\t\t\t\ttrigger={\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Menu' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ ( category === 'custom'\n\t\t\t\t\t\t\t\t? customShadowMenuItems\n\t\t\t\t\t\t\t\t: presetShadowMenuItems\n\t\t\t\t\t\t\t).map( ( item ) => (\n\t\t\t\t\t\t\t\t<Menu.Item\n\t\t\t\t\t\t\t\t\tkey={ item.action }\n\t\t\t\t\t\t\t\t\tonClick={ () => onMenuClick( item.action ) }\n\t\t\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t\t\titem.action === 'reset' &&\n\t\t\t\t\t\t\t\t\t\tselectedShadow.shadow ===\n\t\t\t\t\t\t\t\t\t\t\tbaseSelectedShadow.shadow\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t\t{ item.label }\n\t\t\t\t\t\t\t\t\t</Menu.ItemLabel>\n\t\t\t\t\t\t\t\t</Menu.Item>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</Menu>\n\t\t\t\t\t</Spacer>\n\t\t\t\t</FlexItem>\n\t\t\t</HStack>\n\t\t\t<div className=\"edit-site-global-styles-screen\">\n\t\t\t\t<ShadowsPreview shadow={ selectedShadow.shadow } />\n\t\t\t\t<ShadowEditor\n\t\t\t\t\tshadow={ selectedShadow.shadow }\n\t\t\t\t\tonChange={ onShadowChange }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t{ isConfirmDialogVisible && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\tisOpen\n\t\t\t\t\tonConfirm={ () => {\n\t\t\t\t\t\thandleShadowDelete();\n\t\t\t\t\t\tsetIsConfirmDialogVisible( false );\n\t\t\t\t\t} }\n\t\t\t\t\tonCancel={ () => {\n\t\t\t\t\t\tsetIsConfirmDialogVisible( false );\n\t\t\t\t\t} }\n\t\t\t\t\tconfirmButtonText={ __( 'Delete' ) }\n\t\t\t\t\tsize=\"medium\"\n\t\t\t\t>\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t// translators: %s: name of the shadow\n\t\t\t\t\t\t'Are you sure you want to delete \"%s\"?',\n\t\t\t\t\t\tselectedShadow.name\n\t\t\t\t\t) }\n\t\t\t\t</ConfirmDialog>\n\t\t\t) }\n\t\t\t{ isRenameModalVisible && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Rename' ) }\n\t\t\t\t\tonRequestClose={ () => setIsRenameModalVisible( false ) }\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\thandleShadowRename( shadowName );\n\t\t\t\t\t\t\tsetIsRenameModalVisible( false );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\tplaceholder={ __( 'Shadow name' ) }\n\t\t\t\t\t\t\tvalue={ shadowName }\n\t\t\t\t\t\t\tonChange={ ( value ) => setShadowName( value ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Spacer marginBottom={ 6 } />\n\t\t\t\t\t\t<Flex\n\t\t\t\t\t\t\tclassName=\"block-editor-shadow-edit-modal__actions\"\n\t\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\tsetIsRenameModalVisible( false )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t</Flex>\n\t\t\t\t\t</form>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction ShadowsPreview( { shadow } ) {\n\tconst shadowStyle = {\n\t\tboxShadow: shadow,\n\t};\n\n\treturn (\n\t\t<Spacer marginBottom={ 4 } marginTop={ -2 }>\n\t\t\t<HStack\n\t\t\t\talign=\"center\"\n\t\t\t\tjustify=\"center\"\n\t\t\t\tclassName=\"edit-site-global-styles__shadow-preview-panel\"\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"edit-site-global-styles__shadow-preview-block\"\n\t\t\t\t\tstyle={ shadowStyle }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t</Spacer>\n\t);\n}\n\nfunction ShadowEditor( { shadow, onChange } ) {\n\tconst shadowParts = useMemo( () => getShadowParts( shadow ), [ shadow ] );\n\n\tconst onChangeShadowPart = ( index, part ) => {\n\t\tconst newShadowParts = [ ...shadowParts ];\n\t\tnewShadowParts[ index ] = part;\n\t\tonChange( newShadowParts.join( ', ' ) );\n\t};\n\n\tconst onAddShadowPart = () => {\n\t\tonChange( [ ...shadowParts, defaultShadow ].join( ', ' ) );\n\t};\n\n\tconst onRemoveShadowPart = ( index ) => {\n\t\tonChange( shadowParts.filter( ( p, i ) => i !== index ).join( ', ' ) );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<VStack spacing={ 2 }>\n\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t<Flex\n\t\t\t\t\t\talign=\"center\"\n\t\t\t\t\t\tclassName=\"edit-site-global-styles__shadows-panel__title\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Subtitle level={ 3 }>{ __( 'Shadows' ) }</Subtitle>\n\t\t\t\t\t</Flex>\n\t\t\t\t\t<FlexItem className=\"edit-site-global-styles__shadows-panel__options-container\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\t\tlabel={ __( 'Add shadow' ) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonAddShadowPart();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t\t<Spacer />\n\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t{ shadowParts.map( ( part, index ) => (\n\t\t\t\t\t<ShadowItem\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tshadow={ part }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tonChangeShadowPart( index, value )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcanRemove={ shadowParts.length > 1 }\n\t\t\t\t\t\tonRemove={ () => onRemoveShadowPart( index ) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</ItemGroup>\n\t\t</>\n\t);\n}\n\nfunction ShadowItem( { shadow, onChange, canRemove, onRemove } ) {\n\tconst popoverProps = {\n\t\tplacement: 'left-start',\n\t\toffset: 36,\n\t\tshift: true,\n\t};\n\tconst shadowObj = useMemo(\n\t\t() => shadowStringToObject( shadow ),\n\t\t[ shadow ]\n\t);\n\tconst onShadowChange = ( newShadow ) => {\n\t\tonChange( shadowObjectToString( newShadow ) );\n\t};\n\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ popoverProps }\n\t\t\tclassName=\"edit-site-global-styles__shadow-editor__dropdown\"\n\t\t\trenderToggle={ ( { onToggle, isOpen } ) => {\n\t\t\t\tconst toggleProps = {\n\t\t\t\t\tonClick: onToggle,\n\t\t\t\t\tclassName: clsx(\n\t\t\t\t\t\t'edit-site-global-styles__shadow-editor__dropdown-toggle',\n\t\t\t\t\t\t{ 'is-open': isOpen }\n\t\t\t\t\t),\n\t\t\t\t\t'aria-expanded': isOpen,\n\t\t\t\t};\n\t\t\t\tconst removeButtonProps = {\n\t\t\t\t\tonClick: onRemove,\n\t\t\t\t\tclassName: clsx(\n\t\t\t\t\t\t'edit-site-global-styles__shadow-editor__remove-button',\n\t\t\t\t\t\t{ 'is-open': isOpen }\n\t\t\t\t\t),\n\t\t\t\t\tlabel: __( 'Remove shadow' ),\n\t\t\t\t};\n\n\t\t\t\treturn (\n\t\t\t\t\t<HStack align=\"center\" justify=\"flex-start\" spacing={ 0 }>\n\t\t\t\t\t\t<FlexItem style={ { flexGrow: 1 } }>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\ticon={ shadowIcon }\n\t\t\t\t\t\t\t\t{ ...toggleProps }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ shadowObj.inset\n\t\t\t\t\t\t\t\t\t? __( 'Inner shadow' )\n\t\t\t\t\t\t\t\t\t: __( 'Drop shadow' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t{ canRemove && (\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\ticon={ reset }\n\t\t\t\t\t\t\t\t\t{ ...removeButtonProps }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HStack>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trenderContent={ () => (\n\t\t\t\t<DropdownContentWrapper\n\t\t\t\t\tpaddingSize=\"medium\"\n\t\t\t\t\tclassName=\"edit-site-global-styles__shadow-editor__dropdown-content\"\n\t\t\t\t>\n\t\t\t\t\t<ShadowPopover\n\t\t\t\t\t\tshadowObj={ shadowObj }\n\t\t\t\t\t\tonChange={ onShadowChange }\n\t\t\t\t\t/>\n\t\t\t\t</DropdownContentWrapper>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nfunction ShadowPopover( { shadowObj, onChange } ) {\n\tconst __experimentalIsRenderedInSidebar = true;\n\tconst enableAlpha = true;\n\n\tconst onShadowChange = ( key, value ) => {\n\t\tconst newShadow = {\n\t\t\t...shadowObj,\n\t\t\t[ key ]: value,\n\t\t};\n\t\tonChange( newShadow );\n\t};\n\n\treturn (\n\t\t<VStack\n\t\t\tspacing={ 4 }\n\t\t\tclassName=\"edit-site-global-styles__shadow-editor-panel\"\n\t\t>\n\t\t\t<ColorPalette\n\t\t\t\tclearable={ false }\n\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t}\n\t\t\t\tvalue={ shadowObj.color }\n\t\t\t\tonChange={ ( value ) => onShadowChange( 'color', value ) }\n\t\t\t/>\n\t\t\t<ToggleGroupControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tvalue={ shadowObj.inset ? 'inset' : 'outset' }\n\t\t\t\tisBlock\n\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\tonShadowChange( 'inset', value === 'inset' )\n\t\t\t\t}\n\t\t\t\thideLabelFromVision\n\t\t\t\t__next40pxDefaultSize\n\t\t\t>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tvalue=\"outset\"\n\t\t\t\t\tlabel={ __( 'Outset' ) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tvalue=\"inset\"\n\t\t\t\t\tlabel={ __( 'Inset' ) }\n\t\t\t\t/>\n\t\t\t</ToggleGroupControl>\n\t\t\t<Grid columns={ 2 } gap={ 4 }>\n\t\t\t\t<ShadowInputControl\n\t\t\t\t\tlabel={ __( 'X Position' ) }\n\t\t\t\t\tvalue={ shadowObj.x }\n\t\t\t\t\tonChange={ ( value ) => onShadowChange( 'x', value ) }\n\t\t\t\t/>\n\t\t\t\t<ShadowInputControl\n\t\t\t\t\tlabel={ __( 'Y Position' ) }\n\t\t\t\t\tvalue={ shadowObj.y }\n\t\t\t\t\tonChange={ ( value ) => onShadowChange( 'y', value ) }\n\t\t\t\t/>\n\t\t\t\t<ShadowInputControl\n\t\t\t\t\tlabel={ __( 'Blur' ) }\n\t\t\t\t\tvalue={ shadowObj.blur }\n\t\t\t\t\tonChange={ ( value ) => onShadowChange( 'blur', value ) }\n\t\t\t\t/>\n\t\t\t\t<ShadowInputControl\n\t\t\t\t\tlabel={ __( 'Spread' ) }\n\t\t\t\t\tvalue={ shadowObj.spread }\n\t\t\t\t\tonChange={ ( value ) => onShadowChange( 'spread', value ) }\n\t\t\t\t/>\n\t\t\t</Grid>\n\t\t</VStack>\n\t);\n}\n\nfunction ShadowInputControl( { label, value, onChange } ) {\n\tconst onValueChange = ( next ) => {\n\t\tconst isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : '0px';\n\t\tonChange( nextValue );\n\t};\n\n\treturn (\n\t\t<UnitControl\n\t\t\tlabel={ label }\n\t\t\t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O,CAAG;QACtB2F,KAAK,EAAG8B,SAAS,CAACwB,IAAM;QACxBlE,QAAQ,EAAKY,KAAK,IAAMtC,cAAc,CAAE,MAAM,EAAEsC,KAAM;MAAG,CACzD,CAAC,eACFxE,IAAA,CAAC2H,kBAAkB;QAClBnH,KAAK,EAAG3B,EAAE,CAAE,QAAS,CAAG;QACxB2F,KAAK,EAAG8B,SAAS,CAACyB,MAAQ;QAC1BnE,QAAQ,EAAKY,KAAK,IAAMtC,cAAc,CAAE,QAAQ,EAAEsC,KAAM;MAAG,CAC3D,CAAC;IAAA,CACG,CAAC;EAAA,CACA,CAAC;AAEX;AAEA,SAASmD,kBAAkBA,CAAE;EAAEnH,KAAK;EAAEgE,KAAK;EAAEZ;AAAS,CAAC,EAAG;EACzD,MAAMoE,aAAa,GAAKC,IAAI,IAAM;IACjC,MAAMC,SAAS,GAAGD,IAAI,KAAK5G,SAAS,IAAI,CAAE8G,KAAK,CAAEC,UAAU,CAAEH,IAAK,CAAE,CAAC;IACrE,MAAMI,SAAS,GAAGH,SAAS,GAAGD,IAAI,GAAG,KAAK;IAC1CrE,QAAQ,CAAEyE,SAAU,CAAC;EACtB,CAAC;EAED,oBACCrI,IAAA,CAACvC,WAAW;IACX+C,KAAK,EAAGA,KAAO;IACf6D,qBAAqB;IACrBG,KAAK,EAAGA,KAAO;IACfZ,QAAQ,EAAGoE;EAAe,CAC1B,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalSpacer","Spacer","__experimentalItemGroup","ItemGroup","__experimentalInputControl","InputControl","__experimentalUnitControl","UnitControl","__experimentalGrid","Grid","__experimentalDropdownContentWrapper","DropdownContentWrapper","useNavigator","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","__experimentalConfirmDialog","ConfirmDialog","Dropdown","Button","Flex","FlexItem","ColorPalette","Modal","privateApis","componentsPrivateApis","__","sprintf","blockEditorPrivateApis","plus","shadow","shadowIcon","reset","moreVertical","useState","useMemo","useEffect","unlock","Subtitle","ScreenHeader","defaultShadow","getShadowParts","shadowStringToObject","shadowObjectToString","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useGlobalSetting","Menu","customShadowMenuItems","label","action","presetShadowMenuItems","ShadowsEditPanel","goBack","params","category","slug","shadows","setShadows","hasCurrentShadow","some","baseShadows","undefined","selectedShadow","setSelectedShadow","find","baseSelectedShadow","b","isConfirmDialogVisible","setIsConfirmDialogVisible","isRenameModalVisible","setIsRenameModalVisible","shadowName","setShadowName","name","onShadowChange","updatedShadows","map","s","onMenuClick","handleShadowDelete","filter","handleShadowRename","newName","title","children","justify","marginTop","marginBottom","paddingX","trigger","size","icon","item","Item","onClick","disabled","ItemLabel","className","ShadowsPreview","ShadowEditor","onChange","isOpen","onConfirm","onCancel","confirmButtonText","onRequestClose","onSubmit","event","preventDefault","__next40pxDefaultSize","autoComplete","placeholder","value","expanded","variant","type","shadowStyle","boxShadow","align","style","shadowParts","onChangeShadowPart","index","part","newShadowParts","join","onAddShadowPart","onRemoveShadowPart","p","i","spacing","level","isBordered","isSeparated","ShadowItem","canRemove","length","onRemove","popoverProps","placement","offset","shift","shadowObj","newShadow","renderToggle","onToggle","toggleProps","removeButtonProps","flexGrow","inset","renderContent","paddingSize","ShadowPopover","__experimentalIsRenderedInSidebar","enableAlpha","key","clearable","color","__nextHasNoMarginBottom","isBlock","hideLabelFromVision","columns","gap","ShadowInputControl","x","y","blur","spread","onValueChange","next","isNumeric","isNaN","parseFloat","nextValue"],"sources":["@wordpress/edit-site/src/components/global-styles/shadows-edit-panel.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalInputControl as InputControl,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalGrid as Grid,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\tuseNavigator,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalConfirmDialog as ConfirmDialog,\n\tDropdown,\n\tButton,\n\tFlex,\n\tFlexItem,\n\tColorPalette,\n\tModal,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport {\n\tplus,\n\tshadow as shadowIcon,\n\treset,\n\tmoreVertical,\n} from '@wordpress/icons';\nimport { useState, useMemo, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport Subtitle from './subtitle';\nimport ScreenHeader from './header';\nimport { defaultShadow } from './shadows-panel';\nimport {\n\tgetShadowParts,\n\tshadowStringToObject,\n\tshadowObjectToString,\n} from './shadow-utils';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\nconst { Menu } = unlock( componentsPrivateApis );\n\nconst customShadowMenuItems = [\n\t{\n\t\tlabel: __( 'Rename' ),\n\t\taction: 'rename',\n\t},\n\t{\n\t\tlabel: __( 'Delete' ),\n\t\taction: 'delete',\n\t},\n];\n\nconst presetShadowMenuItems = [\n\t{\n\t\tlabel: __( 'Reset' ),\n\t\taction: 'reset',\n\t},\n];\n\nexport default function ShadowsEditPanel() {\n\tconst {\n\t\tgoBack,\n\t\tparams: { category, slug },\n\t} = useNavigator();\n\tconst [ shadows, setShadows ] = useGlobalSetting(\n\t\t`shadow.presets.${ category }`\n\t);\n\n\tuseEffect( () => {\n\t\tconst hasCurrentShadow = shadows?.some(\n\t\t\t( shadow ) => shadow.slug === slug\n\t\t);\n\t\t// If the shadow being edited doesn't exist anymore in the global styles setting, navigate back\n\t\t// to prevent the user from editing a non-existent shadow entry.\n\t\t// This can happen, for example:\n\t\t// - when the user deletes the shadow\n\t\t// - when the user resets the styles while editing a custom shadow\n\t\t//\n\t\t// The check on the slug is necessary to prevent a double back navigation when the user triggers\n\t\t// a backward navigation by interacting with the screen's UI.\n\t\tif ( !! slug && ! hasCurrentShadow ) {\n\t\t\tgoBack();\n\t\t}\n\t}, [ shadows, slug, goBack ] );\n\n\tconst [ baseShadows ] = useGlobalSetting(\n\t\t`shadow.presets.${ category }`,\n\t\tundefined,\n\t\t'base'\n\t);\n\tconst [ selectedShadow, setSelectedShadow ] = useState( () =>\n\t\t( shadows || [] ).find( ( shadow ) => shadow.slug === slug )\n\t);\n\tconst baseSelectedShadow = useMemo(\n\t\t() => ( baseShadows || [] ).find( ( b ) => b.slug === slug ),\n\t\t[ baseShadows, slug ]\n\t);\n\tconst [ isConfirmDialogVisible, setIsConfirmDialogVisible ] =\n\t\tuseState( false );\n\tconst [ isRenameModalVisible, setIsRenameModalVisible ] = useState( false );\n\tconst [ shadowName, setShadowName ] = useState( selectedShadow.name );\n\n\tif ( ! category || ! slug ) {\n\t\treturn null;\n\t}\n\n\tconst onShadowChange = ( shadow ) => {\n\t\tsetSelectedShadow( { ...selectedShadow, shadow } );\n\t\tconst updatedShadows = shadows.map( ( s ) =>\n\t\t\ts.slug === slug ? { ...selectedShadow, shadow } : s\n\t\t);\n\t\tsetShadows( updatedShadows );\n\t};\n\n\tconst onMenuClick = ( action ) => {\n\t\tif ( action === 'reset' ) {\n\t\t\tconst updatedShadows = shadows.map( ( s ) =>\n\t\t\t\ts.slug === slug ? baseSelectedShadow : s\n\t\t\t);\n\t\t\tsetSelectedShadow( baseSelectedShadow );\n\t\t\tsetShadows( updatedShadows );\n\t\t} else if ( action === 'delete' ) {\n\t\t\tsetIsConfirmDialogVisible( true );\n\t\t} else if ( action === 'rename' ) {\n\t\t\tsetIsRenameModalVisible( true );\n\t\t}\n\t};\n\n\tconst handleShadowDelete = () => {\n\t\tsetShadows( shadows.filter( ( s ) => s.slug !== slug ) );\n\t};\n\n\tconst handleShadowRename = ( newName ) => {\n\t\tif ( ! newName ) {\n\t\t\treturn;\n\t\t}\n\t\tconst updatedShadows = shadows.map( ( s ) =>\n\t\t\ts.slug === slug ? { ...selectedShadow, name: newName } : s\n\t\t);\n\t\tsetSelectedShadow( { ...selectedShadow, name: newName } );\n\t\tsetShadows( updatedShadows );\n\t};\n\n\treturn ! selectedShadow ? (\n\t\t<ScreenHeader title=\"\" />\n\t) : (\n\t\t<>\n\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t<ScreenHeader title={ selectedShadow.name } />\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Spacer marginTop={ 2 } marginBottom={ 0 } paddingX={ 4 }>\n\t\t\t\t\t\t<Menu\n\t\t\t\t\t\t\ttrigger={\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Menu' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ ( category === 'custom'\n\t\t\t\t\t\t\t\t? customShadowMenuItems\n\t\t\t\t\t\t\t\t: presetShadowMenuItems\n\t\t\t\t\t\t\t).map( ( item ) => (\n\t\t\t\t\t\t\t\t<Menu.Item\n\t\t\t\t\t\t\t\t\tkey={ item.action }\n\t\t\t\t\t\t\t\t\tonClick={ () => onMenuClick( item.action ) }\n\t\t\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t\t\titem.action === 'reset' &&\n\t\t\t\t\t\t\t\t\t\tselectedShadow.shadow ===\n\t\t\t\t\t\t\t\t\t\t\tbaseSelectedShadow.shadow\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t\t{ item.label }\n\t\t\t\t\t\t\t\t\t</Menu.ItemLabel>\n\t\t\t\t\t\t\t\t</Menu.Item>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</Menu>\n\t\t\t\t\t</Spacer>\n\t\t\t\t</FlexItem>\n\t\t\t</HStack>\n\t\t\t<div className=\"edit-site-global-styles-screen\">\n\t\t\t\t<ShadowsPreview shadow={ selectedShadow.shadow } />\n\t\t\t\t<ShadowEditor\n\t\t\t\t\tshadow={ selectedShadow.shadow }\n\t\t\t\t\tonChange={ onShadowChange }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t{ isConfirmDialogVisible && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\tisOpen\n\t\t\t\t\tonConfirm={ () => {\n\t\t\t\t\t\thandleShadowDelete();\n\t\t\t\t\t\tsetIsConfirmDialogVisible( false );\n\t\t\t\t\t} }\n\t\t\t\t\tonCancel={ () => {\n\t\t\t\t\t\tsetIsConfirmDialogVisible( false );\n\t\t\t\t\t} }\n\t\t\t\t\tconfirmButtonText={ __( 'Delete' ) }\n\t\t\t\t\tsize=\"medium\"\n\t\t\t\t>\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %s: Name of the shadow preset. */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Are you sure you want to delete \"%s\" shadow preset?'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tselectedShadow.name\n\t\t\t\t\t) }\n\t\t\t\t</ConfirmDialog>\n\t\t\t) }\n\t\t\t{ isRenameModalVisible && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Rename' ) }\n\t\t\t\t\tonRequestClose={ () => setIsRenameModalVisible( false ) }\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\thandleShadowRename( shadowName );\n\t\t\t\t\t\t\tsetIsRenameModalVisible( false );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\tplaceholder={ __( 'Shadow name' ) }\n\t\t\t\t\t\t\tvalue={ shadowName }\n\t\t\t\t\t\t\tonChange={ ( value ) => setShadowName( value ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Spacer marginBottom={ 6 } />\n\t\t\t\t\t\t<Flex\n\t\t\t\t\t\t\tclassName=\"block-editor-shadow-edit-modal__actions\"\n\t\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\tsetIsRenameModalVisible( false )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t</Flex>\n\t\t\t\t\t</form>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction ShadowsPreview( { shadow } ) {\n\tconst shadowStyle = {\n\t\tboxShadow: shadow,\n\t};\n\n\treturn (\n\t\t<Spacer marginBottom={ 4 } marginTop={ -2 }>\n\t\t\t<HStack\n\t\t\t\talign=\"center\"\n\t\t\t\tjustify=\"center\"\n\t\t\t\tclassName=\"edit-site-global-styles__shadow-preview-panel\"\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"edit-site-global-styles__shadow-preview-block\"\n\t\t\t\t\tstyle={ shadowStyle }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t</Spacer>\n\t);\n}\n\nfunction ShadowEditor( { shadow, onChange } ) {\n\tconst shadowParts = useMemo( () => getShadowParts( shadow ), [ shadow ] );\n\n\tconst onChangeShadowPart = ( index, part ) => {\n\t\tconst newShadowParts = [ ...shadowParts ];\n\t\tnewShadowParts[ index ] = part;\n\t\tonChange( newShadowParts.join( ', ' ) );\n\t};\n\n\tconst onAddShadowPart = () => {\n\t\tonChange( [ ...shadowParts, defaultShadow ].join( ', ' ) );\n\t};\n\n\tconst onRemoveShadowPart = ( index ) => {\n\t\tonChange( shadowParts.filter( ( p, i ) => i !== index ).join( ', ' ) );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<VStack spacing={ 2 }>\n\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t<Flex\n\t\t\t\t\t\talign=\"center\"\n\t\t\t\t\t\tclassName=\"edit-site-global-styles__shadows-panel__title\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Subtitle level={ 3 }>{ __( 'Shadows' ) }</Subtitle>\n\t\t\t\t\t</Flex>\n\t\t\t\t\t<FlexItem className=\"edit-site-global-styles__shadows-panel__options-container\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\t\tlabel={ __( 'Add shadow' ) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonAddShadowPart();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t\t<Spacer />\n\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t{ shadowParts.map( ( part, index ) => (\n\t\t\t\t\t<ShadowItem\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tshadow={ part }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tonChangeShadowPart( index, value )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcanRemove={ shadowParts.length > 1 }\n\t\t\t\t\t\tonRemove={ () => onRemoveShadowPart( index ) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</ItemGroup>\n\t\t</>\n\t);\n}\n\nfunction ShadowItem( { shadow, onChange, canRemove, onRemove } ) {\n\tconst popoverProps = {\n\t\tplacement: 'left-start',\n\t\toffset: 36,\n\t\tshift: true,\n\t};\n\tconst shadowObj = useMemo(\n\t\t() => shadowStringToObject( shadow ),\n\t\t[ shadow ]\n\t);\n\tconst onShadowChange = ( newShadow ) => {\n\t\tonChange( shadowObjectToString( newShadow ) );\n\t};\n\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ popoverProps }\n\t\t\tclassName=\"edit-site-global-styles__shadow-editor__dropdown\"\n\t\t\trenderToggle={ ( { onToggle, isOpen } ) => {\n\t\t\t\tconst toggleProps = {\n\t\t\t\t\tonClick: onToggle,\n\t\t\t\t\tclassName: clsx(\n\t\t\t\t\t\t'edit-site-global-styles__shadow-editor__dropdown-toggle',\n\t\t\t\t\t\t{ 'is-open': isOpen }\n\t\t\t\t\t),\n\t\t\t\t\t'aria-expanded': isOpen,\n\t\t\t\t};\n\t\t\t\tconst removeButtonProps = {\n\t\t\t\t\tonClick: onRemove,\n\t\t\t\t\tclassName: clsx(\n\t\t\t\t\t\t'edit-site-global-styles__shadow-editor__remove-button',\n\t\t\t\t\t\t{ 'is-open': isOpen }\n\t\t\t\t\t),\n\t\t\t\t\tlabel: __( 'Remove shadow' ),\n\t\t\t\t};\n\n\t\t\t\treturn (\n\t\t\t\t\t<HStack align=\"center\" justify=\"flex-start\" spacing={ 0 }>\n\t\t\t\t\t\t<FlexItem style={ { flexGrow: 1 } }>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\ticon={ shadowIcon }\n\t\t\t\t\t\t\t\t{ ...toggleProps }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ shadowObj.inset\n\t\t\t\t\t\t\t\t\t? __( 'Inner shadow' )\n\t\t\t\t\t\t\t\t\t: __( 'Drop shadow' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t{ canRemove && (\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\ticon={ reset }\n\t\t\t\t\t\t\t\t\t{ ...removeButtonProps }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HStack>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trenderContent={ () => (\n\t\t\t\t<DropdownContentWrapper\n\t\t\t\t\tpaddingSize=\"medium\"\n\t\t\t\t\tclassName=\"edit-site-global-styles__shadow-editor__dropdown-content\"\n\t\t\t\t>\n\t\t\t\t\t<ShadowPopover\n\t\t\t\t\t\tshadowObj={ shadowObj }\n\t\t\t\t\t\tonChange={ onShadowChange }\n\t\t\t\t\t/>\n\t\t\t\t</DropdownContentWrapper>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nfunction ShadowPopover( { shadowObj, onChange } ) {\n\tconst __experimentalIsRenderedInSidebar = true;\n\tconst enableAlpha = true;\n\n\tconst onShadowChange = ( key, value ) => {\n\t\tconst newShadow = {\n\t\t\t...shadowObj,\n\t\t\t[ key ]: value,\n\t\t};\n\t\tonChange( newShadow );\n\t};\n\n\treturn (\n\t\t<VStack\n\t\t\tspacing={ 4 }\n\t\t\tclassName=\"edit-site-global-styles__shadow-editor-panel\"\n\t\t>\n\t\t\t<ColorPalette\n\t\t\t\tclearable={ false }\n\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t}\n\t\t\t\tvalue={ shadowObj.color }\n\t\t\t\tonChange={ ( value ) => onShadowChange( 'color', value ) }\n\t\t\t/>\n\t\t\t<ToggleGroupControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tvalue={ shadowObj.inset ? 'inset' : 'outset' }\n\t\t\t\tisBlock\n\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\tonShadowChange( 'inset', value === 'inset' )\n\t\t\t\t}\n\t\t\t\thideLabelFromVision\n\t\t\t\t__next40pxDefaultSize\n\t\t\t>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tvalue=\"outset\"\n\t\t\t\t\tlabel={ __( 'Outset' ) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tvalue=\"inset\"\n\t\t\t\t\tlabel={ __( 'Inset' ) }\n\t\t\t\t/>\n\t\t\t</ToggleGroupControl>\n\t\t\t<Grid columns={ 2 } gap={ 4 }>\n\t\t\t\t<ShadowInputControl\n\t\t\t\t\tlabel={ __( 'X Position' ) }\n\t\t\t\t\tvalue={ shadowObj.x }\n\t\t\t\t\tonChange={ ( value ) => onShadowChange( 'x', value ) }\n\t\t\t\t/>\n\t\t\t\t<ShadowInputControl\n\t\t\t\t\tlabel={ __( 'Y Position' ) }\n\t\t\t\t\tvalue={ shadowObj.y }\n\t\t\t\t\tonChange={ ( value ) => onShadowChange( 'y', value ) }\n\t\t\t\t/>\n\t\t\t\t<ShadowInputControl\n\t\t\t\t\tlabel={ __( 'Blur' ) }\n\t\t\t\t\tvalue={ shadowObj.blur }\n\t\t\t\t\tonChange={ ( value ) => onShadowChange( 'blur', value ) }\n\t\t\t\t/>\n\t\t\t\t<ShadowInputControl\n\t\t\t\t\tlabel={ __( 'Spread' ) }\n\t\t\t\t\tvalue={ shadowObj.spread }\n\t\t\t\t\tonChange={ ( value ) => onShadowChange( 'spread', value ) }\n\t\t\t\t/>\n\t\t\t</Grid>\n\t\t</VStack>\n\t);\n}\n\nfunction ShadowInputControl( { label, value, onChange } ) {\n\tconst onValueChange = ( next ) => {\n\t\tconst isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : '0px';\n\t\tonChange( nextValue );\n\t};\n\n\treturn (\n\t\t<UnitControl\n\t\t\tlabel={ label }\n\t\t\t__next40pxDefaultSize\n\t\t\tvalue={ value }\n\t\t\tonChange={ onValueChange }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,uBAAuB,IAAIC,SAAS,EACpCC,0BAA0B,IAAIC,YAAY,EAC1CC,yBAAyB,IAAIC,WAAW,EACxCC,kBAAkB,IAAIC,IAAI,EAC1BC,oCAAoC,IAAIC,sBAAsB,EAC9DC,YAAY,EACZC,gCAAgC,IAAIC,kBAAkB,EACtDC,sCAAsC,IAAIC,wBAAwB,EAClEC,2BAA2B,IAAIC,aAAa,EAC5CC,QAAQ,EACRC,MAAM,EACNC,IAAI,EACJC,QAAQ,EACRC,YAAY,EACZC,KAAK,EACLC,WAAW,IAAIC,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASH,WAAW,IAAII,sBAAsB,QAAQ,yBAAyB;AAC/E,SACCC,IAAI,EACJC,MAAM,IAAIC,UAAU,EACpBC,KAAK,EACLC,YA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KAAK,EAAGA,KAAO;IACf6D,qBAAqB;IACrBG,KAAK,EAAGA,KAAO;IACfZ,QAAQ,EAAGoE;EAAe,CAC1B,CAAC;AAEJ","ignoreList":[]}
@@ -10,6 +10,7 @@ import { store as preferencesStore } from '@wordpress/preferences';
10
10
  import { moreVertical } from '@wordpress/icons';
11
11
  import { store as coreStore } from '@wordpress/core-data';
12
12
  import { useEffect } from '@wordpress/element';
13
+ import { usePrevious } from '@wordpress/compose';
13
14
 
14
15
  /**
15
16
  * Internal dependencies
@@ -163,6 +164,11 @@ function GlobalStylesStyleBook() {
163
164
  navigator.goTo('/colors/palette');
164
165
  return;
165
166
  }
167
+ if (blockName === 'typography') {
168
+ // Go to typography Global Styles.
169
+ navigator.goTo('/typography');
170
+ return;
171
+ }
166
172
 
167
173
  // Now go to the selected block.
168
174
  navigator.goTo('/blocks/' + encodeURIComponent(blockName));
@@ -251,13 +257,47 @@ function GlobalStylesEditorCanvasContainerLink() {
251
257
  }
252
258
  }, [editorCanvasContainerView, isRevisionsOpen, goTo]);
253
259
  }
254
- function GlobalStylesUI() {
260
+ function useNavigatorSync(parentPath, onPathChange) {
261
+ const navigator = useNavigator();
262
+ const {
263
+ path: childPath
264
+ } = navigator.location;
265
+ const previousParentPath = usePrevious(parentPath);
266
+ const previousChildPath = usePrevious(childPath);
267
+ useEffect(() => {
268
+ if (parentPath !== childPath) {
269
+ if (parentPath !== previousParentPath) {
270
+ navigator.goTo(parentPath);
271
+ } else if (childPath !== previousChildPath) {
272
+ onPathChange(childPath);
273
+ }
274
+ }
275
+ }, [onPathChange, parentPath, previousChildPath, previousParentPath, childPath, navigator]);
276
+ }
277
+
278
+ // This component is used to wrap the hook in order to conditionally execute it
279
+ // when the parent component is used on controlled mode.
280
+ function NavigationSync({
281
+ path: parentPath,
282
+ onPathChange,
283
+ children
284
+ }) {
285
+ useNavigatorSync(parentPath, onPathChange);
286
+ return children;
287
+ }
288
+ function GlobalStylesUI({
289
+ path,
290
+ onPathChange
291
+ }) {
255
292
  const blocks = getBlockTypes();
256
293
  const editorCanvasContainerView = useSelect(select => unlock(select(editSiteStore)).getEditorCanvasContainerView(), []);
257
294
  return /*#__PURE__*/_jsxs(Navigator, {
258
295
  className: "edit-site-global-styles-sidebar__navigator-provider",
259
296
  initialPath: "/",
260
- children: [/*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
297
+ children: [path && onPathChange && /*#__PURE__*/_jsx(NavigationSync, {
298
+ path: path,
299
+ onPathChange: onPathChange
300
+ }), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
261
301
  path: "/",
262
302
  children: /*#__PURE__*/_jsx(ScreenRoot, {})
263
303
  }), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {