@wordpress/edit-site 3.0.26 → 3.1.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 (274) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/LICENSE.md +1 -1
  3. package/build/components/block-editor/resizable-editor.js +1 -0
  4. package/build/components/block-editor/resizable-editor.js.map +1 -1
  5. package/build/components/code-editor/code-editor-text-area.js +95 -0
  6. package/build/components/code-editor/code-editor-text-area.js.map +1 -0
  7. package/build/components/code-editor/index.js +79 -0
  8. package/build/components/code-editor/index.js.map +1 -0
  9. package/build/components/editor/index.js +10 -5
  10. package/build/components/editor/index.js.map +1 -1
  11. package/build/components/global-styles/border-panel.js +81 -22
  12. package/build/components/global-styles/border-panel.js.map +1 -1
  13. package/build/components/global-styles/context-menu.js +4 -6
  14. package/build/components/global-styles/context-menu.js.map +1 -1
  15. package/build/components/global-styles/global-styles-provider.js +1 -0
  16. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  17. package/build/components/global-styles/header.js +2 -7
  18. package/build/components/global-styles/header.js.map +1 -1
  19. package/build/components/global-styles/navigation-button.js +27 -12
  20. package/build/components/global-styles/navigation-button.js.map +1 -1
  21. package/build/components/global-styles/palette.js +2 -2
  22. package/build/components/global-styles/palette.js.map +1 -1
  23. package/build/components/global-styles/preview.js +46 -15
  24. package/build/components/global-styles/preview.js.map +1 -1
  25. package/build/components/global-styles/screen-background-color.js +9 -12
  26. package/build/components/global-styles/screen-background-color.js.map +1 -1
  27. package/build/components/global-styles/screen-block-list.js +2 -3
  28. package/build/components/global-styles/screen-block-list.js.map +1 -1
  29. package/build/components/global-styles/screen-block.js +0 -1
  30. package/build/components/global-styles/screen-block.js.map +1 -1
  31. package/build/components/global-styles/screen-color-palette.js +0 -2
  32. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  33. package/build/components/global-styles/screen-colors.js +5 -6
  34. package/build/components/global-styles/screen-colors.js.map +1 -1
  35. package/build/components/global-styles/screen-layout.js +0 -2
  36. package/build/components/global-styles/screen-layout.js.map +1 -1
  37. package/build/components/global-styles/screen-link-color.js +6 -12
  38. package/build/components/global-styles/screen-link-color.js.map +1 -1
  39. package/build/components/global-styles/screen-root.js +22 -3
  40. package/build/components/global-styles/screen-root.js.map +1 -1
  41. package/build/components/global-styles/screen-style-variations.js +138 -0
  42. package/build/components/global-styles/screen-style-variations.js.map +1 -0
  43. package/build/components/global-styles/screen-text-color.js +6 -12
  44. package/build/components/global-styles/screen-text-color.js.map +1 -1
  45. package/build/components/global-styles/screen-typography-element.js +0 -2
  46. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  47. package/build/components/global-styles/screen-typography.js +2 -3
  48. package/build/components/global-styles/screen-typography.js.map +1 -1
  49. package/build/components/global-styles/ui.js +31 -14
  50. package/build/components/global-styles/ui.js.map +1 -1
  51. package/build/components/header/index.js +12 -4
  52. package/build/components/header/index.js.map +1 -1
  53. package/build/components/header/mode-switcher/index.js +78 -0
  54. package/build/components/header/mode-switcher/index.js.map +1 -0
  55. package/build/components/header/more-menu/copy-content-menu-item.js +74 -0
  56. package/build/components/header/more-menu/copy-content-menu-item.js.map +1 -0
  57. package/build/components/header/more-menu/index.js +72 -39
  58. package/build/components/header/more-menu/index.js.map +1 -1
  59. package/build/{plugins → components/header/more-menu}/site-export.js +0 -0
  60. package/build/components/header/more-menu/site-export.js.map +1 -0
  61. package/build/{plugins → components/header/more-menu}/welcome-guide-menu-item.js +1 -1
  62. package/build/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
  63. package/build/components/header/tools-more-menu-group/index.js +1 -5
  64. package/build/components/header/tools-more-menu-group/index.js.map +1 -1
  65. package/build/components/keyboard-shortcut-help-modal/config.js +45 -0
  66. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  67. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +56 -0
  68. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  69. package/build/components/keyboard-shortcut-help-modal/index.js +137 -0
  70. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  71. package/build/components/keyboard-shortcut-help-modal/shortcut.js +65 -0
  72. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  73. package/build/components/keyboard-shortcuts/index.js +26 -1
  74. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  75. package/build/components/list/actions/index.js +5 -4
  76. package/build/components/list/actions/index.js.map +1 -1
  77. package/build/components/list/actions/rename-menu-item.js +3 -3
  78. package/build/components/list/actions/rename-menu-item.js.map +1 -1
  79. package/build/components/list/added-by.js +51 -50
  80. package/build/components/list/added-by.js.map +1 -1
  81. package/build/components/routes/redirect-to-homepage.js +87 -0
  82. package/build/components/routes/redirect-to-homepage.js.map +1 -0
  83. package/build/components/secondary-sidebar/inserter-sidebar.js +13 -3
  84. package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  85. package/build/components/secondary-sidebar/list-view-sidebar.js +7 -5
  86. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  87. package/build/components/sidebar/default-sidebar.js +4 -2
  88. package/build/components/sidebar/default-sidebar.js.map +1 -1
  89. package/build/components/sidebar/global-styles-sidebar.js +1 -0
  90. package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
  91. package/build/components/url-query-controller/index.js +1 -38
  92. package/build/components/url-query-controller/index.js.map +1 -1
  93. package/build/index.js +9 -4
  94. package/build/index.js.map +1 -1
  95. package/build/store/actions.js +26 -25
  96. package/build/store/actions.js.map +1 -1
  97. package/build/store/defaults.js +2 -1
  98. package/build/store/defaults.js.map +1 -1
  99. package/build/store/reducer.js +11 -0
  100. package/build/store/reducer.js.map +1 -1
  101. package/build/store/selectors.js +13 -0
  102. package/build/store/selectors.js.map +1 -1
  103. package/build-module/components/block-editor/resizable-editor.js +1 -0
  104. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  105. package/build-module/components/code-editor/code-editor-text-area.js +83 -0
  106. package/build-module/components/code-editor/code-editor-text-area.js.map +1 -0
  107. package/build-module/components/code-editor/index.js +62 -0
  108. package/build-module/components/code-editor/index.js.map +1 -0
  109. package/build-module/components/editor/index.js +9 -5
  110. package/build-module/components/editor/index.js.map +1 -1
  111. package/build-module/components/global-styles/border-panel.js +82 -23
  112. package/build-module/components/global-styles/border-panel.js.map +1 -1
  113. package/build-module/components/global-styles/context-menu.js +1 -1
  114. package/build-module/components/global-styles/context-menu.js.map +1 -1
  115. package/build-module/components/global-styles/global-styles-provider.js +1 -1
  116. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  117. package/build-module/components/global-styles/header.js +2 -5
  118. package/build-module/components/global-styles/header.js.map +1 -1
  119. package/build-module/components/global-styles/navigation-button.js +27 -10
  120. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  121. package/build-module/components/global-styles/palette.js +1 -1
  122. package/build-module/components/global-styles/palette.js.map +1 -1
  123. package/build-module/components/global-styles/preview.js +45 -15
  124. package/build-module/components/global-styles/preview.js.map +1 -1
  125. package/build-module/components/global-styles/screen-background-color.js +9 -13
  126. package/build-module/components/global-styles/screen-background-color.js.map +1 -1
  127. package/build-module/components/global-styles/screen-block-list.js +1 -2
  128. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  129. package/build-module/components/global-styles/screen-block.js +0 -1
  130. package/build-module/components/global-styles/screen-block.js.map +1 -1
  131. package/build-module/components/global-styles/screen-color-palette.js +0 -2
  132. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  133. package/build-module/components/global-styles/screen-colors.js +2 -3
  134. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  135. package/build-module/components/global-styles/screen-layout.js +0 -2
  136. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  137. package/build-module/components/global-styles/screen-link-color.js +7 -13
  138. package/build-module/components/global-styles/screen-link-color.js.map +1 -1
  139. package/build-module/components/global-styles/screen-root.js +21 -4
  140. package/build-module/components/global-styles/screen-root.js.map +1 -1
  141. package/build-module/components/global-styles/screen-style-variations.js +119 -0
  142. package/build-module/components/global-styles/screen-style-variations.js.map +1 -0
  143. package/build-module/components/global-styles/screen-text-color.js +7 -13
  144. package/build-module/components/global-styles/screen-text-color.js.map +1 -1
  145. package/build-module/components/global-styles/screen-typography-element.js +0 -2
  146. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  147. package/build-module/components/global-styles/screen-typography.js +1 -2
  148. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  149. package/build-module/components/global-styles/ui.js +29 -14
  150. package/build-module/components/global-styles/ui.js.map +1 -1
  151. package/build-module/components/header/index.js +13 -5
  152. package/build-module/components/header/index.js.map +1 -1
  153. package/build-module/components/header/mode-switcher/index.js +65 -0
  154. package/build-module/components/header/mode-switcher/index.js.map +1 -0
  155. package/build-module/components/header/more-menu/copy-content-menu-item.js +59 -0
  156. package/build-module/components/header/more-menu/copy-content-menu-item.js.map +1 -0
  157. package/build-module/components/header/more-menu/index.js +67 -40
  158. package/build-module/components/header/more-menu/index.js.map +1 -1
  159. package/build-module/{plugins → components/header/more-menu}/site-export.js +0 -0
  160. package/build-module/components/header/more-menu/site-export.js.map +1 -0
  161. package/build-module/{plugins → components/header/more-menu}/welcome-guide-menu-item.js +1 -1
  162. package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
  163. package/build-module/components/header/tools-more-menu-group/index.js +2 -5
  164. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  165. package/build-module/components/keyboard-shortcut-help-modal/config.js +36 -0
  166. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  167. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +44 -0
  168. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  169. package/build-module/components/keyboard-shortcut-help-modal/index.js +120 -0
  170. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  171. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +58 -0
  172. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  173. package/build-module/components/keyboard-shortcuts/index.js +26 -1
  174. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  175. package/build-module/components/list/actions/index.js +5 -4
  176. package/build-module/components/list/actions/index.js.map +1 -1
  177. package/build-module/components/list/actions/rename-menu-item.js +3 -3
  178. package/build-module/components/list/actions/rename-menu-item.js.map +1 -1
  179. package/build-module/components/list/added-by.js +52 -51
  180. package/build-module/components/list/added-by.js.map +1 -1
  181. package/build-module/components/routes/redirect-to-homepage.js +75 -0
  182. package/build-module/components/routes/redirect-to-homepage.js.map +1 -0
  183. package/build-module/components/secondary-sidebar/inserter-sidebar.js +14 -4
  184. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  185. package/build-module/components/secondary-sidebar/list-view-sidebar.js +7 -5
  186. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  187. package/build-module/components/sidebar/default-sidebar.js +4 -2
  188. package/build-module/components/sidebar/default-sidebar.js.map +1 -1
  189. package/build-module/components/sidebar/global-styles-sidebar.js +1 -0
  190. package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
  191. package/build-module/components/url-query-controller/index.js +3 -40
  192. package/build-module/components/url-query-controller/index.js.map +1 -1
  193. package/build-module/index.js +8 -3
  194. package/build-module/index.js.map +1 -1
  195. package/build-module/store/actions.js +22 -23
  196. package/build-module/store/actions.js.map +1 -1
  197. package/build-module/store/defaults.js +2 -1
  198. package/build-module/store/defaults.js.map +1 -1
  199. package/build-module/store/reducer.js +11 -0
  200. package/build-module/store/reducer.js.map +1 -1
  201. package/build-module/store/selectors.js +11 -0
  202. package/build-module/store/selectors.js.map +1 -1
  203. package/build-style/style-rtl.css +199 -68
  204. package/build-style/style.css +199 -68
  205. package/package.json +29 -28
  206. package/src/components/block-editor/resizable-editor.js +1 -0
  207. package/src/components/block-editor/style.scss +10 -18
  208. package/src/components/code-editor/code-editor-text-area.js +79 -0
  209. package/src/components/code-editor/index.js +65 -0
  210. package/src/components/code-editor/style.scss +100 -0
  211. package/src/components/editor/index.js +16 -7
  212. package/src/components/global-styles/border-panel.js +106 -42
  213. package/src/components/global-styles/context-menu.js +1 -1
  214. package/src/components/global-styles/global-styles-provider.js +1 -2
  215. package/src/components/global-styles/header.js +3 -5
  216. package/src/components/global-styles/navigation-button.js +14 -10
  217. package/src/components/global-styles/palette.js +1 -1
  218. package/src/components/global-styles/preview.js +46 -18
  219. package/src/components/global-styles/screen-background-color.js +7 -12
  220. package/src/components/global-styles/screen-block-list.js +1 -2
  221. package/src/components/global-styles/screen-block.js +1 -1
  222. package/src/components/global-styles/screen-color-palette.js +0 -2
  223. package/src/components/global-styles/screen-colors.js +2 -3
  224. package/src/components/global-styles/screen-layout.js +1 -5
  225. package/src/components/global-styles/screen-link-color.js +6 -16
  226. package/src/components/global-styles/screen-root.js +32 -3
  227. package/src/components/global-styles/screen-style-variations.js +130 -0
  228. package/src/components/global-styles/screen-text-color.js +6 -16
  229. package/src/components/global-styles/screen-typography-element.js +0 -4
  230. package/src/components/global-styles/screen-typography.js +2 -3
  231. package/src/components/global-styles/style.scss +24 -25
  232. package/src/components/global-styles/ui.js +55 -25
  233. package/src/components/header/document-actions/style.scss +1 -9
  234. package/src/components/header/index.js +10 -2
  235. package/src/components/header/mode-switcher/index.js +67 -0
  236. package/src/components/header/more-menu/copy-content-menu-item.js +53 -0
  237. package/src/components/header/more-menu/index.js +107 -44
  238. package/src/{plugins → components/header/more-menu}/site-export.js +0 -0
  239. package/src/{plugins → components/header/more-menu}/welcome-guide-menu-item.js +1 -1
  240. package/src/components/header/style.scss +2 -1
  241. package/src/components/header/tools-more-menu-group/index.js +2 -7
  242. package/src/components/keyboard-shortcut-help-modal/config.js +27 -0
  243. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +41 -0
  244. package/src/components/keyboard-shortcut-help-modal/index.js +135 -0
  245. package/src/components/keyboard-shortcut-help-modal/shortcut.js +73 -0
  246. package/src/components/keyboard-shortcut-help-modal/style.scss +66 -0
  247. package/src/components/keyboard-shortcuts/index.js +27 -1
  248. package/src/components/list/actions/index.js +5 -4
  249. package/src/components/list/actions/rename-menu-item.js +3 -3
  250. package/src/components/list/added-by.js +57 -63
  251. package/src/components/routes/redirect-to-homepage.js +71 -0
  252. package/src/components/secondary-sidebar/inserter-sidebar.js +14 -3
  253. package/src/components/secondary-sidebar/list-view-sidebar.js +12 -5
  254. package/src/components/secondary-sidebar/style.scss +0 -4
  255. package/src/components/sidebar/default-sidebar.js +2 -0
  256. package/src/components/sidebar/global-styles-sidebar.js +1 -0
  257. package/src/components/sidebar/style.scss +21 -14
  258. package/src/components/url-query-controller/index.js +3 -35
  259. package/src/index.js +9 -2
  260. package/src/store/actions.js +22 -35
  261. package/src/store/defaults.js +1 -0
  262. package/src/store/reducer.js +6 -0
  263. package/src/store/selectors.js +11 -0
  264. package/src/store/test/actions.js +2 -92
  265. package/src/style.scss +2 -0
  266. package/build/plugins/index.js +0 -28
  267. package/build/plugins/index.js.map +0 -1
  268. package/build/plugins/site-export.js.map +0 -1
  269. package/build/plugins/welcome-guide-menu-item.js.map +0 -1
  270. package/build-module/plugins/index.js +0 -20
  271. package/build-module/plugins/index.js.map +0 -1
  272. package/build-module/plugins/site-export.js.map +0 -1
  273. package/build-module/plugins/welcome-guide-menu-item.js.map +0 -1
  274. package/src/plugins/index.js +0 -24
@@ -11,7 +11,7 @@ import { useMemo } from '@wordpress/element';
11
11
  */
12
12
 
13
13
  import Subtitle from './subtitle';
14
- import NavigationButton from './navigation-button';
14
+ import { NavigationButton } from './navigation-button';
15
15
  import { useSetting } from './hooks';
16
16
  const EMPTY_COLORS = [];
17
17
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/palette.js"],"names":["__experimentalItemGroup","ItemGroup","FlexItem","__experimentalHStack","HStack","__experimentalZStack","ZStack","__experimentalVStack","VStack","FlexBlock","ColorIndicator","__","_n","sprintf","useMemo","Subtitle","NavigationButton","useSetting","EMPTY_COLORS","Palette","name","customColors","themeColors","defaultColors","defaultPaletteEnabled","colors","screenPath","paletteButtonText","length","slice","map","color"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAD5B,EAECC,QAFD,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,oBAAoB,IAAIC,MAJzB,EAKCC,oBAAoB,IAAIC,MALzB,EAMCC,SAND,EAOCC,cAPD,QAQO,uBARP;AASA,SAASC,EAAT,EAAaC,EAAb,EAAiBC,OAAjB,QAAgC,iBAAhC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AAEA;AACA;AACA;;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,gBAAP,MAA6B,qBAA7B;AACA,SAASC,UAAT,QAA2B,SAA3B;AAEA,MAAMC,YAAY,GAAG,EAArB;;AAEA,SAASC,OAAT,OAA6B;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AAC5B,QAAM,CAAEC,YAAF,IAAmBJ,UAAU,CAAE,sBAAF,CAAnC;AACA,QAAM,CAAEK,WAAF,IAAkBL,UAAU,CAAE,qBAAF,CAAlC;AACA,QAAM,CAAEM,aAAF,IAAoBN,UAAU,CAAE,uBAAF,CAApC;AAEA,QAAM,CAAEO,qBAAF,IAA4BP,UAAU,CAC3C,sBAD2C,EAE3CG,IAF2C,CAA5C;AAIA,QAAMK,MAAM,GAAGX,OAAO,CACrB,MAAM,CACL,IAAKO,YAAY,IAAIH,YAArB,CADK,EAEL,IAAKI,WAAW,IAAIJ,YAApB,CAFK,EAGL,IAAKK,aAAa,IAAIC,qBAAjB,GACFD,aADE,GAEFL,YAFH,CAHK,CADe,EAQrB,CAAEG,YAAF,EAAgBC,WAAhB,EAA6BC,aAA7B,EAA4CC,qBAA5C,CARqB,CAAtB;AAWA,QAAME,UAAU,GAAG,CAAEN,IAAF,GAChB,iBADgB,GAEhB,aAAaA,IAAb,GAAoB,iBAFvB;AAGA,QAAMO,iBAAiB,GACtBF,MAAM,CAACG,MAAP,GAAgB,CAAhB,GACGf,OAAO,EACP;AACAD,EAAAA,EAAE,CAAE,UAAF,EAAc,WAAd,EAA2Ba,MAAM,CAACG,MAAlC,CAFK,EAGPH,MAAM,CAACG,MAHA,CADV,GAMGjB,EAAE,CAAE,mBAAF,CAPN;AASA,SACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,QAAD,QAAYA,EAAE,CAAE,SAAF,CAAd,CADD,EAEC,cAAC,SAAD;AAAW,IAAA,UAAU,MAArB;AAAsB,IAAA,WAAW;AAAjC,KACC,cAAC,gBAAD;AAAkB,IAAA,IAAI,EAAGe;AAAzB,KACC,cAAC,MAAD;AAAQ,IAAA,UAAU,EAAGD,MAAM,CAACG,MAAP,KAAkB;AAAvC,KACC,cAAC,SAAD,QACC,cAAC,MAAD;AAAQ,IAAA,SAAS,EAAG,KAApB;AAA4B,IAAA,MAAM,EAAG,CAAC;AAAtC,KACGH,MAAM,CAACI,KAAP,CAAc,CAAd,EAAiB,CAAjB,EAAqBC,GAArB,CAA0B;AAAA,QAAE;AAAEC,MAAAA;AAAF,KAAF;AAAA,WAC3B,cAAC,cAAD;AACC,MAAA,GAAG,EAAGA,KADP;AAEC,MAAA,UAAU,EAAGA;AAFd,MAD2B;AAAA,GAA1B,CADH,CADD,CADD,EAWC,cAAC,QAAD,QAAYJ,iBAAZ,CAXD,CADD,CADD,CAFD,CADD;AAsBA;;AAED,eAAeR,OAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tFlexItem,\n\t__experimentalHStack as HStack,\n\t__experimentalZStack as ZStack,\n\t__experimentalVStack as VStack,\n\tFlexBlock,\n\tColorIndicator,\n} from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Subtitle from './subtitle';\nimport NavigationButton from './navigation-button';\nimport { useSetting } from './hooks';\n\nconst EMPTY_COLORS = [];\n\nfunction Palette( { name } ) {\n\tconst [ customColors ] = useSetting( 'color.palette.custom' );\n\tconst [ themeColors ] = useSetting( 'color.palette.theme' );\n\tconst [ defaultColors ] = useSetting( 'color.palette.default' );\n\n\tconst [ defaultPaletteEnabled ] = useSetting(\n\t\t'color.defaultPalette',\n\t\tname\n\t);\n\tconst colors = useMemo(\n\t\t() => [\n\t\t\t...( customColors || EMPTY_COLORS ),\n\t\t\t...( themeColors || EMPTY_COLORS ),\n\t\t\t...( defaultColors && defaultPaletteEnabled\n\t\t\t\t? defaultColors\n\t\t\t\t: EMPTY_COLORS ),\n\t\t],\n\t\t[ customColors, themeColors, defaultColors, defaultPaletteEnabled ]\n\t);\n\n\tconst screenPath = ! name\n\t\t? '/colors/palette'\n\t\t: '/blocks/' + name + '/colors/palette';\n\tconst paletteButtonText =\n\t\tcolors.length > 0\n\t\t\t? sprintf(\n\t\t\t\t\t// Translators: %d: Number of palette colors.\n\t\t\t\t\t_n( '%d color', '%d colors', colors.length ),\n\t\t\t\t\tcolors.length\n\t\t\t )\n\t\t\t: __( 'Add custom colors' );\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<Subtitle>{ __( 'Palette' ) }</Subtitle>\n\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t<NavigationButton path={ screenPath }>\n\t\t\t\t\t<HStack isReversed={ colors.length === 0 }>\n\t\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t\t<ZStack isLayered={ false } offset={ -8 }>\n\t\t\t\t\t\t\t\t{ colors.slice( 0, 5 ).map( ( { color } ) => (\n\t\t\t\t\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\t\t\t\t\tkey={ color }\n\t\t\t\t\t\t\t\t\t\tcolorValue={ color }\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</ZStack>\n\t\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t\t<FlexItem>{ paletteButtonText }</FlexItem>\n\t\t\t\t\t</HStack>\n\t\t\t\t</NavigationButton>\n\t\t\t</ItemGroup>\n\t\t</VStack>\n\t);\n}\n\nexport default Palette;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/palette.js"],"names":["__experimentalItemGroup","ItemGroup","FlexItem","__experimentalHStack","HStack","__experimentalZStack","ZStack","__experimentalVStack","VStack","FlexBlock","ColorIndicator","__","_n","sprintf","useMemo","Subtitle","NavigationButton","useSetting","EMPTY_COLORS","Palette","name","customColors","themeColors","defaultColors","defaultPaletteEnabled","colors","screenPath","paletteButtonText","length","slice","map","color"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAD5B,EAECC,QAFD,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,oBAAoB,IAAIC,MAJzB,EAKCC,oBAAoB,IAAIC,MALzB,EAMCC,SAND,EAOCC,cAPD,QAQO,uBARP;AASA,SAASC,EAAT,EAAaC,EAAb,EAAiBC,OAAjB,QAAgC,iBAAhC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AAEA;AACA;AACA;;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,SAASC,gBAAT,QAAiC,qBAAjC;AACA,SAASC,UAAT,QAA2B,SAA3B;AAEA,MAAMC,YAAY,GAAG,EAArB;;AAEA,SAASC,OAAT,OAA6B;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AAC5B,QAAM,CAAEC,YAAF,IAAmBJ,UAAU,CAAE,sBAAF,CAAnC;AACA,QAAM,CAAEK,WAAF,IAAkBL,UAAU,CAAE,qBAAF,CAAlC;AACA,QAAM,CAAEM,aAAF,IAAoBN,UAAU,CAAE,uBAAF,CAApC;AAEA,QAAM,CAAEO,qBAAF,IAA4BP,UAAU,CAC3C,sBAD2C,EAE3CG,IAF2C,CAA5C;AAIA,QAAMK,MAAM,GAAGX,OAAO,CACrB,MAAM,CACL,IAAKO,YAAY,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eR,OAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tFlexItem,\n\t__experimentalHStack as HStack,\n\t__experimentalZStack as ZStack,\n\t__experimentalVStack as VStack,\n\tFlexBlock,\n\tColorIndicator,\n} from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Subtitle from './subtitle';\nimport { NavigationButton } from './navigation-button';\nimport { useSetting } from './hooks';\n\nconst EMPTY_COLORS = [];\n\nfunction Palette( { name } ) {\n\tconst [ customColors ] = useSetting( 'color.palette.custom' );\n\tconst [ themeColors ] = useSetting( 'color.palette.theme' );\n\tconst [ defaultColors ] = useSetting( 'color.palette.default' );\n\n\tconst [ defaultPaletteEnabled ] = useSetting(\n\t\t'color.defaultPalette',\n\t\tname\n\t);\n\tconst colors = useMemo(\n\t\t() => [\n\t\t\t...( customColors || EMPTY_COLORS ),\n\t\t\t...( themeColors || EMPTY_COLORS ),\n\t\t\t...( defaultColors && defaultPaletteEnabled\n\t\t\t\t? defaultColors\n\t\t\t\t: EMPTY_COLORS ),\n\t\t],\n\t\t[ customColors, themeColors, defaultColors, defaultPaletteEnabled ]\n\t);\n\n\tconst screenPath = ! name\n\t\t? '/colors/palette'\n\t\t: '/blocks/' + name + '/colors/palette';\n\tconst paletteButtonText =\n\t\tcolors.length > 0\n\t\t\t? sprintf(\n\t\t\t\t\t// Translators: %d: Number of palette colors.\n\t\t\t\t\t_n( '%d color', '%d colors', colors.length ),\n\t\t\t\t\tcolors.length\n\t\t\t )\n\t\t\t: __( 'Add custom colors' );\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<Subtitle>{ __( 'Palette' ) }</Subtitle>\n\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t<NavigationButton path={ screenPath }>\n\t\t\t\t\t<HStack isReversed={ colors.length === 0 }>\n\t\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t\t<ZStack isLayered={ false } offset={ -8 }>\n\t\t\t\t\t\t\t\t{ colors.slice( 0, 5 ).map( ( { color } ) => (\n\t\t\t\t\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\t\t\t\t\tkey={ color }\n\t\t\t\t\t\t\t\t\t\tcolorValue={ color }\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</ZStack>\n\t\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t\t<FlexItem>{ paletteButtonText }</FlexItem>\n\t\t\t\t\t</HStack>\n\t\t\t\t</NavigationButton>\n\t\t\t</ItemGroup>\n\t\t</VStack>\n\t);\n}\n\nexport default Palette;\n"]}
@@ -3,38 +3,68 @@ import { createElement } from "@wordpress/element";
3
3
  /**
4
4
  * WordPress dependencies
5
5
  */
6
- import { __experimentalHStack as HStack, __experimentalVStack as VStack, Card, ColorIndicator } from '@wordpress/components';
6
+ import { __unstableIframe as Iframe, __unstableEditorStyles as EditorStyles } from '@wordpress/block-editor';
7
7
  /**
8
8
  * Internal dependencies
9
9
  */
10
10
 
11
11
  import { useStyle } from './hooks';
12
+ import { useGlobalStylesOutput } from './use-global-styles-output';
12
13
 
13
- const StylesPreview = () => {
14
+ const StylesPreview = _ref => {
15
+ let {
16
+ height = 150
17
+ } = _ref;
14
18
  const [fontFamily = 'serif'] = useStyle('typography.fontFamily');
15
19
  const [textColor = 'black'] = useStyle('color.text');
16
20
  const [linkColor = 'blue'] = useStyle('elements.link.color.text');
17
21
  const [backgroundColor = 'white'] = useStyle('color.background');
18
22
  const [gradientValue] = useStyle('color.gradient');
19
- return createElement(Card, {
20
- className: "edit-site-global-styles-preview",
23
+ const [styles] = useGlobalStylesOutput();
24
+ return createElement(Iframe, {
25
+ className: "edit-site-global-styles-preview__iframe",
26
+ head: createElement(EditorStyles, {
27
+ styles: styles
28
+ }),
21
29
  style: {
22
- background: gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor
30
+ height
31
+ }
32
+ }, createElement("div", {
33
+ style: {
34
+ display: 'flex',
35
+ gap: 20,
36
+ alignItems: 'center',
37
+ justifyContent: 'center',
38
+ height: '100%',
39
+ transform: `scale(${height / 150})`,
40
+ background: gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor,
41
+ cursor: 'pointer'
23
42
  }
24
- }, createElement(HStack, {
25
- spacing: 5
26
43
  }, createElement("div", {
27
44
  style: {
28
45
  fontFamily,
29
- fontSize: '80px',
30
- color: textColor
46
+ fontSize: '80px'
47
+ }
48
+ }, "Aa"), createElement("div", {
49
+ style: {
50
+ display: 'flex',
51
+ gap: 20,
52
+ flexDirection: 'column'
53
+ }
54
+ }, createElement("div", {
55
+ style: {
56
+ height: 40,
57
+ width: 40,
58
+ background: textColor,
59
+ borderRadius: 20
60
+ }
61
+ }), ' ', createElement("div", {
62
+ style: {
63
+ height: 40,
64
+ width: 40,
65
+ background: linkColor,
66
+ borderRadius: 20
31
67
  }
32
- }, "Aa"), createElement(VStack, {
33
- spacing: 2
34
- }, createElement(ColorIndicator, {
35
- colorValue: textColor
36
- }), createElement(ColorIndicator, {
37
- colorValue: linkColor
38
68
  }))));
39
69
  };
40
70
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/preview.js"],"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","Card","ColorIndicator","useStyle","StylesPreview","fontFamily","textColor","linkColor","backgroundColor","gradientValue","background","fontSize","color"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MADzB,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,IAHD,EAICC,cAJD,QAKO,uBALP;AAOA;AACA;AACA;;AACA,SAASC,QAAT,QAAyB,SAAzB;;AAEA,MAAMC,aAAa,GAAG,MAAM;AAC3B,QAAM,CAAEC,UAAU,GAAG,OAAf,IAA2BF,QAAQ,CAAE,uBAAF,CAAzC;AACA,QAAM,CAAEG,SAAS,GAAG,OAAd,IAA0BH,QAAQ,CAAE,YAAF,CAAxC;AACA,QAAM,CAAEI,SAAS,GAAG,MAAd,IAAyBJ,QAAQ,CAAE,0BAAF,CAAvC;AACA,QAAM,CAAEK,eAAe,GAAG,OAApB,IAAgCL,QAAQ,CAAE,kBAAF,CAA9C;AACA,QAAM,CAAEM,aAAF,IAAoBN,QAAQ,CAAE,gBAAF,CAAlC;AAEA,SACC,cAAC,IAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,KAAK,EAAG;AAAEO,MAAAA,UAAU,EAAED,aAAF,aAAEA,aAAF,cAAEA,aAAF,GAAmBD;AAA/B;AAFT,KAIC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC;AACC,IAAA,KAAK,EAAG;AAAEH,MAAAA,UAAF;AAAcM,MAAAA,QAAQ,EAAE,MAAxB;AAAgCC,MAAAA,KAAK,EAAEN;AAAvC;AADT,UADD,EAMC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,cAAD;AAAgB,IAAA,UAAU,EAAGA;AAA7B,IADD,EAEC,cAAC,cAAD;AAAgB,IAAA,UAAU,EAAGC;AAA7B,IAFD,CAND,CAJD,CADD;AAkBA,CAzBD;;AA2BA,eAAeH,aAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tCard,\n\tColorIndicator,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { useStyle } from './hooks';\n\nconst StylesPreview = () => {\n\tconst [ fontFamily = 'serif' ] = useStyle( 'typography.fontFamily' );\n\tconst [ textColor = 'black' ] = useStyle( 'color.text' );\n\tconst [ linkColor = 'blue' ] = useStyle( 'elements.link.color.text' );\n\tconst [ backgroundColor = 'white' ] = useStyle( 'color.background' );\n\tconst [ gradientValue ] = useStyle( 'color.gradient' );\n\n\treturn (\n\t\t<Card\n\t\t\tclassName=\"edit-site-global-styles-preview\"\n\t\t\tstyle={ { background: gradientValue ?? backgroundColor } }\n\t\t>\n\t\t\t<HStack spacing={ 5 }>\n\t\t\t\t<div\n\t\t\t\t\tstyle={ { fontFamily, fontSize: '80px', color: textColor } }\n\t\t\t\t>\n\t\t\t\t\tAa\n\t\t\t\t</div>\n\t\t\t\t<VStack spacing={ 2 }>\n\t\t\t\t\t<ColorIndicator colorValue={ textColor } />\n\t\t\t\t\t<ColorIndicator colorValue={ linkColor } />\n\t\t\t\t</VStack>\n\t\t\t</HStack>\n\t\t</Card>\n\t);\n};\n\nexport default StylesPreview;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/preview.js"],"names":["__unstableIframe","Iframe","__unstableEditorStyles","EditorStyles","useStyle","useGlobalStylesOutput","StylesPreview","height","fontFamily","textColor","linkColor","backgroundColor","gradientValue","styles","display","gap","alignItems","justifyContent","transform","background","cursor","fontSize","flexDirection","width","borderRadius"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,gBAAgB,IAAIC,MADrB,EAECC,sBAAsB,IAAIC,YAF3B,QAGO,yBAHP;AAKA;AACA;AACA;;AACA,SAASC,QAAT,QAAyB,SAAzB;AACA,SAASC,qBAAT,QAAsC,4BAAtC;;AAEA,MAAMC,aAAa,GAAG,QAAwB;AAAA,MAAtB;AAAEC,IAAAA,MAAM,GAAG;AAAX,GAAsB;AAC7C,QAAM,CAAEC,UAAU,GAAG,OAAf,IAA2BJ,QAAQ,CAAE,uBAAF,CAAzC;AACA,QAAM,CAAEK,SAAS,GAAG,OAAd,IAA0BL,QAAQ,CAAE,YAAF,CAAxC;AACA,QAAM,CAAEM,SAAS,GAAG,MAAd,IAAyBN,QAAQ,CAAE,0BAAF,CAAvC;AACA,QAAM,CAAEO,eAAe,GAAG,OAApB,IAAgCP,QAAQ,CAAE,kBAAF,CAA9C;AACA,QAAM,CAAEQ,aAAF,IAAoBR,QAAQ,CAAE,gBAAF,CAAlC;AACA,QAAM,CAAES,MAAF,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stableIframe as Iframe,\n\t__unstableEditorStyles as EditorStyles,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { useStyle } from './hooks';\nimport { useGlobalStylesOutput } from './use-global-styles-output';\n\nconst StylesPreview = ( { height = 150 } ) => {\n\tconst [ fontFamily = 'serif' ] = useStyle( 'typography.fontFamily' );\n\tconst [ textColor = 'black' ] = useStyle( 'color.text' );\n\tconst [ linkColor = 'blue' ] = useStyle( 'elements.link.color.text' );\n\tconst [ backgroundColor = 'white' ] = useStyle( 'color.background' );\n\tconst [ gradientValue ] = useStyle( 'color.gradient' );\n\tconst [ styles ] = useGlobalStylesOutput();\n\n\treturn (\n\t\t<Iframe\n\t\t\tclassName=\"edit-site-global-styles-preview__iframe\"\n\t\t\thead={ <EditorStyles styles={ styles } /> }\n\t\t\tstyle={ { height } }\n\t\t>\n\t\t\t<div\n\t\t\t\tstyle={ {\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tgap: 20,\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\theight: '100%',\n\t\t\t\t\ttransform: `scale(${ height / 150 })`,\n\t\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<div style={ { fontFamily, fontSize: '80px' } }>Aa</div>\n\t\t\t\t<div\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\tgap: 20,\n\t\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: 40,\n\t\t\t\t\t\t\twidth: 40,\n\t\t\t\t\t\t\tbackground: textColor,\n\t\t\t\t\t\t\tborderRadius: 20,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>{ ' ' }\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: 40,\n\t\t\t\t\t\t\twidth: 40,\n\t\t\t\t\t\t\tbackground: linkColor,\n\t\t\t\t\t\t\tborderRadius: 20,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Iframe>\n\t);\n};\n\nexport default StylesPreview;\n"]}
@@ -1,10 +1,11 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
1
2
  import { createElement, Fragment } from "@wordpress/element";
2
3
 
3
4
  /**
4
5
  * WordPress dependencies
5
6
  */
6
7
  import { __ } from '@wordpress/i18n';
7
- import { __experimentalPanelColorGradientSettings as PanelColorGradientSettings } from '@wordpress/block-editor';
8
+ import { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';
8
9
  /**
9
10
  * Internal dependencies
10
11
  */
@@ -16,7 +17,6 @@ function ScreenBackgroundColor(_ref) {
16
17
  let {
17
18
  name
18
19
  } = _ref;
19
- const parentMenu = name === undefined ? '' : '/blocks/' + name;
20
20
  const supports = getSupportedGlobalStylesPanels(name);
21
21
  const [solids] = useSetting('color.palette', name);
22
22
  const [gradients] = useSetting('color.gradients', name);
@@ -36,7 +36,6 @@ function ScreenBackgroundColor(_ref) {
36
36
  return null;
37
37
  }
38
38
 
39
- const settings = [];
40
39
  let backgroundSettings = {};
41
40
 
42
41
  if (hasBackgroundColor) {
@@ -63,17 +62,14 @@ function ScreenBackgroundColor(_ref) {
63
62
  }
64
63
  }
65
64
 
66
- settings.push({ ...backgroundSettings,
67
- ...gradientSettings,
68
- label: __('Background color')
69
- });
65
+ const controlProps = { ...backgroundSettings,
66
+ ...gradientSettings
67
+ };
70
68
  return createElement(Fragment, null, createElement(ScreenHeader, {
71
- back: parentMenu + '/colors',
72
69
  title: __('Background'),
73
- description: __('Set a background color or gradient for the whole website.')
74
- }), createElement(PanelColorGradientSettings, {
75
- title: __('Color'),
76
- settings: settings,
70
+ description: __('Set a background color or gradient for the whole site.')
71
+ }), createElement(ColorGradientControl, _extends({
72
+ className: "edit-site-screen-background-color__control",
77
73
  colors: colorsPerOrigin,
78
74
  gradients: gradientsPerOrigin,
79
75
  disableCustomColors: !areCustomSolidsEnabled,
@@ -82,7 +78,7 @@ function ScreenBackgroundColor(_ref) {
82
78
  showTitle: false,
83
79
  enableAlpha: true,
84
80
  __experimentalIsRenderedInSidebar: true
85
- }));
81
+ }, controlProps)));
86
82
  }
87
83
 
88
84
  export default ScreenBackgroundColor;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-background-color.js"],"names":["__","__experimentalPanelColorGradientSettings","PanelColorGradientSettings","ScreenHeader","getSupportedGlobalStylesPanels","useColorsPerOrigin","useGradientsPerOrigin","useSetting","useStyle","ScreenBackgroundColor","name","parentMenu","undefined","supports","solids","gradients","areCustomSolidsEnabled","areCustomGradientsEnabled","colorsPerOrigin","gradientsPerOrigin","isBackgroundEnabled","hasBackgroundColor","includes","length","hasGradientColor","backgroundColor","setBackgroundColor","userBackgroundColor","gradient","setGradient","userGradient","settings","backgroundSettings","colorValue","onColorChange","clearable","gradientSettings","gradientValue","onGradientChange","push","label"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,wCAAwC,IAAIC,0BAArD,QAAuF,yBAAvF;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,SACCC,8BADD,EAECC,kBAFD,EAGCC,qBAHD,EAICC,UAJD,EAKCC,QALD,QAMO,SANP;;AAQA,SAASC,qBAAT,OAA2C;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AAC1C,QAAMC,UAAU,GAAGD,IAAI,KAAKE,SAAT,GAAqB,EAArB,GAA0B,aAAaF,IAA1D;AACA,QAAMG,QAAQ,GAAGT,8BAA8B,CAAEM,IAAF,CAA/C;AACA,QAAM,CAAEI,MAAF,IAAaP,UAAU,CAAE,eAAF,EAAmBG,IAAnB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i18n';\nimport { __experimentalPanelColorGradientSettings as PanelColorGradientSettings } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport {\n\tgetSupportedGlobalStylesPanels,\n\tuseColorsPerOrigin,\n\tuseGradientsPerOrigin,\n\tuseSetting,\n\tuseStyle,\n} from './hooks';\n\nfunction ScreenBackgroundColor( { name } ) {\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst [ solids ] = useSetting( 'color.palette', name );\n\tconst [ gradients ] = useSetting( 'color.gradients', name );\n\tconst [ areCustomSolidsEnabled ] = useSetting( 'color.custom', name );\n\tconst [ areCustomGradientsEnabled ] = useSetting(\n\t\t'color.customGradient',\n\t\tname\n\t);\n\n\tconst colorsPerOrigin = useColorsPerOrigin( name );\n\tconst gradientsPerOrigin = useGradientsPerOrigin( name );\n\n\tconst [ isBackgroundEnabled ] = useSetting( 'color.background', name );\n\n\tconst hasBackgroundColor =\n\t\tsupports.includes( 'backgroundColor' ) &&\n\t\tisBackgroundEnabled &&\n\t\t( solids.length > 0 || areCustomSolidsEnabled );\n\tconst hasGradientColor =\n\t\tsupports.includes( 'background' ) &&\n\t\t( gradients.length > 0 || areCustomGradientsEnabled );\n\tconst [ backgroundColor, setBackgroundColor ] = useStyle(\n\t\t'color.background',\n\t\tname\n\t);\n\tconst [ userBackgroundColor ] = useStyle(\n\t\t'color.background',\n\t\tname,\n\t\t'user'\n\t);\n\tconst [ gradient, setGradient ] = useStyle( 'color.gradient', name );\n\tconst [ userGradient ] = useStyle( 'color.gradient', name, 'user' );\n\n\tif ( ! hasBackgroundColor && ! hasGradientColor ) {\n\t\treturn null;\n\t}\n\n\tconst settings = [];\n\tlet backgroundSettings = {};\n\tif ( hasBackgroundColor ) {\n\t\tbackgroundSettings = {\n\t\t\tcolorValue: backgroundColor,\n\t\t\tonColorChange: setBackgroundColor,\n\t\t};\n\t\tif ( backgroundColor ) {\n\t\t\tbackgroundSettings.clearable =\n\t\t\t\tbackgroundColor === userBackgroundColor;\n\t\t}\n\t}\n\n\tlet gradientSettings = {};\n\tif ( hasGradientColor ) {\n\t\tgradientSettings = {\n\t\t\tgradientValue: gradient,\n\t\t\tonGradientChange: setGradient,\n\t\t};\n\t\tif ( gradient ) {\n\t\t\tgradientSettings.clearable = gradient === userGradient;\n\t\t}\n\t}\n\n\tsettings.push( {\n\t\t...backgroundSettings,\n\t\t...gradientSettings,\n\t\tlabel: __( 'Background color' ),\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback={ parentMenu + '/colors' }\n\t\t\t\ttitle={ __( 'Background' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Set a background color or gradient for the whole website.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<PanelColorGradientSettings\n\t\t\t\ttitle={ __( 'Color' ) }\n\t\t\t\tsettings={ settings }\n\t\t\t\tcolors={ colorsPerOrigin }\n\t\t\t\tgradients={ gradientsPerOrigin }\n\t\t\t\tdisableCustomColors={ ! areCustomSolidsEnabled }\n\t\t\t\tdisableCustomGradients={ ! areCustomGradientsEnabled }\n\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\tshowTitle={ false }\n\t\t\t\tenableAlpha\n\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenBackgroundColor;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-background-color.js"],"names":["__","__experimentalColorGradientControl","ColorGradientControl","ScreenHeader","getSupportedGlobalStylesPanels","useColorsPerOrigin","useGradientsPerOrigin","useSetting","useStyle","ScreenBackgroundColor","name","supports","solids","gradients","areCustomSolidsEnabled","areCustomGradientsEnabled","colorsPerOrigin","gradientsPerOrigin","isBackgroundEnabled","hasBackgroundColor","includes","length","hasGradientColor","backgroundColor","setBackgroundColor","userBackgroundColor","gradient","setGradient","userGradient","backgroundSettings","colorValue","onColorChange","clearable","gradientSettings","gradientValue","onGradientChange","controlProps"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,kCAAkC,IAAIC,oBAA/C,QAA2E,yBAA3E;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,SACCC,8BADD,EAECC,kBAFD,EAGCC,qBAHD,EAICC,UAJD,EAKCC,QALD,QAMO,SANP;;AAQA,SAASC,qBAAT,OAA2C;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AAC1C,QAAMC,QAAQ,GAAGP,8BAA8B,CAAEM,IAAF,CAA/C;AACA,QAAM,CAAEE,MAAF,IAAaL,UAAU,CAAE,eAAF,EAAmBG,IAAnB,CAA7B;AACA,QAAM,CAAEG,SAAF,IAAgBN,UAAU,CAAE,iBAAF,EAAqBG,IAArB,CAAhC;AACA,QAAM,CAAEI,sBAAF,IAA6BP,UAAU,CAAE,cAAF,EAAkBG,IAAlB,CAA7C;AACA,QAAM,CAAEK,yBAAF,IAAgCR,UAAU,CAC/C,sBAD+C,EAE/CG,IAF+C,CAAhD;AAKA,QAAMM,eAAe,GAAGX,kBAAkB,CAAEK,IAAF,CAA1C;AACA,QAAMO,kBAAkB,GAAGX,qBAAqB,CAAEI,IAAF,CAAhD;AAEA,QAAM,CAAEQ,mBAAF,IAA0BX,UAAU,CAAE,kBAAF,EAAsBG,IAAtB,CAA1C;AAEA,QAAMS,kBAAkB,GACvBR,QAAQ,CAACS,QAAT,CAAmB,iBAAnB,KACAF,mBADA,KAEEN,MAAM,CAACS,MAAP,GAAgB,CAAhB,IAAqBP,sBAFvB,CADD;AAIA,QAAMQ,gBAAgB,GACrBX,QAAQ,CAACS,QAAT,CAAmB,YAAnB,MACEP,SAAS,CAACQ,MAAV,GAAmB,CAAnB,IAAwBN,yBAD1B,CADD;AAGA,QAAM,CAAEQ,eAAF,EAAmBC,kBAAnB,IAA0ChB,QAAQ,CACvD,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GC,kBAHb;AAIC,IAAA,mBAAmB,EAAG,CAAEH,sBAJzB;AAKC,IAAA,sBAAsB,EAAG,CAAEC,yBAL5B;AAMC,IAAA,gCAAgC,MANjC;AAOC,IAAA,SAAS,EAAG,KAPb;AAQC,IAAA,WAAW,MARZ;AASC,IAAA,iCAAiC;AATlC,KAUMqB,YAVN,EAPD,CADD;AAsBA;;AAED,eAAe3B,qBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport {\n\tgetSupportedGlobalStylesPanels,\n\tuseColorsPerOrigin,\n\tuseGradientsPerOrigin,\n\tuseSetting,\n\tuseStyle,\n} from './hooks';\n\nfunction ScreenBackgroundColor( { name } ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst [ solids ] = useSetting( 'color.palette', name );\n\tconst [ gradients ] = useSetting( 'color.gradients', name );\n\tconst [ areCustomSolidsEnabled ] = useSetting( 'color.custom', name );\n\tconst [ areCustomGradientsEnabled ] = useSetting(\n\t\t'color.customGradient',\n\t\tname\n\t);\n\n\tconst colorsPerOrigin = useColorsPerOrigin( name );\n\tconst gradientsPerOrigin = useGradientsPerOrigin( name );\n\n\tconst [ isBackgroundEnabled ] = useSetting( 'color.background', name );\n\n\tconst hasBackgroundColor =\n\t\tsupports.includes( 'backgroundColor' ) &&\n\t\tisBackgroundEnabled &&\n\t\t( solids.length > 0 || areCustomSolidsEnabled );\n\tconst hasGradientColor =\n\t\tsupports.includes( 'background' ) &&\n\t\t( gradients.length > 0 || areCustomGradientsEnabled );\n\tconst [ backgroundColor, setBackgroundColor ] = useStyle(\n\t\t'color.background',\n\t\tname\n\t);\n\tconst [ userBackgroundColor ] = useStyle(\n\t\t'color.background',\n\t\tname,\n\t\t'user'\n\t);\n\tconst [ gradient, setGradient ] = useStyle( 'color.gradient', name );\n\tconst [ userGradient ] = useStyle( 'color.gradient', name, 'user' );\n\n\tif ( ! hasBackgroundColor && ! hasGradientColor ) {\n\t\treturn null;\n\t}\n\n\tlet backgroundSettings = {};\n\tif ( hasBackgroundColor ) {\n\t\tbackgroundSettings = {\n\t\t\tcolorValue: backgroundColor,\n\t\t\tonColorChange: setBackgroundColor,\n\t\t};\n\t\tif ( backgroundColor ) {\n\t\t\tbackgroundSettings.clearable =\n\t\t\t\tbackgroundColor === userBackgroundColor;\n\t\t}\n\t}\n\n\tlet gradientSettings = {};\n\tif ( hasGradientColor ) {\n\t\tgradientSettings = {\n\t\t\tgradientValue: gradient,\n\t\t\tonGradientChange: setGradient,\n\t\t};\n\t\tif ( gradient ) {\n\t\t\tgradientSettings.clearable = gradient === userGradient;\n\t\t}\n\t}\n\n\tconst controlProps = {\n\t\t...backgroundSettings,\n\t\t...gradientSettings,\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Background' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Set a background color or gradient for the whole site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ColorGradientControl\n\t\t\t\tclassName=\"edit-site-screen-background-color__control\"\n\t\t\t\tcolors={ colorsPerOrigin }\n\t\t\t\tgradients={ gradientsPerOrigin }\n\t\t\t\tdisableCustomColors={ ! areCustomSolidsEnabled }\n\t\t\t\tdisableCustomGradients={ ! areCustomGradientsEnabled }\n\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\tshowTitle={ false }\n\t\t\t\tenableAlpha\n\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t{ ...controlProps }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenBackgroundColor;\n"]}
@@ -16,7 +16,7 @@ import { useHasColorPanel } from './color-utils';
16
16
  import { useHasDimensionsPanel } from './dimensions-panel';
17
17
  import { useHasTypographyPanel } from './typography-panel';
18
18
  import ScreenHeader from './header';
19
- import NavigationButton from './navigation-button';
19
+ import { NavigationButton } from './navigation-button';
20
20
 
21
21
  function BlockMenuItem(_ref) {
22
22
  let {
@@ -44,7 +44,6 @@ function BlockMenuItem(_ref) {
44
44
 
45
45
  function ScreenBlockList() {
46
46
  return createElement(Fragment, null, createElement(ScreenHeader, {
47
- back: "/",
48
47
  title: __('Blocks'),
49
48
  description: __('Customize the appearance of specific blocks and for the whole site.')
50
49
  }), getBlockTypes().map(block => createElement(BlockMenuItem, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-block-list.js"],"names":["getBlockTypes","__","FlexItem","__experimentalHStack","HStack","BlockIcon","useHasBorderPanel","useHasColorPanel","useHasDimensionsPanel","useHasTypographyPanel","ScreenHeader","NavigationButton","BlockMenuItem","block","hasTypographyPanel","name","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel","hasBlockMenuItem","icon","title","ScreenBlockList","map"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,aAAT,QAA8B,mBAA9B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SACCC,QADD,EAECC,oBAAoB,IAAIC,MAFzB,QAGO,uBAHP;AAIA,SAASC,SAAT,QAA0B,yBAA1B;AAEA;AACA;AACA;;AACA,SAASC,iBAAT,QAAkC,gBAAlC;AACA,SAASC,gBAAT,QAAiC,eAAjC;AACA,SAASC,qBAAT,QAAsC,oBAAtC;AACA,SAASC,qBAAT,QAAsC,oBAAtC;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,OAAOC,gBAAP,MAA6B,qBAA7B;;AAEA,SAASC,aAAT,OAAoC;AAAA,MAAZ;AAAEC,IAAAA;AAAF,GAAY;AACnC,QAAMC,kBAAkB,GAAGL,qBAAqB,CAAEI,KAAK,CAACE,IAAR,CAAhD;AACA,QAAMC,aAAa,GAAGT,gBAAgB,CAAEM,KAAK,CAACE,IAAR,CAAtC;AACA,QAAME,cAAc,GAAGX,iBAAiB,CAAEO,KAAK,CAACE,IAAR,CAAxC;AACA,QAAMG,kBAAkB,GAAGV,qBAAqB,CAAEK,KAAK,CAACE,IAAR,CAAhD;AACA,QAAMI,cAAc,GAAGF,cAAc,IAAIC,kBAAzC;AACA,QAAME,gBAAgB,GACrBN,kBAAkB,IAAIE,aAAtB,IAAuCG,cADxC;;AAGA,MAAK,CAAEC,gBAAP,EAA0B;AACzB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,gBAAD;AAAkB,IAAA,IAAI,EAAG,aAAaP,KAAK,CAACE;AAA5C,KACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,cAAC,QAAD,QACC,cAAC,SAAD;AAAW,IAAA,IAAI,EAAGF,KAAK,CAACQ;AAAxB,IADD,CADD,EAIC,cAAC,QAAD,QAAYR,KAAK,CAACS,KAAlB,CAJD,CADD,CADD;AAUA;;AAED,SAASC,eAAT,GAA2B;AAC1B,SACC,8BACC,cAAC,YAAD;AACC,IAAA,IAAI,EAAC,GADN;AAEC,IAAA,KAAK,EAAGtB,EAAE,CAAE,QAAF,CAFX;AAGC,IAAA,WAAW,EAAGA,EAAE,CACf,qEADe;AAHjB,IADD,EAQGD,aAAa,GAAGwB,GAAhB,CAAuBX,KAAF,IACtB,cAAC,aAAD;AACC,IAAA,KAAK,EAAGA,KADT;AAEC,IAAA,GAAG,EAAG,oBAAoBA,KAAK,CAACE;AAFjC,IADC,CARH,CADD;AAiBA;;AAED,eAAeQ,eAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockTypes } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tFlexItem,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { useHasBorderPanel } from './border-panel';\nimport { useHasColorPanel } from './color-utils';\nimport { useHasDimensionsPanel } from './dimensions-panel';\nimport { useHasTypographyPanel } from './typography-panel';\nimport ScreenHeader from './header';\nimport NavigationButton from './navigation-button';\n\nfunction BlockMenuItem( { block } ) {\n\tconst hasTypographyPanel = useHasTypographyPanel( block.name );\n\tconst hasColorPanel = useHasColorPanel( block.name );\n\tconst hasBorderPanel = useHasBorderPanel( block.name );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( block.name );\n\tconst hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;\n\tconst hasBlockMenuItem =\n\t\thasTypographyPanel || hasColorPanel || hasLayoutPanel;\n\n\tif ( ! hasBlockMenuItem ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButton path={ '/blocks/' + block.name }>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<BlockIcon icon={ block.icon } />\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ block.title }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButton>\n\t);\n}\n\nfunction ScreenBlockList() {\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback=\"/\"\n\t\t\t\ttitle={ __( 'Blocks' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Customize the appearance of specific blocks and for the whole site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t{ getBlockTypes().map( ( block ) => (\n\t\t\t\t<BlockMenuItem\n\t\t\t\t\tblock={ block }\n\t\t\t\t\tkey={ 'menu-itemblock-' + block.name }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nexport default ScreenBlockList;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-block-list.js"],"names":["getBlockTypes","__","FlexItem","__experimentalHStack","HStack","BlockIcon","useHasBorderPanel","useHasColorPanel","useHasDimensionsPanel","useHasTypographyPanel","ScreenHeader","NavigationButton","BlockMenuItem","block","hasTypographyPanel","name","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel","hasBlockMenuItem","icon","title","ScreenBlockList","map"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YAAD;AACC,IAAA,KAAK,EAAGtB,EAAE,CAAE,QAAF,CADX;AAEC,IAAA,WAAW,EAAGA,EAAE,CACf,qEADe;AAFjB,IADD,EAOGD,aAAa,GAAGwB,GAAhB,CAAuBX,KAAF,IACtB,cAAC,aAAD;AACC,IAAA,KAAK,EAAGA,KADT;AAEC,IAAA,GAAG,EAAG,oBAAoBA,KAAK,CAACE;AAFjC,IADC,CAPH,CADD;AAgBA;;AAED,eAAeQ,eAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockTypes } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tFlexItem,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { useHasBorderPanel } from './border-panel';\nimport { useHasColorPanel } from './color-utils';\nimport { useHasDimensionsPanel } from './dimensions-panel';\nimport { useHasTypographyPanel } from './typography-panel';\nimport ScreenHeader from './header';\nimport { NavigationButton } from './navigation-button';\n\nfunction BlockMenuItem( { block } ) {\n\tconst hasTypographyPanel = useHasTypographyPanel( block.name );\n\tconst hasColorPanel = useHasColorPanel( block.name );\n\tconst hasBorderPanel = useHasBorderPanel( block.name );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( block.name );\n\tconst hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;\n\tconst hasBlockMenuItem =\n\t\thasTypographyPanel || hasColorPanel || hasLayoutPanel;\n\n\tif ( ! hasBlockMenuItem ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButton path={ '/blocks/' + block.name }>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<BlockIcon icon={ block.icon } />\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ block.title }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButton>\n\t);\n}\n\nfunction ScreenBlockList() {\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Blocks' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Customize the appearance of specific blocks and for the whole site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t{ getBlockTypes().map( ( block ) => (\n\t\t\t\t<BlockMenuItem\n\t\t\t\t\tblock={ block }\n\t\t\t\t\tkey={ 'menu-itemblock-' + block.name }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nexport default ScreenBlockList;\n"]}
@@ -17,7 +17,6 @@ function ScreenBlock(_ref) {
17
17
  } = _ref;
18
18
  const blockType = getBlockType(name);
19
19
  return createElement(Fragment, null, createElement(ScreenHeader, {
20
- back: "/blocks",
21
20
  title: blockType.title
22
21
  }), createElement(ContextMenu, {
23
22
  parentMenu: '/blocks/' + name,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-block.js"],"names":["getBlockType","ContextMenu","ScreenHeader","ScreenBlock","name","blockType","title"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,YAAT,QAA6B,mBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,YAAP,MAAyB,UAAzB;;AAEA,SAASC,WAAT,OAAiC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AAChC,QAAMC,SAAS,GAAGL,YAAY,CAAEI,IAAF,CAA9B;AAEA,SACC,8BACC,cAAC,YAAD;AAAc,IAAA,IAAI,EAAC,SAAnB;AAA6B,IAAA,KAAK,EAAGC,SAAS,CAACC;AAA/C,IADD,EAEC,cAAC,WAAD;AAAa,IAAA,UAAU,EAAG,aAAaF,IAAvC;AAA8C,IAAA,IAAI,EAAGA;AAArD,IAFD,CADD;AAMA;;AAED,eAAeD,WAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport ContextMenu from './context-menu';\nimport ScreenHeader from './header';\n\nfunction ScreenBlock( { name } ) {\n\tconst blockType = getBlockType( name );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader back=\"/blocks\" title={ blockType.title } />\n\t\t\t<ContextMenu parentMenu={ '/blocks/' + name } name={ name } />\n\t\t</>\n\t);\n}\n\nexport default ScreenBlock;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-block.js"],"names":["getBlockType","ContextMenu","ScreenHeader","ScreenBlock","name","blockType","title"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,YAAT,QAA6B,mBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,YAAP,MAAyB,UAAzB;;AAEA,SAASC,WAAT,OAAiC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AAChC,QAAMC,SAAS,GAAGL,YAAY,CAAEI,IAAF,CAA9B;AAEA,SACC,8BACC,cAAC,YAAD;AAAc,IAAA,KAAK,EAAGC,SAAS,CAACC;AAAhC,IADD,EAEC,cAAC,WAAD;AAAa,IAAA,UAAU,EAAG,aAAaF,IAAvC;AAA8C,IAAA,IAAI,EAAGA;AAArD,IAFD,CADD;AAMA;;AAED,eAAeD,WAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport ContextMenu from './context-menu';\nimport ScreenHeader from './header';\n\nfunction ScreenBlock( { name } ) {\n\tconst blockType = getBlockType( name );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader title={ blockType.title } />\n\t\t\t<ContextMenu parentMenu={ '/blocks/' + name } name={ name } />\n\t\t</>\n\t);\n}\n\nexport default ScreenBlock;\n"]}
@@ -19,9 +19,7 @@ function ScreenColorPalette(_ref) {
19
19
  name
20
20
  } = _ref;
21
21
  const [currentTab, setCurrentTab] = useState('solid');
22
- const parentMenu = name === undefined ? '' : '/blocks/' + name;
23
22
  return createElement(Fragment, null, createElement(ScreenHeader, {
24
- back: parentMenu + '/colors',
25
23
  title: __('Palette'),
26
24
  description: __('Palettes are used to provide default color options for blocks and various design tools. Here you can edit the colors with their labels.')
27
25
  }), createElement(ToggleGroupControl, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-color-palette.js"],"names":["__","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","useState","ColorPalettePanel","GradientPalettePanel","ScreenHeader","ScreenColorPalette","name","currentTab","setCurrentTab","parentMenu","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SACCC,gCAAgC,IAAIC,kBADrC,EAECC,sCAAsC,IAAIC,wBAF3C,QAGO,uBAHP;AAIA,SAASC,QAAT,QAAyB,oBAAzB;AAEA;AACA;AACA;;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AACA,OAAOC,YAAP,MAAyB,UAAzB;;AAEA,SAASC,kBAAT,OAAwC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACvC,QAAM,CAAEC,UAAF,EAAcC,aAAd,IAAgCP,QAAQ,CAAE,OAAF,CAA9C;AACA,QAAMQ,UAAU,GAAGH,IAAI,KAAKI,SAAT,GAAqB,EAArB,GAA0B,aAAaJ,IAA1D;AAEA,SACC,8BACC,cAAC,YAAD;AACC,IAAA,IAAI,EAAGG,UAAU,GAAG,SADrB;AAEC,IAAA,KAAK,EAAGb,EAAE,CAAE,SAAF,CAFX;AAGC,IAAA,WAAW,EAAGA,EAAE,CACf,yIADe;AAHjB,IADD,EAQC,cAAC,kBAAD;AACC,IAAA,SAAS,EAAC,uCADX;AAEC,IAAA,KAAK,EAAGW,UAFT;AAGC,IAAA,QAAQ,EAAGC,aAHZ;AAIC,IAAA,KAAK,EAAGZ,EAAE,CAAE,qBAAF,CAJX;AAKC,IAAA,mBAAmB,MALpB;AAMC,IAAA,OAAO;AANR,KAQC,cAAC,wBAAD;AACC,IAAA,KAAK,EAAC,OADP;AAEC,IAAA,KAAK,EAAGA,EAAE,CAAE,OAAF;AAFX,IARD,EAYC,cAAC,wBAAD;AACC,IAAA,KAAK,EAAC,UADP;AAEC,IAAA,KAAK,EAAGA,EAAE,CAAE,UAAF;AAFX,IAZD,CARD,EAyBGW,UAAU,KAAK,OAAf,IAA0B,cAAC,iBAAD;AAAmB,IAAA,IAAI,EAAGD;AAA1B,IAzB7B,EA0BGC,UAAU,KAAK,UAAf,IACD,cAAC,oBAAD;AAAsB,IAAA,IAAI,EAAGD;AAA7B,IA3BF,CADD;AAgCA;;AAED,eAAeD,kBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ColorPalettePanel from './color-palette-panel';\nimport GradientPalettePanel from './gradients-palette-panel';\nimport ScreenHeader from './header';\n\nfunction ScreenColorPalette( { name } ) {\n\tconst [ currentTab, setCurrentTab ] = useState( 'solid' );\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback={ parentMenu + '/colors' }\n\t\t\t\ttitle={ __( 'Palette' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Palettes are used to provide default color options for blocks and various design tools. Here you can edit the colors with their labels.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ToggleGroupControl\n\t\t\t\tclassName=\"edit-site-screen-color-palette-toggle\"\n\t\t\t\tvalue={ currentTab }\n\t\t\t\tonChange={ setCurrentTab }\n\t\t\t\tlabel={ __( 'Select palette type' ) }\n\t\t\t\thideLabelFromVision\n\t\t\t\tisBlock\n\t\t\t>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tvalue=\"solid\"\n\t\t\t\t\tlabel={ __( 'Solid' ) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tvalue=\"gradient\"\n\t\t\t\t\tlabel={ __( 'Gradient' ) }\n\t\t\t\t/>\n\t\t\t</ToggleGroupControl>\n\t\t\t{ currentTab === 'solid' && <ColorPalettePanel name={ name } /> }\n\t\t\t{ currentTab === 'gradient' && (\n\t\t\t\t<GradientPalettePanel name={ name } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default ScreenColorPalette;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-color-palette.js"],"names":["__","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","useState","ColorPalettePanel","GradientPalettePanel","ScreenHeader","ScreenColorPalette","name","currentTab","setCurrentTab"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SACCC,gCAAgC,IAAIC,kBADrC,EAECC,sCAAsC,IAAIC,wBAF3C,QAGO,uBAHP;AAIA,SAASC,QAAT,QAAyB,oBAAzB;AAEA;AACA;AACA;;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AACA,OAAOC,YAAP,MAAyB,UAAzB;;AAEA,SAASC,kBAAT,OAAwC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACvC,QAAM,CAAEC,UAAF,EAAcC,aAAd,IAAgCP,QAAQ,CAAE,OAAF,CAA9C;AAEA,SACC,8BACC,cAAC,YAAD;AACC,IAAA,KAAK,EAAGL,EAAE,CAAE,SAAF,CADX;AAEC,IAAA,WAAW,EAAGA,EAAE,CACf,yIADe;AAFjB,IADD,EAOC,cAAC,kBAAD;AACC,IAAA,SAAS,EAAC,uCADX;AAEC,IAAA,KAAK,EAAGW,UAFT;AAGC,IAAA,QAAQ,EAAGC,aAHZ;AAIC,IAAA,KAAK,EAAGZ,EAAE,CAAE,qBAAF,CAJX;AAKC,IAAA,mBAAmB,MALpB;AAMC,IAAA,OAAO;AANR,KAQC,cAAC,wBAAD;AACC,IAAA,KAAK,EAAC,OADP;AAEC,IAAA,KAAK,EAAGA,EAAE,CAAE,OAAF;AAFX,IARD,EAYC,cAAC,wBAAD;AACC,IAAA,KAAK,EAAC,UADP;AAEC,IAAA,KAAK,EAAGA,EAAE,CAAE,UAAF;AAFX,IAZD,CAPD,EAwBGW,UAAU,KAAK,OAAf,IAA0B,cAAC,iBAAD;AAAmB,IAAA,IAAI,EAAGD;AAA1B,IAxB7B,EAyBGC,UAAU,KAAK,UAAf,IACD,cAAC,oBAAD;AAAsB,IAAA,IAAI,EAAGD;AAA7B,IA1BF,CADD;AA+BA;;AAED,eAAeD,kBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ColorPalettePanel from './color-palette-panel';\nimport GradientPalettePanel from './gradients-palette-panel';\nimport ScreenHeader from './header';\n\nfunction ScreenColorPalette( { name } ) {\n\tconst [ currentTab, setCurrentTab ] = useState( 'solid' );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Palette' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Palettes are used to provide default color options for blocks and various design tools. Here you can edit the colors with their labels.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ToggleGroupControl\n\t\t\t\tclassName=\"edit-site-screen-color-palette-toggle\"\n\t\t\t\tvalue={ currentTab }\n\t\t\t\tonChange={ setCurrentTab }\n\t\t\t\tlabel={ __( 'Select palette type' ) }\n\t\t\t\thideLabelFromVision\n\t\t\t\tisBlock\n\t\t\t>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tvalue=\"solid\"\n\t\t\t\t\tlabel={ __( 'Solid' ) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tvalue=\"gradient\"\n\t\t\t\t\tlabel={ __( 'Gradient' ) }\n\t\t\t\t/>\n\t\t\t</ToggleGroupControl>\n\t\t\t{ currentTab === 'solid' && <ColorPalettePanel name={ name } /> }\n\t\t\t{ currentTab === 'gradient' && (\n\t\t\t\t<GradientPalettePanel name={ name } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default ScreenColorPalette;\n"]}
@@ -11,7 +11,7 @@ import { __experimentalItemGroup as ItemGroup, __experimentalHStack as HStack, _
11
11
 
12
12
  import ScreenHeader from './header';
13
13
  import Palette from './palette';
14
- import NavigationButton from './navigation-button';
14
+ import { NavigationButton } from './navigation-button';
15
15
  import { getSupportedGlobalStylesPanels, useStyle } from './hooks';
16
16
  import Subtitle from './subtitle';
17
17
 
@@ -88,9 +88,8 @@ function ScreenColors(_ref4) {
88
88
  } = _ref4;
89
89
  const parentMenu = name === undefined ? '' : '/blocks/' + name;
90
90
  return createElement(Fragment, null, createElement(ScreenHeader, {
91
- back: parentMenu ? parentMenu : '/',
92
91
  title: __('Colors'),
93
- description: __('Manage palettes and the default color of different global elements on the website.')
92
+ description: __('Manage palettes and the default color of different global elements on the site.')
94
93
  }), createElement("div", {
95
94
  className: "edit-site-global-styles-screen-colors"
96
95
  }, createElement(VStack, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-colors.js"],"names":["__","__experimentalItemGroup","ItemGroup","__experimentalHStack","HStack","__experimentalVStack","VStack","FlexItem","ColorIndicator","ScreenHeader","Palette","NavigationButton","getSupportedGlobalStylesPanels","useStyle","Subtitle","BackgroundColorItem","name","parentMenu","supports","hasSupport","includes","backgroundColor","gradientValue","TextColorItem","color","LinkColorItem","ScreenColors","undefined"],"mappings":";;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T,GAAqB,EAArB,GAA0B,aAAaX,IAA1D;AAEA,SACC,8BACC,cAAC,YAAD;AACC,IAAA,IAAI,EAAGC,UAAU,GAAGA,UAAH,GAAgB,GADlC;AAEC,IAAA,KAAK,EAAGjB,EAAE,CAAE,QAAF,CAFX;AAGC,IAAA,WAAW,EAAGA,EAAE,CACf,oFADe;AAHjB,IADD,EASC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,OAAD;AAAS,IAAA,IAAI,EAAGgB;AAAhB,IADD,EAGC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,QAAD,QAAYhB,EAAE,CAAE,UAAF,CAAd,CADD,EAEC,cAAC,SAAD;AAAW,IAAA,UAAU,MAArB;AAAsB,IAAA,WAAW;AAAjC,KACC,cAAC,mBAAD;AACC,IAAA,IAAI,EAAGgB,IADR;AAEC,IAAA,UAAU,EAAGC;AAFd,IADD,EAKC,cAAC,aAAD;AACC,IAAA,IAAI,EAAGD,IADR;AAEC,IAAA,UAAU,EAAGC;AAFd,IALD,EASC,cAAC,aAAD;AACC,IAAA,IAAI,EAAGD,IADR;AAEC,IAAA,UAAU,EAAGC;AAFd,IATD,CAFD,CAHD,CADD,CATD,CADD;AAmCA;;AAED,eAAeS,YAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tFlexItem,\n\tColorIndicator,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport Palette from './palette';\nimport NavigationButton from './navigation-button';\nimport { getSupportedGlobalStylesPanels, useStyle } from './hooks';\nimport Subtitle from './subtitle';\n\nfunction BackgroundColorItem( { name, parentMenu } ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst hasSupport =\n\t\tsupports.includes( 'backgroundColor' ) ||\n\t\tsupports.includes( 'background' );\n\tconst [ backgroundColor ] = useStyle( 'color.background', name );\n\tconst [ gradientValue ] = useStyle( 'color.gradient', name );\n\n\tif ( ! hasSupport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButton path={ parentMenu + '/colors/background' }>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\tcolorValue={ gradientValue ?? backgroundColor }\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ __( 'Background' ) }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButton>\n\t);\n}\n\nfunction TextColorItem( { name, parentMenu } ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst hasSupport = supports.includes( 'color' );\n\tconst [ color ] = useStyle( 'color.text', name );\n\n\tif ( ! hasSupport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButton path={ parentMenu + '/colors/text' }>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<ColorIndicator colorValue={ color } />\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ __( 'Text' ) }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButton>\n\t);\n}\n\nfunction LinkColorItem( { name, parentMenu } ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst hasSupport = supports.includes( 'linkColor' );\n\tconst [ color ] = useStyle( 'elements.link.color.text', name );\n\n\tif ( ! hasSupport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButton path={ parentMenu + '/colors/link' }>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<ColorIndicator colorValue={ color } />\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ __( 'Links' ) }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButton>\n\t);\n}\n\nfunction ScreenColors( { name } ) {\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback={ parentMenu ? parentMenu : '/' }\n\t\t\t\ttitle={ __( 'Colors' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Manage palettes and the default color of different global elements on the website.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<div className=\"edit-site-global-styles-screen-colors\">\n\t\t\t\t<VStack spacing={ 10 }>\n\t\t\t\t\t<Palette name={ name } />\n\n\t\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t\t<Subtitle>{ __( 'Elements' ) }</Subtitle>\n\t\t\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t\t\t<BackgroundColorItem\n\t\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<TextColorItem\n\t\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<LinkColorItem\n\t\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</VStack>\n\t\t\t\t</VStack>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default ScreenColors;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-colors.js"],"names":["__","__experimentalItemGroup","ItemGroup","__experimentalHStack","HStack","__experimentalVStack","VStack","FlexItem","ColorIndicator","ScreenHeader","Palette","NavigationButton","getSupportedGlobalStylesPanels","useStyle","Subtitle","BackgroundColorItem","name","parentMenu","supports","hasSupport","includes","backgroundColor","gradientValue","TextColorItem","color","LinkColorItem","ScreenColors","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I,KAAKW,SAAT,GAAqB,EAArB,GAA0B,aAAaX,IAA1D;AAEA,SACC,8BACC,cAAC,YAAD;AACC,IAAA,KAAK,EAAGhB,EAAE,CAAE,QAAF,CADX;AAEC,IAAA,WAAW,EAAGA,EAAE,CACf,iFADe;AAFjB,IADD,EAQC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,OAAD;AAAS,IAAA,IAAI,EAAGgB;AAAhB,IADD,EAGC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,QAAD,QAAYhB,EAAE,CAAE,UAAF,CAAd,CADD,EAEC,cAAC,SAAD;AAAW,IAAA,UAAU,MAArB;AAAsB,IAAA,WAAW;AAAjC,KACC,cAAC,mBAAD;AACC,IAAA,IAAI,EAAGgB,IADR;AAEC,IAAA,UAAU,EAAGC;AAFd,IADD,EAKC,cAAC,aAAD;AACC,IAAA,IAAI,EAAGD,IADR;AAEC,IAAA,UAAU,EAAGC;AAFd,IALD,EASC,cAAC,aAAD;AACC,IAAA,IAAI,EAAGD,IADR;AAEC,IAAA,UAAU,EAAGC;AAFd,IATD,CAFD,CAHD,CADD,CARD,CADD;AAkCA;;AAED,eAAeS,YAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tFlexItem,\n\tColorIndicator,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport Palette from './palette';\nimport { NavigationButton } from './navigation-button';\nimport { getSupportedGlobalStylesPanels, useStyle } from './hooks';\nimport Subtitle from './subtitle';\n\nfunction BackgroundColorItem( { name, parentMenu } ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst hasSupport =\n\t\tsupports.includes( 'backgroundColor' ) ||\n\t\tsupports.includes( 'background' );\n\tconst [ backgroundColor ] = useStyle( 'color.background', name );\n\tconst [ gradientValue ] = useStyle( 'color.gradient', name );\n\n\tif ( ! hasSupport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButton path={ parentMenu + '/colors/background' }>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\tcolorValue={ gradientValue ?? backgroundColor }\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ __( 'Background' ) }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButton>\n\t);\n}\n\nfunction TextColorItem( { name, parentMenu } ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst hasSupport = supports.includes( 'color' );\n\tconst [ color ] = useStyle( 'color.text', name );\n\n\tif ( ! hasSupport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButton path={ parentMenu + '/colors/text' }>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<ColorIndicator colorValue={ color } />\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ __( 'Text' ) }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButton>\n\t);\n}\n\nfunction LinkColorItem( { name, parentMenu } ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst hasSupport = supports.includes( 'linkColor' );\n\tconst [ color ] = useStyle( 'elements.link.color.text', name );\n\n\tif ( ! hasSupport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButton path={ parentMenu + '/colors/link' }>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<ColorIndicator colorValue={ color } />\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ __( 'Links' ) }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButton>\n\t);\n}\n\nfunction ScreenColors( { name } ) {\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Colors' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Manage palettes and the default color of different global elements on the site.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<div className=\"edit-site-global-styles-screen-colors\">\n\t\t\t\t<VStack spacing={ 10 }>\n\t\t\t\t\t<Palette name={ name } />\n\n\t\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t\t<Subtitle>{ __( 'Elements' ) }</Subtitle>\n\t\t\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t\t\t<BackgroundColorItem\n\t\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<TextColorItem\n\t\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<LinkColorItem\n\t\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</VStack>\n\t\t\t\t</VStack>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default ScreenColors;\n"]}
@@ -16,11 +16,9 @@ function ScreenLayout(_ref) {
16
16
  let {
17
17
  name
18
18
  } = _ref;
19
- const parentMenu = name === undefined ? '' : '/blocks/' + name;
20
19
  const hasBorderPanel = useHasBorderPanel(name);
21
20
  const hasDimensionsPanel = useHasDimensionsPanel(name);
22
21
  return createElement(Fragment, null, createElement(ScreenHeader, {
23
- back: parentMenu ? parentMenu : '/',
24
22
  title: __('Layout')
25
23
  }), hasDimensionsPanel && createElement(DimensionsPanel, {
26
24
  name: name
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-layout.js"],"names":["__","BorderPanel","useHasBorderPanel","DimensionsPanel","useHasDimensionsPanel","ScreenHeader","ScreenLayout","name","parentMenu","undefined","hasBorderPanel","hasDimensionsPanel"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,IAAsBC,iBAAtB,QAA+C,gBAA/C;AACA,OAAOC,eAAP,IAA0BC,qBAA1B,QAAuD,oBAAvD;AACA,OAAOC,YAAP,MAAyB,UAAzB;;AAEA,SAASC,YAAT,OAAkC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACjC,QAAMC,UAAU,GAAGD,IAAI,KAAKE,SAAT,GAAqB,EAArB,GAA0B,aAAaF,IAA1D;AACA,QAAMG,cAAc,GAAGR,iBAAiB,CAAEK,IAAF,CAAxC;AACA,QAAMI,kBAAkB,GAAGP,qBAAqB,CAAEG,IAAF,CAAhD;AAEA,SACC,8BACC,cAAC,YAAD;AACC,IAAA,IAAI,EAAGC,UAAU,GAAGA,UAAH,GAAgB,GADlC;AAEC,IAAA,KAAK,EAAGR,EAAE,CAAE,QAAF;AAFX,IADD,EAKGW,kBAAkB,IAAI,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAGJ;AAAxB,IALzB,EAMGG,cAAc,IAAI,cAAC,WAAD;AAAa,IAAA,IAAI,EAAGH;AAApB,IANrB,CADD;AAUA;;AAED,eAAeD,YAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BorderPanel, { useHasBorderPanel } from './border-panel';\nimport DimensionsPanel, { useHasDimensionsPanel } from './dimensions-panel';\nimport ScreenHeader from './header';\n\nfunction ScreenLayout( { name } ) {\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\tconst hasBorderPanel = useHasBorderPanel( name );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( name );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback={ parentMenu ? parentMenu : '/' }\n\t\t\t\ttitle={ __( 'Layout' ) }\n\t\t\t/>\n\t\t\t{ hasDimensionsPanel && <DimensionsPanel name={ name } /> }\n\t\t\t{ hasBorderPanel && <BorderPanel name={ name } /> }\n\t\t</>\n\t);\n}\n\nexport default ScreenLayout;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-layout.js"],"names":["__","BorderPanel","useHasBorderPanel","DimensionsPanel","useHasDimensionsPanel","ScreenHeader","ScreenLayout","name","hasBorderPanel","hasDimensionsPanel"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,IAAsBC,iBAAtB,QAA+C,gBAA/C;AACA,OAAOC,eAAP,IAA0BC,qBAA1B,QAAuD,oBAAvD;AACA,OAAOC,YAAP,MAAyB,UAAzB;;AAEA,SAASC,YAAT,OAAkC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACjC,QAAMC,cAAc,GAAGN,iBAAiB,CAAEK,IAAF,CAAxC;AACA,QAAME,kBAAkB,GAAGL,qBAAqB,CAAEG,IAAF,CAAhD;AAEA,SACC,8BACC,cAAC,YAAD;AAAc,IAAA,KAAK,EAAGP,EAAE,CAAE,QAAF;AAAxB,IADD,EAEGS,kBAAkB,IAAI,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAGF;AAAxB,IAFzB,EAGGC,cAAc,IAAI,cAAC,WAAD;AAAa,IAAA,IAAI,EAAGD;AAApB,IAHrB,CADD;AAOA;;AAED,eAAeD,YAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BorderPanel, { useHasBorderPanel } from './border-panel';\nimport DimensionsPanel, { useHasDimensionsPanel } from './dimensions-panel';\nimport ScreenHeader from './header';\n\nfunction ScreenLayout( { name } ) {\n\tconst hasBorderPanel = useHasBorderPanel( name );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( name );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader title={ __( 'Layout' ) } />\n\t\t\t{ hasDimensionsPanel && <DimensionsPanel name={ name } /> }\n\t\t\t{ hasBorderPanel && <BorderPanel name={ name } /> }\n\t\t</>\n\t);\n}\n\nexport default ScreenLayout;\n"]}
@@ -4,7 +4,7 @@ import { createElement, Fragment } from "@wordpress/element";
4
4
  * WordPress dependencies
5
5
  */
6
6
  import { __ } from '@wordpress/i18n';
7
- import { __experimentalPanelColorGradientSettings as PanelColorGradientSettings } from '@wordpress/block-editor';
7
+ import { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';
8
8
  /**
9
9
  * Internal dependencies
10
10
  */
@@ -16,7 +16,6 @@ function ScreenLinkColor(_ref) {
16
16
  let {
17
17
  name
18
18
  } = _ref;
19
- const parentMenu = name === undefined ? '' : '/blocks/' + name;
20
19
  const supports = getSupportedGlobalStylesPanels(name);
21
20
  const [solids] = useSetting('color.palette', name);
22
21
  const [areCustomSolidsEnabled] = useSetting('color.custom', name);
@@ -30,25 +29,20 @@ function ScreenLinkColor(_ref) {
30
29
  return null;
31
30
  }
32
31
 
33
- const settings = [{
34
- colorValue: linkColor,
35
- onColorChange: setLinkColor,
36
- label: __('Link color'),
37
- clearable: linkColor === userLinkColor
38
- }];
39
32
  return createElement(Fragment, null, createElement(ScreenHeader, {
40
- back: parentMenu + '/colors',
41
33
  title: __('Links'),
42
34
  description: __('Set the default color used for links across the site.')
43
- }), createElement(PanelColorGradientSettings, {
44
- title: __('Color'),
45
- settings: settings,
35
+ }), createElement(ColorGradientControl, {
36
+ className: "edit-site-screen-link-color__control",
46
37
  colors: colorsPerOrigin,
47
38
  disableCustomColors: !areCustomSolidsEnabled,
48
39
  __experimentalHasMultipleOrigins: true,
49
40
  showTitle: false,
50
41
  enableAlpha: true,
51
- __experimentalIsRenderedInSidebar: true
42
+ __experimentalIsRenderedInSidebar: true,
43
+ colorValue: linkColor,
44
+ onColorChange: setLinkColor,
45
+ clearable: linkColor === userLinkColor
52
46
  }));
53
47
  }
54
48
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-link-color.js"],"names":["__","__experimentalPanelColorGradientSettings","PanelColorGradientSettings","ScreenHeader","getSupportedGlobalStylesPanels","useSetting","useStyle","useColorsPerOrigin","ScreenLinkColor","name","parentMenu","undefined","supports","solids","areCustomSolidsEnabled","colorsPerOrigin","isLinkEnabled","hasLinkColor","includes","length","linkColor","setLinkColor","userLinkColor","settings","colorValue","onColorChange","label","clearable"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,wCAAwC,IAAIC,0BAArD,QAAuF,yBAAvF;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,SACCC,8BADD,EAECC,UAFD,EAGCC,QAHD,EAICC,kBAJD,QAKO,SALP;;AAOA,SAASC,eAAT,OAAqC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACpC,QAAMC,UAAU,GAAGD,IAAI,KAAKE,SAAT,GAAqB,EAArB,GAA0B,aAAaF,IAA1D;AACA,QAAMG,QAAQ,GAAGR,8BAA8B,CAAEK,IAAF,CAA/C;AACA,QAAM,CAAEI,MAAF,IAAaR,UAAU,CAAE,eAAF,EAAmBI,IAAnB,CAA7B;AACA,QAAM,CAAEK,sBAAF,IAA6BT,UAAU,CAAE,cAAF,EAAkBI,IAAlB,CAA7C;AAEA,QAAMM,eAAe,GAAGR,kBAAkB,CAAEE,IAAF,CAA1C;AAEA,QAAM,CAAEO,aAAF,IAAoBX,UAAU,CAAE,YAAF,EAAgBI,IAAhB,CAApC;AAEA,QAAMQ,YAAY,GACjBL,QAAQ,CAACM,QAAT,CAAmB,WAAnB,KACAF,aADA,KAEEH,MAAM,CAACM,MAAP,GAAgB,CAAhB,IAAqBL,sBAFvB,CADD;AAKA,QAAM,CAAEM,SAAF,EAAaC,YAAb,IAA8Bf,QAAQ,CAC3C,0BAD2C,EAE3CG,IAF2C,CAA5C;AAIA,QAAM,CAAEa,aAAF,IAAoBhB,QAAQ,CACjC,0BADiC,EAEjCG,IAFiC,EAGjC,MAHiC,CAAlC;;AAMA,MAAK,CAAEQ,YAAP,EAAsB;AACrB,WAAO,IAAP;AACA;;AAED,QAAMM,QAAQ,GAAG,CAChB;AACCC,IAAAA,UAAU,EAAEJ,SADb;AAECK,IAAAA,aAAa,EAAEJ,YAFhB;AAGCK,IAAAA,KAAK,EAAE1B,EAAE,CAAE,YAAF,CAHV;AAIC2B,IAAAA,SAAS,EAAEP,SAAS,KAAKE;AAJ1B,GADgB,CAAjB;AASA,SACC,8BACC,cAAC,YAAD;AACC,IAAA,IAAI,EAAGZ,UAAU,GAAG,SADrB;AAEC,IAAA,KAAK,EAAGV,EAAE,CAAE,OAAF,CAFX;AAGC,IAAA,WAAW,EAAGA,EAAE,CACf,uDADe;AAHjB,IADD,EASC,cAAC,0BAAD;AACC,IAAA,KAAK,EAAGA,EAAE,CAAE,OAAF,CADX;AAEC,IAAA,QAAQ,EAAGuB,QAFZ;AAGC,IAAA,MAAM,EAAGR,eAHV;AAIC,IAAA,mBAAmB,EAAG,CAAED,sBAJzB;AAKC,IAAA,gCAAgC,MALjC;AAMC,IAAA,SAAS,EAAG,KANb;AAOC,IAAA,WAAW,MAPZ;AAQC,IAAA,iCAAiC;AARlC,IATD,CADD;AAsBA;;AAED,eAAeN,eAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalPanelColorGradientSettings as PanelColorGradientSettings } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport {\n\tgetSupportedGlobalStylesPanels,\n\tuseSetting,\n\tuseStyle,\n\tuseColorsPerOrigin,\n} from './hooks';\n\nfunction ScreenLinkColor( { name } ) {\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst [ solids ] = useSetting( 'color.palette', name );\n\tconst [ areCustomSolidsEnabled ] = useSetting( 'color.custom', name );\n\n\tconst colorsPerOrigin = useColorsPerOrigin( name );\n\n\tconst [ isLinkEnabled ] = useSetting( 'color.link', name );\n\n\tconst hasLinkColor =\n\t\tsupports.includes( 'linkColor' ) &&\n\t\tisLinkEnabled &&\n\t\t( solids.length > 0 || areCustomSolidsEnabled );\n\n\tconst [ linkColor, setLinkColor ] = useStyle(\n\t\t'elements.link.color.text',\n\t\tname\n\t);\n\tconst [ userLinkColor ] = useStyle(\n\t\t'elements.link.color.text',\n\t\tname,\n\t\t'user'\n\t);\n\n\tif ( ! hasLinkColor ) {\n\t\treturn null;\n\t}\n\n\tconst settings = [\n\t\t{\n\t\t\tcolorValue: linkColor,\n\t\t\tonColorChange: setLinkColor,\n\t\t\tlabel: __( 'Link color' ),\n\t\t\tclearable: linkColor === userLinkColor,\n\t\t},\n\t];\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback={ parentMenu + '/colors' }\n\t\t\t\ttitle={ __( 'Links' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Set the default color used for links across the site.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<PanelColorGradientSettings\n\t\t\t\ttitle={ __( 'Color' ) }\n\t\t\t\tsettings={ settings }\n\t\t\t\tcolors={ colorsPerOrigin }\n\t\t\t\tdisableCustomColors={ ! areCustomSolidsEnabled }\n\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\tshowTitle={ false }\n\t\t\t\tenableAlpha\n\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenLinkColor;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-link-color.js"],"names":["__","__experimentalColorGradientControl","ColorGradientControl","ScreenHeader","getSupportedGlobalStylesPanels","useSetting","useStyle","useColorsPerOrigin","ScreenLinkColor","name","supports","solids","areCustomSolidsEnabled","colorsPerOrigin","isLinkEnabled","hasLinkColor","includes","length","linkColor","setLinkColor","userLinkColor"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,kCAAkC,IAAIC,oBAA/C,QAA2E,yBAA3E;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,SACCC,8BADD,EAECC,UAFD,EAGCC,QAHD,EAICC,kBAJD,QAKO,SALP;;AAOA,SAASC,eAAT,OAAqC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACpC,QAAMC,QAAQ,GAAGN,8BAA8B,CAAEK,IAAF,CAA/C;AACA,QAAM,CAAEE,MAAF,IAAaN,UAAU,CAAE,eAAF,EAAmBI,IAAnB,CAA7B;AACA,QAAM,CAAEG,sBAAF,IAA6BP,UAAU,CAAE,cAAF,EAAkBI,IAAlB,CAA7C;AAEA,QAAMI,eAAe,GAAGN,kBAAkB,CAAEE,IAAF,CAA1C;AAEA,QAAM,CAAEK,aAAF,IAAoBT,UAAU,CAAE,YAAF,EAAgBI,IAAhB,CAApC;AAEA,QAAMM,YAAY,GACjBL,QAAQ,CAACM,QAAT,CAAmB,WAAnB,KACAF,aADA,KAEEH,MAAM,CAACM,MAAP,GAAgB,CAAhB,IAAqBL,sBAFvB,CADD;AAKA,QAAM,CAAEM,SAAF,EAAaC,YAAb,IAA8Bb,QAAQ,CAC3C,0BAD2C,EAE3CG,IAF2C,CAA5C;AAIA,QAAM,CAAEW,aAAF,IAAoBd,QAAQ,CACjC,0BADiC,EAEjCG,IAFiC,EAGjC,MAHiC,CAAlC;;AAMA,MAAK,CAAEM,YAAP,EAAsB;AACrB,WAAO,IAAP;AACA;;AAED,SACC,8BACC,cAAC,YAAD;AACC,IAAA,KAAK,EAAGf,EAAE,CAAE,OAAF,CADX;AAEC,IAAA,WAAW,EAAGA,EAAE,CACf,uDADe;AAFjB,IADD,EAOC,cAAC,oBAAD;AACC,IAAA,SAAS,EAAC,sCADX;AAEC,IAAA,MAAM,EAAGa,eAFV;AAGC,IAAA,mBAAmB,EAAG,CAAED,sBAHzB;AAIC,IAAA,gCAAgC,MAJjC;AAKC,IAAA,SAAS,EAAG,KALb;AAMC,IAAA,WAAW,MANZ;AAOC,IAAA,iCAAiC,MAPlC;AAQC,IAAA,UAAU,EAAGM,SARd;AASC,IAAA,aAAa,EAAGC,YATjB;AAUC,IAAA,SAAS,EAAGD,SAAS,KAAKE;AAV3B,IAPD,CADD;AAsBA;;AAED,eAAeZ,eAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport {\n\tgetSupportedGlobalStylesPanels,\n\tuseSetting,\n\tuseStyle,\n\tuseColorsPerOrigin,\n} from './hooks';\n\nfunction ScreenLinkColor( { name } ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst [ solids ] = useSetting( 'color.palette', name );\n\tconst [ areCustomSolidsEnabled ] = useSetting( 'color.custom', name );\n\n\tconst colorsPerOrigin = useColorsPerOrigin( name );\n\n\tconst [ isLinkEnabled ] = useSetting( 'color.link', name );\n\n\tconst hasLinkColor =\n\t\tsupports.includes( 'linkColor' ) &&\n\t\tisLinkEnabled &&\n\t\t( solids.length > 0 || areCustomSolidsEnabled );\n\n\tconst [ linkColor, setLinkColor ] = useStyle(\n\t\t'elements.link.color.text',\n\t\tname\n\t);\n\tconst [ userLinkColor ] = useStyle(\n\t\t'elements.link.color.text',\n\t\tname,\n\t\t'user'\n\t);\n\n\tif ( ! hasLinkColor ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Links' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Set the default color used for links across the site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ColorGradientControl\n\t\t\t\tclassName=\"edit-site-screen-link-color__control\"\n\t\t\t\tcolors={ colorsPerOrigin }\n\t\t\t\tdisableCustomColors={ ! areCustomSolidsEnabled }\n\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\tshowTitle={ false }\n\t\t\t\tenableAlpha\n\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\tcolorValue={ linkColor }\n\t\t\t\tonColorChange={ setLinkColor }\n\t\t\t\tclearable={ linkColor === userLinkColor }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenLinkColor;\n"]}
@@ -3,21 +3,38 @@ import { createElement } from "@wordpress/element";
3
3
  /**
4
4
  * WordPress dependencies
5
5
  */
6
- import { __experimentalItemGroup as ItemGroup, __experimentalItem as Item, __experimentalHStack as HStack, FlexItem, CardBody, Card, CardDivider } from '@wordpress/components';
6
+ import { __experimentalItemGroup as ItemGroup, __experimentalItem as Item, __experimentalHStack as HStack, __experimentalVStack as VStack, FlexItem, CardBody, Card, CardDivider } from '@wordpress/components';
7
7
  import { isRTL, __ } from '@wordpress/i18n';
8
8
  import { chevronLeft, chevronRight, Icon } from '@wordpress/icons';
9
+ import { useSelect } from '@wordpress/data';
10
+ import { store as coreStore } from '@wordpress/core-data';
9
11
  /**
10
12
  * Internal dependencies
11
13
  */
12
14
 
13
- import StylesPreview from './preview';
14
- import NavigationButton from './navigation-button';
15
+ import { NavigationButton } from './navigation-button';
15
16
  import ContextMenu from './context-menu';
17
+ import StylesPreview from './preview';
16
18
 
17
19
  function ScreenRoot() {
20
+ const {
21
+ variations
22
+ } = useSelect(select => {
23
+ return {
24
+ variations: select(coreStore).__experimentalGetCurrentThemeGlobalStylesVariations()
25
+ };
26
+ }, []);
18
27
  return createElement(Card, {
19
28
  size: "small"
20
- }, createElement(CardBody, null, createElement(StylesPreview, null)), createElement(CardBody, null, createElement(ContextMenu, null)), createElement(CardDivider, null), createElement(CardBody, null, createElement(ItemGroup, null, createElement(Item, null, __('Customize the appearance of specific blocks for the whole site.')), createElement(NavigationButton, {
29
+ }, createElement(CardBody, null, createElement(VStack, {
30
+ spacing: 2
31
+ }, createElement(Card, null, createElement(StylesPreview, null)), !!(variations !== null && variations !== void 0 && variations.length) && createElement(NavigationButton, {
32
+ path: "/variations"
33
+ }, createElement(HStack, {
34
+ justify: "space-between"
35
+ }, createElement(FlexItem, null, __('Other styles')), createElement(FlexItem, null, createElement(Icon, {
36
+ icon: isRTL() ? chevronLeft : chevronRight
37
+ })))))), createElement(CardBody, null, createElement(ContextMenu, null)), createElement(CardDivider, null), createElement(CardBody, null, createElement(ItemGroup, null, createElement(Item, null, __('Customize the appearance of specific blocks for the whole site.')), createElement(NavigationButton, {
21
38
  path: "/blocks"
22
39
  }, createElement(HStack, {
23
40
  justify: "space-between"
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"names":["__experimentalItemGroup","ItemGroup","__experimentalItem","Item","__experimentalHStack","HStack","FlexItem","CardBody","Card","CardDivider","isRTL","__","chevronLeft","chevronRight","Icon","StylesPreview","NavigationButton","ContextMenu","ScreenRoot"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAD5B,EAECC,kBAAkB,IAAIC,IAFvB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,QAJD,EAKCC,QALD,EAMCC,IAND,EAOCC,WAPD,QAQO,uBARP;AASA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBAA1B;AACA,SAASC,WAAT,EAAsBC,YAAtB,EAAoCC,IAApC,QAAgD,kBAAhD;AAEA;AACA;AACA;;AACA,OAAOC,aAAP,MAA0B,WAA1B;AACA,OAAOC,gBAAP,MAA6B,qBAA7B;AACA,OAAOC,WAAP,MAAwB,gBAAxB;;AAEA,SAASC,UAAT,GAAsB;AACrB,SACC,cAAC,IAAD;AAAM,IAAA,IAAI,EAAC;AAAX,KACC,cAAC,QAAD,QACC,cAAC,aAAD,OADD,CADD,EAKC,cAAC,QAAD,QACC,cAAC,WAAD,OADD,CALD,EASC,cAAC,WAAD,OATD,EAWC,cAAC,QAAD,QACC,cAAC,SAAD,QACC,cAAC,IAAD,QACGP,EAAE,CACH,iEADG,CADL,CADD,EAMC,cAAC,gBAAD;AAAkB,IAAA,IAAI,EAAC;AAAvB,KACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,cAAC,QAAD,QAAYA,EAAE,CAAE,QAAF,CAAd,CADD,EAEC,cAAC,QAAD,QACC,cAAC,IAAD;AACC,IAAA,IAAI,EACHD,KAAK,KAAKE,WAAL,GAAmBC;AAF1B,IADD,CAFD,CADD,CAND,CADD,CAXD,CADD;AAmCA;;AAED,eAAeK,UAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tFlexItem,\n\tCardBody,\n\tCard,\n\tCardDivider,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronLeft, chevronRight, Icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport StylesPreview from './preview';\nimport NavigationButton from './navigation-button';\nimport ContextMenu from './context-menu';\n\nfunction ScreenRoot() {\n\treturn (\n\t\t<Card size=\"small\">\n\t\t\t<CardBody>\n\t\t\t\t<StylesPreview />\n\t\t\t</CardBody>\n\n\t\t\t<CardBody>\n\t\t\t\t<ContextMenu />\n\t\t\t</CardBody>\n\n\t\t\t<CardDivider />\n\n\t\t\t<CardBody>\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t<Item>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Customize the appearance of specific blocks for the whole site.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Item>\n\t\t\t\t\t<NavigationButton path=\"/blocks\">\n\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t<FlexItem>{ __( 'Blocks' ) }</FlexItem>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\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</FlexItem>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</NavigationButton>\n\t\t\t\t</ItemGroup>\n\t\t\t</CardBody>\n\t\t</Card>\n\t);\n}\n\nexport default ScreenRoot;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"names":["__experimentalItemGroup","ItemGroup","__experimentalItem","Item","__experimentalHStack","HStack","__experimentalVStack","VStack","FlexItem","CardBody","Card","CardDivider","isRTL","__","chevronLeft","chevronRight","Icon","useSelect","store","coreStore","NavigationButton","ContextMenu","StylesPreview","ScreenRoot","variations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAD5B,EAECC,kBAAkB,IAAIC,IAFvB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,oBAAoB,IAAIC,MAJzB,EAKCC,QALD,EAMCC,QAND,EAOCC,IAPD,EAQCC,WARD,QASO,uBATP;AAUA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBAA1B;AACA,SAASC,WAAT,EAAsBC,YAAtB,EAAoCC,IAApC,QAAgD,kBAAhD;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASC,gBAAT,QAAiC,qBAAjC;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,aAAP,MAA0B,WAA1B;;AAEA,SAASC,UAAT,GAAsB;AACrB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t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tFlexItem,\n\tCardBody,\n\tCard,\n\tCardDivider,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronLeft, chevronRight, Icon } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { NavigationButton } from './navigation-button';\nimport ContextMenu from './context-menu';\nimport StylesPreview from './preview';\n\nfunction ScreenRoot() {\n\tconst { variations } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tvariations: select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations(),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Card size=\"small\">\n\t\t\t<CardBody>\n\t\t\t\t<VStack spacing={ 2 }>\n\t\t\t\t\t<Card>\n\t\t\t\t\t\t<StylesPreview />\n\t\t\t\t\t</Card>\n\t\t\t\t\t{ !! variations?.length && (\n\t\t\t\t\t\t<NavigationButton path=\"/variations\">\n\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t<FlexItem>{ __( 'Other styles' ) }</FlexItem>\n\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</NavigationButton>\n\t\t\t\t\t) }\n\t\t\t\t</VStack>\n\t\t\t</CardBody>\n\n\t\t\t<CardBody>\n\t\t\t\t<ContextMenu />\n\t\t\t</CardBody>\n\n\t\t\t<CardDivider />\n\n\t\t\t<CardBody>\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t<Item>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Customize the appearance of specific blocks for the whole site.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Item>\n\t\t\t\t\t<NavigationButton path=\"/blocks\">\n\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t<FlexItem>{ __( 'Blocks' ) }</FlexItem>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\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</FlexItem>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</NavigationButton>\n\t\t\t\t</ItemGroup>\n\t\t\t</CardBody>\n\t\t</Card>\n\t);\n}\n\nexport default ScreenRoot;\n"]}