@wordpress/edit-site 3.0.24 → 4.0.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 (275) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE.md +1 -1
  3. package/README.md +7 -1
  4. package/build/components/block-editor/resizable-editor.js +1 -0
  5. package/build/components/block-editor/resizable-editor.js.map +1 -1
  6. package/build/components/code-editor/code-editor-text-area.js +95 -0
  7. package/build/components/code-editor/code-editor-text-area.js.map +1 -0
  8. package/build/components/code-editor/index.js +79 -0
  9. package/build/components/code-editor/index.js.map +1 -0
  10. package/build/components/editor/index.js +39 -9
  11. package/build/components/editor/index.js.map +1 -1
  12. package/build/components/global-styles/border-panel.js +81 -22
  13. package/build/components/global-styles/border-panel.js.map +1 -1
  14. package/build/components/global-styles/context-menu.js +4 -6
  15. package/build/components/global-styles/context-menu.js.map +1 -1
  16. package/build/components/global-styles/global-styles-provider.js +1 -0
  17. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  18. package/build/components/global-styles/header.js +2 -7
  19. package/build/components/global-styles/header.js.map +1 -1
  20. package/build/components/global-styles/navigation-button.js +35 -12
  21. package/build/components/global-styles/navigation-button.js.map +1 -1
  22. package/build/components/global-styles/palette.js +3 -3
  23. package/build/components/global-styles/palette.js.map +1 -1
  24. package/build/components/global-styles/preview.js +46 -15
  25. package/build/components/global-styles/preview.js.map +1 -1
  26. package/build/components/global-styles/screen-background-color.js +9 -12
  27. package/build/components/global-styles/screen-background-color.js.map +1 -1
  28. package/build/components/global-styles/screen-block-list.js +2 -3
  29. package/build/components/global-styles/screen-block-list.js.map +1 -1
  30. package/build/components/global-styles/screen-block.js +0 -1
  31. package/build/components/global-styles/screen-block.js.map +1 -1
  32. package/build/components/global-styles/screen-color-palette.js +0 -2
  33. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  34. package/build/components/global-styles/screen-colors.js +5 -6
  35. package/build/components/global-styles/screen-colors.js.map +1 -1
  36. package/build/components/global-styles/screen-layout.js +0 -2
  37. package/build/components/global-styles/screen-layout.js.map +1 -1
  38. package/build/components/global-styles/screen-link-color.js +6 -12
  39. package/build/components/global-styles/screen-link-color.js.map +1 -1
  40. package/build/components/global-styles/screen-root.js +22 -3
  41. package/build/components/global-styles/screen-root.js.map +1 -1
  42. package/build/components/global-styles/screen-style-variations.js +138 -0
  43. package/build/components/global-styles/screen-style-variations.js.map +1 -0
  44. package/build/components/global-styles/screen-text-color.js +6 -12
  45. package/build/components/global-styles/screen-text-color.js.map +1 -1
  46. package/build/components/global-styles/screen-typography-element.js +0 -2
  47. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  48. package/build/components/global-styles/screen-typography.js +2 -3
  49. package/build/components/global-styles/screen-typography.js.map +1 -1
  50. package/build/components/global-styles/ui.js +31 -14
  51. package/build/components/global-styles/ui.js.map +1 -1
  52. package/build/components/header/index.js +12 -4
  53. package/build/components/header/index.js.map +1 -1
  54. package/build/components/header/mode-switcher/index.js +78 -0
  55. package/build/components/header/mode-switcher/index.js.map +1 -0
  56. package/build/components/header/more-menu/copy-content-menu-item.js +74 -0
  57. package/build/components/header/more-menu/copy-content-menu-item.js.map +1 -0
  58. package/build/components/header/more-menu/index.js +72 -39
  59. package/build/components/header/more-menu/index.js.map +1 -1
  60. package/build/{plugins → components/header/more-menu}/site-export.js +0 -0
  61. package/build/components/header/more-menu/site-export.js.map +1 -0
  62. package/build/{plugins → components/header/more-menu}/welcome-guide-menu-item.js +1 -1
  63. package/build/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
  64. package/build/components/header/tools-more-menu-group/index.js +1 -5
  65. package/build/components/header/tools-more-menu-group/index.js.map +1 -1
  66. package/build/components/keyboard-shortcut-help-modal/config.js +45 -0
  67. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  68. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +56 -0
  69. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  70. package/build/components/keyboard-shortcut-help-modal/index.js +137 -0
  71. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  72. package/build/components/keyboard-shortcut-help-modal/shortcut.js +65 -0
  73. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  74. package/build/components/keyboard-shortcuts/index.js +26 -1
  75. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  76. package/build/components/list/actions/index.js +5 -4
  77. package/build/components/list/actions/index.js.map +1 -1
  78. package/build/components/list/actions/rename-menu-item.js +3 -3
  79. package/build/components/list/actions/rename-menu-item.js.map +1 -1
  80. package/build/components/list/added-by.js +51 -50
  81. package/build/components/list/added-by.js.map +1 -1
  82. package/build/components/routes/redirect-to-homepage.js +87 -0
  83. package/build/components/routes/redirect-to-homepage.js.map +1 -0
  84. package/build/components/secondary-sidebar/inserter-sidebar.js +13 -3
  85. package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  86. package/build/components/secondary-sidebar/list-view-sidebar.js +7 -5
  87. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  88. package/build/components/sidebar/default-sidebar.js +4 -2
  89. package/build/components/sidebar/default-sidebar.js.map +1 -1
  90. package/build/components/sidebar/global-styles-sidebar.js +1 -0
  91. package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
  92. package/build/components/url-query-controller/index.js +1 -38
  93. package/build/components/url-query-controller/index.js.map +1 -1
  94. package/build/index.js +10 -5
  95. package/build/index.js.map +1 -1
  96. package/build/store/actions.js +29 -27
  97. package/build/store/actions.js.map +1 -1
  98. package/build/store/defaults.js +2 -1
  99. package/build/store/defaults.js.map +1 -1
  100. package/build/store/reducer.js +11 -0
  101. package/build/store/reducer.js.map +1 -1
  102. package/build/store/selectors.js +13 -0
  103. package/build/store/selectors.js.map +1 -1
  104. package/build-module/components/block-editor/resizable-editor.js +1 -0
  105. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  106. package/build-module/components/code-editor/code-editor-text-area.js +83 -0
  107. package/build-module/components/code-editor/code-editor-text-area.js.map +1 -0
  108. package/build-module/components/code-editor/index.js +62 -0
  109. package/build-module/components/code-editor/index.js.map +1 -0
  110. package/build-module/components/editor/index.js +38 -10
  111. package/build-module/components/editor/index.js.map +1 -1
  112. package/build-module/components/global-styles/border-panel.js +82 -23
  113. package/build-module/components/global-styles/border-panel.js.map +1 -1
  114. package/build-module/components/global-styles/context-menu.js +1 -1
  115. package/build-module/components/global-styles/context-menu.js.map +1 -1
  116. package/build-module/components/global-styles/global-styles-provider.js +1 -1
  117. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  118. package/build-module/components/global-styles/header.js +2 -5
  119. package/build-module/components/global-styles/header.js.map +1 -1
  120. package/build-module/components/global-styles/navigation-button.js +35 -10
  121. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  122. package/build-module/components/global-styles/palette.js +2 -2
  123. package/build-module/components/global-styles/palette.js.map +1 -1
  124. package/build-module/components/global-styles/preview.js +45 -15
  125. package/build-module/components/global-styles/preview.js.map +1 -1
  126. package/build-module/components/global-styles/screen-background-color.js +9 -13
  127. package/build-module/components/global-styles/screen-background-color.js.map +1 -1
  128. package/build-module/components/global-styles/screen-block-list.js +1 -2
  129. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  130. package/build-module/components/global-styles/screen-block.js +0 -1
  131. package/build-module/components/global-styles/screen-block.js.map +1 -1
  132. package/build-module/components/global-styles/screen-color-palette.js +0 -2
  133. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  134. package/build-module/components/global-styles/screen-colors.js +2 -3
  135. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  136. package/build-module/components/global-styles/screen-layout.js +0 -2
  137. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  138. package/build-module/components/global-styles/screen-link-color.js +7 -13
  139. package/build-module/components/global-styles/screen-link-color.js.map +1 -1
  140. package/build-module/components/global-styles/screen-root.js +21 -4
  141. package/build-module/components/global-styles/screen-root.js.map +1 -1
  142. package/build-module/components/global-styles/screen-style-variations.js +119 -0
  143. package/build-module/components/global-styles/screen-style-variations.js.map +1 -0
  144. package/build-module/components/global-styles/screen-text-color.js +7 -13
  145. package/build-module/components/global-styles/screen-text-color.js.map +1 -1
  146. package/build-module/components/global-styles/screen-typography-element.js +0 -2
  147. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  148. package/build-module/components/global-styles/screen-typography.js +1 -2
  149. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  150. package/build-module/components/global-styles/ui.js +29 -14
  151. package/build-module/components/global-styles/ui.js.map +1 -1
  152. package/build-module/components/header/index.js +13 -5
  153. package/build-module/components/header/index.js.map +1 -1
  154. package/build-module/components/header/mode-switcher/index.js +65 -0
  155. package/build-module/components/header/mode-switcher/index.js.map +1 -0
  156. package/build-module/components/header/more-menu/copy-content-menu-item.js +59 -0
  157. package/build-module/components/header/more-menu/copy-content-menu-item.js.map +1 -0
  158. package/build-module/components/header/more-menu/index.js +67 -40
  159. package/build-module/components/header/more-menu/index.js.map +1 -1
  160. package/build-module/{plugins → components/header/more-menu}/site-export.js +0 -0
  161. package/build-module/components/header/more-menu/site-export.js.map +1 -0
  162. package/build-module/{plugins → components/header/more-menu}/welcome-guide-menu-item.js +1 -1
  163. package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
  164. package/build-module/components/header/tools-more-menu-group/index.js +2 -5
  165. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  166. package/build-module/components/keyboard-shortcut-help-modal/config.js +36 -0
  167. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  168. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +44 -0
  169. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  170. package/build-module/components/keyboard-shortcut-help-modal/index.js +120 -0
  171. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  172. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +58 -0
  173. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  174. package/build-module/components/keyboard-shortcuts/index.js +26 -1
  175. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  176. package/build-module/components/list/actions/index.js +5 -4
  177. package/build-module/components/list/actions/index.js.map +1 -1
  178. package/build-module/components/list/actions/rename-menu-item.js +3 -3
  179. package/build-module/components/list/actions/rename-menu-item.js.map +1 -1
  180. package/build-module/components/list/added-by.js +52 -51
  181. package/build-module/components/list/added-by.js.map +1 -1
  182. package/build-module/components/routes/redirect-to-homepage.js +75 -0
  183. package/build-module/components/routes/redirect-to-homepage.js.map +1 -0
  184. package/build-module/components/secondary-sidebar/inserter-sidebar.js +14 -4
  185. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  186. package/build-module/components/secondary-sidebar/list-view-sidebar.js +7 -5
  187. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  188. package/build-module/components/sidebar/default-sidebar.js +4 -2
  189. package/build-module/components/sidebar/default-sidebar.js.map +1 -1
  190. package/build-module/components/sidebar/global-styles-sidebar.js +1 -0
  191. package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
  192. package/build-module/components/url-query-controller/index.js +3 -40
  193. package/build-module/components/url-query-controller/index.js.map +1 -1
  194. package/build-module/index.js +9 -4
  195. package/build-module/index.js.map +1 -1
  196. package/build-module/store/actions.js +25 -25
  197. package/build-module/store/actions.js.map +1 -1
  198. package/build-module/store/defaults.js +2 -1
  199. package/build-module/store/defaults.js.map +1 -1
  200. package/build-module/store/reducer.js +11 -0
  201. package/build-module/store/reducer.js.map +1 -1
  202. package/build-module/store/selectors.js +11 -0
  203. package/build-module/store/selectors.js.map +1 -1
  204. package/build-style/style-rtl.css +202 -72
  205. package/build-style/style.css +202 -72
  206. package/package.json +28 -30
  207. package/src/components/block-editor/resizable-editor.js +1 -0
  208. package/src/components/block-editor/style.scss +15 -23
  209. package/src/components/code-editor/code-editor-text-area.js +79 -0
  210. package/src/components/code-editor/index.js +65 -0
  211. package/src/components/code-editor/style.scss +100 -0
  212. package/src/components/editor/index.js +55 -10
  213. package/src/components/global-styles/border-panel.js +106 -42
  214. package/src/components/global-styles/context-menu.js +1 -1
  215. package/src/components/global-styles/global-styles-provider.js +1 -2
  216. package/src/components/global-styles/header.js +3 -5
  217. package/src/components/global-styles/navigation-button.js +31 -10
  218. package/src/components/global-styles/palette.js +6 -2
  219. package/src/components/global-styles/preview.js +46 -18
  220. package/src/components/global-styles/screen-background-color.js +7 -12
  221. package/src/components/global-styles/screen-block-list.js +1 -2
  222. package/src/components/global-styles/screen-block.js +1 -1
  223. package/src/components/global-styles/screen-color-palette.js +0 -2
  224. package/src/components/global-styles/screen-colors.js +2 -3
  225. package/src/components/global-styles/screen-layout.js +1 -5
  226. package/src/components/global-styles/screen-link-color.js +6 -16
  227. package/src/components/global-styles/screen-root.js +32 -3
  228. package/src/components/global-styles/screen-style-variations.js +130 -0
  229. package/src/components/global-styles/screen-text-color.js +6 -16
  230. package/src/components/global-styles/screen-typography-element.js +0 -4
  231. package/src/components/global-styles/screen-typography.js +2 -3
  232. package/src/components/global-styles/style.scss +24 -25
  233. package/src/components/global-styles/ui.js +55 -25
  234. package/src/components/header/document-actions/style.scss +1 -9
  235. package/src/components/header/index.js +10 -2
  236. package/src/components/header/mode-switcher/index.js +67 -0
  237. package/src/components/header/more-menu/copy-content-menu-item.js +53 -0
  238. package/src/components/header/more-menu/index.js +107 -44
  239. package/src/{plugins → components/header/more-menu}/site-export.js +0 -0
  240. package/src/{plugins → components/header/more-menu}/welcome-guide-menu-item.js +1 -1
  241. package/src/components/header/style.scss +2 -1
  242. package/src/components/header/tools-more-menu-group/index.js +2 -7
  243. package/src/components/keyboard-shortcut-help-modal/config.js +27 -0
  244. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +41 -0
  245. package/src/components/keyboard-shortcut-help-modal/index.js +135 -0
  246. package/src/components/keyboard-shortcut-help-modal/shortcut.js +73 -0
  247. package/src/components/keyboard-shortcut-help-modal/style.scss +66 -0
  248. package/src/components/keyboard-shortcuts/index.js +27 -1
  249. package/src/components/list/actions/index.js +5 -4
  250. package/src/components/list/actions/rename-menu-item.js +3 -3
  251. package/src/components/list/added-by.js +57 -63
  252. package/src/components/routes/redirect-to-homepage.js +71 -0
  253. package/src/components/secondary-sidebar/inserter-sidebar.js +14 -3
  254. package/src/components/secondary-sidebar/list-view-sidebar.js +12 -5
  255. package/src/components/secondary-sidebar/style.scss +0 -4
  256. package/src/components/sidebar/default-sidebar.js +2 -0
  257. package/src/components/sidebar/global-styles-sidebar.js +1 -0
  258. package/src/components/sidebar/style.scss +21 -14
  259. package/src/components/url-query-controller/index.js +3 -35
  260. package/src/index.js +10 -3
  261. package/src/store/actions.js +24 -37
  262. package/src/store/defaults.js +1 -0
  263. package/src/store/reducer.js +6 -0
  264. package/src/store/selectors.js +11 -0
  265. package/src/store/test/actions.js +2 -92
  266. package/src/style.scss +2 -0
  267. package/build/plugins/index.js +0 -28
  268. package/build/plugins/index.js.map +0 -1
  269. package/build/plugins/site-export.js.map +0 -1
  270. package/build/plugins/welcome-guide-menu-item.js.map +0 -1
  271. package/build-module/plugins/index.js +0 -20
  272. package/build-module/plugins/index.js.map +0 -1
  273. package/build-module/plugins/site-export.js.map +0 -1
  274. package/build-module/plugins/welcome-guide-menu-item.js.map +0 -1
  275. package/src/plugins/index.js +0 -24
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/border-panel.js"],"names":["MIN_BORDER_WIDTH","EMPTY_ARRAY","useHasBorderPanel","name","controls","useHasBorderColorControl","useHasBorderRadiusControl","useHasBorderStyleControl","useHasBorderWidthControl","some","Boolean","supports","includes","BorderPanel","units","availableUnits","hasBorderWidth","borderWidthValue","setBorderWidth","hasBorderStyle","borderStyle","setBorderStyle","colors","disableCustomColors","disableCustomGradients","hasBorderColor","borderColor","setBorderColor","hasBorderRadius","borderRadiusValues","setBorderRadius","value","undefined"],"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AAAf,KACGH,cAAc,IACf,4BAAC,qCAAD;AACC,IAAA,KAAK,EAAGC,gBADT;AAEC,IAAA,KAAK,EAAG,cAAI,OAAJ,CAFT;AAGC,IAAA,GAAG,EAAGjB,gBAHP;AAIC,IAAA,QAAQ,EAAK+B,KAAF,IAAa;AACvBb,MAAAA,cAAc,CAAEa,KAAK,IAAIC,SAAX,CAAd;AACA,KANF;AAOC,IAAA,KAAK,EAAGlB;AAPT,IAFF,EAYGK,cAAc,IACf,4BAAC,6CAAD;AACC,IAAA,KAAK,EAAGC,WADT;AAEC,IAAA,QAAQ,EAAGC;AAFZ,IAbF,CAFF,EAsBGI,cAAc,IACf,4BAAC,+CAAD;AACC,IAAA,KAAK,EAAG,cAAI,OAAJ,CADT;AAEC,IAAA,UAAU,EAAGC,WAFd;AAGC,IAAA,MAAM,EAAGJ,MAHV;AAIC,IAAA,SAAS,EAAGU,SAJb;AAKC,IAAA,mBAAmB,EAAGT,mBALvB;AAMC,IAAA,sBAAsB,EAAGC,sBAN1B;AAOC,IAAA,aAAa,EAAGG;AAPjB,IAvBF,EAiCGC,eAAe,IAChB,4BAAC,8CAAD;AACC,IAAA,MAAM,EAAGC,kBADV;AAEC,IAAA,QAAQ,EAAGC;AAFZ,IAlCF,CADD;AA0CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalBorderRadiusControl as BorderRadiusControl,\n\t__experimentalBorderStyleControl as BorderStyleControl,\n\t__experimentalColorGradientControl as ColorGradientControl,\n} from '@wordpress/block-editor';\nimport {\n\tPanelBody,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalUseCustomUnits as useCustomUnits,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getSupportedGlobalStylesPanels, useSetting, useStyle } from './hooks';\n\nconst MIN_BORDER_WIDTH = 0;\n\n// Defining empty array here instead of inline avoids unnecessary re-renders of\n// color control.\nconst EMPTY_ARRAY = [];\n\nexport function useHasBorderPanel( name ) {\n\tconst controls = [\n\t\tuseHasBorderColorControl( name ),\n\t\tuseHasBorderRadiusControl( name ),\n\t\tuseHasBorderStyleControl( name ),\n\t\tuseHasBorderWidthControl( name ),\n\t];\n\n\treturn controls.some( Boolean );\n}\n\nfunction useHasBorderColorControl( name ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\treturn (\n\t\tuseSetting( 'border.color', name )[ 0 ] &&\n\t\tsupports.includes( 'borderColor' )\n\t);\n}\n\nfunction useHasBorderRadiusControl( name ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\treturn (\n\t\tuseSetting( 'border.radius', name )[ 0 ] &&\n\t\tsupports.includes( 'borderRadius' )\n\t);\n}\n\nfunction useHasBorderStyleControl( name ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\treturn (\n\t\tuseSetting( 'border.style', name )[ 0 ] &&\n\t\tsupports.includes( 'borderStyle' )\n\t);\n}\n\nfunction useHasBorderWidthControl( name ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\treturn (\n\t\tuseSetting( 'border.width', name )[ 0 ] &&\n\t\tsupports.includes( 'borderWidth' )\n\t);\n}\n\nexport default function BorderPanel( { name } ) {\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: useSetting( 'spacing.units' )[ 0 ] || [\n\t\t\t'px',\n\t\t\t'em',\n\t\t\t'rem',\n\t\t],\n\t} );\n\n\t// Border width.\n\tconst hasBorderWidth = useHasBorderWidthControl( name );\n\tconst [ borderWidthValue, setBorderWidth ] = useStyle(\n\t\t'border.width',\n\t\tname\n\t);\n\n\t// Border style.\n\tconst hasBorderStyle = useHasBorderStyleControl( name );\n\tconst [ borderStyle, setBorderStyle ] = useStyle( 'border.style', name );\n\n\t// Border color.\n\tconst [ colors = EMPTY_ARRAY ] = useSetting( 'color.palette' );\n\tconst disableCustomColors = ! useSetting( 'color.custom' )[ 0 ];\n\tconst disableCustomGradients = ! useSetting( 'color.customGradient' )[ 0 ];\n\tconst hasBorderColor = useHasBorderColorControl( name );\n\tconst [ borderColor, setBorderColor ] = useStyle( 'border.color', name );\n\n\t// Border radius.\n\tconst hasBorderRadius = useHasBorderRadiusControl( name );\n\tconst [ borderRadiusValues, setBorderRadius ] = useStyle(\n\t\t'border.radius',\n\t\tname\n\t);\n\n\treturn (\n\t\t<PanelBody title={ __( 'Border' ) } initialOpen={ true }>\n\t\t\t{ ( hasBorderWidth || hasBorderStyle ) && (\n\t\t\t\t<div className=\"edit-site-global-styles-sidebar__border-controls-row\">\n\t\t\t\t\t{ hasBorderWidth && (\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tvalue={ borderWidthValue }\n\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\tmin={ MIN_BORDER_WIDTH }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetBorderWidth( value || undefined );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ hasBorderStyle && (\n\t\t\t\t\t\t<BorderStyleControl\n\t\t\t\t\t\t\tvalue={ borderStyle }\n\t\t\t\t\t\t\tonChange={ setBorderStyle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ hasBorderColor && (\n\t\t\t\t<ColorGradientControl\n\t\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\t\tcolorValue={ borderColor }\n\t\t\t\t\tcolors={ colors }\n\t\t\t\t\tgradients={ undefined }\n\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\tdisableCustomGradients={ disableCustomGradients }\n\t\t\t\t\tonColorChange={ setBorderColor }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasBorderRadius && (\n\t\t\t\t<BorderRadiusControl\n\t\t\t\t\tvalues={ borderRadiusValues }\n\t\t\t\t\tonChange={ setBorderRadius }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</PanelBody>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/border-panel.js"],"names":["MIN_BORDER_WIDTH","EMPTY_ARRAY","useHasBorderPanel","name","controls","useHasBorderColorControl","useHasBorderRadiusControl","useHasBorderStyleControl","useHasBorderWidthControl","some","Boolean","supports","includes","BorderPanel","userBorderStyles","createHasValueCallback","feature","createResetCallback","setStyle","undefined","handleOnChange","value","units","availableUnits","showBorderWidth","borderWidthValue","setBorderWidth","showBorderStyle","borderStyle","setBorderStyle","showBorderColor","borderColor","setBorderColor","colors","disableCustomColors","disableCustomGradients","showBorderRadius","borderRadiusValues","setBorderRadius","hasBorderRadius","borderValues","radius","Object","entries","resetAll","handleOnChangeWithStyle"],"mappings":";;;;;;;;;;AAGA;;AAKA;;AAMA;;AAKA;;AAnBA;AACA;AACA;;AAcA;AACA;AACA;AAGA,MAAMA,gBAAgB,GAAG,CAAzB,C,CAEA;AACA;;AACA,MAAMC,WAAW,GAAG,EAApB;;AAEO,SAASC,iBAAT,CAA4BC,IAA5B,EAAmC;AACzC,QAAMC,QAAQ,GAAG,CAChBC,wBAAwB,CAAEF,IAAF,CADR,EAEhBG,yBAAyB,CAAEH,IAAF,CAFT,EAGhBI,wBAAwB,CAAEJ,IAAF,CAHR,EAIhBK,wBAAwB,CAAEL,IAAF,CAJR,CAAjB;AAOA,SAAOC,QAAQ,CAACK,IAAT,CAAeC,OAAf,CAAP;AACA;;AAED,SAASL,wBAAT,CAAmCF,IAAnC,EAA0C;AACzC,QAAMQ,QAAQ,GAAG,2CAAgCR,IAAhC,CAAjB;AACA,SACC,uBAAY,cAAZ,EAA4BA,IAA5B,EAAoC,CAApC,KACAQ,QAAQ,CAACC,QAAT,CAAmB,aAAnB,CAFD;AAIA;;AAED,SAASN,yBAAT,CAAoCH,IAApC,EAA2C;AAC1C,QAAMQ,QAAQ,GAAG,2CAAgCR,IAAhC,CAAjB;AACA,SACC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AC,wCAAD;AACC,IAAA,QAAQ,EAAGf,sBAAsB,CAAE,OAAF,CADlC;AAEC,IAAA,KAAK,EAAG,cAAI,OAAJ,CAFT;AAGC,IAAA,UAAU,EAAGE,mBAAmB,CAAEe,cAAF,CAHjC;AAIC,IAAA,gBAAgB,EAAG;AAJpB,KAMC,4BAAC,+CAAD;AACC,IAAA,KAAK,EAAG,cAAI,OAAJ,CADT;AAEC,IAAA,UAAU,EAAGD,WAFd;AAGC,IAAA,MAAM,EAAGE,MAHV;AAIC,IAAA,SAAS,EAAGd,SAJb;AAKC,IAAA,mBAAmB,EAAGe,mBALvB;AAMC,IAAA,sBAAsB,EAAGC,sBAN1B;AAOC,IAAA,aAAa,EAAGU,uBAAuB,CACtCb,cADsC,CAPxC;AAUC,IAAA,SAAS,EAAG;AAVb,IAND,CAjCF,EAqDGI,gBAAgB,IACjB,4BAAC,wCAAD;AACC,IAAA,QAAQ,EAAGG,eADZ;AAEC,IAAA,KAAK,EAAG,cAAI,QAAJ,CAFT;AAGC,IAAA,UAAU,EAAGtB,mBAAmB,CAAEqB,eAAF,CAHjC;AAIC,IAAA,gBAAgB,EAAG;AAJpB,KAMC,4BAAC,8CAAD;AACC,IAAA,MAAM,EAAGD,kBADV;AAEC,IAAA,QAAQ,EAAGjB,cAAc,CAAEkB,eAAF;AAF1B,IAND,CAtDF,CADD;AAqEA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalBorderRadiusControl as BorderRadiusControl,\n\t__experimentalBorderStyleControl as BorderStyleControl,\n\t__experimentalColorGradientControl as ColorGradientControl,\n} from '@wordpress/block-editor';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalUseCustomUnits as useCustomUnits,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getSupportedGlobalStylesPanels, useSetting, useStyle } from './hooks';\n\nconst MIN_BORDER_WIDTH = 0;\n\n// Defining empty array here instead of inline avoids unnecessary re-renders of\n// color control.\nconst EMPTY_ARRAY = [];\n\nexport function useHasBorderPanel( name ) {\n\tconst controls = [\n\t\tuseHasBorderColorControl( name ),\n\t\tuseHasBorderRadiusControl( name ),\n\t\tuseHasBorderStyleControl( name ),\n\t\tuseHasBorderWidthControl( name ),\n\t];\n\n\treturn controls.some( Boolean );\n}\n\nfunction useHasBorderColorControl( name ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\treturn (\n\t\tuseSetting( 'border.color', name )[ 0 ] &&\n\t\tsupports.includes( 'borderColor' )\n\t);\n}\n\nfunction useHasBorderRadiusControl( name ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\treturn (\n\t\tuseSetting( 'border.radius', name )[ 0 ] &&\n\t\tsupports.includes( 'borderRadius' )\n\t);\n}\n\nfunction useHasBorderStyleControl( name ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\treturn (\n\t\tuseSetting( 'border.style', name )[ 0 ] &&\n\t\tsupports.includes( 'borderStyle' )\n\t);\n}\n\nfunction useHasBorderWidthControl( name ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\treturn (\n\t\tuseSetting( 'border.width', name )[ 0 ] &&\n\t\tsupports.includes( 'borderWidth' )\n\t);\n}\n\nexport default function BorderPanel( { name } ) {\n\t// To better reflect if the user has customized a value we need to\n\t// ensure the style value being checked is from the `user` origin.\n\tconst [ userBorderStyles ] = useStyle( 'border', name, 'user' );\n\tconst createHasValueCallback = ( feature ) => () =>\n\t\t!! userBorderStyles?.[ feature ];\n\n\tconst createResetCallback = ( setStyle ) => () => setStyle( undefined );\n\n\tconst handleOnChange = ( setStyle ) => ( value ) => {\n\t\tsetStyle( value || undefined );\n\t};\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: useSetting( 'spacing.units' )[ 0 ] || [\n\t\t\t'px',\n\t\t\t'em',\n\t\t\t'rem',\n\t\t],\n\t} );\n\n\t// Border width.\n\tconst showBorderWidth = useHasBorderWidthControl( name );\n\tconst [ borderWidthValue, setBorderWidth ] = useStyle(\n\t\t'border.width',\n\t\tname\n\t);\n\n\t// Border style.\n\tconst showBorderStyle = useHasBorderStyleControl( name );\n\tconst [ borderStyle, setBorderStyle ] = useStyle( 'border.style', name );\n\n\t// Border color.\n\tconst showBorderColor = useHasBorderColorControl( name );\n\tconst [ borderColor, setBorderColor ] = useStyle( 'border.color', name );\n\tconst [ colors = EMPTY_ARRAY ] = useSetting( 'color.palette' );\n\tconst disableCustomColors = ! useSetting( 'color.custom' )[ 0 ];\n\tconst disableCustomGradients = ! useSetting( 'color.customGradient' )[ 0 ];\n\n\t// Border radius.\n\tconst showBorderRadius = useHasBorderRadiusControl( name );\n\tconst [ borderRadiusValues, setBorderRadius ] = useStyle(\n\t\t'border.radius',\n\t\tname\n\t);\n\tconst hasBorderRadius = () => {\n\t\tconst borderValues = userBorderStyles?.radius;\n\t\tif ( typeof borderValues === 'object' ) {\n\t\t\treturn Object.entries( borderValues ).some( Boolean );\n\t\t}\n\t\treturn !! borderValues;\n\t};\n\n\tconst resetAll = () => {\n\t\tsetBorderColor( undefined );\n\t\tsetBorderRadius( undefined );\n\t\tsetBorderStyle( undefined );\n\t\tsetBorderWidth( undefined );\n\t};\n\n\t// When we set a border color or width ensure we have a style so the user\n\t// can see a visible border.\n\tconst handleOnChangeWithStyle = ( setStyle ) => ( value ) => {\n\t\tif ( !! value && ! borderStyle ) {\n\t\t\tsetBorderStyle( 'solid' );\n\t\t}\n\n\t\tsetStyle( value || undefined );\n\t};\n\n\treturn (\n\t\t<ToolsPanel label={ __( 'Border' ) } resetAll={ resetAll }>\n\t\t\t{ showBorderWidth && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tclassName=\"single-column\"\n\t\t\t\t\thasValue={ createHasValueCallback( 'width' ) }\n\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\tonDeselect={ createResetCallback( setBorderWidth ) }\n\t\t\t\t\tisShownByDefault={ true }\n\t\t\t\t>\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\tvalue={ borderWidthValue }\n\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\tmin={ MIN_BORDER_WIDTH }\n\t\t\t\t\t\tonChange={ handleOnChangeWithStyle( setBorderWidth ) }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showBorderStyle && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tclassName=\"single-column\"\n\t\t\t\t\thasValue={ createHasValueCallback( 'style' ) }\n\t\t\t\t\tlabel={ __( 'Style' ) }\n\t\t\t\t\tonDeselect={ createResetCallback( setBorderStyle ) }\n\t\t\t\t\tisShownByDefault={ true }\n\t\t\t\t>\n\t\t\t\t\t<BorderStyleControl\n\t\t\t\t\t\tvalue={ borderStyle }\n\t\t\t\t\t\tonChange={ handleOnChange( setBorderStyle ) }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showBorderColor && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ createHasValueCallback( 'color' ) }\n\t\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\t\tonDeselect={ createResetCallback( setBorderColor ) }\n\t\t\t\t\tisShownByDefault={ true }\n\t\t\t\t>\n\t\t\t\t\t<ColorGradientControl\n\t\t\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\t\t\tcolorValue={ borderColor }\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tgradients={ undefined }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tdisableCustomGradients={ disableCustomGradients }\n\t\t\t\t\t\tonColorChange={ handleOnChangeWithStyle(\n\t\t\t\t\t\t\tsetBorderColor\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showBorderRadius && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ hasBorderRadius }\n\t\t\t\t\tlabel={ __( 'Radius' ) }\n\t\t\t\t\tonDeselect={ createResetCallback( setBorderRadius ) }\n\t\t\t\t\tisShownByDefault={ true }\n\t\t\t\t>\n\t\t\t\t\t<BorderRadiusControl\n\t\t\t\t\t\tvalues={ borderRadiusValues }\n\t\t\t\t\t\tonChange={ handleOnChange( setBorderRadius ) }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t</ToolsPanel>\n\t);\n}\n"]}
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -23,7 +21,7 @@ var _dimensionsPanel = require("./dimensions-panel");
23
21
 
24
22
  var _typographyPanel = require("./typography-panel");
25
23
 
26
- var _navigationButton = _interopRequireDefault(require("./navigation-button"));
24
+ var _navigationButton = require("./navigation-button");
27
25
 
28
26
  /**
29
27
  * WordPress dependencies
@@ -42,13 +40,13 @@ function ContextMenu(_ref) {
42
40
  const hasBorderPanel = (0, _borderPanel.useHasBorderPanel)(name);
43
41
  const hasDimensionsPanel = (0, _dimensionsPanel.useHasDimensionsPanel)(name);
44
42
  const hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;
45
- return (0, _element.createElement)(_components.__experimentalItemGroup, null, hasTypographyPanel && (0, _element.createElement)(_navigationButton.default, {
43
+ return (0, _element.createElement)(_components.__experimentalItemGroup, null, hasTypographyPanel && (0, _element.createElement)(_navigationButton.NavigationButton, {
46
44
  icon: _icons.typography,
47
45
  path: parentMenu + '/typography'
48
- }, (0, _i18n.__)('Typography')), hasColorPanel && (0, _element.createElement)(_navigationButton.default, {
46
+ }, (0, _i18n.__)('Typography')), hasColorPanel && (0, _element.createElement)(_navigationButton.NavigationButton, {
49
47
  icon: _icons.color,
50
48
  path: parentMenu + '/colors'
51
- }, (0, _i18n.__)('Colors')), hasLayoutPanel && (0, _element.createElement)(_navigationButton.default, {
49
+ }, (0, _i18n.__)('Colors')), hasLayoutPanel && (0, _element.createElement)(_navigationButton.NavigationButton, {
52
50
  icon: _icons.layout,
53
51
  path: parentMenu + '/layout'
54
52
  }, (0, _i18n.__)('Layout')));
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/context-menu.js"],"names":["ContextMenu","name","parentMenu","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel","typography","color","layout"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAdA;AACA;AACA;;AAKA;AACA;AACA;AAOA,SAASA,WAAT,OAAkD;AAAA,MAA5B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,UAAU,GAAG;AAArB,GAA4B;AACjD,QAAMC,kBAAkB,GAAG,4CAAuBF,IAAvB,CAA3B;AACA,QAAMG,aAAa,GAAG,kCAAkBH,IAAlB,CAAtB;AACA,QAAMI,cAAc,GAAG,oCAAmBJ,IAAnB,CAAvB;AACA,QAAMK,kBAAkB,GAAG,4CAAuBL,IAAvB,CAA3B;AACA,QAAMM,cAAc,GAAGF,cAAc,IAAIC,kBAAzC;AAEA,SACC,4BAAC,mCAAD,QACGH,kBAAkB,IACnB,4BAAC,yBAAD;AACC,IAAA,IAAI,EAAGK,iBADR;AAEC,IAAA,IAAI,EAAGN,UAAU,GAAG;AAFrB,KAIG,cAAI,YAAJ,CAJH,CAFF,EASGE,aAAa,IACd,4BAAC,yBAAD;AACC,IAAA,IAAI,EAAGK,YADR;AAEC,IAAA,IAAI,EAAGP,UAAU,GAAG;AAFrB,KAIG,cAAI,QAAJ,CAJH,CAVF,EAiBGK,cAAc,IACf,4BAAC,yBAAD;AACC,IAAA,IAAI,EAAGG,aADR;AAEC,IAAA,IAAI,EAAGR,UAAU,GAAG;AAFrB,KAIG,cAAI,QAAJ,CAJH,CAlBF,CADD;AA4BA;;eAEcF,W","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { typography, color, layout } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\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 NavigationButton from './navigation-button';\n\nfunction ContextMenu( { name, parentMenu = '' } ) {\n\tconst hasTypographyPanel = useHasTypographyPanel( name );\n\tconst hasColorPanel = useHasColorPanel( name );\n\tconst hasBorderPanel = useHasBorderPanel( name );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( name );\n\tconst hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;\n\n\treturn (\n\t\t<ItemGroup>\n\t\t\t{ hasTypographyPanel && (\n\t\t\t\t<NavigationButton\n\t\t\t\t\ticon={ typography }\n\t\t\t\t\tpath={ parentMenu + '/typography' }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Typography' ) }\n\t\t\t\t</NavigationButton>\n\t\t\t) }\n\t\t\t{ hasColorPanel && (\n\t\t\t\t<NavigationButton\n\t\t\t\t\ticon={ color }\n\t\t\t\t\tpath={ parentMenu + '/colors' }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Colors' ) }\n\t\t\t\t</NavigationButton>\n\t\t\t) }\n\t\t\t{ hasLayoutPanel && (\n\t\t\t\t<NavigationButton\n\t\t\t\t\ticon={ layout }\n\t\t\t\t\tpath={ parentMenu + '/layout' }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Layout' ) }\n\t\t\t\t</NavigationButton>\n\t\t\t) }\n\t\t</ItemGroup>\n\t);\n}\n\nexport default ContextMenu;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/context-menu.js"],"names":["ContextMenu","name","parentMenu","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel","typography","color","layout"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAdA;AACA;AACA;;AAKA;AACA;AACA;AAOA,SAASA,WAAT,OAAkD;AAAA,MAA5B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,UAAU,GAAG;AAArB,GAA4B;AACjD,QAAMC,kBAAkB,GAAG,4CAAuBF,IAAvB,CAA3B;AACA,QAAMG,aAAa,GAAG,kCAAkBH,IAAlB,CAAtB;AACA,QAAMI,cAAc,GAAG,oCAAmBJ,IAAnB,CAAvB;AACA,QAAMK,kBAAkB,GAAG,4CAAuBL,IAAvB,CAA3B;AACA,QAAMM,cAAc,GAAGF,cAAc,IAAIC,kBAAzC;AAEA,SACC,4BAAC,mCAAD,QACGH,kBAAkB,IACnB,4BAAC,kCAAD;AACC,IAAA,IAAI,EAAGK,iBADR;AAEC,IAAA,IAAI,EAAGN,UAAU,GAAG;AAFrB,KAIG,cAAI,YAAJ,CAJH,CAFF,EASGE,aAAa,IACd,4BAAC,kCAAD;AACC,IAAA,IAAI,EAAGK,YADR;AAEC,IAAA,IAAI,EAAGP,UAAU,GAAG;AAFrB,KAIG,cAAI,QAAJ,CAJH,CAVF,EAiBGK,cAAc,IACf,4BAAC,kCAAD;AACC,IAAA,IAAI,EAAGG,aADR;AAEC,IAAA,IAAI,EAAGR,UAAU,GAAG;AAFrB,KAIG,cAAI,QAAJ,CAJH,CAlBF,CADD;AA4BA;;eAEcF,W","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { typography, color, layout } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\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 { NavigationButton } from './navigation-button';\n\nfunction ContextMenu( { name, parentMenu = '' } ) {\n\tconst hasTypographyPanel = useHasTypographyPanel( name );\n\tconst hasColorPanel = useHasColorPanel( name );\n\tconst hasBorderPanel = useHasBorderPanel( name );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( name );\n\tconst hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;\n\n\treturn (\n\t\t<ItemGroup>\n\t\t\t{ hasTypographyPanel && (\n\t\t\t\t<NavigationButton\n\t\t\t\t\ticon={ typography }\n\t\t\t\t\tpath={ parentMenu + '/typography' }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Typography' ) }\n\t\t\t\t</NavigationButton>\n\t\t\t) }\n\t\t\t{ hasColorPanel && (\n\t\t\t\t<NavigationButton\n\t\t\t\t\ticon={ color }\n\t\t\t\t\tpath={ parentMenu + '/colors' }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Colors' ) }\n\t\t\t\t</NavigationButton>\n\t\t\t) }\n\t\t\t{ hasLayoutPanel && (\n\t\t\t\t<NavigationButton\n\t\t\t\t\ticon={ layout }\n\t\t\t\t\tpath={ parentMenu + '/layout' }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Layout' ) }\n\t\t\t\t</NavigationButton>\n\t\t\t) }\n\t\t</ItemGroup>\n\t);\n}\n\nexport default ContextMenu;\n"]}
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.GlobalStylesProvider = GlobalStylesProvider;
7
+ exports.mergeBaseAndUserConfigs = mergeBaseAndUserConfigs;
7
8
 
8
9
  var _element = require("@wordpress/element");
9
10
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/global-styles-provider.js"],"names":["mergeTreesCustomizer","_","srcValue","Array","isArray","mergeBaseAndUserConfigs","base","user","cleanEmptyObject","object","cleanedNestedObjects","identity","undefined","useGlobalStylesUserConfig","globalStylesId","settings","styles","select","_globalStylesId","coreStore","__experimentalGetCurrentGlobalStylesId","record","getEditedEntityRecord","editEntityRecord","config","setConfig","callback","currentConfig","updatedConfig","useGlobalStylesBaseConfig","baseConfig","__experimentalGetCurrentThemeBaseGlobalStyles","useGlobalStylesContext","isUserConfigReady","userConfig","setUserConfig","isBaseConfigReady","mergedConfig","context","isReady","merged","GlobalStylesProvider","children"],"mappings":";;;;;;;AAeA;;AAZA;;AAaA;;AACA;;AAKA;;AAtBA;AACA;AACA;;AAUA;AACA;AACA;;AAKA;AACA;AACA;AAGA,SAASA,oBAAT,CAA+BC,CAA/B,EAAkCC,QAAlC,EAA6C;AAC5C;AACA;AACA;AACA,MAAKC,KAAK,CAACC,OAAN,CAAeF,QAAf,CAAL,EAAiC;AAChC,WAAOA,QAAP;AACA;AACD;;AAED,SAASG,uBAAT,CAAkCC,IAAlC,EAAwCC,IAAxC,EAA+C;AAC9C,SAAO,uBAAW,EAAX,EAAeD,IAAf,EAAqBC,IAArB,EAA2BP,oBAA3B,CAAP;AACA;;AAED,MAAMQ,gBAAgB,GAAKC,MAAF,IAAc;AACtC,MAAK,CAAE,sBAAUA,MAAV,CAAF,IAAwBN,KAAK,CAACC,OAAN,CAAeK,MAAf,CAA7B,EAAuD;AACtD,WAAOA,MAAP;AACA;;AACD,QAAMC,oBAAoB,GAAG,oBAC5B,uBAAWD,MAAX,EAAmBD,gBAAnB,CAD4B,EAE5BG,gBAF4B,CAA7B;AAIA,SAAO,qBAASD,oBAAT,IAAkCE,SAAlC,GAA8CF,oBAArD;AACA,CATD;;AAWA,SAASG,yBAAT,GAAqC;AACpC,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA,QAAlB;AAA4BC,IAAAA;AAA5B,MAAuC,qBAAaC,MAAF,IAAc;AACrE,UAAMC,eAAe,GAAGD,MAAM,CAC7BE,eAD6B,CAAN,CAE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ACFE,YADE,EAEFH,UAFE,EAGFJ,UAHE,EAIFK,aAJE,EAKFF,iBALE,EAMFG,iBANE,CARa,CAAhB;AAiBA,SAAOE,OAAP;AACA;;AAEM,SAASG,oBAAT,OAA8C;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AACpD,QAAMJ,OAAO,GAAGN,sBAAsB,EAAtC;;AACA,MAAK,CAAEM,OAAO,CAACC,OAAf,EAAyB;AACxB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,4BAAD,CAAqB,QAArB;AAA8B,IAAA,KAAK,EAAGD;AAAtC,KACGI,QADH,CADD;AAKA","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tmergeWith,\n\tpickBy,\n\tisEmpty,\n\tisObject,\n\tidentity,\n\tmapValues,\n} from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { GlobalStylesContext } from './context';\n\nfunction mergeTreesCustomizer( _, srcValue ) {\n\t// We only pass as arrays the presets,\n\t// in which case we want the new array of values\n\t// to override the old array (no merging).\n\tif ( Array.isArray( srcValue ) ) {\n\t\treturn srcValue;\n\t}\n}\n\nfunction mergeBaseAndUserConfigs( base, user ) {\n\treturn mergeWith( {}, base, user, mergeTreesCustomizer );\n}\n\nconst cleanEmptyObject = ( object ) => {\n\tif ( ! isObject( object ) || Array.isArray( object ) ) {\n\t\treturn object;\n\t}\n\tconst cleanedNestedObjects = pickBy(\n\t\tmapValues( object, cleanEmptyObject ),\n\t\tidentity\n\t);\n\treturn isEmpty( cleanedNestedObjects ) ? undefined : cleanedNestedObjects;\n};\n\nfunction useGlobalStylesUserConfig() {\n\tconst { globalStylesId, settings, styles } = useSelect( ( select ) => {\n\t\tconst _globalStylesId = select(\n\t\t\tcoreStore\n\t\t).__experimentalGetCurrentGlobalStylesId();\n\t\tconst record = _globalStylesId\n\t\t\t? select( coreStore ).getEditedEntityRecord(\n\t\t\t\t\t'root',\n\t\t\t\t\t'globalStyles',\n\t\t\t\t\t_globalStylesId\n\t\t\t )\n\t\t\t: undefined;\n\t\treturn {\n\t\t\tglobalStylesId: _globalStylesId,\n\t\t\tsettings: record?.settings,\n\t\t\tstyles: record?.styles,\n\t\t};\n\t}, [] );\n\n\tconst { getEditedEntityRecord } = useSelect( coreStore );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst config = useMemo( () => {\n\t\treturn {\n\t\t\tsettings: settings ?? {},\n\t\t\tstyles: styles ?? {},\n\t\t};\n\t}, [ settings, styles ] );\n\n\tconst setConfig = useCallback(\n\t\t( callback ) => {\n\t\t\tconst record = getEditedEntityRecord(\n\t\t\t\t'root',\n\t\t\t\t'globalStyles',\n\t\t\t\tglobalStylesId\n\t\t\t);\n\t\t\tconst currentConfig = {\n\t\t\t\tstyles: record?.styles ?? {},\n\t\t\t\tsettings: record?.settings ?? {},\n\t\t\t};\n\t\t\tconst updatedConfig = callback( currentConfig );\n\t\t\teditEntityRecord( 'root', 'globalStyles', globalStylesId, {\n\t\t\t\tstyles: cleanEmptyObject( updatedConfig.styles ) || {},\n\t\t\t\tsettings: cleanEmptyObject( updatedConfig.settings ) || {},\n\t\t\t} );\n\t\t},\n\t\t[ globalStylesId ]\n\t);\n\n\treturn [ !! settings || !! styles, config, setConfig ];\n}\n\nfunction useGlobalStylesBaseConfig() {\n\tconst baseConfig = useSelect( ( select ) => {\n\t\treturn select(\n\t\t\tcoreStore\n\t\t).__experimentalGetCurrentThemeBaseGlobalStyles();\n\t}, [] );\n\n\treturn [ !! baseConfig, baseConfig ];\n}\n\nfunction useGlobalStylesContext() {\n\tconst [\n\t\tisUserConfigReady,\n\t\tuserConfig,\n\t\tsetUserConfig,\n\t] = useGlobalStylesUserConfig();\n\tconst [ isBaseConfigReady, baseConfig ] = useGlobalStylesBaseConfig();\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! baseConfig || ! userConfig ) {\n\t\t\treturn {};\n\t\t}\n\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t}, [ userConfig, baseConfig ] );\n\tconst context = useMemo( () => {\n\t\treturn {\n\t\t\tisReady: isUserConfigReady && isBaseConfigReady,\n\t\t\tuser: userConfig,\n\t\t\tbase: baseConfig,\n\t\t\tmerged: mergedConfig,\n\t\t\tsetUserConfig,\n\t\t};\n\t}, [\n\t\tmergedConfig,\n\t\tuserConfig,\n\t\tbaseConfig,\n\t\tsetUserConfig,\n\t\tisUserConfigReady,\n\t\tisBaseConfigReady,\n\t] );\n\n\treturn context;\n}\n\nexport function GlobalStylesProvider( { children } ) {\n\tconst context = useGlobalStylesContext();\n\tif ( ! context.isReady ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ context }>\n\t\t\t{ children }\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/global-styles-provider.js"],"names":["mergeTreesCustomizer","_","srcValue","Array","isArray","mergeBaseAndUserConfigs","base","user","cleanEmptyObject","object","cleanedNestedObjects","identity","undefined","useGlobalStylesUserConfig","globalStylesId","settings","styles","select","_globalStylesId","coreStore","__experimentalGetCurrentGlobalStylesId","record","getEditedEntityRecord","editEntityRecord","config","setConfig","callback","currentConfig","updatedConfig","useGlobalStylesBaseConfig","baseConfig","__experimentalGetCurrentThemeBaseGlobalStyles","useGlobalStylesContext","isUserConfigReady","userConfig","setUserConfig","isBaseConfigReady","mergedConfig","context","isReady","merged","GlobalStylesProvider","children"],"mappings":";;;;;;;;AAeA;;AAZA;;AAaA;;AACA;;AAKA;;AAtBA;AACA;AACA;;AAUA;AACA;AACA;;AAKA;AACA;AACA;AAGA,SAASA,oBAAT,CAA+BC,CAA/B,EAAkCC,QAAlC,EAA6C;AAC5C;AACA;AACA;AACA,MAAKC,KAAK,CAACC,OAAN,CAAeF,QAAf,CAAL,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AC,CAAED,UAAL,EAAiBA,UAAjB,CAAP;AACA;;AAED,SAASE,sBAAT,GAAkC;AACjC,QAAM,CACLC,iBADK,EAELC,UAFK,EAGLC,aAHK,IAIFtB,yBAAyB,EAJ7B;AAKA,QAAM,CAAEuB,iBAAF,EAAqBN,UAArB,IAAoCD,yBAAyB,EAAnE;AACA,QAAMQ,YAAY,GAAG,sBAAS,MAAM;AACnC,QAAK,CAAEP,UAAF,IAAgB,CAAEI,UAAvB,EAAoC;AACnC,aAAO,EAAP;AACA;;AACD,WAAO7B,uBAAuB,CAAEyB,UAAF,EAAcI,UAAd,CAA9B;AACA,GALoB,EAKlB,CAAEA,UAAF,EAAcJ,UAAd,CALkB,CAArB;AAMA,QAAMQ,OAAO,GAAG,sBAAS,MAAM;AAC9B,WAAO;AACNC,MAAAA,OAAO,EAAEN,iBAAiB,IAAIG,iBADxB;AAEN7B,MAAAA,IAAI,EAAE2B,UAFA;AAGN5B,MAAAA,IAAI,EAAEwB,UAHA;AAINU,MAAAA,MAAM,EAAEH,YAJF;AAKNF,MAAAA;AALM,KAAP;AAOA,GARe,EAQb,CACFE,YADE,EAEFH,UAFE,EAGFJ,UAHE,EAIFK,aAJE,EAKFF,iBALE,EAMFG,iBANE,CARa,CAAhB;AAiBA,SAAOE,OAAP;AACA;;AAEM,SAASG,oBAAT,OAA8C;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AACpD,QAAMJ,OAAO,GAAGN,sBAAsB,EAAtC;;AACA,MAAK,CAAEM,OAAO,CAACC,OAAf,EAAyB;AACxB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,4BAAD,CAAqB,QAArB;AAA8B,IAAA,KAAK,EAAGD;AAAtC,KACGI,QADH,CADD;AAKA","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tmergeWith,\n\tpickBy,\n\tisEmpty,\n\tisObject,\n\tidentity,\n\tmapValues,\n} from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { GlobalStylesContext } from './context';\n\nfunction mergeTreesCustomizer( _, srcValue ) {\n\t// We only pass as arrays the presets,\n\t// in which case we want the new array of values\n\t// to override the old array (no merging).\n\tif ( Array.isArray( srcValue ) ) {\n\t\treturn srcValue;\n\t}\n}\n\nexport function mergeBaseAndUserConfigs( base, user ) {\n\treturn mergeWith( {}, base, user, mergeTreesCustomizer );\n}\n\nconst cleanEmptyObject = ( object ) => {\n\tif ( ! isObject( object ) || Array.isArray( object ) ) {\n\t\treturn object;\n\t}\n\tconst cleanedNestedObjects = pickBy(\n\t\tmapValues( object, cleanEmptyObject ),\n\t\tidentity\n\t);\n\treturn isEmpty( cleanedNestedObjects ) ? undefined : cleanedNestedObjects;\n};\n\nfunction useGlobalStylesUserConfig() {\n\tconst { globalStylesId, settings, styles } = useSelect( ( select ) => {\n\t\tconst _globalStylesId = select(\n\t\t\tcoreStore\n\t\t).__experimentalGetCurrentGlobalStylesId();\n\t\tconst record = _globalStylesId\n\t\t\t? select( coreStore ).getEditedEntityRecord(\n\t\t\t\t\t'root',\n\t\t\t\t\t'globalStyles',\n\t\t\t\t\t_globalStylesId\n\t\t\t )\n\t\t\t: undefined;\n\t\treturn {\n\t\t\tglobalStylesId: _globalStylesId,\n\t\t\tsettings: record?.settings,\n\t\t\tstyles: record?.styles,\n\t\t};\n\t}, [] );\n\n\tconst { getEditedEntityRecord } = useSelect( coreStore );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst config = useMemo( () => {\n\t\treturn {\n\t\t\tsettings: settings ?? {},\n\t\t\tstyles: styles ?? {},\n\t\t};\n\t}, [ settings, styles ] );\n\n\tconst setConfig = useCallback(\n\t\t( callback ) => {\n\t\t\tconst record = getEditedEntityRecord(\n\t\t\t\t'root',\n\t\t\t\t'globalStyles',\n\t\t\t\tglobalStylesId\n\t\t\t);\n\t\t\tconst currentConfig = {\n\t\t\t\tstyles: record?.styles ?? {},\n\t\t\t\tsettings: record?.settings ?? {},\n\t\t\t};\n\t\t\tconst updatedConfig = callback( currentConfig );\n\t\t\teditEntityRecord( 'root', 'globalStyles', globalStylesId, {\n\t\t\t\tstyles: cleanEmptyObject( updatedConfig.styles ) || {},\n\t\t\t\tsettings: cleanEmptyObject( updatedConfig.settings ) || {},\n\t\t\t} );\n\t\t},\n\t\t[ globalStylesId ]\n\t);\n\n\treturn [ !! settings || !! styles, config, setConfig ];\n}\n\nfunction useGlobalStylesBaseConfig() {\n\tconst baseConfig = useSelect( ( select ) => {\n\t\treturn select(\n\t\t\tcoreStore\n\t\t).__experimentalGetCurrentThemeBaseGlobalStyles();\n\t}, [] );\n\n\treturn [ !! baseConfig, baseConfig ];\n}\n\nfunction useGlobalStylesContext() {\n\tconst [\n\t\tisUserConfigReady,\n\t\tuserConfig,\n\t\tsetUserConfig,\n\t] = useGlobalStylesUserConfig();\n\tconst [ isBaseConfigReady, baseConfig ] = useGlobalStylesBaseConfig();\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! baseConfig || ! userConfig ) {\n\t\t\treturn {};\n\t\t}\n\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t}, [ userConfig, baseConfig ] );\n\tconst context = useMemo( () => {\n\t\treturn {\n\t\t\tisReady: isUserConfigReady && isBaseConfigReady,\n\t\t\tuser: userConfig,\n\t\t\tbase: baseConfig,\n\t\t\tmerged: mergedConfig,\n\t\t\tsetUserConfig,\n\t\t};\n\t}, [\n\t\tmergedConfig,\n\t\tuserConfig,\n\t\tbaseConfig,\n\t\tsetUserConfig,\n\t\tisUserConfigReady,\n\t\tisBaseConfigReady,\n\t] );\n\n\treturn context;\n}\n\nexport function GlobalStylesProvider( { children } ) {\n\tconst context = useGlobalStylesContext();\n\tif ( ! context.isReady ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ context }>\n\t\t\t{ children }\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n"]}
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -15,7 +13,7 @@ var _i18n = require("@wordpress/i18n");
15
13
 
16
14
  var _icons = require("@wordpress/icons");
17
15
 
18
- var _navigationButton = _interopRequireDefault(require("./navigation-button"));
16
+ var _navigationButton = require("./navigation-button");
19
17
 
20
18
  /**
21
19
  * WordPress dependencies
@@ -26,7 +24,6 @@ var _navigationButton = _interopRequireDefault(require("./navigation-button"));
26
24
  */
27
25
  function ScreenHeader(_ref) {
28
26
  let {
29
- back,
30
27
  title,
31
28
  description
32
29
  } = _ref;
@@ -34,14 +31,12 @@ function ScreenHeader(_ref) {
34
31
  spacing: 2
35
32
  }, (0, _element.createElement)(_components.__experimentalHStack, {
36
33
  spacing: 2
37
- }, (0, _element.createElement)(_components.__experimentalView, null, (0, _element.createElement)(_navigationButton.default, {
38
- path: back,
34
+ }, (0, _element.createElement)(_components.__experimentalView, null, (0, _element.createElement)(_navigationButton.NavigationBackButton, {
39
35
  icon: (0, _element.createElement)(_icons.Icon, {
40
36
  icon: (0, _i18n.isRTL)() ? _icons.chevronRight : _icons.chevronLeft,
41
37
  variant: "muted"
42
38
  }),
43
39
  size: "small",
44
- isBack: true,
45
40
  "aria-label": (0, _i18n.__)('Navigate to the previous view')
46
41
  })), (0, _element.createElement)(_components.__experimentalSpacer, null, (0, _element.createElement)(_components.__experimentalHeading, {
47
42
  level: 5
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/header.js"],"names":["ScreenHeader","back","title","description","chevronRight","chevronLeft"],"mappings":";;;;;;;;;;;AAGA;;AAOA;;AACA;;AAKA;;AAhBA;AACA;AACA;;AAWA;AACA;AACA;AAGA,SAASA,YAAT,OAAsD;AAAA,MAA/B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,KAAR;AAAeC,IAAAA;AAAf,GAA+B;AACrD,SACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,8BAAD,QACC,4BAAC,yBAAD;AACC,IAAA,IAAI,EAAGF,IADR;AAEC,IAAA,IAAI,EACH,4BAAC,WAAD;AACC,MAAA,IAAI,EAAG,qBAAUG,mBAAV,GAAyBC,kBADjC;AAEC,MAAA,OAAO,EAAC;AAFT,MAHF;AAQC,IAAA,IAAI,EAAC,OARN;AASC,IAAA,MAAM,MATP;AAUC,kBAAa,cAAI,+BAAJ;AAVd,IADD,CADD,EAeC,4BAAC,gCAAD,QACC,4BAAC,iCAAD;AAAS,IAAA,KAAK,EAAG;AAAjB,KAAuBH,KAAvB,CADD,CAfD,CADD,EAoBGC,WAAW,IACZ;AAAG,IAAA,SAAS,EAAC;AAAb,KACGA,WADH,CArBF,CADD;AA4BA;;eAEcH,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalHeading as Heading,\n\t__experimentalView as View,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft, Icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport NavigationButton from './navigation-button';\n\nfunction ScreenHeader( { back, title, description } ) {\n\treturn (\n\t\t<VStack spacing={ 2 }>\n\t\t\t<HStack spacing={ 2 }>\n\t\t\t\t<View>\n\t\t\t\t\t<NavigationButton\n\t\t\t\t\t\tpath={ back }\n\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\t\t\tvariant=\"muted\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tisBack\n\t\t\t\t\t\taria-label={ __( 'Navigate to the previous view' ) }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t\t<Spacer>\n\t\t\t\t\t<Heading level={ 5 }>{ title }</Heading>\n\t\t\t\t</Spacer>\n\t\t\t</HStack>\n\t\t\t{ description && (\n\t\t\t\t<p className=\"edit-site-global-styles-header__description\">\n\t\t\t\t\t{ description }\n\t\t\t\t</p>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport default ScreenHeader;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/header.js"],"names":["ScreenHeader","title","description","chevronRight","chevronLeft"],"mappings":";;;;;;;;;AAGA;;AAOA;;AACA;;AAKA;;AAhBA;AACA;AACA;;AAWA;AACA;AACA;AAGA,SAASA,YAAT,OAAgD;AAAA,MAAzB;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAyB;AAC/C,SACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,8BAAD,QACC,4BAAC,sCAAD;AACC,IAAA,IAAI,EACH,4BAAC,WAAD;AACC,MAAA,IAAI,EAAG,qBAAUC,mBAAV,GAAyBC,kBADjC;AAEC,MAAA,OAAO,EAAC;AAFT,MAFF;AAOC,IAAA,IAAI,EAAC,OAPN;AAQC,kBAAa,cAAI,+BAAJ;AARd,IADD,CADD,EAaC,4BAAC,gCAAD,QACC,4BAAC,iCAAD;AAAS,IAAA,KAAK,EAAG;AAAjB,KAAuBH,KAAvB,CADD,CAbD,CADD,EAkBGC,WAAW,IACZ;AAAG,IAAA,SAAS,EAAC;AAAb,KACGA,WADH,CAnBF,CADD;AA0BA;;eAEcF,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalHeading as Heading,\n\t__experimentalView as View,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft, Icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { NavigationBackButton } from './navigation-button';\n\nfunction ScreenHeader( { title, description } ) {\n\treturn (\n\t\t<VStack spacing={ 2 }>\n\t\t\t<HStack spacing={ 2 }>\n\t\t\t\t<View>\n\t\t\t\t\t<NavigationBackButton\n\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\t\t\tvariant=\"muted\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\taria-label={ __( 'Navigate to the previous view' ) }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t\t<Spacer>\n\t\t\t\t\t<Heading level={ 5 }>{ title }</Heading>\n\t\t\t\t</Spacer>\n\t\t\t</HStack>\n\t\t\t{ description && (\n\t\t\t\t<p className=\"edit-site-global-styles-header__description\">\n\t\t\t\t\t{ description }\n\t\t\t\t</p>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport default ScreenHeader;\n"]}
@@ -5,7 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = void 0;
8
+ exports.NavigationBackButton = NavigationBackButton;
9
+ exports.NavigationButton = NavigationButton;
9
10
 
10
11
  var _element = require("@wordpress/element");
11
12
 
@@ -18,20 +19,13 @@ var _icons = require("@wordpress/icons");
18
19
  /**
19
20
  * WordPress dependencies
20
21
  */
21
- function NavigationButton(_ref) {
22
+ function GenericNavigationButton(_ref) {
22
23
  let {
23
- path,
24
24
  icon,
25
25
  children,
26
- isBack = false,
27
26
  ...props
28
27
  } = _ref;
29
- const navigator = (0, _components.__experimentalUseNavigator)();
30
- return (0, _element.createElement)(_components.__experimentalItem, (0, _extends2.default)({
31
- onClick: () => navigator.push(path, {
32
- isBack
33
- })
34
- }, props), icon && (0, _element.createElement)(_components.__experimentalHStack, {
28
+ return (0, _element.createElement)(_components.__experimentalItem, props, icon && (0, _element.createElement)(_components.__experimentalHStack, {
35
29
  justify: "flex-start"
36
30
  }, (0, _element.createElement)(_components.FlexItem, null, (0, _element.createElement)(_icons.Icon, {
37
31
  icon: icon,
@@ -39,6 +33,35 @@ function NavigationButton(_ref) {
39
33
  })), (0, _element.createElement)(_components.FlexItem, null, children)), !icon && children);
40
34
  }
41
35
 
42
- var _default = NavigationButton;
43
- exports.default = _default;
36
+ function NavigationButton(_ref2) {
37
+ let {
38
+ path,
39
+ ...props
40
+ } = _ref2;
41
+ const {
42
+ goTo
43
+ } = (0, _components.__experimentalUseNavigator)();
44
+ const dataAttrName = 'data-navigator-focusable-id';
45
+ const dataAttrValue = path;
46
+ const dataAttrCssSelector = `[${dataAttrName}="${dataAttrValue}"]`;
47
+ const buttonProps = { ...props,
48
+ [dataAttrName]: dataAttrValue
49
+ };
50
+ return (0, _element.createElement)(GenericNavigationButton, (0, _extends2.default)({
51
+ onClick: () => goTo(path, {
52
+ focusTargetSelector: dataAttrCssSelector
53
+ })
54
+ }, buttonProps));
55
+ }
56
+
57
+ function NavigationBackButton(_ref3) {
58
+ let { ...props
59
+ } = _ref3;
60
+ const {
61
+ goBack
62
+ } = (0, _components.__experimentalUseNavigator)();
63
+ return (0, _element.createElement)(GenericNavigationButton, (0, _extends2.default)({
64
+ onClick: goBack
65
+ }, props));
66
+ }
44
67
  //# sourceMappingURL=navigation-button.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/navigation-button.js"],"names":["NavigationButton","path","icon","children","isBack","props","navigator","push"],"mappings":";;;;;;;;;;;;;AAGA;;AAMA;;AATA;AACA;AACA;AASA,SAASA,gBAAT,OAMI;AAAA,MANuB;AAC1BC,IAAAA,IAD0B;AAE1BC,IAAAA,IAF0B;AAG1BC,IAAAA,QAH0B;AAI1BC,IAAAA,MAAM,GAAG,KAJiB;AAK1B,OAAGC;AALuB,GAMvB;AACH,QAAMC,SAAS,GAAG,6CAAlB;AACA,SACC,4BAAC,8BAAD;AAAM,IAAA,OAAO,EAAG,MAAMA,SAAS,CAACC,IAAV,CAAgBN,IAAhB,EAAsB;AAAEG,MAAAA;AAAF,KAAtB;AAAtB,KAAgEC,KAAhE,GACGH,IAAI,IACL,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,oBAAD,QACC,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAGA,IAAb;AAAoB,IAAA,IAAI,EAAG;AAA3B,IADD,CADD,EAIC,4BAAC,oBAAD,QAAYC,QAAZ,CAJD,CAFF,EASG,CAAED,IAAF,IAAUC,QATb,CADD;AAaA;;eAEcH,gB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\t__experimentalItem as Item,\n\tFlexItem,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { Icon } from '@wordpress/icons';\n\nfunction NavigationButton( {\n\tpath,\n\ticon,\n\tchildren,\n\tisBack = false,\n\t...props\n} ) {\n\tconst navigator = useNavigator();\n\treturn (\n\t\t<Item onClick={ () => navigator.push( path, { isBack } ) } { ...props }>\n\t\t\t{ icon && (\n\t\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Icon icon={ icon } size={ 24 } />\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>{ children }</FlexItem>\n\t\t\t\t</HStack>\n\t\t\t) }\n\t\t\t{ ! icon && children }\n\t\t</Item>\n\t);\n}\n\nexport default NavigationButton;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/navigation-button.js"],"names":["GenericNavigationButton","icon","children","props","NavigationButton","path","goTo","dataAttrName","dataAttrValue","dataAttrCssSelector","buttonProps","focusTargetSelector","NavigationBackButton","goBack"],"mappings":";;;;;;;;;;;;;;AAGA;;AAMA;;AATA;AACA;AACA;AASA,SAASA,uBAAT,OAAiE;AAAA,MAA/B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,QAAR;AAAkB,OAAGC;AAArB,GAA+B;AAChE,SACC,4BAAC,8BAAD,EAAWA,KAAX,EACGF,IAAI,IACL,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,oBAAD,QACC,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAGA,IAAb;AAAoB,IAAA,IAAI,EAAG;AAA3B,IADD,CADD,EAIC,4BAAC,oBAAD,QAAYC,QAAZ,CAJD,CAFF,EASG,CAAED,IAAF,IAAUC,QATb,CADD;AAaA;;AAED,SAASE,gBAAT,QAAgD;AAAA,MAArB;AAAEC,IAAAA,IAAF;AAAQ,OAAGF;AAAX,GAAqB;AAC/C,QAAM;AAAEG,IAAAA;AAAF,MAAW,6CAAjB;AAEA,QAAMC,YAAY,GAAG,6BAArB;AACA,QAAMC,aAAa,GAAGH,IAAtB;AAEA,QAAMI,mBAAmB,GAAI,IAAIF,YAAc,KAAKC,aAAe,IAAnE;AAEA,QAAME,WAAW,GAAG,EACnB,GAAGP,KADgB;AAEnB,KAAEI,YAAF,GAAkBC;AAFC,GAApB;AAKA,SACC,4BAAC,uBAAD;AACC,IAAA,OAAO,EAAG,MACTF,IAAI,CAAED,IAAF,EAAQ;AAAEM,MAAAA,mBAAmB,EAAEF;AAAvB,KAAR;AAFN,KAIMC,WAJN,EADD;AAQA;;AAED,SAASE,oBAAT,QAA8C;AAAA,MAAf,EAAE,GAAGT;AAAL,GAAe;AAC7C,QAAM;AAAEU,IAAAA;AAAF,MAAa,6CAAnB;AACA,SAAO,4BAAC,uBAAD;AAAyB,IAAA,OAAO,EAAGA;AAAnC,KAAiDV,KAAjD,EAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\t__experimentalItem as Item,\n\tFlexItem,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { Icon } from '@wordpress/icons';\n\nfunction GenericNavigationButton( { icon, children, ...props } ) {\n\treturn (\n\t\t<Item { ...props }>\n\t\t\t{ icon && (\n\t\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Icon icon={ icon } size={ 24 } />\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>{ children }</FlexItem>\n\t\t\t\t</HStack>\n\t\t\t) }\n\t\t\t{ ! icon && children }\n\t\t</Item>\n\t);\n}\n\nfunction NavigationButton( { path, ...props } ) {\n\tconst { goTo } = useNavigator();\n\n\tconst dataAttrName = 'data-navigator-focusable-id';\n\tconst dataAttrValue = path;\n\n\tconst dataAttrCssSelector = `[${ dataAttrName }=\"${ dataAttrValue }\"]`;\n\n\tconst buttonProps = {\n\t\t...props,\n\t\t[ dataAttrName ]: dataAttrValue,\n\t};\n\n\treturn (\n\t\t<GenericNavigationButton\n\t\t\tonClick={ () =>\n\t\t\t\tgoTo( path, { focusTargetSelector: dataAttrCssSelector } )\n\t\t\t}\n\t\t\t{ ...buttonProps }\n\t\t/>\n\t);\n}\n\nfunction NavigationBackButton( { ...props } ) {\n\tconst { goBack } = useNavigator();\n\treturn <GenericNavigationButton onClick={ goBack } { ...props } />;\n}\n\nexport { NavigationButton, NavigationBackButton };\n"]}
@@ -15,7 +15,7 @@ var _i18n = require("@wordpress/i18n");
15
15
 
16
16
  var _subtitle = _interopRequireDefault(require("./subtitle"));
17
17
 
18
- var _navigationButton = _interopRequireDefault(require("./navigation-button"));
18
+ var _navigationButton = require("./navigation-button");
19
19
 
20
20
  var _hooks = require("./hooks");
21
21
 
@@ -45,10 +45,10 @@ function Palette(_ref) {
45
45
  }, (0, _element.createElement)(_subtitle.default, null, (0, _i18n.__)('Palette')), (0, _element.createElement)(_components.__experimentalItemGroup, {
46
46
  isBordered: true,
47
47
  isSeparated: true
48
- }, (0, _element.createElement)(_navigationButton.default, {
48
+ }, (0, _element.createElement)(_navigationButton.NavigationButton, {
49
49
  path: screenPath
50
50
  }, (0, _element.createElement)(_components.__experimentalHStack, {
51
- isReversed: colors.length === 0
51
+ direction: colors.length === 0 ? 'row-reverse' : 'row'
52
52
  }, (0, _element.createElement)(_components.FlexBlock, null, (0, _element.createElement)(_components.__experimentalZStack, {
53
53
  isLayered: false,
54
54
  offset: -8
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/palette.js"],"names":["EMPTY_COLORS","Palette","name","customColors","themeColors","defaultColors","defaultPaletteEnabled","colors","screenPath","paletteButtonText","length","slice","map","color"],"mappings":";;;;;;;;;AAaA;;AAVA;;AASA;;AAMA;;AACA;;AACA;;AApBA;AACA;AACA;;AAaA;AACA;AACA;AAKA,MAAMA,YAAY,GAAG,EAArB;;AAEA,SAASC,OAAT,OAA6B;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AAC5B,QAAM,CAAEC,YAAF,IAAmB,uBAAY,sBAAZ,CAAzB;AACA,QAAM,CAAEC,WAAF,IAAkB,uBAAY,qBAAZ,CAAxB;AACA,QAAM,CAAEC,aAAF,IAAoB,uBAAY,uBAAZ,CAA1B;AAEA,QAAM,CAAEC,qBAAF,IAA4B,uBACjC,sBADiC,EAEjCJ,IAFiC,CAAlC;AAIA,QAAMK,MAAM,GAAG,sBACd,MAAM,CACL,IAAKJ,YAAY,IAAIH,YAArB,CADK,EAEL,IAAKI,WAAW,IAAIJ,YAApB,CAFK,EAGL,IAAKK,aAAa,IAAIC,qBAAjB,GACFD,aADE,GAEFL,YAFH,CAHK,CADQ,EAQd,CAAEG,YAAF,EAAgBC,WAAhB,EAA6BC,aAA7B,EAA4CC,qBAA5C,CARc,CAAf;AAWA,QAAME,UAAU,GAAG,CAAEN,IAAF,GAChB,iBADgB,GAEhB,aAAaA,IAAb,GAAoB,iBAFvB;AAGA,QAAMO,iBAAiB,GACtBF,MAAM,CAACG,MAAP,GAAgB,CAAhB,GACG,oBACA;AACA,gBAAI,UAAJ,EAAgB,WAAhB,EAA6BH,MAAM,CAACG,MAApC,CAFA,EAGAH,MAAM,CAACG,MAHP,CADH,GAMG,cAAI,mBAAJ,CAPJ;AASA,SACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,iBAAD,QAAY,cAAI,SAAJ,CAAZ,CADD,EAEC,4BAAC,mCAAD;AAAW,IAAA,UAAU,MAArB;AAAsB,IAAA,WAAW;AAAjC,KACC,4BAAC,yBAAD;AAAkB,IAAA,IAAI,EAAGF;AAAzB,KACC,4BAAC,gCAAD;AAAQ,IAAA,UAAU,EAAGD,MAAM,CAACG,MAAP,KAAkB;AAAvC,KACC,4BAAC,qBAAD,QACC,4BAAC,gCAAD;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,4BAAC,0BAAD;AACC,MAAA,GAAG,EAAGA,KADP;AAEC,MAAA,UAAU,EAAGA;AAFd,MAD2B;AAAA,GAA1B,CADH,CADD,CADD,EAWC,4BAAC,oBAAD,QAAYJ,iBAAZ,CAXD,CADD,CADD,CAFD,CADD;AAsBA;;eAEcR,O","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":["EMPTY_COLORS","Palette","name","customColors","themeColors","defaultColors","defaultPaletteEnabled","colors","screenPath","paletteButtonText","length","slice","map","color"],"mappings":";;;;;;;;;AAaA;;AAVA;;AASA;;AAMA;;AACA;;AACA;;AApBA;AACA;AACA;;AAaA;AACA;AACA;AAKA,MAAMA,YAAY,GAAG,EAArB;;AAEA,SAASC,OAAT,OAA6B;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AAC5B,QAAM,CAAEC,YAAF,IAAmB,uBAAY,sBAAZ,CAAzB;AACA,QAAM,CAAEC,WAAF,IAAkB,uBAAY,qBAAZ,CAAxB;AACA,QAAM,CAAEC,aAAF,IAAoB,uBAAY,uBAAZ,CAA1B;AAEA,QAAM,CAAEC,qBAAF,IAA4B,uBACjC,sBADiC,EAEjCJ,IAFiC,CAAlC;AAIA,QAAMK,MAAM,GAAG,sBACd,MAAM,CACL,IAAKJ,YAAY,IAAIH,YAArB,CADK,EAEL,IAAKI,WAAW,IAAIJ,YAApB,CAFK,EAGL,IAAKK,aAAa,IAAIC,qBAAjB,GACFD,aADE,GAEFL,YAFH,CAHK,CADQ,EAQd,CAAEG,YAAF,EAAgBC,WAAhB,EAA6BC,aAA7B,EAA4CC,qBAA5C,CARc,CAAf;AAWA,QAAME,UAAU,GAAG,CAAEN,IAAF,GAChB,iBADgB,GAEhB,aAAaA,IAAb,GAAoB,iBAFvB;AAGA,QAAMO,iBAAiB,GACtBF,MAAM,CAACG,MAAP,GAAgB,CAAhB,GACG,oBACA;AACA,gBAAI,UAAJ,EAAgB,WAAhB,EAA6BH,MAAM,CAACG,MAApC,CAFA,EAGAH,MAAM,CAACG,MAHP,CADH,GAMG,cAAI,mBAAJ,CAPJ;AASA,SACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,iBAAD,QAAY,cAAI,SAAJ,CAAZ,CADD,EAEC,4BAAC,mCAAD;AAAW,IAAA,UAAU,MAArB;AAAsB,IAAA,WAAW;AAAjC,KACC,4BAAC,kCAAD;AAAkB,IAAA,IAAI,EAAGF;AAAzB,KACC,4BAAC,gCAAD;AACC,IAAA,SAAS,EACRD,MAAM,CAACG,MAAP,KAAkB,CAAlB,GAAsB,aAAtB,GAAsC;AAFxC,KAKC,4BAAC,qBAAD,QACC,4BAAC,gCAAD;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,4BAAC,0BAAD;AACC,MAAA,GAAG,EAAGA,KADP;AAEC,MAAA,UAAU,EAAGA;AAFd,MAD2B;AAAA,GAA1B,CADH,CADD,CALD,EAeC,4BAAC,oBAAD,QAAYJ,iBAAZ,CAfD,CADD,CADD,CAFD,CADD;AA0BA;;eAEcR,O","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\n\t\t\t\t\t\tdirection={\n\t\t\t\t\t\t\tcolors.length === 0 ? 'row-reverse' : 'row'\n\t\t\t\t\t\t}\n\t\t\t\t\t>\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"]}
@@ -7,10 +7,12 @@ exports.default = void 0;
7
7
 
8
8
  var _element = require("@wordpress/element");
9
9
 
10
- var _components = require("@wordpress/components");
10
+ var _blockEditor = require("@wordpress/block-editor");
11
11
 
12
12
  var _hooks = require("./hooks");
13
13
 
14
+ var _useGlobalStylesOutput = require("./use-global-styles-output");
15
+
14
16
  /**
15
17
  * WordPress dependencies
16
18
  */
@@ -18,31 +20,60 @@ var _hooks = require("./hooks");
18
20
  /**
19
21
  * Internal dependencies
20
22
  */
21
- const StylesPreview = () => {
23
+ const StylesPreview = _ref => {
24
+ let {
25
+ height = 150
26
+ } = _ref;
22
27
  const [fontFamily = 'serif'] = (0, _hooks.useStyle)('typography.fontFamily');
23
28
  const [textColor = 'black'] = (0, _hooks.useStyle)('color.text');
24
29
  const [linkColor = 'blue'] = (0, _hooks.useStyle)('elements.link.color.text');
25
30
  const [backgroundColor = 'white'] = (0, _hooks.useStyle)('color.background');
26
31
  const [gradientValue] = (0, _hooks.useStyle)('color.gradient');
27
- return (0, _element.createElement)(_components.Card, {
28
- className: "edit-site-global-styles-preview",
32
+ const [styles] = (0, _useGlobalStylesOutput.useGlobalStylesOutput)();
33
+ return (0, _element.createElement)(_blockEditor.__unstableIframe, {
34
+ className: "edit-site-global-styles-preview__iframe",
35
+ head: (0, _element.createElement)(_blockEditor.__unstableEditorStyles, {
36
+ styles: styles
37
+ }),
38
+ style: {
39
+ height
40
+ }
41
+ }, (0, _element.createElement)("div", {
29
42
  style: {
30
- background: gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor
43
+ display: 'flex',
44
+ gap: 20,
45
+ alignItems: 'center',
46
+ justifyContent: 'center',
47
+ height: '100%',
48
+ transform: `scale(${height / 150})`,
49
+ background: gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor,
50
+ cursor: 'pointer'
31
51
  }
32
- }, (0, _element.createElement)(_components.__experimentalHStack, {
33
- spacing: 5
34
52
  }, (0, _element.createElement)("div", {
35
53
  style: {
36
54
  fontFamily,
37
- fontSize: '80px',
38
- color: textColor
55
+ fontSize: '80px'
56
+ }
57
+ }, "Aa"), (0, _element.createElement)("div", {
58
+ style: {
59
+ display: 'flex',
60
+ gap: 20,
61
+ flexDirection: 'column'
62
+ }
63
+ }, (0, _element.createElement)("div", {
64
+ style: {
65
+ height: 40,
66
+ width: 40,
67
+ background: textColor,
68
+ borderRadius: 20
69
+ }
70
+ }), ' ', (0, _element.createElement)("div", {
71
+ style: {
72
+ height: 40,
73
+ width: 40,
74
+ background: linkColor,
75
+ borderRadius: 20
39
76
  }
40
- }, "Aa"), (0, _element.createElement)(_components.__experimentalVStack, {
41
- spacing: 2
42
- }, (0, _element.createElement)(_components.ColorIndicator, {
43
- colorValue: textColor
44
- }), (0, _element.createElement)(_components.ColorIndicator, {
45
- colorValue: linkColor
46
77
  }))));
47
78
  };
48
79
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/preview.js"],"names":["StylesPreview","fontFamily","textColor","linkColor","backgroundColor","gradientValue","background","fontSize","color"],"mappings":";;;;;;;;;AAGA;;AAUA;;AAbA;AACA;AACA;;AAQA;AACA;AACA;AAGA,MAAMA,aAAa,GAAG,MAAM;AAC3B,QAAM,CAAEC,UAAU,GAAG,OAAf,IAA2B,qBAAU,uBAAV,CAAjC;AACA,QAAM,CAAEC,SAAS,GAAG,OAAd,IAA0B,qBAAU,YAAV,CAAhC;AACA,QAAM,CAAEC,SAAS,GAAG,MAAd,IAAyB,qBAAU,0BAAV,CAA/B;AACA,QAAM,CAAEC,eAAe,GAAG,OAApB,IAAgC,qBAAU,kBAAV,CAAtC;AACA,QAAM,CAAEC,aAAF,IAAoB,qBAAU,gBAAV,CAA1B;AAEA,SACC,4BAAC,gBAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,KAAK,EAAG;AAAEC,MAAAA,UAAU,EAAED,aAAF,aAAEA,aAAF,cAAEA,aAAF,GAAmBD;AAA/B;AAFT,KAIC,4BAAC,gCAAD;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,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,0BAAD;AAAgB,IAAA,UAAU,EAAGA;AAA7B,IADD,EAEC,4BAAC,0BAAD;AAAgB,IAAA,UAAU,EAAGC;AAA7B,IAFD,CAND,CAJD,CADD;AAkBA,CAzBD;;eA2BeH,a","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":["StylesPreview","height","fontFamily","textColor","linkColor","backgroundColor","gradientValue","styles","display","gap","alignItems","justifyContent","transform","background","cursor","fontSize","flexDirection","width","borderRadius"],"mappings":";;;;;;;;;AAGA;;AAQA;;AACA;;AAZA;AACA;AACA;;AAMA;AACA;AACA;AAIA,MAAMA,aAAa,GAAG,QAAwB;AAAA,MAAtB;AAAEC,IAAAA,MAAM,GAAG;AAAX,GAAsB;AAC7C,QAAM,CAAEC,UAAU,GAAG,OAAf,IAA2B,qBAAU,uBAAV,CAAjC;AACA,QAAM,CAAEC,SAAS,GAAG,OAAd,IAA0B,qBAAU,YAAV,CAAhC;AACA,QAAM,CAAEC,SAAS,GAAG,MAAd,IAAyB,qBAAU,0BAAV,CAA/B;AACA,QAAM,CAAEC,eAAe,GAAG,OAApB,IAAgC,qBAAU,kBAAV,CAAtC;AACA,QAAM,CAAEC,aAAF,IAAoB,qBAAU,gBAAV,CAA1B;AACA,QAAM,CAAEC,MAAF,IAAa,mDAAnB;AAEA,SACC,4BAAC,6BAAD;AACC,IAAA,SAAS,EAAC,yCADX;AAEC,IAAA,IAAI,EAAG,4BAAC,mCAAD;AAAc,MAAA,MAAM,EAAGA;AAAvB,MAFR;AAGC,IAAA,KAAK,EAAG;AAAEN,MAAAA;AAAF;AAHT,KAKC;AACC,IAAA,KAAK,EAAG;AACPO,MAAAA,OAAO,EAAE,MADF;AAEPC,MAAAA,GAAG,EAAE,EAFE;AAGPC,MAAAA,UAAU,EAAE,QAHL;AAIPC,MAAAA,cAAc,EAAE,QAJT;AAKPV,MAAAA,MAAM,EAAE,MALD;AAMPW,MAAAA,SAAS,EAAG,SAASX,MAAM,GAAG,GAAK,GAN5B;AAOPY,MAAAA,UAAU,EAAEP,aAAF,aAAEA,aAAF,cAAEA,aAAF,GAAmBD,eAPtB;AAQPS,MAAAA,MAAM,EAAE;AARD;AADT,KAYC;AAAK,IAAA,KAAK,EAAG;AAAEZ,MAAAA,UAAF;AAAca,MAAAA,QAAQ,EAAE;AAAxB;AAAb,UAZD,EAaC;AACC,IAAA,KAAK,EAAG;AACPP,MAAAA,OAAO,EAAE,MADF;AAEPC,MAAAA,GAAG,EAAE,EAFE;AAGPO,MAAAA,aAAa,EAAE;AAHR;AADT,KAOC;AACC,IAAA,KAAK,EAAG;AACPf,MAAAA,MAAM,EAAE,EADD;AAEPgB,MAAAA,KAAK,EAAE,EAFA;AAGPJ,MAAAA,UAAU,EAAEV,SAHL;AAIPe,MAAAA,YAAY,EAAE;AAJP;AADT,IAPD,EAcK,GAdL,EAeC;AACC,IAAA,KAAK,EAAG;AACPjB,MAAAA,MAAM,EAAE,EADD;AAEPgB,MAAAA,KAAK,EAAE,EAFA;AAGPJ,MAAAA,UAAU,EAAET,SAHL;AAIPc,MAAAA,YAAY,EAAE;AAJP;AADT,IAfD,CAbD,CALD,CADD;AA8CA,CAtDD;;eAwDelB,a","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__unstableIframe 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"]}
@@ -9,6 +9,8 @@ exports.default = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
+
12
14
  var _i18n = require("@wordpress/i18n");
13
15
 
14
16
  var _blockEditor = require("@wordpress/block-editor");
@@ -28,7 +30,6 @@ function ScreenBackgroundColor(_ref) {
28
30
  let {
29
31
  name
30
32
  } = _ref;
31
- const parentMenu = name === undefined ? '' : '/blocks/' + name;
32
33
  const supports = (0, _hooks.getSupportedGlobalStylesPanels)(name);
33
34
  const [solids] = (0, _hooks.useSetting)('color.palette', name);
34
35
  const [gradients] = (0, _hooks.useSetting)('color.gradients', name);
@@ -48,7 +49,6 @@ function ScreenBackgroundColor(_ref) {
48
49
  return null;
49
50
  }
50
51
 
51
- const settings = [];
52
52
  let backgroundSettings = {};
53
53
 
54
54
  if (hasBackgroundColor) {
@@ -75,17 +75,14 @@ function ScreenBackgroundColor(_ref) {
75
75
  }
76
76
  }
77
77
 
78
- settings.push({ ...backgroundSettings,
79
- ...gradientSettings,
80
- label: (0, _i18n.__)('Background color')
81
- });
78
+ const controlProps = { ...backgroundSettings,
79
+ ...gradientSettings
80
+ };
82
81
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
83
- back: parentMenu + '/colors',
84
82
  title: (0, _i18n.__)('Background'),
85
- description: (0, _i18n.__)('Set a background color or gradient for the whole website.')
86
- }), (0, _element.createElement)(_blockEditor.__experimentalPanelColorGradientSettings, {
87
- title: (0, _i18n.__)('Color'),
88
- settings: settings,
83
+ description: (0, _i18n.__)('Set a background color or gradient for the whole site.')
84
+ }), (0, _element.createElement)(_blockEditor.__experimentalColorGradientControl, (0, _extends2.default)({
85
+ className: "edit-site-screen-background-color__control",
89
86
  colors: colorsPerOrigin,
90
87
  gradients: gradientsPerOrigin,
91
88
  disableCustomColors: !areCustomSolidsEnabled,
@@ -94,7 +91,7 @@ function ScreenBackgroundColor(_ref) {
94
91
  showTitle: false,
95
92
  enableAlpha: true,
96
93
  __experimentalIsRenderedInSidebar: true
97
- }));
94
+ }, controlProps)));
98
95
  }
99
96
 
100
97
  var _default = ScreenBackgroundColor;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-background-color.js"],"names":["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":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAUA,SAASA,qBAAT,OAA2C;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AAC1C,QAAMC,UAAU,GAAGD,IAAI,KAAKE,SAAT,GAAqB,EAArB,GAA0B,aAAaF,IAA1D;AACA,QAAMG,QAAQ,GAAG,2CAAgCH,IAAhC,CAAjB;AACA,QAAM,CAAEI,MAAF,IAAa,uBAAY,eAAZ,EAA6BJ,IAA7B,CAAnB;AACA,QAAM,CAAEK,SAAF,IAAgB,uBAAY,iBAAZ,EAA+BL,IAA/B,CAAtB;AACA,QAAM,CAAEM,sBAAF,IAA6B,uBAAY,cAAZ,EAA4BN,IAA5B,CAAnC;AACA,QAAM,CAAEO,yBAAF,IAAgC,uBACrC,sBADqC,EAErCP,IAFqC,CAAtC;AAKA,QAAMQ,eAAe,GAAG,+BAAoBR,IAApB,CAAxB;AACA,QAAMS,kBAAkB,GAAG,kCAAuBT,IAAvB,CAA3B;AAEA,QAAM,CAAEU,mBAAF,IAA0B,uBAAY,kBAAZ,EAAgCV,IAAhC,CAAhC;AAEA,QAAMW,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,IAA0C,qBAC/C,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,IADD,EASC,4BAAC,qDAAD;AACC,IAAA,KAAK,EAAG,cAAI,OAAJ,CADT;AAEC,IAAA,QAAQ,EAAGoB,QAFZ;AAGC,IAAA,MAAM,EAAGb,eAHV;AAIC,IAAA,SAAS,EAAGC,kBAJb;AAKC,IAAA,mBAAmB,EAAG,CAAEH,sBALzB;AAMC,IAAA,sBAAsB,EAAG,CAAEC,yBAN5B;AAOC,IAAA,gCAAgC,MAPjC;AAQC,IAAA,SAAS,EAAG,KARb;AASC,IAAA,WAAW,MATZ;AAUC,IAAA,iCAAiC;AAVlC,IATD,CADD;AAwBA;;eAEcR,qB","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\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":["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":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAUA,SAASA,qBAAT,OAA2C;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AAC1C,QAAMC,QAAQ,GAAG,2CAAgCD,IAAhC,CAAjB;AACA,QAAM,CAAEE,MAAF,IAAa,uBAAY,eAAZ,EAA6BF,IAA7B,CAAnB;AACA,QAAM,CAAEG,SAAF,IAAgB,uBAAY,iBAAZ,EAA+BH,IAA/B,CAAtB;AACA,QAAM,CAAEI,sBAAF,IAA6B,uBAAY,cAAZ,EAA4BJ,IAA5B,CAAnC;AACA,QAAM,CAAEK,yBAAF,IAAgC,uBACrC,sBADqC,EAErCL,IAFqC,CAAtC;AAKA,QAAMM,eAAe,GAAG,+BAAoBN,IAApB,CAAxB;AACA,QAAMO,kBAAkB,GAAG,kCAAuBP,IAAvB,CAA3B;AAEA,QAAM,CAAEQ,mBAAF,IAA0B,uBAAY,kBAAZ,EAAgCR,IAAhC,CAAhC;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,YAA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BAAC,+CAAD;AACC,IAAA,SAAS,EAAC,4CADX;AAEC,IAAA,MAAM,EAAGjB,eAFV;AAGC,IAAA,SAAS,EAAGC,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;;eAEc3B,qB","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"]}
@@ -27,7 +27,7 @@ var _typographyPanel = require("./typography-panel");
27
27
 
28
28
  var _header = _interopRequireDefault(require("./header"));
29
29
 
30
- var _navigationButton = _interopRequireDefault(require("./navigation-button"));
30
+ var _navigationButton = require("./navigation-button");
31
31
 
32
32
  /**
33
33
  * WordPress dependencies
@@ -51,7 +51,7 @@ function BlockMenuItem(_ref) {
51
51
  return null;
52
52
  }
53
53
 
54
- return (0, _element.createElement)(_navigationButton.default, {
54
+ return (0, _element.createElement)(_navigationButton.NavigationButton, {
55
55
  path: '/blocks/' + block.name
56
56
  }, (0, _element.createElement)(_components.__experimentalHStack, {
57
57
  justify: "flex-start"
@@ -62,7 +62,6 @@ function BlockMenuItem(_ref) {
62
62
 
63
63
  function ScreenBlockList() {
64
64
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
65
- back: "/",
66
65
  title: (0, _i18n.__)('Blocks'),
67
66
  description: (0, _i18n.__)('Customize the appearance of specific blocks and for the whole site.')
68
67
  }), (0, _blocks.getBlockTypes)().map(block => (0, _element.createElement)(BlockMenuItem, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-block-list.js"],"names":["BlockMenuItem","block","hasTypographyPanel","name","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel","hasBlockMenuItem","icon","title","ScreenBlockList","map"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAIA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AASA;AACA;AACA;AAQA,SAASA,aAAT,OAAoC;AAAA,MAAZ;AAAEC,IAAAA;AAAF,GAAY;AACnC,QAAMC,kBAAkB,GAAG,4CAAuBD,KAAK,CAACE,IAA7B,CAA3B;AACA,QAAMC,aAAa,GAAG,kCAAkBH,KAAK,CAACE,IAAxB,CAAtB;AACA,QAAME,cAAc,GAAG,oCAAmBJ,KAAK,CAACE,IAAzB,CAAvB;AACA,QAAMG,kBAAkB,GAAG,4CAAuBL,KAAK,CAACE,IAA7B,CAA3B;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,4BAAC,yBAAD;AAAkB,IAAA,IAAI,EAAG,aAAaP,KAAK,CAACE;AAA5C,KACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,oBAAD,QACC,4BAAC,sBAAD;AAAW,IAAA,IAAI,EAAGF,KAAK,CAACQ;AAAxB,IADD,CADD,EAIC,4BAAC,oBAAD,QAAYR,KAAK,CAACS,KAAlB,CAJD,CADD,CADD;AAUA;;AAED,SAASC,eAAT,GAA2B;AAC1B,SACC,qDACC,4BAAC,eAAD;AACC,IAAA,IAAI,EAAC,GADN;AAEC,IAAA,KAAK,EAAG,cAAI,QAAJ,CAFT;AAGC,IAAA,WAAW,EAAG,cACb,qEADa;AAHf,IADD,EAQG,6BAAgBC,GAAhB,CAAuBX,KAAF,IACtB,4BAAC,aAAD;AACC,IAAA,KAAK,EAAGA,KADT;AAEC,IAAA,GAAG,EAAG,oBAAoBA,KAAK,CAACE;AAFjC,IADC,CARH,CADD;AAiBA;;eAEcQ,e","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":["BlockMenuItem","block","hasTypographyPanel","name","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel","hasBlockMenuItem","icon","title","ScreenBlockList","map"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAIA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AASA;AACA;AACA;AAQA,SAASA,aAAT,OAAoC;AAAA,MAAZ;AAAEC,IAAAA;AAAF,GAAY;AACnC,QAAMC,kBAAkB,GAAG,4CAAuBD,KAAK,CAACE,IAA7B,CAA3B;AACA,QAAMC,aAAa,GAAG,kCAAkBH,KAAK,CAACE,IAAxB,CAAtB;AACA,QAAME,cAAc,GAAG,oCAAmBJ,KAAK,CAACE,IAAzB,CAAvB;AACA,QAAMG,kBAAkB,GAAG,4CAAuBL,KAAK,CAACE,IAA7B,CAA3B;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,4BAAC,kCAAD;AAAkB,IAAA,IAAI,EAAG,aAAaP,KAAK,CAACE;AAA5C,KACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,oBAAD,QACC,4BAAC,sBAAD;AAAW,IAAA,IAAI,EAAGF,KAAK,CAACQ;AAAxB,IADD,CADD,EAIC,4BAAC,oBAAD,QAAYR,KAAK,CAACS,KAAlB,CAJD,CADD,CADD;AAUA;;AAED,SAASC,eAAT,GAA2B;AAC1B,SACC,qDACC,4BAAC,eAAD;AACC,IAAA,KAAK,EAAG,cAAI,QAAJ,CADT;AAEC,IAAA,WAAW,EAAG,cACb,qEADa;AAFf,IADD,EAOG,6BAAgBC,GAAhB,CAAuBX,KAAF,IACtB,4BAAC,aAAD;AACC,IAAA,KAAK,EAAGA,KADT;AAEC,IAAA,GAAG,EAAG,oBAAoBA,KAAK,CAACE;AAFjC,IADC,CAPH,CADD;AAgBA;;eAEcQ,e","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"]}
@@ -28,7 +28,6 @@ function ScreenBlock(_ref) {
28
28
  } = _ref;
29
29
  const blockType = (0, _blocks.getBlockType)(name);
30
30
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
31
- back: "/blocks",
32
31
  title: blockType.title
33
32
  }), (0, _element.createElement)(_contextMenu.default, {
34
33
  parentMenu: '/blocks/' + name,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-block.js"],"names":["ScreenBlock","name","blockType","title"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,SAASA,WAAT,OAAiC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AAChC,QAAMC,SAAS,GAAG,0BAAcD,IAAd,CAAlB;AAEA,SACC,qDACC,4BAAC,eAAD;AAAc,IAAA,IAAI,EAAC,SAAnB;AAA6B,IAAA,KAAK,EAAGC,SAAS,CAACC;AAA/C,IADD,EAEC,4BAAC,oBAAD;AAAa,IAAA,UAAU,EAAG,aAAaF,IAAvC;AAA8C,IAAA,IAAI,EAAGA;AAArD,IAFD,CADD;AAMA;;eAEcD,W","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":["ScreenBlock","name","blockType","title"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,SAASA,WAAT,OAAiC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AAChC,QAAMC,SAAS,GAAG,0BAAcD,IAAd,CAAlB;AAEA,SACC,qDACC,4BAAC,eAAD;AAAc,IAAA,KAAK,EAAGC,SAAS,CAACC;AAAhC,IADD,EAEC,4BAAC,oBAAD;AAAa,IAAA,UAAU,EAAG,aAAaF,IAAvC;AAA8C,IAAA,IAAI,EAAGA;AAArD,IAFD,CADD;AAMA;;eAEcD,W","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"]}