@wordpress/edit-site 5.34.0 → 5.35.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 (371) hide show
  1. package/CHANGELOG.md +9 -3
  2. package/build/components/add-new-template/index.js +2 -2
  3. package/build/components/add-new-template/index.js.map +1 -1
  4. package/build/components/app/index.js +4 -2
  5. package/build/components/app/index.js.map +1 -1
  6. package/build/components/block-editor/editor-canvas.js +4 -18
  7. package/build/components/block-editor/editor-canvas.js.map +1 -1
  8. package/build/components/block-editor/site-editor-canvas.js +2 -2
  9. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  10. package/build/components/dataviews-actions/index.js +46 -0
  11. package/build/components/dataviews-actions/index.js.map +1 -0
  12. package/build/components/editor/index.js +68 -12
  13. package/build/components/editor/index.js.map +1 -1
  14. package/build/components/global-styles/background-panel.js +13 -1
  15. package/build/components/global-styles/background-panel.js.map +1 -1
  16. package/build/components/global-styles/color-indicator-wrapper.js +2 -2
  17. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  18. package/build/components/global-styles/color-palette-panel.js +5 -2
  19. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  20. package/build/components/global-styles/gradients-palette-panel.js +1 -2
  21. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  22. package/build/components/global-styles/hooks.js +5 -2
  23. package/build/components/global-styles/hooks.js.map +1 -1
  24. package/build/components/global-styles/icon-with-current-color.js +2 -2
  25. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  26. package/build/components/global-styles/preset-colors.js +29 -0
  27. package/build/components/global-styles/preset-colors.js.map +1 -0
  28. package/build/components/global-styles/preview-colors.js +3 -7
  29. package/build/components/global-styles/preview-colors.js.map +1 -1
  30. package/build/components/global-styles/screen-color-palette.js +5 -5
  31. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  32. package/build/components/global-styles/screen-colors.js +1 -4
  33. package/build/components/global-styles/screen-colors.js.map +1 -1
  34. package/build/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  35. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  36. package/build/components/global-styles/typography-example.js +5 -2
  37. package/build/components/global-styles/typography-example.js.map +1 -1
  38. package/build/components/global-styles/ui.js +4 -1
  39. package/build/components/global-styles/ui.js.map +1 -1
  40. package/build/components/global-styles/variations/variation.js +12 -6
  41. package/build/components/global-styles/variations/variation.js.map +1 -1
  42. package/build/components/global-styles/variations/variations-color.js +5 -5
  43. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  44. package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -0
  45. package/build/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +8 -5
  46. package/build/components/global-styles-sidebar/index.js.map +1 -0
  47. package/build/components/header-edit-mode/index.js +20 -120
  48. package/build/components/header-edit-mode/index.js.map +1 -1
  49. package/build/components/layout/index.js +3 -6
  50. package/build/components/layout/index.js.map +1 -1
  51. package/build/components/layout/router.js +69 -14
  52. package/build/components/layout/router.js.map +1 -1
  53. package/build/components/page/index.js +2 -2
  54. package/build/components/page/index.js.map +1 -1
  55. package/build/components/page-pages/index.js +4 -15
  56. package/build/components/page-pages/index.js.map +1 -1
  57. package/build/components/page-patterns/dataviews-pattern-actions.js +4 -80
  58. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  59. package/build/components/page-patterns/index.js +9 -20
  60. package/build/components/page-patterns/index.js.map +1 -1
  61. package/build/components/page-templates/index.js +6 -14
  62. package/build/components/page-templates/index.js.map +1 -1
  63. package/build/components/pagination/index.js +2 -2
  64. package/build/components/pagination/index.js.map +1 -1
  65. package/build/components/resizable-frame/index.js +11 -3
  66. package/build/components/resizable-frame/index.js.map +1 -1
  67. package/build/components/revisions/index.js +5 -2
  68. package/build/components/revisions/index.js.map +1 -1
  69. package/build/components/save-panel/index.js +4 -4
  70. package/build/components/save-panel/index.js.map +1 -1
  71. package/build/components/sidebar/index.js +61 -31
  72. package/build/components/sidebar/index.js.map +1 -1
  73. package/build/components/sidebar-button/index.js +2 -2
  74. package/build/components/sidebar-button/index.js.map +1 -1
  75. package/build/components/sidebar-dataviews/dataview-item.js +2 -2
  76. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  77. package/build/components/sidebar-navigation-item/index.js +5 -3
  78. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  79. package/build/components/sidebar-navigation-screen/index.js +6 -32
  80. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  81. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
  82. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  83. package/build/components/sidebar-navigation-screen-global-styles/index.js +4 -1
  84. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  85. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +10 -3
  86. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  87. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +16 -1
  88. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  89. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
  90. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  91. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +16 -6
  92. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  93. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +2 -9
  94. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  95. package/build/components/sidebar-navigation-screen-page/status-label.js +2 -2
  96. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  97. package/build/components/sidebar-navigation-screen-pattern/index.js +4 -9
  98. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  99. package/build/components/sidebar-navigation-screen-patterns/index.js +4 -14
  100. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  101. package/build/components/sidebar-navigation-screen-template/index.js +4 -1
  102. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  103. package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -1
  104. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  105. package/build/components/site-hub/index.js +3 -3
  106. package/build/components/site-hub/index.js.map +1 -1
  107. package/build/components/site-icon/index.js +2 -2
  108. package/build/components/site-icon/index.js.map +1 -1
  109. package/build/components/style-book/index.js +10 -7
  110. package/build/components/style-book/index.js.map +1 -1
  111. package/build/components/template-part-converter/index.js +18 -1
  112. package/build/components/template-part-converter/index.js.map +1 -1
  113. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +5 -2
  114. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  115. package/build/utils/get-is-list-page.js +1 -1
  116. package/build/utils/get-is-list-page.js.map +1 -1
  117. package/build/utils/use-activate-theme.js +9 -6
  118. package/build/utils/use-activate-theme.js.map +1 -1
  119. package/build-module/components/add-new-template/index.js +2 -2
  120. package/build-module/components/add-new-template/index.js.map +1 -1
  121. package/build-module/components/app/index.js +4 -2
  122. package/build-module/components/app/index.js.map +1 -1
  123. package/build-module/components/block-editor/editor-canvas.js +4 -18
  124. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  125. package/build-module/components/block-editor/site-editor-canvas.js +2 -2
  126. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  127. package/build-module/components/dataviews-actions/index.js +38 -0
  128. package/build-module/components/dataviews-actions/index.js.map +1 -0
  129. package/build-module/components/editor/index.js +69 -13
  130. package/build-module/components/editor/index.js.map +1 -1
  131. package/build-module/components/global-styles/background-panel.js +12 -1
  132. package/build-module/components/global-styles/background-panel.js.map +1 -1
  133. package/build-module/components/global-styles/color-indicator-wrapper.js +2 -2
  134. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  135. package/build-module/components/global-styles/color-palette-panel.js +4 -2
  136. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  137. package/build-module/components/global-styles/gradients-palette-panel.js +1 -2
  138. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  139. package/build-module/components/global-styles/hooks.js +4 -1
  140. package/build-module/components/global-styles/hooks.js.map +1 -1
  141. package/build-module/components/global-styles/icon-with-current-color.js +2 -2
  142. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  143. package/build-module/components/global-styles/preset-colors.js +22 -0
  144. package/build-module/components/global-styles/preset-colors.js.map +1 -0
  145. package/build-module/components/global-styles/preview-colors.js +3 -7
  146. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  147. package/build-module/components/global-styles/screen-color-palette.js +5 -5
  148. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  149. package/build-module/components/global-styles/screen-colors.js +1 -4
  150. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  151. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  152. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  153. package/build-module/components/global-styles/typography-example.js +4 -1
  154. package/build-module/components/global-styles/typography-example.js.map +1 -1
  155. package/build-module/components/global-styles/ui.js +4 -1
  156. package/build-module/components/global-styles/ui.js.map +1 -1
  157. package/build-module/components/global-styles/variations/variation.js +11 -5
  158. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  159. package/build-module/components/global-styles/variations/variations-color.js +6 -6
  160. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  161. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -0
  162. package/build-module/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +8 -5
  163. package/build-module/components/global-styles-sidebar/index.js.map +1 -0
  164. package/build-module/components/header-edit-mode/index.js +20 -120
  165. package/build-module/components/header-edit-mode/index.js.map +1 -1
  166. package/build-module/components/layout/index.js +3 -6
  167. package/build-module/components/layout/index.js.map +1 -1
  168. package/build-module/components/layout/router.js +69 -15
  169. package/build-module/components/layout/router.js.map +1 -1
  170. package/build-module/components/page/index.js +2 -2
  171. package/build-module/components/page/index.js.map +1 -1
  172. package/build-module/components/page-pages/index.js +4 -15
  173. package/build-module/components/page-pages/index.js.map +1 -1
  174. package/build-module/components/page-patterns/dataviews-pattern-actions.js +4 -80
  175. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  176. package/build-module/components/page-patterns/index.js +10 -21
  177. package/build-module/components/page-patterns/index.js.map +1 -1
  178. package/build-module/components/page-templates/index.js +6 -14
  179. package/build-module/components/page-templates/index.js.map +1 -1
  180. package/build-module/components/pagination/index.js +2 -2
  181. package/build-module/components/pagination/index.js.map +1 -1
  182. package/build-module/components/resizable-frame/index.js +12 -4
  183. package/build-module/components/resizable-frame/index.js.map +1 -1
  184. package/build-module/components/revisions/index.js +4 -1
  185. package/build-module/components/revisions/index.js.map +1 -1
  186. package/build-module/components/save-panel/index.js +4 -4
  187. package/build-module/components/save-panel/index.js.map +1 -1
  188. package/build-module/components/sidebar/index.js +62 -32
  189. package/build-module/components/sidebar/index.js.map +1 -1
  190. package/build-module/components/sidebar-button/index.js +2 -2
  191. package/build-module/components/sidebar-button/index.js.map +1 -1
  192. package/build-module/components/sidebar-dataviews/dataview-item.js +2 -2
  193. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  194. package/build-module/components/sidebar-navigation-item/index.js +5 -3
  195. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  196. package/build-module/components/sidebar-navigation-screen/index.js +6 -32
  197. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  198. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
  199. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  200. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +4 -1
  201. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  202. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +10 -3
  203. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  204. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +16 -1
  205. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  206. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
  207. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  208. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +16 -6
  209. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  210. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +2 -9
  211. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  212. package/build-module/components/sidebar-navigation-screen-page/status-label.js +2 -2
  213. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  214. package/build-module/components/sidebar-navigation-screen-pattern/index.js +4 -9
  215. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  216. package/build-module/components/sidebar-navigation-screen-patterns/index.js +4 -14
  217. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  218. package/build-module/components/sidebar-navigation-screen-template/index.js +4 -1
  219. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  220. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -1
  221. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  222. package/build-module/components/site-hub/index.js +3 -3
  223. package/build-module/components/site-hub/index.js.map +1 -1
  224. package/build-module/components/site-icon/index.js +2 -2
  225. package/build-module/components/site-icon/index.js.map +1 -1
  226. package/build-module/components/style-book/index.js +9 -6
  227. package/build-module/components/style-book/index.js.map +1 -1
  228. package/build-module/components/template-part-converter/index.js +18 -1
  229. package/build-module/components/template-part-converter/index.js.map +1 -1
  230. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +4 -1
  231. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  232. package/build-module/utils/get-is-list-page.js +1 -1
  233. package/build-module/utils/get-is-list-page.js.map +1 -1
  234. package/build-module/utils/use-activate-theme.js +9 -6
  235. package/build-module/utils/use-activate-theme.js.map +1 -1
  236. package/build-style/style-rtl.css +144 -374
  237. package/build-style/style.css +144 -374
  238. package/package.json +43 -45
  239. package/src/components/add-new-template/index.js +2 -2
  240. package/src/components/app/index.js +5 -2
  241. package/src/components/block-editor/editor-canvas.js +6 -26
  242. package/src/components/block-editor/site-editor-canvas.js +2 -2
  243. package/src/components/block-editor/style.scss +2 -2
  244. package/src/components/dataviews-actions/index.js +38 -0
  245. package/src/components/editor/index.js +76 -16
  246. package/src/components/editor/style.scss +0 -4
  247. package/src/components/global-styles/background-panel.js +17 -2
  248. package/src/components/global-styles/color-indicator-wrapper.js +2 -2
  249. package/src/components/global-styles/color-palette-panel.js +3 -4
  250. package/src/components/global-styles/gradients-palette-panel.js +1 -4
  251. package/src/components/global-styles/hooks.js +2 -1
  252. package/src/components/global-styles/icon-with-current-color.js +2 -2
  253. package/src/components/global-styles/preset-colors.js +18 -0
  254. package/src/components/global-styles/preview-colors.js +4 -7
  255. package/src/components/global-styles/screen-color-palette.js +4 -4
  256. package/src/components/global-styles/screen-colors.js +0 -2
  257. package/src/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  258. package/src/components/global-styles/stories/index.story.js +2 -1
  259. package/src/components/global-styles/typography-example.js +2 -1
  260. package/src/components/global-styles/ui.js +5 -1
  261. package/src/components/global-styles/variations/style.scss +15 -31
  262. package/src/components/global-styles/variations/variation.js +13 -10
  263. package/src/components/global-styles/variations/variations-color.js +5 -8
  264. package/src/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +7 -2
  265. package/src/components/{sidebar-edit-mode → global-styles-sidebar}/style.scss +0 -11
  266. package/src/components/header-edit-mode/index.js +25 -164
  267. package/src/components/header-edit-mode/style.scss +1 -199
  268. package/src/components/layout/index.js +3 -8
  269. package/src/components/layout/router.js +65 -15
  270. package/src/components/layout/style.scss +2 -1
  271. package/src/components/page/index.js +2 -2
  272. package/src/components/page-pages/index.js +8 -38
  273. package/src/components/page-pages/style.scss +0 -11
  274. package/src/components/page-patterns/dataviews-pattern-actions.js +3 -92
  275. package/src/components/page-patterns/index.js +16 -35
  276. package/src/components/page-templates/index.js +10 -29
  277. package/src/components/pagination/index.js +2 -2
  278. package/src/components/resizable-frame/index.js +16 -4
  279. package/src/components/revisions/index.js +2 -1
  280. package/src/components/save-panel/index.js +4 -4
  281. package/src/components/sidebar/index.js +61 -37
  282. package/src/components/sidebar-button/index.js +2 -5
  283. package/src/components/sidebar-dataviews/dataview-item.js +4 -7
  284. package/src/components/sidebar-navigation-item/index.js +3 -3
  285. package/src/components/sidebar-navigation-screen/index.js +7 -31
  286. package/src/components/sidebar-navigation-screen/style.scss +11 -9
  287. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
  288. package/src/components/sidebar-navigation-screen-global-styles/index.js +2 -1
  289. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +6 -1
  290. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +18 -1
  291. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
  292. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +8 -4
  293. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +0 -10
  294. package/src/components/sidebar-navigation-screen-page/status-label.js +2 -2
  295. package/src/components/sidebar-navigation-screen-pattern/index.js +2 -8
  296. package/src/components/sidebar-navigation-screen-patterns/index.js +2 -13
  297. package/src/components/sidebar-navigation-screen-template/index.js +2 -1
  298. package/src/components/sidebar-navigation-screen-templates-browse/index.js +2 -1
  299. package/src/components/site-hub/index.js +3 -3
  300. package/src/components/site-icon/index.js +2 -2
  301. package/src/components/style-book/index.js +7 -6
  302. package/src/components/template-part-converter/index.js +16 -3
  303. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
  304. package/src/style.scss +1 -11
  305. package/src/utils/get-is-list-page.js +1 -3
  306. package/src/utils/use-activate-theme.js +4 -4
  307. package/build/components/global-styles/global-styles-provider.js +0 -129
  308. package/build/components/global-styles/global-styles-provider.js.map +0 -1
  309. package/build/components/header-edit-mode/document-tools/index.js +0 -68
  310. package/build/components/header-edit-mode/document-tools/index.js.map +0 -1
  311. package/build/components/sidebar-edit-mode/default-sidebar.js.map +0 -1
  312. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +0 -1
  313. package/build/components/sidebar-edit-mode/index.js +0 -147
  314. package/build/components/sidebar-edit-mode/index.js.map +0 -1
  315. package/build/components/sidebar-edit-mode/page-panels/index.js +0 -129
  316. package/build/components/sidebar-edit-mode/page-panels/index.js.map +0 -1
  317. package/build/components/sidebar-edit-mode/page-panels/page-content.js +0 -34
  318. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +0 -1
  319. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +0 -46
  320. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +0 -1
  321. package/build/components/sidebar-edit-mode/settings-header/index.js +0 -42
  322. package/build/components/sidebar-edit-mode/settings-header/index.js.map +0 -1
  323. package/build/components/sidebar-edit-mode/template-panel/hooks.js +0 -86
  324. package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +0 -1
  325. package/build/components/sidebar-edit-mode/template-panel/index.js +0 -127
  326. package/build/components/sidebar-edit-mode/template-panel/index.js.map +0 -1
  327. package/build/components/start-template-options/index.js +0 -191
  328. package/build/components/start-template-options/index.js.map +0 -1
  329. package/build/utils/math.js +0 -98
  330. package/build/utils/math.js.map +0 -1
  331. package/build-module/components/global-styles/global-styles-provider.js +0 -120
  332. package/build-module/components/global-styles/global-styles-provider.js.map +0 -1
  333. package/build-module/components/header-edit-mode/document-tools/index.js +0 -61
  334. package/build-module/components/header-edit-mode/document-tools/index.js.map +0 -1
  335. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +0 -1
  336. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +0 -1
  337. package/build-module/components/sidebar-edit-mode/index.js +0 -138
  338. package/build-module/components/sidebar-edit-mode/index.js.map +0 -1
  339. package/build-module/components/sidebar-edit-mode/page-panels/index.js +0 -121
  340. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +0 -1
  341. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +0 -27
  342. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +0 -1
  343. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +0 -39
  344. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +0 -1
  345. package/build-module/components/sidebar-edit-mode/settings-header/index.js +0 -35
  346. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +0 -1
  347. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js +0 -79
  348. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +0 -1
  349. package/build-module/components/sidebar-edit-mode/template-panel/index.js +0 -119
  350. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +0 -1
  351. package/build-module/components/start-template-options/index.js +0 -184
  352. package/build-module/components/start-template-options/index.js.map +0 -1
  353. package/build-module/utils/math.js +0 -92
  354. package/build-module/utils/math.js.map +0 -1
  355. package/src/components/global-styles/global-styles-provider.js +0 -162
  356. package/src/components/header-edit-mode/document-tools/index.js +0 -68
  357. package/src/components/sidebar-edit-mode/index.js +0 -173
  358. package/src/components/sidebar-edit-mode/page-panels/index.js +0 -133
  359. package/src/components/sidebar-edit-mode/page-panels/page-content.js +0 -29
  360. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +0 -61
  361. package/src/components/sidebar-edit-mode/settings-header/index.js +0 -43
  362. package/src/components/sidebar-edit-mode/settings-header/style.scss +0 -14
  363. package/src/components/sidebar-edit-mode/template-panel/hooks.js +0 -114
  364. package/src/components/sidebar-edit-mode/template-panel/index.js +0 -134
  365. package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -16
  366. package/src/components/start-template-options/index.js +0 -231
  367. package/src/components/start-template-options/style.scss +0 -55
  368. package/src/utils/math.js +0 -93
  369. /package/build/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
  370. /package/build-module/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
  371. /package/src/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
@@ -2,7 +2,7 @@ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -11,21 +11,21 @@ import { useDispatch, useSelect } from '@wordpress/data';
11
11
  import { Notice, __unstableAnimatePresence as AnimatePresence, __unstableMotion as motion } from '@wordpress/components';
12
12
  import { useInstanceId, useViewportMatch, useReducedMotion } from '@wordpress/compose';
13
13
  import { store as preferencesStore } from '@wordpress/preferences';
14
- import { BlockBreadcrumb, BlockToolbar, store as blockEditorStore, BlockInspector } from '@wordpress/block-editor';
14
+ import { BlockBreadcrumb, BlockToolbar, store as blockEditorStore } from '@wordpress/block-editor';
15
15
  import { EditorKeyboardShortcutsRegister, EditorKeyboardShortcuts, EditorNotices, EditorSnackbars, privateApis as editorPrivateApis, store as editorStore } from '@wordpress/editor';
16
16
  import { __, sprintf } from '@wordpress/i18n';
17
17
  import { store as coreDataStore } from '@wordpress/core-data';
18
18
  import { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';
19
19
  import { useState, useCallback } from '@wordpress/element';
20
+ import { store as noticesStore } from '@wordpress/notices';
21
+ import { privateApis as routerPrivateApis } from '@wordpress/router';
20
22
 
21
23
  /**
22
24
  * Internal dependencies
23
25
  */
24
- import { SidebarComplementaryAreaFills, SidebarInspectorFill } from '../sidebar-edit-mode';
25
26
  import CodeEditor from '../code-editor';
26
27
  import Header from '../header-edit-mode';
27
28
  import WelcomeGuide from '../welcome-guide';
28
- import StartTemplateOptions from '../start-template-options';
29
29
  import { store as editSiteStore } from '../../store';
30
30
  import { GlobalStylesRenderer } from '../global-styles-renderer';
31
31
  import useTitle from '../routes/use-title';
@@ -37,6 +37,8 @@ import { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';
37
37
  import SiteEditorCanvas from '../block-editor/site-editor-canvas';
38
38
  import TemplatePartConverter from '../template-part-converter';
39
39
  import { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';
40
+ import PluginTemplateSettingPanel from '../plugin-template-setting-panel';
41
+ import GlobalStylesSidebar from '../global-styles-sidebar';
40
42
  const {
41
43
  ExperimentalEditorProvider: EditorProvider,
42
44
  InserterSidebar,
@@ -44,8 +46,12 @@ const {
44
46
  InterfaceSkeleton,
45
47
  ComplementaryArea,
46
48
  interfaceStore,
47
- SavePublishPanels
49
+ SavePublishPanels,
50
+ Sidebar
48
51
  } = unlock(editorPrivateApis);
52
+ const {
53
+ useHistory
54
+ } = unlock(routerPrivateApis);
49
55
  const {
50
56
  BlockKeyboardShortcuts
51
57
  } = unlock(blockLibraryPrivateApis);
@@ -88,14 +94,17 @@ export default function Editor({
88
94
  isDistractionFree,
89
95
  showIconLabels,
90
96
  showBlockBreadcrumbs,
91
- postTypeLabel
97
+ postTypeLabel,
98
+ isEditingPage,
99
+ supportsGlobalStyles
92
100
  } = useSelect(select => {
93
101
  const {
94
102
  get
95
103
  } = select(preferencesStore);
96
104
  const {
97
105
  getEditedPostContext,
98
- getCanvasMode
106
+ getCanvasMode,
107
+ isPage
99
108
  } = unlock(select(editSiteStore));
100
109
  const {
101
110
  __unstableGetEditorMode
@@ -104,7 +113,8 @@ export default function Editor({
104
113
  getActiveComplementaryArea
105
114
  } = select(interfaceStore);
106
115
  const {
107
- getEntityRecord
116
+ getEntityRecord,
117
+ getCurrentTheme
108
118
  } = select(coreDataStore);
109
119
  const {
110
120
  isInserterOpened,
@@ -128,7 +138,9 @@ export default function Editor({
128
138
  isDistractionFree: get('core', 'distractionFree'),
129
139
  showBlockBreadcrumbs: get('core', 'showBlockBreadcrumbs'),
130
140
  showIconLabels: get('core', 'showIconLabels'),
131
- postTypeLabel: getPostTypeLabel()
141
+ postTypeLabel: getPostTypeLabel(),
142
+ isEditingPage: isPage(),
143
+ supportsGlobalStyles: getCurrentTheme()?.is_block_theme
132
144
  };
133
145
  }, []);
134
146
  const isViewMode = canvasMode === 'view';
@@ -165,6 +177,47 @@ export default function Editor({
165
177
  }
166
178
  setEntitiesSavedStatesCallback(false);
167
179
  }, [entitiesSavedStatesCallback]);
180
+ const {
181
+ createSuccessNotice
182
+ } = useDispatch(noticesStore);
183
+ const history = useHistory();
184
+ const onActionPerformed = useCallback((actionId, items) => {
185
+ switch (actionId) {
186
+ case 'move-to-trash':
187
+ {
188
+ history.push({
189
+ path: '/' + items[0].type,
190
+ postId: undefined,
191
+ postType: undefined,
192
+ canvas: 'view'
193
+ });
194
+ }
195
+ break;
196
+ case 'duplicate-post':
197
+ {
198
+ const newItem = items[0];
199
+ const _title = typeof newItem.title === 'string' ? newItem.title : newItem.title?.rendered;
200
+ createSuccessNotice(sprintf(
201
+ // translators: %s: Title of the created post e.g: "Post 1".
202
+ __('"%s" successfully created.'), _title), {
203
+ type: 'snackbar',
204
+ id: 'duplicate-post-action',
205
+ actions: [{
206
+ label: __('Edit'),
207
+ onClick: () => {
208
+ history.push({
209
+ path: undefined,
210
+ postId: newItem.id,
211
+ postType: newItem.type,
212
+ canvas: 'edit'
213
+ });
214
+ }
215
+ }]
216
+ });
217
+ }
218
+ break;
219
+ }
220
+ }, [history, createSuccessNotice]);
168
221
  const isReady = !isLoading && (postWithTemplate && !!contextPost && !!editedPost || !postWithTemplate && !!editedPost);
169
222
  return createElement(Fragment, null, !isReady ? createElement(CanvasLoader, {
170
223
  id: loadingProgressId
@@ -176,10 +229,10 @@ export default function Editor({
176
229
  __unstableTemplate: postWithTemplate ? editedPost : undefined,
177
230
  settings: settings,
178
231
  useSubRegistry: false
179
- }, createElement(SidebarComplementaryAreaFills, null), isEditMode && createElement(StartTemplateOptions, null), createElement(InterfaceSkeleton, {
232
+ }, createElement(InterfaceSkeleton, {
180
233
  isDistractionFree: isDistractionFree,
181
234
  enableRegionNavigation: false,
182
- className: classnames('edit-site-editor__interface-skeleton', {
235
+ className: clsx('edit-site-editor__interface-skeleton', {
183
236
  'show-icon-labels': showIconLabels,
184
237
  'is-entity-save-view-open': !!entitiesSavedStatesCallback
185
238
  }),
@@ -211,7 +264,7 @@ export default function Editor({
211
264
  setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
212
265
  }),
213
266
  notices: createElement(EditorSnackbars, null),
214
- content: createElement(Fragment, null, createElement(GlobalStylesRenderer, null), isEditMode && createElement(EditorNotices, null), showVisualEditor && createElement(Fragment, null, createElement(TemplatePartConverter, null), createElement(SidebarInspectorFill, null, createElement(BlockInspector, null)), !isLargeViewport && createElement(BlockToolbar, {
267
+ content: createElement(Fragment, null, createElement(GlobalStylesRenderer, null), isEditMode && createElement(EditorNotices, null), showVisualEditor && createElement(Fragment, null, createElement(TemplatePartConverter, null), !isLargeViewport && createElement(BlockToolbar, {
215
268
  hideDragHandle: true
216
269
  }), createElement(SiteEditorCanvas, {
217
270
  onClick: onClick
@@ -230,6 +283,9 @@ export default function Editor({
230
283
  ...interfaceLabels,
231
284
  secondarySidebar: secondarySidebarLabel
232
285
  }
233
- })));
286
+ }), createElement(Sidebar, {
287
+ onActionPerformed: onActionPerformed,
288
+ extraPanels: !isEditingPage && createElement(PluginTemplateSettingPanel.Slot, null)
289
+ }), supportsGlobalStyles && createElement(GlobalStylesSidebar, null)));
234
290
  }
235
291
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useDispatch","useSelect","Notice","__unstableAnimatePresence","AnimatePresence","__unstableMotion","motion","useInstanceId","useViewportMatch","useReducedMotion","store","preferencesStore","BlockBreadcrumb","BlockToolbar","blockEditorStore","BlockInspector","EditorKeyboardShortcutsRegister","EditorKeyboardShortcuts","EditorNotices","EditorSnackbars","privateApis","editorPrivateApis","editorStore","__","sprintf","coreDataStore","blockLibraryPrivateApis","useState","useCallback","SidebarComplementaryAreaFills","SidebarInspectorFill","CodeEditor","Header","WelcomeGuide","StartTemplateOptions","editSiteStore","GlobalStylesRenderer","useTitle","CanvasLoader","unlock","useEditedEntityRecord","PatternModal","POST_TYPE_LABELS","TEMPLATE_POST_TYPE","SiteEditorCanvas","TemplatePartConverter","useSpecificEditorSettings","ExperimentalEditorProvider","EditorProvider","InserterSidebar","ListViewSidebar","InterfaceSkeleton","ComplementaryArea","interfaceStore","SavePublishPanels","BlockKeyboardShortcuts","interfaceLabels","body","sidebar","actions","footer","header","ANIMATION_DURATION","Editor","isLoading","onClick","record","editedPost","getTitle","isLoaded","hasLoadedPost","type","editedPostType","isLargeViewport","disableMotion","context","contextPost","editorMode","canvasMode","blockEditorMode","isRightSidebarOpen","isInserterOpen","isListViewOpen","isDistractionFree","showIconLabels","showBlockBreadcrumbs","postTypeLabel","select","get","getEditedPostContext","getCanvasMode","__unstableGetEditorMode","getActiveComplementaryArea","getEntityRecord","isInserterOpened","isListViewOpened","getPostTypeLabel","getEditorMode","_context","postId","postType","undefined","isViewMode","isEditMode","showVisualEditor","shouldShowBlockBreadcrumbs","shouldShowInserter","shouldShowListView","secondarySidebarLabel","postWithTemplate","title","_POST_TYPE_LABELS$edi","loadingProgressId","closeGeneralSidebar","settings","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","isReady","createElement","Fragment","id","status","isDismissible","post","__unstableTemplate","useSubRegistry","enableRegionNavigation","className","initial","div","marginTop","animate","exit","transition","duration","ease","isEntitiesSavedStatesOpen","notices","content","hideDragHandle","secondarySidebar","Slot","scope","rootLabelText","labels"],"sources":["@wordpress/edit-site/src/components/editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tNotice,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport {\n\tuseInstanceId,\n\tuseViewportMatch,\n\tuseReducedMotion,\n} from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tBlockBreadcrumb,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n\tBlockInspector,\n} from '@wordpress/block-editor';\nimport {\n\tEditorKeyboardShortcutsRegister,\n\tEditorKeyboardShortcuts,\n\tEditorNotices,\n\tEditorSnackbars,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSidebarComplementaryAreaFills,\n\tSidebarInspectorFill,\n} from '../sidebar-edit-mode';\nimport CodeEditor from '../code-editor';\nimport Header from '../header-edit-mode';\nimport WelcomeGuide from '../welcome-guide';\nimport StartTemplateOptions from '../start-template-options';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport useTitle from '../routes/use-title';\nimport CanvasLoader from '../canvas-loader';\nimport { unlock } from '../../lock-unlock';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport PatternModal from '../pattern-modal';\nimport { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport SiteEditorCanvas from '../block-editor/site-editor-canvas';\nimport TemplatePartConverter from '../template-part-converter';\nimport { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';\n\nconst {\n\tExperimentalEditorProvider: EditorProvider,\n\tInserterSidebar,\n\tListViewSidebar,\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tinterfaceStore,\n\tSavePublishPanels,\n} = unlock( editorPrivateApis );\n\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n\t/* translators: accessibility text for the editor header landmark region. */\n\theader: __( 'Editor top bar' ),\n};\n\nconst ANIMATION_DURATION = 0.25;\n\nexport default function Editor( { isLoading, onClick } ) {\n\tconst {\n\t\trecord: editedPost,\n\t\tgetTitle,\n\t\tisLoaded: hasLoadedPost,\n\t} = useEditedEntityRecord();\n\n\tconst { type: editedPostType } = editedPost;\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst disableMotion = useReducedMotion();\n\n\tconst {\n\t\tcontext,\n\t\tcontextPost,\n\t\teditorMode,\n\t\tcanvasMode,\n\t\tblockEditorMode,\n\t\tisRightSidebarOpen,\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tisDistractionFree,\n\t\tshowIconLabels,\n\t\tshowBlockBreadcrumbs,\n\t\tpostTypeLabel,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditedPostContext, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst { getEntityRecord } = select( coreDataStore );\n\t\tconst {\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t\tgetPostTypeLabel,\n\t\t\tgetEditorMode,\n\t\t} = select( editorStore );\n\t\tconst _context = getEditedPostContext();\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tcontext: _context,\n\t\t\tcontextPost: _context?.postId\n\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t_context.postType,\n\t\t\t\t\t\t_context.postId\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t\teditorMode: getEditorMode(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisRightSidebarOpen: getActiveComplementaryArea( 'core' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tpostTypeLabel: getPostTypeLabel(),\n\t\t};\n\t}, [] );\n\n\tconst isViewMode = canvasMode === 'view';\n\tconst isEditMode = canvasMode === 'edit';\n\tconst showVisualEditor = isViewMode || editorMode === 'visual';\n\tconst shouldShowBlockBreadcrumbs =\n\t\t! isDistractionFree &&\n\t\tshowBlockBreadcrumbs &&\n\t\tisEditMode &&\n\t\tshowVisualEditor &&\n\t\tblockEditorMode !== 'zoom-out';\n\tconst shouldShowInserter = isEditMode && showVisualEditor && isInserterOpen;\n\tconst shouldShowListView = isEditMode && showVisualEditor && isListViewOpen;\n\tconst secondarySidebarLabel = isListViewOpen\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\tconst postWithTemplate = !! context?.postId;\n\n\tlet title;\n\tif ( hasLoadedPost ) {\n\t\ttitle = sprintf(\n\t\t\t// translators: A breadcrumb trail for the Admin document title. %1$s: title of template being edited, %2$s: type of template (Template or Template Part).\n\t\t\t__( '%1$s ‹ %2$s' ),\n\t\t\tgetTitle(),\n\t\t\tPOST_TYPE_LABELS[ editedPostType ] ??\n\t\t\t\tPOST_TYPE_LABELS[ TEMPLATE_POST_TYPE ]\n\t\t);\n\t}\n\n\t// Only announce the title once the editor is ready to prevent \"Replace\"\n\t// action in <URLQueryController> from double-announcing.\n\tuseTitle( hasLoadedPost && title );\n\n\tconst loadingProgressId = useInstanceId(\n\t\tCanvasLoader,\n\t\t'edit-site-editor__loading-progress'\n\t);\n\n\tconst { closeGeneralSidebar } = useDispatch( editSiteStore );\n\n\tconst settings = useSpecificEditorSettings();\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\tconst isReady =\n\t\t! isLoading &&\n\t\t( ( postWithTemplate && !! contextPost && !! editedPost ) ||\n\t\t\t( ! postWithTemplate && !! editedPost ) );\n\n\treturn (\n\t\t<>\n\t\t\t{ ! isReady ? <CanvasLoader id={ loadingProgressId } /> : null }\n\t\t\t{ isEditMode && <WelcomeGuide /> }\n\t\t\t{ hasLoadedPost && ! editedPost && (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t\"You attempted to edit an item that doesn't exist. Perhaps it was deleted?\"\n\t\t\t\t\t) }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t\t{ isReady && (\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ postWithTemplate ? contextPost : editedPost }\n\t\t\t\t\t__unstableTemplate={\n\t\t\t\t\t\tpostWithTemplate ? editedPost : undefined\n\t\t\t\t\t}\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t>\n\t\t\t\t\t<SidebarComplementaryAreaFills />\n\t\t\t\t\t{ isEditMode && <StartTemplateOptions /> }\n\t\t\t\t\t<InterfaceSkeleton\n\t\t\t\t\t\tisDistractionFree={ isDistractionFree }\n\t\t\t\t\t\tenableRegionNavigation={ false }\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'edit-site-editor__interface-skeleton',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t\t\t\t\t'is-entity-save-view-open':\n\t\t\t\t\t\t\t\t\t!! entitiesSavedStatesCallback,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\theader={\n\t\t\t\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t\t\t\t{ canvasMode === 'edit' && (\n\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tinitial={ {\n\t\t\t\t\t\t\t\t\t\t\tmarginTop: -60,\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\t\t\t\tmarginTop: 0,\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\t\t\t\tmarginTop: -60,\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\t// Disable transition in mobile to emulate a full page transition.\n\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion ||\n\t\t\t\t\t\t\t\t\t\t\t\t! isLargeViewport\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\t\tease: [ 0.6, 0, 0.4, 1 ],\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Header\n\t\t\t\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tactions={\n\t\t\t\t\t\t\t<SavePublishPanels\n\t\t\t\t\t\t\t\tcloseEntitiesSavedStates={\n\t\t\t\t\t\t\t\t\tcloseEntitiesSavedStates\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\t\t\tcontent={\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<GlobalStylesRenderer />\n\t\t\t\t\t\t\t\t{ isEditMode && <EditorNotices /> }\n\t\t\t\t\t\t\t\t{ showVisualEditor && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<TemplatePartConverter />\n\t\t\t\t\t\t\t\t\t\t<SidebarInspectorFill>\n\t\t\t\t\t\t\t\t\t\t\t<BlockInspector />\n\t\t\t\t\t\t\t\t\t\t</SidebarInspectorFill>\n\t\t\t\t\t\t\t\t\t\t{ ! isLargeViewport && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t<SiteEditorCanvas onClick={ onClick } />\n\t\t\t\t\t\t\t\t\t\t<PatternModal />\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ editorMode === 'text' && isEditMode && (\n\t\t\t\t\t\t\t\t\t<CodeEditor />\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ isEditMode && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t\t<BlockKeyboardShortcuts />\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</>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsecondarySidebar={\n\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t( ( shouldShowInserter && (\n\t\t\t\t\t\t\t\t<InserterSidebar\n\t\t\t\t\t\t\t\t\tcloseGeneralSidebar={ closeGeneralSidebar }\n\t\t\t\t\t\t\t\t\tisRightSidebarOpen={ isRightSidebarOpen }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) ||\n\t\t\t\t\t\t\t\t( shouldShowListView && <ListViewSidebar /> ) )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsidebar={\n\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t! isDistractionFree && (\n\t\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core\" />\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfooter={\n\t\t\t\t\t\t\tshouldShowBlockBreadcrumbs && (\n\t\t\t\t\t\t\t\t<BlockBreadcrumb\n\t\t\t\t\t\t\t\t\trootLabelText={ postTypeLabel }\n\t\t\t\t\t\t\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AE,CAAC,EACzB2E,aAAA,CAAC1F,oBAAoB,QACpB0F,aAAA,CAACzG,cAAc,MAAE,CACI,CAAC,EACrB,CAAE0D,eAAe,IAClB+C,aAAA,CAAC3G,YAAY;MAACgI,cAAc;IAAA,CAAE,CAC9B,EACDrB,aAAA,CAAC5E,gBAAgB;MAACqB,OAAO,EAAGA;IAAS,CAAE,CAAC,EACxCuD,aAAA,CAAC/E,YAAY,MAAE,CACd,CACF,EACCoC,UAAU,KAAK,MAAM,IAAI0B,UAAU,IACpCiB,aAAA,CAACzF,UAAU,MAAE,CACb,EACCwE,UAAU,IACXiB,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACxG,+BAA+B,MAAE,CAAC,EACnCwG,aAAA,CAACvG,uBAAuB,MAAE,CAAC,EAC3BuG,aAAA,CAACjE,sBAAsB,MAAE,CACxB,CAEF,CACF;IACDuF,gBAAgB,EACfvC,UAAU,KACNG,kBAAkB,IACrBc,aAAA,CAACvE,eAAe;MACfgE,mBAAmB,EAAGA,mBAAqB;MAC3CjC,kBAAkB,EAAGA;IAAoB,CACzC,CACD,IACE2B,kBAAkB,IAAIa,aAAA,CAACtE,eAAe,MAAE,CAAG,CAC9C;IACDQ,OAAO,EACN6C,UAAU,IACV,CAAEpB,iBAAiB,IAClBqC,aAAA,CAACpE,iBAAiB,CAAC2F,IAAI;MAACC,KAAK,EAAC;IAAM,CAAE,CAEvC;IACDpF,MAAM,EACL6C,0BAA0B,IACzBe,aAAA,CAAC5G,eAAe;MACfqI,aAAa,EAAG3D;IAAe,CAC/B,CAEF;IACD4D,MAAM,EAAG;MACR,GAAG1F,eAAe;MAClBsF,gBAAgB,EAAElC;IACnB;EAAG,CACH,CACc,CAEhB,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useDispatch","useSelect","Notice","__unstableAnimatePresence","AnimatePresence","__unstableMotion","motion","useInstanceId","useViewportMatch","useReducedMotion","store","preferencesStore","BlockBreadcrumb","BlockToolbar","blockEditorStore","EditorKeyboardShortcutsRegister","EditorKeyboardShortcuts","EditorNotices","EditorSnackbars","privateApis","editorPrivateApis","editorStore","__","sprintf","coreDataStore","blockLibraryPrivateApis","useState","useCallback","noticesStore","routerPrivateApis","CodeEditor","Header","WelcomeGuide","editSiteStore","GlobalStylesRenderer","useTitle","CanvasLoader","unlock","useEditedEntityRecord","PatternModal","POST_TYPE_LABELS","TEMPLATE_POST_TYPE","SiteEditorCanvas","TemplatePartConverter","useSpecificEditorSettings","PluginTemplateSettingPanel","GlobalStylesSidebar","ExperimentalEditorProvider","EditorProvider","InserterSidebar","ListViewSidebar","InterfaceSkeleton","ComplementaryArea","interfaceStore","SavePublishPanels","Sidebar","useHistory","BlockKeyboardShortcuts","interfaceLabels","body","sidebar","actions","footer","header","ANIMATION_DURATION","Editor","isLoading","onClick","record","editedPost","getTitle","isLoaded","hasLoadedPost","type","editedPostType","isLargeViewport","disableMotion","context","contextPost","editorMode","canvasMode","blockEditorMode","isRightSidebarOpen","isInserterOpen","isListViewOpen","isDistractionFree","showIconLabels","showBlockBreadcrumbs","postTypeLabel","isEditingPage","supportsGlobalStyles","select","get","getEditedPostContext","getCanvasMode","isPage","__unstableGetEditorMode","getActiveComplementaryArea","getEntityRecord","getCurrentTheme","isInserterOpened","isListViewOpened","getPostTypeLabel","getEditorMode","_context","postId","postType","undefined","is_block_theme","isViewMode","isEditMode","showVisualEditor","shouldShowBlockBreadcrumbs","shouldShowInserter","shouldShowListView","secondarySidebarLabel","postWithTemplate","title","_POST_TYPE_LABELS$edi","loadingProgressId","closeGeneralSidebar","settings","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","createSuccessNotice","history","onActionPerformed","actionId","items","push","path","canvas","newItem","_title","rendered","id","label","isReady","createElement","Fragment","status","isDismissible","post","__unstableTemplate","useSubRegistry","enableRegionNavigation","className","initial","div","marginTop","animate","exit","transition","duration","ease","isEntitiesSavedStatesOpen","notices","content","hideDragHandle","secondarySidebar","Slot","scope","rootLabelText","labels","extraPanels"],"sources":["@wordpress/edit-site/src/components/editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tNotice,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport {\n\tuseInstanceId,\n\tuseViewportMatch,\n\tuseReducedMotion,\n} from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tBlockBreadcrumb,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tEditorKeyboardShortcutsRegister,\n\tEditorKeyboardShortcuts,\n\tEditorNotices,\n\tEditorSnackbars,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { useState, useCallback } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport CodeEditor from '../code-editor';\nimport Header from '../header-edit-mode';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport useTitle from '../routes/use-title';\nimport CanvasLoader from '../canvas-loader';\nimport { unlock } from '../../lock-unlock';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport PatternModal from '../pattern-modal';\nimport { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport SiteEditorCanvas from '../block-editor/site-editor-canvas';\nimport TemplatePartConverter from '../template-part-converter';\nimport { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';\nimport PluginTemplateSettingPanel from '../plugin-template-setting-panel';\nimport GlobalStylesSidebar from '../global-styles-sidebar';\n\nconst {\n\tExperimentalEditorProvider: EditorProvider,\n\tInserterSidebar,\n\tListViewSidebar,\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tinterfaceStore,\n\tSavePublishPanels,\n\tSidebar,\n} = unlock( editorPrivateApis );\nconst { useHistory } = unlock( routerPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n\t/* translators: accessibility text for the editor header landmark region. */\n\theader: __( 'Editor top bar' ),\n};\n\nconst ANIMATION_DURATION = 0.25;\n\nexport default function Editor( { isLoading, onClick } ) {\n\tconst {\n\t\trecord: editedPost,\n\t\tgetTitle,\n\t\tisLoaded: hasLoadedPost,\n\t} = useEditedEntityRecord();\n\n\tconst { type: editedPostType } = editedPost;\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst disableMotion = useReducedMotion();\n\n\tconst {\n\t\tcontext,\n\t\tcontextPost,\n\t\teditorMode,\n\t\tcanvasMode,\n\t\tblockEditorMode,\n\t\tisRightSidebarOpen,\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tisDistractionFree,\n\t\tshowIconLabels,\n\t\tshowBlockBreadcrumbs,\n\t\tpostTypeLabel,\n\t\tisEditingPage,\n\t\tsupportsGlobalStyles,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditedPostContext, getCanvasMode, isPage } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst { getEntityRecord, getCurrentTheme } = select( coreDataStore );\n\t\tconst {\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t\tgetPostTypeLabel,\n\t\t\tgetEditorMode,\n\t\t} = select( editorStore );\n\t\tconst _context = getEditedPostContext();\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tcontext: _context,\n\t\t\tcontextPost: _context?.postId\n\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t_context.postType,\n\t\t\t\t\t\t_context.postId\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t\teditorMode: getEditorMode(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisRightSidebarOpen: getActiveComplementaryArea( 'core' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tpostTypeLabel: getPostTypeLabel(),\n\t\t\tisEditingPage: isPage(),\n\t\t\tsupportsGlobalStyles: getCurrentTheme()?.is_block_theme,\n\t\t};\n\t}, [] );\n\n\tconst isViewMode = canvasMode === 'view';\n\tconst isEditMode = canvasMode === 'edit';\n\tconst showVisualEditor = isViewMode || editorMode === 'visual';\n\tconst shouldShowBlockBreadcrumbs =\n\t\t! isDistractionFree &&\n\t\tshowBlockBreadcrumbs &&\n\t\tisEditMode &&\n\t\tshowVisualEditor &&\n\t\tblockEditorMode !== 'zoom-out';\n\tconst shouldShowInserter = isEditMode && showVisualEditor && isInserterOpen;\n\tconst shouldShowListView = isEditMode && showVisualEditor && isListViewOpen;\n\tconst secondarySidebarLabel = isListViewOpen\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\tconst postWithTemplate = !! context?.postId;\n\n\tlet title;\n\tif ( hasLoadedPost ) {\n\t\ttitle = sprintf(\n\t\t\t// translators: A breadcrumb trail for the Admin document title. %1$s: title of template being edited, %2$s: type of template (Template or Template Part).\n\t\t\t__( '%1$s ‹ %2$s' ),\n\t\t\tgetTitle(),\n\t\t\tPOST_TYPE_LABELS[ editedPostType ] ??\n\t\t\t\tPOST_TYPE_LABELS[ TEMPLATE_POST_TYPE ]\n\t\t);\n\t}\n\n\t// Only announce the title once the editor is ready to prevent \"Replace\"\n\t// action in <URLQueryController> from double-announcing.\n\tuseTitle( hasLoadedPost && title );\n\n\tconst loadingProgressId = useInstanceId(\n\t\tCanvasLoader,\n\t\t'edit-site-editor__loading-progress'\n\t);\n\n\tconst { closeGeneralSidebar } = useDispatch( editSiteStore );\n\n\tconst settings = useSpecificEditorSettings();\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst history = useHistory();\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\t\t{\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/' + items[ 0 ].type,\n\t\t\t\t\t\t\tpostId: undefined,\n\t\t\t\t\t\t\tpostType: undefined,\n\t\t\t\t\t\t\tcanvas: 'view',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst _title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post e.g: \"Post 1\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\t_title\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\t\t\t\t\tpath: undefined,\n\t\t\t\t\t\t\t\t\t\t\t\tpostId: newItem.id,\n\t\t\t\t\t\t\t\t\t\t\t\tpostType: newItem.type,\n\t\t\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ history, createSuccessNotice ]\n\t);\n\n\tconst isReady =\n\t\t! isLoading &&\n\t\t( ( postWithTemplate && !! contextPost && !! editedPost ) ||\n\t\t\t( ! postWithTemplate && !! editedPost ) );\n\n\treturn (\n\t\t<>\n\t\t\t{ ! isReady ? <CanvasLoader id={ loadingProgressId } /> : null }\n\t\t\t{ isEditMode && <WelcomeGuide /> }\n\t\t\t{ hasLoadedPost && ! editedPost && (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t\"You attempted to edit an item that doesn't exist. Perhaps it was deleted?\"\n\t\t\t\t\t) }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t\t{ isReady && (\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ postWithTemplate ? contextPost : editedPost }\n\t\t\t\t\t__unstableTemplate={\n\t\t\t\t\t\tpostWithTemplate ? editedPost : undefined\n\t\t\t\t\t}\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t>\n\t\t\t\t\t<InterfaceSkeleton\n\t\t\t\t\t\tisDistractionFree={ isDistractionFree }\n\t\t\t\t\t\tenableRegionNavigation={ false }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'edit-site-editor__interface-skeleton',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t\t\t\t\t'is-entity-save-view-open':\n\t\t\t\t\t\t\t\t\t!! entitiesSavedStatesCallback,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\theader={\n\t\t\t\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t\t\t\t{ canvasMode === 'edit' && (\n\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tinitial={ {\n\t\t\t\t\t\t\t\t\t\t\tmarginTop: -60,\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\t\t\t\tmarginTop: 0,\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\t\t\t\tmarginTop: -60,\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\t// Disable transition in mobile to emulate a full page transition.\n\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion ||\n\t\t\t\t\t\t\t\t\t\t\t\t! isLargeViewport\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\t\tease: [ 0.6, 0, 0.4, 1 ],\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Header\n\t\t\t\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tactions={\n\t\t\t\t\t\t\t<SavePublishPanels\n\t\t\t\t\t\t\t\tcloseEntitiesSavedStates={\n\t\t\t\t\t\t\t\t\tcloseEntitiesSavedStates\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\t\t\tcontent={\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<GlobalStylesRenderer />\n\t\t\t\t\t\t\t\t{ isEditMode && <EditorNotices /> }\n\t\t\t\t\t\t\t\t{ showVisualEditor && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<TemplatePartConverter />\n\t\t\t\t\t\t\t\t\t\t{ ! isLargeViewport && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t<SiteEditorCanvas onClick={ onClick } />\n\t\t\t\t\t\t\t\t\t\t<PatternModal />\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ editorMode === 'text' && isEditMode && (\n\t\t\t\t\t\t\t\t\t<CodeEditor />\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ isEditMode && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t\t<BlockKeyboardShortcuts />\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</>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsecondarySidebar={\n\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t( ( shouldShowInserter && (\n\t\t\t\t\t\t\t\t<InserterSidebar\n\t\t\t\t\t\t\t\t\tcloseGeneralSidebar={ closeGeneralSidebar }\n\t\t\t\t\t\t\t\t\tisRightSidebarOpen={ isRightSidebarOpen }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) ||\n\t\t\t\t\t\t\t\t( shouldShowListView && <ListViewSidebar /> ) )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsidebar={\n\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t! isDistractionFree && (\n\t\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core\" />\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfooter={\n\t\t\t\t\t\t\tshouldShowBlockBreadcrumbs && (\n\t\t\t\t\t\t\t\t<BlockBreadcrumb\n\t\t\t\t\t\t\t\t\trootLabelText={ postTypeLabel }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlabels={ {\n\t\t\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t<Sidebar\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\textraPanels={\n\t\t\t\t\t\t\t! isEditingPage && (\n\t\t\t\t\t\t\t\t<PluginTemplateSettingPanel.Slot />\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t{ supportsGlobalStyles && <GlobalStylesSidebar /> }\n\t\t\t\t</EditorProvider>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,MAAM,EACNC,yBAAyB,IAAIC,eAAe,EAC5CC,gBAAgB,IAAIC,MAAM,QACpB,uBAAuB;AAC9B,SACCC,aAAa,EACbC,gBAAgB,EAChBC,gBAAgB,QACV,oBAAoB;AAC3B,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,eAAe,EACfC,YAAY,EACZH,KAAK,IAAII,gBAAgB,QACnB,yBAAyB;AAChC,SACCC,+BAA+B,EAC/BC,uBAAuB,EACvBC,aAAa,EACbC,eAAe,EACfC,WAAW,IAAIC,iBAAiB,EAChCV,KAAK,IAAIW,WAAW,QACd,mBAAmB;AAC1B,SAASC,EAAE,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AAoB,CACzC,CACD,IACEgC,kBAAkB,IAAI0B,aAAA,CAAC1F,eAAe,MAAE,CAAG,CAC9C;IACDU,OAAO,EACNkD,UAAU,IACV,CAAEzB,iBAAiB,IAClBuD,aAAA,CAACxF,iBAAiB,CAAC8G,IAAI;MAACC,KAAK,EAAC;IAAM,CAAE,CAEvC;IACDrG,MAAM,EACLkD,0BAA0B,IACzB4B,aAAA,CAAChI,eAAe;MACfwJ,aAAa,EAAG5E;IAAe,CAC/B,CAEF;IACD6E,MAAM,EAAG;MACR,GAAG3G,eAAe;MAClBuG,gBAAgB,EAAE9C;IACnB;EAAG,CACH,CAAC,EACFyB,aAAA,CAACrF,OAAO;IACPyE,iBAAiB,EAAGA,iBAAmB;IACvCsC,WAAW,EACV,CAAE7E,aAAa,IACdmD,aAAA,CAAC/F,0BAA0B,CAACqH,IAAI,MAAE;EAEnC,CACD,CAAC,EACAxE,oBAAoB,IAAIkD,aAAA,CAAC9F,mBAAmB,MAAE,CACjC,CAEhB,CAAC;AAEL","ignoreList":[]}
@@ -19,6 +19,17 @@ const {
19
19
  useGlobalSetting,
20
20
  BackgroundPanel: StylesBackgroundPanel
21
21
  } = unlock(blockEditorPrivateApis);
22
+
23
+ /**
24
+ * Checks if there is a current value in the background image block support
25
+ * attributes.
26
+ *
27
+ * @param {Object} style Style attribute.
28
+ * @return {boolean} Whether the block has a background image value set.
29
+ */
30
+ export function hasBackgroundImageValue(style) {
31
+ return !!style?.background?.backgroundImage?.id || !!style?.background?.backgroundImage?.url || typeof style?.background?.backgroundImage === 'string';
32
+ }
22
33
  export default function BackgroundPanel() {
23
34
  const [style] = useGlobalStyle('', undefined, 'user', {
24
35
  shouldDecodeEncode: false
@@ -29,7 +40,7 @@ export default function BackgroundPanel() {
29
40
  const [settings] = useGlobalSetting('');
30
41
  const defaultControls = {
31
42
  backgroundImage: true,
32
- backgroundSize: !!style?.background?.backgroundImage && !!inheritedStyle?.background?.backgroundImage
43
+ backgroundSize: hasBackgroundImageValue(style) || hasBackgroundImageValue(inheritedStyle)
33
44
  };
34
45
  return createElement(StylesBackgroundPanel, {
35
46
  inheritedValue: inheritedStyle,
@@ -1 +1 @@
1
- {"version":3,"names":["privateApis","blockEditorPrivateApis","__","unlock","BACKGROUND_DEFAULT_VALUES","backgroundSize","useGlobalStyle","useGlobalSetting","BackgroundPanel","StylesBackgroundPanel","style","undefined","shouldDecodeEncode","inheritedStyle","setStyle","settings","defaultControls","backgroundImage","background","createElement","inheritedValue","value","onChange","headerLabel","defaultValues"],"sources":["@wordpress/edit-site/src/components/global-styles/background-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\n// Initial control values where no block style is set.\nconst BACKGROUND_DEFAULT_VALUES = {\n\tbackgroundSize: 'auto',\n};\n\nconst {\n\tuseGlobalStyle,\n\tuseGlobalSetting,\n\tBackgroundPanel: StylesBackgroundPanel,\n} = unlock( blockEditorPrivateApis );\n\nexport default function BackgroundPanel() {\n\tconst [ style ] = useGlobalStyle( '', undefined, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle( '', undefined, 'all', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ settings ] = useGlobalSetting( '' );\n\n\tconst defaultControls = {\n\t\tbackgroundImage: true,\n\t\tbackgroundSize:\n\t\t\t!! style?.background?.backgroundImage &&\n\t\t\t!! inheritedStyle?.background?.backgroundImage,\n\t};\n\n\treturn (\n\t\t<StylesBackgroundPanel\n\t\t\tinheritedValue={ inheritedStyle }\n\t\t\tvalue={ style }\n\t\t\tonChange={ setStyle }\n\t\t\tsettings={ settings }\n\t\t\theaderLabel={ __( 'Image' ) }\n\t\t\tdefaultValues={ BACKGROUND_DEFAULT_VALUES }\n\t\t\tdefaultControls={ defaultControls }\n\t\t/>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T_VALUES","backgroundSize","useGlobalStyle","useGlobalSetting","BackgroundPanel","StylesBackgroundPanel","hasBackgroundImageValue","style","background","backgroundImage","id","url","undefined","shouldDecodeEncode","inheritedStyle","setStyle","settings","defaultControls","createElement","inheritedValue","value","onChange","headerLabel","defaultValues"],"sources":["@wordpress/edit-site/src/components/global-styles/background-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\n// Initial control values where no block style is set.\nconst BACKGROUND_DEFAULT_VALUES = {\n\tbackgroundSize: 'auto',\n};\n\nconst {\n\tuseGlobalStyle,\n\tuseGlobalSetting,\n\tBackgroundPanel: StylesBackgroundPanel,\n} = unlock( blockEditorPrivateApis );\n\n/**\n * Checks if there is a current value in the background image block support\n * attributes.\n *\n * @param {Object} style Style attribute.\n * @return {boolean} Whether the block has a background image value set.\n */\nexport function hasBackgroundImageValue( style ) {\n\treturn (\n\t\t!! style?.background?.backgroundImage?.id ||\n\t\t!! style?.background?.backgroundImage?.url ||\n\t\ttypeof style?.background?.backgroundImage === 'string'\n\t);\n}\n\nexport default function BackgroundPanel() {\n\tconst [ style ] = useGlobalStyle( '', undefined, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle( '', undefined, 'all', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ settings ] = useGlobalSetting( '' );\n\n\tconst defaultControls = {\n\t\tbackgroundImage: true,\n\t\tbackgroundSize:\n\t\t\thasBackgroundImageValue( style ) ||\n\t\t\thasBackgroundImageValue( inheritedStyle ),\n\t};\n\n\treturn (\n\t\t<StylesBackgroundPanel\n\t\t\tinheritedValue={ inheritedStyle }\n\t\t\tvalue={ style }\n\t\t\tonChange={ setStyle }\n\t\t\tsettings={ settings }\n\t\t\theaderLabel={ __( 'Image' ) }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AAA,CAACb,qBAAqB;IACrBc,cAAc,EAAGL,cAAgB;IACjCM,KAAK,EAAGb,KAAO;IACfc,QAAQ,EAAGN,QAAU;IACrBC,QAAQ,EAAGA,QAAU;IACrBM,WAAW,EAAGxB,EAAE,CAAE,OAAQ,CAAG;IAC7ByB,aAAa,EAAGvB,yBAA2B;IAC3CiB,eAAe,EAAGA;EAAiB,CACnC,CAAC;AAEJ","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -13,7 +13,7 @@ function ColorIndicatorWrapper({
13
13
  ...props
14
14
  }) {
15
15
  return createElement(Flex, {
16
- className: classnames('edit-site-global-styles__color-indicator-wrapper', className),
16
+ className: clsx('edit-site-global-styles__color-indicator-wrapper', className),
17
17
  ...props
18
18
  });
19
19
  }
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","Flex","ColorIndicatorWrapper","className","props","createElement"],"sources":["@wordpress/edit-site/src/components/global-styles/color-indicator-wrapper.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Flex } from '@wordpress/components';\n\nfunction ColorIndicatorWrapper( { className, ...props } ) {\n\treturn (\n\t\t<Flex\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-global-styles__color-indicator-wrapper',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default ColorIndicatorWrapper;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,IAAI,QAAQ,uBAAuB;AAE5C,SAASC,qBAAqBA,CAAE;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAG;EACzD,OACCC,aAAA,CAACJ,IAAI;IACJE,SAAS,EAAGH,UAAU,CACrB,kDAAkD,EAClDG,SACD,CAAG;IAAA,GACEC;EAAK,CACV,CAAC;AAEJ;AAEA,eAAeF,qBAAqB","ignoreList":[]}
1
+ {"version":3,"names":["clsx","Flex","ColorIndicatorWrapper","className","props","createElement"],"sources":["@wordpress/edit-site/src/components/global-styles/color-indicator-wrapper.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Flex } from '@wordpress/components';\n\nfunction ColorIndicatorWrapper( { className, ...props } ) {\n\treturn (\n\t\t<Flex\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-site-global-styles__color-indicator-wrapper',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default ColorIndicatorWrapper;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,IAAI,QAAQ,uBAAuB;AAE5C,SAASC,qBAAqBA,CAAE;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAG;EACzD,OACCC,aAAA,CAACJ,IAAI;IACJE,SAAS,EAAGH,IAAI,CACf,kDAAkD,EAClDG,SACD,CAAG;IAAA,GACEC;EAAK,CACV,CAAC;AAEJ;AAEA,eAAeF,qBAAqB","ignoreList":[]}
@@ -11,6 +11,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
11
11
  * Internal dependencies
12
12
  */
13
13
  import { unlock } from '../../lock-unlock';
14
+ import ColorVariations from './variations/variations-color';
14
15
  const {
15
16
  useGlobalSetting
16
17
  } = unlock(blockEditorPrivateApis);
@@ -31,7 +32,7 @@ export default function ColorPalettePanel({
31
32
  const popoverProps = isMobileViewport ? mobilePopoverProps : undefined;
32
33
  return createElement(VStack, {
33
34
  className: "edit-site-global-styles-color-palette-panel",
34
- spacing: 10
35
+ spacing: 8
35
36
  }, !!themeColors && !!themeColors.length && createElement(PaletteEdit, {
36
37
  canReset: themeColors !== baseThemeColors,
37
38
  canOnlyChangeValues: true,
@@ -53,9 +54,10 @@ export default function ColorPalettePanel({
53
54
  onChange: setCustomColors,
54
55
  paletteLabel: __('Custom'),
55
56
  paletteLabelHeadingLevel: 3,
56
- emptyMessage: __('Custom colors are empty! Add some colors to create your own color palette.'),
57
57
  slugPrefix: "custom-",
58
58
  popoverProps: popoverProps
59
+ }), createElement(ColorVariations, {
60
+ title: __('Presets')
59
61
  }));
60
62
  }
61
63
  //# sourceMappingURL=color-palette-panel.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useViewportMatch","__experimentalPaletteEdit","PaletteEdit","__experimentalVStack","VStack","__","privateApis","blockEditorPrivateApis","unlock","useGlobalSetting","mobilePopoverProps","placement","offset","ColorPalettePanel","name","themeColors","setThemeColors","baseThemeColors","defaultColors","setDefaultColors","baseDefaultColors","customColors","setCustomColors","defaultPaletteEnabled","isMobileViewport","popoverProps","undefined","createElement","className","spacing","length","canReset","canOnlyChangeValues","colors","onChange","paletteLabel","paletteLabelHeadingLevel","emptyMessage","slugPrefix"],"sources":["@wordpress/edit-site/src/components/global-styles/color-palette-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\t__experimentalPaletteEdit as PaletteEdit,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\nconst mobilePopoverProps = { placement: 'bottom-start', offset: 8 };\n\nexport default function ColorPalettePanel( { name } ) {\n\tconst [ themeColors, setThemeColors ] = useGlobalSetting(\n\t\t'color.palette.theme',\n\t\tname\n\t);\n\tconst [ baseThemeColors ] = useGlobalSetting(\n\t\t'color.palette.theme',\n\t\tname,\n\t\t'base'\n\t);\n\tconst [ defaultColors, setDefaultColors ] = useGlobalSetting(\n\t\t'color.palette.default',\n\t\tname\n\t);\n\tconst [ baseDefaultColors ] = useGlobalSetting(\n\t\t'color.palette.default',\n\t\tname,\n\t\t'base'\n\t);\n\tconst [ customColors, setCustomColors ] = useGlobalSetting(\n\t\t'color.palette.custom',\n\t\tname\n\t);\n\n\tconst [ defaultPaletteEnabled ] = useGlobalSetting(\n\t\t'color.defaultPalette',\n\t\tname\n\t);\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst popoverProps = isMobileViewport ? mobilePopoverProps : undefined;\n\n\treturn (\n\t\t<VStack\n\t\t\tclassName=\"edit-site-global-styles-color-palette-panel\"\n\t\t\tspacing={ 10 }\n\t\t>\n\t\t\t{ !! themeColors && !! themeColors.length && (\n\t\t\t\t<PaletteEdit\n\t\t\t\t\tcanReset={ themeColors !== baseThemeColors }\n\t\t\t\t\tcanOnlyChangeValues\n\t\t\t\t\tcolors={ themeColors }\n\t\t\t\t\tonChange={ setThemeColors }\n\t\t\t\t\tpaletteLabel={ __( 'Theme' ) }\n\t\t\t\t\tpaletteLabelHeadingLevel={ 3 }\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ !! defaultColors &&\n\t\t\t\t!! defaultColors.length &&\n\t\t\t\t!! defaultPaletteEnabled && (\n\t\t\t\t\t<PaletteEdit\n\t\t\t\t\t\tcanReset={ defaultColors !== baseDefaultColors }\n\t\t\t\t\t\tcanOnlyChangeValues\n\t\t\t\t\t\tcolors={ defaultColors }\n\t\t\t\t\t\tonChange={ setDefaultColors }\n\t\t\t\t\t\tpaletteLabel={ __( 'Default' ) }\n\t\t\t\t\t\tpaletteLabelHeadingLevel={ 3 }\n\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t<PaletteEdit\n\t\t\t\tcolors={ customColors }\n\t\t\t\tonChange={ setCustomColors }\n\t\t\t\tpaletteLabel={ __( 'Custom' ) }\n\t\t\t\tpaletteLabelHeadingLevel={ 3 }\n\t\t\t\temptyMessage={ __(\n\t\t\t\t\t'Custom colors are empty! Add some colors to create your own color palette.'\n\t\t\t\t) }\n\t\t\t\tslugPrefix=\"custom-\"\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t/>\n\t\t</VStack>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SACCC,yBAAyB,IAAIC,WAAW,EACxCC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAiB,CAAC,GAAGD,MAAM,CAAED,sBAAuB,CAAC;AAC7D,MAAMG,kBAAkB,GAAG;EAAEC,SAAS,EAAE,cAAc;EAAEC,MAAM,EAAE;AAAE,CAAC;AAEnE,eAAe,SAASC,iBAAiBA,CAAE;EAAEC;AAAK,CAAC,EAAG;EACrD,MAAM,CAAEC,WAAW,EAAEC,cAAc,CAAE,GAAGP,gBAAgB,CACvD,qBAAqB,EACrBK,IACD,CAAC;EACD,MAAM,CAAEG,eAAe,CAAE,GAAGR,gBAAgB,CAC3C,qBAAqB,EACrBK,IAAI,EACJ,MACD,CAAC;EACD,MAAM,CAAEI,aAAa,EAAEC,gBAAgB,CAAE,GAAGV,gBAAgB,CAC3D,uBAAuB,EACvBK,IACD,CAAC;EACD,MAAM,CAAEM,iBAAiB,CAAE,GAAGX,gBAAgB,CAC7C,uBAAuB,EACvBK,IAAI,EACJ,MACD,CAAC;EACD,MAAM,CAAEO,YAAY,EAAEC,eAAe,CAAE,GAAGb,gBAAgB,CACzD,sBAAsB,EACtBK,IACD,CAAC;EAED,MAAM,CAAES,qBAAqB,CAAE,GAAGd,gBAAgB,CACjD,sBA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["useViewportMatch","__experimentalPaletteEdit","PaletteEdit","__experimentalVStack","VStack","__","privateApis","blockEditorPrivateApis","unlock","ColorVariations","useGlobalSetting","mobilePopoverProps","placement","offset","ColorPalettePanel","name","themeColors","setThemeColors","baseThemeColors","defaultColors","setDefaultColors","baseDefaultColors","customColors","setCustomColors","defaultPaletteEnabled","isMobileViewport","popoverProps","undefined","createElement","className","spacing","length","canReset","canOnlyChangeValues","colors","onChange","paletteLabel","paletteLabelHeadingLevel","slugPrefix","title"],"sources":["@wordpress/edit-site/src/components/global-styles/color-palette-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\t__experimentalPaletteEdit as PaletteEdit,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport ColorVariations from './variations/variations-color';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\nconst mobilePopoverProps = { placement: 'bottom-start', offset: 8 };\n\nexport default function ColorPalettePanel( { name } ) {\n\tconst [ themeColors, setThemeColors ] = useGlobalSetting(\n\t\t'color.palette.theme',\n\t\tname\n\t);\n\tconst [ baseThemeColors ] = useGlobalSetting(\n\t\t'color.palette.theme',\n\t\tname,\n\t\t'base'\n\t);\n\tconst [ defaultColors, setDefaultColors ] = useGlobalSetting(\n\t\t'color.palette.default',\n\t\tname\n\t);\n\tconst [ baseDefaultColors ] = useGlobalSetting(\n\t\t'color.palette.default',\n\t\tname,\n\t\t'base'\n\t);\n\tconst [ customColors, setCustomColors ] = useGlobalSetting(\n\t\t'color.palette.custom',\n\t\tname\n\t);\n\n\tconst [ defaultPaletteEnabled ] = useGlobalSetting(\n\t\t'color.defaultPalette',\n\t\tname\n\t);\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst popoverProps = isMobileViewport ? mobilePopoverProps : undefined;\n\n\treturn (\n\t\t<VStack\n\t\t\tclassName=\"edit-site-global-styles-color-palette-panel\"\n\t\t\tspacing={ 8 }\n\t\t>\n\t\t\t{ !! themeColors && !! themeColors.length && (\n\t\t\t\t<PaletteEdit\n\t\t\t\t\tcanReset={ themeColors !== baseThemeColors }\n\t\t\t\t\tcanOnlyChangeValues\n\t\t\t\t\tcolors={ themeColors }\n\t\t\t\t\tonChange={ setThemeColors }\n\t\t\t\t\tpaletteLabel={ __( 'Theme' ) }\n\t\t\t\t\tpaletteLabelHeadingLevel={ 3 }\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ !! defaultColors &&\n\t\t\t\t!! defaultColors.length &&\n\t\t\t\t!! defaultPaletteEnabled && (\n\t\t\t\t\t<PaletteEdit\n\t\t\t\t\t\tcanReset={ defaultColors !== baseDefaultColors }\n\t\t\t\t\t\tcanOnlyChangeValues\n\t\t\t\t\t\tcolors={ defaultColors }\n\t\t\t\t\t\tonChange={ setDefaultColors }\n\t\t\t\t\t\tpaletteLabel={ __( 'Default' ) }\n\t\t\t\t\t\tpaletteLabelHeadingLevel={ 3 }\n\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t<PaletteEdit\n\t\t\t\tcolors={ customColors }\n\t\t\t\tonChange={ setCustomColors }\n\t\t\t\tpaletteLabel={ __( 'Custom' ) }\n\t\t\t\tpaletteLabelHeadingLevel={ 3 }\n\t\t\t\tslugPrefix=\"custom-\"\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t/>\n\t\t\t<ColorVariations title={ __( 'Presets' ) } />\n\t\t</VStack>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SACCC,yBAAyB,IAAIC,WAAW,EACxCC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,EAAE,QAA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hB,WAAW,KAAKE,eAAiB;IAC5Ce,mBAAmB;IACnBC,MAAM,EAAGlB,WAAa;IACtBmB,QAAQ,EAAGlB,cAAgB;IAC3BmB,YAAY,EAAG/B,EAAE,CAAE,OAAQ,CAAG;IAC9BgC,wBAAwB,EAAG,CAAG;IAC9BX,YAAY,EAAGA;EAAc,CAC7B,CACD,EACC,CAAC,CAAEP,aAAa,IACjB,CAAC,CAAEA,aAAa,CAACY,MAAM,IACvB,CAAC,CAAEP,qBAAqB,IACvBI,aAAA,CAAC1B,WAAW;IACX8B,QAAQ,EAAGb,aAAa,KAAKE,iBAAmB;IAChDY,mBAAmB;IACnBC,MAAM,EAAGf,aAAe;IACxBgB,QAAQ,EAAGf,gBAAkB;IAC7BgB,YAAY,EAAG/B,EAAE,CAAE,SAAU,CAAG;IAChCgC,wBAAwB,EAAG,CAAG;IAC9BX,YAAY,EAAGA;EAAc,CAC7B,CACD,EACFE,aAAA,CAAC1B,WAAW;IACXgC,MAAM,EAAGZ,YAAc;IACvBa,QAAQ,EAAGZ,eAAiB;IAC5Ba,YAAY,EAAG/B,EAAE,CAAE,QAAS,CAAG;IAC/BgC,wBAAwB,EAAG,CAAG;IAC9BC,UAAU,EAAC,SAAS;IACpBZ,YAAY,EAAGA;EAAc,CAC7B,CAAC,EACFE,aAAA,CAACnB,eAAe;IAAC8B,KAAK,EAAGlC,EAAE,CAAE,SAAU;EAAG,CAAE,CACrC,CAAC;AAEX","ignoreList":[]}
@@ -38,7 +38,7 @@ export default function GradientPalettePanel({
38
38
  const popoverProps = isMobileViewport ? mobilePopoverProps : undefined;
39
39
  return createElement(VStack, {
40
40
  className: "edit-site-global-styles-gradient-palette-panel",
41
- spacing: 10
41
+ spacing: 8
42
42
  }, !!themeGradients && !!themeGradients.length && createElement(PaletteEdit, {
43
43
  canReset: themeGradients !== baseThemeGradients,
44
44
  canOnlyChangeValues: true,
@@ -60,7 +60,6 @@ export default function GradientPalettePanel({
60
60
  onChange: setCustomGradients,
61
61
  paletteLabel: __('Custom'),
62
62
  paletteLabelLevel: 3,
63
- emptyMessage: __('Custom gradients are empty! Add some gradients to create your own palette.'),
64
63
  slugPrefix: "custom-",
65
64
  popoverProps: popoverProps
66
65
  }), !!duotonePalette && !!duotonePalette.length && createElement("div", null, createElement(Subtitle, {
@@ -1 +1 @@
1
- {"version":3,"names":["useViewportMatch","__experimentalVStack","VStack","__experimentalPaletteEdit","PaletteEdit","__experimentalSpacer","Spacer","DuotonePicker","__","privateApis","blockEditorPrivateApis","Subtitle","unlock","useGlobalSetting","mobilePopoverProps","placement","offset","noop","GradientPalettePanel","name","themeGradients","setThemeGradients","baseThemeGradients","defaultGradients","setDefaultGradients","baseDefaultGradients","customGradients","setCustomGradients","defaultPaletteEnabled","customDuotone","defaultDuotone","themeDuotone","defaultDuotoneEnabled","duotonePalette","isMobileViewport","popoverProps","undefined","createElement","className","spacing","length","canReset","canOnlyChangeValues","gradients","onChange","paletteLabel","paletteLabelHeadingLevel","paletteLabelLevel","emptyMessage","slugPrefix","level","margin","disableCustomDuotone","disableCustomColors","clearable"],"sources":["@wordpress/edit-site/src/components/global-styles/gradients-palette-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalPaletteEdit as PaletteEdit,\n\t__experimentalSpacer as Spacer,\n\tDuotonePicker,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport Subtitle from './subtitle';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\nconst mobilePopoverProps = { placement: 'bottom-start', offset: 8 };\n\nconst noop = () => {};\n\nexport default function GradientPalettePanel( { name } ) {\n\tconst [ themeGradients, setThemeGradients ] = useGlobalSetting(\n\t\t'color.gradients.theme',\n\t\tname\n\t);\n\tconst [ baseThemeGradients ] = useGlobalSetting(\n\t\t'color.gradients.theme',\n\t\tname,\n\t\t'base'\n\t);\n\tconst [ defaultGradients, setDefaultGradients ] = useGlobalSetting(\n\t\t'color.gradients.default',\n\t\tname\n\t);\n\tconst [ baseDefaultGradients ] = useGlobalSetting(\n\t\t'color.gradients.default',\n\t\tname,\n\t\t'base'\n\t);\n\tconst [ customGradients, setCustomGradients ] = useGlobalSetting(\n\t\t'color.gradients.custom',\n\t\tname\n\t);\n\n\tconst [ defaultPaletteEnabled ] = useGlobalSetting(\n\t\t'color.defaultGradients',\n\t\tname\n\t);\n\n\tconst [ customDuotone ] = useGlobalSetting( 'color.duotone.custom' ) || [];\n\tconst [ defaultDuotone ] =\n\t\tuseGlobalSetting( 'color.duotone.default' ) || [];\n\tconst [ themeDuotone ] = useGlobalSetting( 'color.duotone.theme' ) || [];\n\tconst [ defaultDuotoneEnabled ] = useGlobalSetting(\n\t\t'color.defaultDuotone'\n\t);\n\n\tconst duotonePalette = [\n\t\t...( customDuotone || [] ),\n\t\t...( themeDuotone || [] ),\n\t\t...( defaultDuotone && defaultDuotoneEnabled ? defaultDuotone : [] ),\n\t];\n\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst popoverProps = isMobileViewport ? mobilePopoverProps : undefined;\n\n\treturn (\n\t\t<VStack\n\t\t\tclassName=\"edit-site-global-styles-gradient-palette-panel\"\n\t\t\tspacing={ 10 }\n\t\t>\n\t\t\t{ !! themeGradients && !! themeGradients.length && (\n\t\t\t\t<PaletteEdit\n\t\t\t\t\tcanReset={ themeGradients !== baseThemeGradients }\n\t\t\t\t\tcanOnlyChangeValues\n\t\t\t\t\tgradients={ themeGradients }\n\t\t\t\t\tonChange={ setThemeGradients }\n\t\t\t\t\tpaletteLabel={ __( 'Theme' ) }\n\t\t\t\t\tpaletteLabelHeadingLevel={ 3 }\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ !! defaultGradients &&\n\t\t\t\t!! defaultGradients.length &&\n\t\t\t\t!! defaultPaletteEnabled && (\n\t\t\t\t\t<PaletteEdit\n\t\t\t\t\t\tcanReset={ defaultGradients !== baseDefaultGradients }\n\t\t\t\t\t\tcanOnlyChangeValues\n\t\t\t\t\t\tgradients={ defaultGradients }\n\t\t\t\t\t\tonChange={ setDefaultGradients }\n\t\t\t\t\t\tpaletteLabel={ __( 'Default' ) }\n\t\t\t\t\t\tpaletteLabelLevel={ 3 }\n\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t<PaletteEdit\n\t\t\t\tgradients={ customGradients }\n\t\t\t\tonChange={ setCustomGradients }\n\t\t\t\tpaletteLabel={ __( 'Custom' ) }\n\t\t\t\tpaletteLabelLevel={ 3 }\n\t\t\t\temptyMessage={ __(\n\t\t\t\t\t'Custom gradients are empty! Add some gradients to create your own palette.'\n\t\t\t\t) }\n\t\t\t\tslugPrefix=\"custom-\"\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t/>\n\t\t\t{ !! duotonePalette && !! duotonePalette.length && (\n\t\t\t\t<div>\n\t\t\t\t\t<Subtitle level={ 3 }>{ __( 'Duotone' ) }</Subtitle>\n\t\t\t\t\t<Spacer margin={ 3 } />\n\t\t\t\t\t<DuotonePicker\n\t\t\t\t\t\tduotonePalette={ duotonePalette }\n\t\t\t\t\t\tdisableCustomDuotone\n\t\t\t\t\t\tdisableCustomColors\n\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\tonChange={ noop }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,yBAAyB,IAAIC,WAAW,EACxCC,oBAAoB,IAAIC,MAAM,EAC9BC,aAAa,QACP,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;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YAAY,EAAGrC,EAAE,CAAE,QAAS,CAAG;IAC/BuC,iBAAiB,EAAG,CAAG;IACvBC,YAAY,EAAGxC,EAAE,CAChB,4EACD,CAAG;IACHyC,UAAU,EAAC,SAAS;IACpBd,YAAY,EAAGA;EAAc,CAC7B,CAAC,EACA,CAAC,CAAEF,cAAc,IAAI,CAAC,CAAEA,cAAc,CAACO,MAAM,IAC9CH,aAAA,cACCA,aAAA,CAAC1B,QAAQ;IAACuC,KAAK,EAAG;EAAG,GAAG1C,EAAE,CAAE,SAAU,CAAa,CAAC,EACpD6B,aAAA,CAAC/B,MAAM;IAAC6C,MAAM,EAAG;EAAG,CAAE,CAAC,EACvBd,aAAA,CAAC9B,aAAa;IACb0B,cAAc,EAAGA,cAAgB;IACjCmB,oBAAoB;IACpBC,mBAAmB;IACnBC,SAAS,EAAG,KAAO;IACnBV,QAAQ,EAAG3B;EAAM,CACjB,CACG,CAEC,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["useViewportMatch","__experimentalVStack","VStack","__experimentalPaletteEdit","PaletteEdit","__experimentalSpacer","Spacer","DuotonePicker","__","privateApis","blockEditorPrivateApis","Subtitle","unlock","useGlobalSetting","mobilePopoverProps","placement","offset","noop","GradientPalettePanel","name","themeGradients","setThemeGradients","baseThemeGradients","defaultGradients","setDefaultGradients","baseDefaultGradients","customGradients","setCustomGradients","defaultPaletteEnabled","customDuotone","defaultDuotone","themeDuotone","defaultDuotoneEnabled","duotonePalette","isMobileViewport","popoverProps","undefined","createElement","className","spacing","length","canReset","canOnlyChangeValues","gradients","onChange","paletteLabel","paletteLabelHeadingLevel","paletteLabelLevel","slugPrefix","level","margin","disableCustomDuotone","disableCustomColors","clearable"],"sources":["@wordpress/edit-site/src/components/global-styles/gradients-palette-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalPaletteEdit as PaletteEdit,\n\t__experimentalSpacer as Spacer,\n\tDuotonePicker,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport Subtitle from './subtitle';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\nconst mobilePopoverProps = { placement: 'bottom-start', offset: 8 };\n\nconst noop = () => {};\n\nexport default function GradientPalettePanel( { name } ) {\n\tconst [ themeGradients, setThemeGradients ] = useGlobalSetting(\n\t\t'color.gradients.theme',\n\t\tname\n\t);\n\tconst [ baseThemeGradients ] = useGlobalSetting(\n\t\t'color.gradients.theme',\n\t\tname,\n\t\t'base'\n\t);\n\tconst [ defaultGradients, setDefaultGradients ] = useGlobalSetting(\n\t\t'color.gradients.default',\n\t\tname\n\t);\n\tconst [ baseDefaultGradients ] = useGlobalSetting(\n\t\t'color.gradients.default',\n\t\tname,\n\t\t'base'\n\t);\n\tconst [ customGradients, setCustomGradients ] = useGlobalSetting(\n\t\t'color.gradients.custom',\n\t\tname\n\t);\n\n\tconst [ defaultPaletteEnabled ] = useGlobalSetting(\n\t\t'color.defaultGradients',\n\t\tname\n\t);\n\n\tconst [ customDuotone ] = useGlobalSetting( 'color.duotone.custom' ) || [];\n\tconst [ defaultDuotone ] =\n\t\tuseGlobalSetting( 'color.duotone.default' ) || [];\n\tconst [ themeDuotone ] = useGlobalSetting( 'color.duotone.theme' ) || [];\n\tconst [ defaultDuotoneEnabled ] = useGlobalSetting(\n\t\t'color.defaultDuotone'\n\t);\n\n\tconst duotonePalette = [\n\t\t...( customDuotone || [] ),\n\t\t...( themeDuotone || [] ),\n\t\t...( defaultDuotone && defaultDuotoneEnabled ? defaultDuotone : [] ),\n\t];\n\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst popoverProps = isMobileViewport ? mobilePopoverProps : undefined;\n\n\treturn (\n\t\t<VStack\n\t\t\tclassName=\"edit-site-global-styles-gradient-palette-panel\"\n\t\t\tspacing={ 8 }\n\t\t>\n\t\t\t{ !! themeGradients && !! themeGradients.length && (\n\t\t\t\t<PaletteEdit\n\t\t\t\t\tcanReset={ themeGradients !== baseThemeGradients }\n\t\t\t\t\tcanOnlyChangeValues\n\t\t\t\t\tgradients={ themeGradients }\n\t\t\t\t\tonChange={ setThemeGradients }\n\t\t\t\t\tpaletteLabel={ __( 'Theme' ) }\n\t\t\t\t\tpaletteLabelHeadingLevel={ 3 }\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ !! defaultGradients &&\n\t\t\t\t!! defaultGradients.length &&\n\t\t\t\t!! defaultPaletteEnabled && (\n\t\t\t\t\t<PaletteEdit\n\t\t\t\t\t\tcanReset={ defaultGradients !== baseDefaultGradients }\n\t\t\t\t\t\tcanOnlyChangeValues\n\t\t\t\t\t\tgradients={ defaultGradients }\n\t\t\t\t\t\tonChange={ setDefaultGradients }\n\t\t\t\t\t\tpaletteLabel={ __( 'Default' ) }\n\t\t\t\t\t\tpaletteLabelLevel={ 3 }\n\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t<PaletteEdit\n\t\t\t\tgradients={ customGradients }\n\t\t\t\tonChange={ setCustomGradients }\n\t\t\t\tpaletteLabel={ __( 'Custom' ) }\n\t\t\t\tpaletteLabelLevel={ 3 }\n\t\t\t\tslugPrefix=\"custom-\"\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t/>\n\t\t\t{ !! duotonePalette && !! duotonePalette.length && (\n\t\t\t\t<div>\n\t\t\t\t\t<Subtitle level={ 3 }>{ __( 'Duotone' ) }</Subtitle>\n\t\t\t\t\t<Spacer margin={ 3 } />\n\t\t\t\t\t<DuotonePicker\n\t\t\t\t\t\tduotonePalette={ duotonePalette }\n\t\t\t\t\t\tdisableCustomDuotone\n\t\t\t\t\t\tdisableCustomColors\n\t\t\t\t\t\tclearable={ false }\n\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AKE,oBAAsB;IACtDiB,mBAAmB;IACnBC,SAAS,EAAGpB,gBAAkB;IAC9BqB,QAAQ,EAAGpB,mBAAqB;IAChCqB,YAAY,EAAGrC,EAAE,CAAE,SAAU,CAAG;IAChCuC,iBAAiB,EAAG,CAAG;IACvBZ,YAAY,EAAGA;EAAc,CAC7B,CACD,EACFE,aAAA,CAACjC,WAAW;IACXuC,SAAS,EAAGjB,eAAiB;IAC7BkB,QAAQ,EAAGjB,kBAAoB;IAC/BkB,YAAY,EAAGrC,EAAE,CAAE,QAAS,CAAG;IAC/BuC,iBAAiB,EAAG,CAAG;IACvBC,UAAU,EAAC,SAAS;IACpBb,YAAY,EAAGA;EAAc,CAC7B,CAAC,EACA,CAAC,CAAEF,cAAc,IAAI,CAAC,CAAEA,cAAc,CAACO,MAAM,IAC9CH,aAAA,cACCA,aAAA,CAAC1B,QAAQ;IAACsC,KAAK,EAAG;EAAG,GAAGzC,EAAE,CAAE,SAAU,CAAa,CAAC,EACpD6B,aAAA,CAAC/B,MAAM;IAAC4C,MAAM,EAAG;EAAG,CAAE,CAAC,EACvBb,aAAA,CAAC9B,aAAa;IACb0B,cAAc,EAAGA,cAAgB;IACjCkB,oBAAoB;IACpBC,mBAAmB;IACnBC,SAAS,EAAG,KAAO;IACnBT,QAAQ,EAAG3B;EAAM,CACjB,CACG,CAEC,CAAC;AAEX","ignoreList":[]}
@@ -9,17 +9,20 @@ import a11yPlugin from 'colord/plugins/a11y';
9
9
  */
10
10
  import { store as blocksStore } from '@wordpress/blocks';
11
11
  import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
12
+ import { privateApis as editorPrivateApis } from '@wordpress/editor';
12
13
  import { useContext } from '@wordpress/element';
13
14
  import { __ } from '@wordpress/i18n';
14
15
 
15
16
  /**
16
17
  * Internal dependencies
17
18
  */
18
- import { mergeBaseAndUserConfigs } from './global-styles-provider';
19
19
  import { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';
20
20
  import { getFontFamilies } from './utils';
21
21
  import { unlock } from '../../lock-unlock';
22
22
  import { useSelect } from '@wordpress/data';
23
+ const {
24
+ mergeBaseAndUserConfigs
25
+ } = unlock(editorPrivateApis);
23
26
  const {
24
27
  useGlobalSetting,
25
28
  useGlobalStyle,
@@ -1 +1 @@
1
- {"version":3,"names":["colord","extend","a11yPlugin","store","blocksStore","privateApis","blockEditorPrivateApis","useContext","__","mergeBaseAndUserConfigs","useCurrentMergeThemeStyleVariationsWithUserConfig","getFontFamilies","unlock","useSelect","useGlobalSetting","useGlobalStyle","GlobalStylesContext","useColorRandomizer","name","themeColors","setThemeColors","randomizeColors","randomRotationValue","Math","floor","random","newColors","map","colorObject","color","newColor","rotate","toHex","window","__experimentalEnableColorRandomizer","useStylesPreviewColors","textColor","backgroundColor","headingColor","linkColor","buttonBackgroundColor","coreColors","customColors","paletteColors","concat","textColorObject","filter","buttonBackgroundColorObject","highlightedColors","slice","useSupportedStyles","element","supportedPanels","select","getSupportedStyles","useColorVariations","colorVariations","property","length","variation","settings","styles","title","Object","keys","useTypographyVariations","typographyVariations","base","values","reduce","acc","bodyFontFamily","headingFontFamily"],"sources":["@wordpress/edit-site/src/components/global-styles/hooks.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { colord, extend } from 'colord';\nimport a11yPlugin from 'colord/plugins/a11y';\n\n/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useContext } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { mergeBaseAndUserConfigs } from './global-styles-provider';\nimport { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';\nimport { getFontFamilies } from './utils';\nimport { unlock } from '../../lock-unlock';\nimport { useSelect } from '@wordpress/data';\n\nconst { useGlobalSetting, useGlobalStyle, GlobalStylesContext } = unlock(\n\tblockEditorPrivateApis\n);\n\n// Enable colord's a11y plugin.\nextend( [ a11yPlugin ] );\n\nexport function useColorRandomizer( name ) {\n\tconst [ themeColors, setThemeColors ] = useGlobalSetting(\n\t\t'color.palette.theme',\n\t\tname\n\t);\n\n\tfunction randomizeColors() {\n\t\t/* eslint-disable no-restricted-syntax */\n\t\tconst randomRotationValue = Math.floor( Math.random() * 225 );\n\t\t/* eslint-enable no-restricted-syntax */\n\n\t\tconst newColors = themeColors.map( ( colorObject ) => {\n\t\t\tconst { color } = colorObject;\n\t\t\tconst newColor = colord( color )\n\t\t\t\t.rotate( randomRotationValue )\n\t\t\t\t.toHex();\n\n\t\t\treturn {\n\t\t\t\t...colorObject,\n\t\t\t\tcolor: newColor,\n\t\t\t};\n\t\t} );\n\n\t\tsetThemeColors( newColors );\n\t}\n\n\treturn window.__experimentalEnableColorRandomizer\n\t\t? [ randomizeColors ]\n\t\t: [];\n}\n\nexport function useStylesPreviewColors() {\n\tconst [ textColor = 'black' ] = useGlobalStyle( 'color.text' );\n\tconst [ backgroundColor = 'white' ] = useGlobalStyle( 'color.background' );\n\tconst [ headingColor = textColor ] = useGlobalStyle(\n\t\t'elements.h1.color.text'\n\t);\n\tconst [ linkColor = headingColor ] = useGlobalStyle(\n\t\t'elements.link.color.text'\n\t);\n\n\tconst [ buttonBackgroundColor = linkColor ] = useGlobalStyle(\n\t\t'elements.button.color.background'\n\t);\n\tconst [ coreColors ] = useGlobalSetting( 'color.palette.core' );\n\tconst [ themeColors ] = useGlobalSetting( 'color.palette.theme' );\n\tconst [ customColors ] = useGlobalSetting( 'color.palette.custom' );\n\n\tconst paletteColors = ( themeColors ?? [] )\n\t\t.concat( customColors ?? [] )\n\t\t.concat( coreColors ?? [] );\n\n\tconst textColorObject = paletteColors.filter(\n\t\t( { color } ) => color === textColor\n\t);\n\tconst buttonBackgroundColorObject = paletteColors.filter(\n\t\t( { color } ) => color === buttonBackgroundColor\n\t);\n\n\tconst highlightedColors = textColorObject\n\t\t.concat( buttonBackgroundColorObject )\n\t\t.concat( paletteColors )\n\t\t.filter(\n\t\t\t// we exclude these background color because it is already visible in the preview.\n\t\t\t( { color } ) => color !== backgroundColor\n\t\t)\n\t\t.slice( 0, 2 );\n\n\treturn {\n\t\tpaletteColors,\n\t\thighlightedColors,\n\t};\n}\n\nexport function useSupportedStyles( name, element ) {\n\tconst { supportedPanels } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\tsupportedPanels: unlock(\n\t\t\t\t\tselect( blocksStore )\n\t\t\t\t).getSupportedStyles( name, element ),\n\t\t\t};\n\t\t},\n\t\t[ name, element ]\n\t);\n\n\treturn supportedPanels;\n}\n\nexport function useColorVariations() {\n\tconst colorVariations = useCurrentMergeThemeStyleVariationsWithUserConfig( {\n\t\tproperty: 'color',\n\t} );\n\t/*\n\t * Filter out variations with no settings or styles.\n\t */\n\treturn colorVariations?.length\n\t\t? colorVariations.filter( ( variation ) => {\n\t\t\t\tconst { settings, styles, title } = variation;\n\t\t\t\treturn (\n\t\t\t\t\ttitle === __( 'Default' ) || // Always preseve the default variation.\n\t\t\t\t\tObject.keys( settings ).length > 0 ||\n\t\t\t\t\tObject.keys( styles ).length > 0\n\t\t\t\t);\n\t\t } )\n\t\t: [];\n}\n\nexport function useTypographyVariations() {\n\tconst typographyVariations =\n\t\tuseCurrentMergeThemeStyleVariationsWithUserConfig( {\n\t\t\tproperty: 'typography',\n\t\t} );\n\n\tconst { base } = useContext( GlobalStylesContext );\n\t/*\n\t * Filter duplicate variations based on whether the variaitons\n\t * have different heading and body font families.\n\t */\n\treturn typographyVariations?.length\n\t\t? Object.values(\n\t\t\t\ttypographyVariations.reduce( ( acc, variation ) => {\n\t\t\t\t\tconst [ bodyFontFamily, headingFontFamily ] =\n\t\t\t\t\t\tgetFontFamilies(\n\t\t\t\t\t\t\tmergeBaseAndUserConfigs( base, variation )\n\t\t\t\t\t\t);\n\n\t\t\t\t\t// Always preseve the default variation.\n\t\t\t\t\tif ( variation?.title === 'Default' ) {\n\t\t\t\t\t\tacc[\n\t\t\t\t\t\t\t`${ headingFontFamily?.name }:${ bodyFontFamily?.name }`\n\t\t\t\t\t\t] = variation;\n\t\t\t\t\t} else if (\n\t\t\t\t\t\theadingFontFamily?.name &&\n\t\t\t\t\t\tbodyFontFamily?.name &&\n\t\t\t\t\t\t! acc[\n\t\t\t\t\t\t\t`${ headingFontFamily?.name }:${ bodyFontFamily?.name }`\n\t\t\t\t\t\t]\n\t\t\t\t\t) {\n\t\t\t\t\t\tacc[\n\t\t\t\t\t\t\t`${ headingFontFamily?.name }:${ bodyFontFamily?.name }`\n\t\t\t\t\t\t] = variation;\n\t\t\t\t\t}\n\t\t\t\t\treturn acc;\n\t\t\t\t}, {} )\n\t\t )\n\t\t: [];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,MAAM,QAAQ,QAAQ;AACvC,OAAOC,UAAU,MAAM,qBAAqB;;AAE5C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,uBAAuB,QAAQ,0BAA0B;AAClE,SAASC,iDAAiD,QAAQ,+EAA+E;AACjJ,SAASC,eAAe,QAAQ,SAAS;AACzC,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,MAAM;EAAEC,gBAAgB;EAAEC,cAAc;EAAEC;AAAoB,CAAC,GAAGJ,MAAM,CACvEN,sBACD,CAAC;;AAED;AACAL,MAAM,CAAE,CAAEC,UAAU,CAAG,CAAC;AAExB,OAAO,SAASe,kBAAkBA,CAAEC,IAAI,EAAG;EAC1C,MAAM,CAAEC,WAAW,EAAEC,cAAc,CAAE,GAAGN,gBAAgB,CACvD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yC,SAAS;IACd;IACA,OAAOW,GAAG;EACX,CAAC,EAAE,CAAC,CAAE,CACN,CAAC,GACD,EAAE;AACN","ignoreList":[]}
1
+ {"version":3,"names":["colord","extend","a11yPlugin","store","blocksStore","privateApis","blockEditorPrivateApis","editorPrivateApis","useContext","__","useCurrentMergeThemeStyleVariationsWithUserConfig","getFontFamilies","unlock","useSelect","mergeBaseAndUserConfigs","useGlobalSetting","useGlobalStyle","GlobalStylesContext","useColorRandomizer","name","themeColors","setThemeColors","randomizeColors","randomRotationValue","Math","floor","random","newColors","map","colorObject","color","newColor","rotate","toHex","window","__experimentalEnableColorRandomizer","useStylesPreviewColors","textColor","backgroundColor","headingColor","linkColor","buttonBackgroundColor","coreColors","customColors","paletteColors","concat","textColorObject","filter","buttonBackgroundColorObject","highlightedColors","slice","useSupportedStyles","element","supportedPanels","select","getSupportedStyles","useColorVariations","colorVariations","property","length","variation","settings","styles","title","Object","keys","useTypographyVariations","typographyVariations","base","values","reduce","acc","bodyFontFamily","headingFontFamily"],"sources":["@wordpress/edit-site/src/components/global-styles/hooks.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { colord, extend } from 'colord';\nimport a11yPlugin from 'colord/plugins/a11y';\n\n/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { useContext } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';\nimport { getFontFamilies } from './utils';\nimport { unlock } from '../../lock-unlock';\nimport { useSelect } from '@wordpress/data';\n\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\nconst { useGlobalSetting, useGlobalStyle, GlobalStylesContext } = unlock(\n\tblockEditorPrivateApis\n);\n\n// Enable colord's a11y plugin.\nextend( [ a11yPlugin ] );\n\nexport function useColorRandomizer( name ) {\n\tconst [ themeColors, setThemeColors ] = useGlobalSetting(\n\t\t'color.palette.theme',\n\t\tname\n\t);\n\n\tfunction randomizeColors() {\n\t\t/* eslint-disable no-restricted-syntax */\n\t\tconst randomRotationValue = Math.floor( Math.random() * 225 );\n\t\t/* eslint-enable no-restricted-syntax */\n\n\t\tconst newColors = themeColors.map( ( colorObject ) => {\n\t\t\tconst { color } = colorObject;\n\t\t\tconst newColor = colord( color )\n\t\t\t\t.rotate( randomRotationValue )\n\t\t\t\t.toHex();\n\n\t\t\treturn {\n\t\t\t\t...colorObject,\n\t\t\t\tcolor: newColor,\n\t\t\t};\n\t\t} );\n\n\t\tsetThemeColors( newColors );\n\t}\n\n\treturn window.__experimentalEnableColorRandomizer\n\t\t? [ randomizeColors ]\n\t\t: [];\n}\n\nexport function useStylesPreviewColors() {\n\tconst [ textColor = 'black' ] = useGlobalStyle( 'color.text' );\n\tconst [ backgroundColor = 'white' ] = useGlobalStyle( 'color.background' );\n\tconst [ headingColor = textColor ] = useGlobalStyle(\n\t\t'elements.h1.color.text'\n\t);\n\tconst [ linkColor = headingColor ] = useGlobalStyle(\n\t\t'elements.link.color.text'\n\t);\n\n\tconst [ buttonBackgroundColor = linkColor ] = useGlobalStyle(\n\t\t'elements.button.color.background'\n\t);\n\tconst [ coreColors ] = useGlobalSetting( 'color.palette.core' );\n\tconst [ themeColors ] = useGlobalSetting( 'color.palette.theme' );\n\tconst [ customColors ] = useGlobalSetting( 'color.palette.custom' );\n\n\tconst paletteColors = ( themeColors ?? [] )\n\t\t.concat( customColors ?? [] )\n\t\t.concat( coreColors ?? [] );\n\n\tconst textColorObject = paletteColors.filter(\n\t\t( { color } ) => color === textColor\n\t);\n\tconst buttonBackgroundColorObject = paletteColors.filter(\n\t\t( { color } ) => color === buttonBackgroundColor\n\t);\n\n\tconst highlightedColors = textColorObject\n\t\t.concat( buttonBackgroundColorObject )\n\t\t.concat( paletteColors )\n\t\t.filter(\n\t\t\t// we exclude these background color because it is already visible in the preview.\n\t\t\t( { color } ) => color !== backgroundColor\n\t\t)\n\t\t.slice( 0, 2 );\n\n\treturn {\n\t\tpaletteColors,\n\t\thighlightedColors,\n\t};\n}\n\nexport function useSupportedStyles( name, element ) {\n\tconst { supportedPanels } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\tsupportedPanels: unlock(\n\t\t\t\t\tselect( blocksStore )\n\t\t\t\t).getSupportedStyles( name, element ),\n\t\t\t};\n\t\t},\n\t\t[ name, element ]\n\t);\n\n\treturn supportedPanels;\n}\n\nexport function useColorVariations() {\n\tconst colorVariations = useCurrentMergeThemeStyleVariationsWithUserConfig( {\n\t\tproperty: 'color',\n\t} );\n\t/*\n\t * Filter out variations with no settings or styles.\n\t */\n\treturn colorVariations?.length\n\t\t? colorVariations.filter( ( variation ) => {\n\t\t\t\tconst { settings, styles, title } = variation;\n\t\t\t\treturn (\n\t\t\t\t\ttitle === __( 'Default' ) || // Always preseve the default variation.\n\t\t\t\t\tObject.keys( settings ).length > 0 ||\n\t\t\t\t\tObject.keys( styles ).length > 0\n\t\t\t\t);\n\t\t } )\n\t\t: [];\n}\n\nexport function useTypographyVariations() {\n\tconst typographyVariations =\n\t\tuseCurrentMergeThemeStyleVariationsWithUserConfig( {\n\t\t\tproperty: 'typography',\n\t\t} );\n\n\tconst { base } = useContext( GlobalStylesContext );\n\t/*\n\t * Filter duplicate variations based on whether the variaitons\n\t * have different heading and body font families.\n\t */\n\treturn typographyVariations?.length\n\t\t? Object.values(\n\t\t\t\ttypographyVariations.reduce( ( acc, variation ) => {\n\t\t\t\t\tconst [ bodyFontFamily, headingFontFamily ] =\n\t\t\t\t\t\tgetFontFamilies(\n\t\t\t\t\t\t\tmergeBaseAndUserConfigs( base, variation )\n\t\t\t\t\t\t);\n\n\t\t\t\t\t// Always preseve the default variation.\n\t\t\t\t\tif ( variation?.title === 'Default' ) {\n\t\t\t\t\t\tacc[\n\t\t\t\t\t\t\t`${ headingFontFamily?.name }:${ bodyFontFamily?.name }`\n\t\t\t\t\t\t] = variation;\n\t\t\t\t\t} else if (\n\t\t\t\t\t\theadingFontFamily?.name &&\n\t\t\t\t\t\tbodyFontFamily?.name &&\n\t\t\t\t\t\t! acc[\n\t\t\t\t\t\t\t`${ headingFontFamily?.name }:${ bodyFontFamily?.name }`\n\t\t\t\t\t\t]\n\t\t\t\t\t) {\n\t\t\t\t\t\tacc[\n\t\t\t\t\t\t\t`${ headingFontFamily?.name }:${ bodyFontFamily?.name }`\n\t\t\t\t\t\t] = variation;\n\t\t\t\t\t}\n\t\t\t\t\treturn acc;\n\t\t\t\t}, {} )\n\t\t )\n\t\t: [];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,MAAM,QAAQ,QAAQ;AACvC,OAAOC,UAAU,MAAM,qBAAqB;;AAE5C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASD,WAAW,IAAIE,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,iDAAiD,QAAQ,+EAA+E;AACjJ,SAASC,eAAe,QAAQ,SAAS;AACzC,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,MAAM;EAAEC;AAAwB,CAAC,GAAGF,MAAM,CAAEL,iBAAkB,CAAC;AAC/D,MAAM;EAAEQ,gBAAgB;EAAEC,cAAc;EAAEC;AAAoB,CAAC,GAAGL,MAAM,CACvEN,sBACD,CAAC;;AAED;AACAL,MAAM,CAAE,CAAEC,UAAU,CAAG,CAAC;AAExB,OAAO,SAASgB,kBAAkBA,CAAEC,IAAI,EAAG;EAC1C,MAAM,CAAEC,WAAW,EAAEC,cAAc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AAErD,IAAM,EAAC,CACxD,GAAGyC,SAAS;IACd;IACA,OAAOW,GAAG;EACX,CAAC,EAAE,CAAC,CAAE,CACN,CAAC,GACD,EAAE;AACN","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -13,7 +13,7 @@ export function IconWithCurrentColor({
13
13
  ...props
14
14
  }) {
15
15
  return createElement(Icon, {
16
- className: classnames(className, 'edit-site-global-styles-icon-with-current-color'),
16
+ className: clsx(className, 'edit-site-global-styles-icon-with-current-color'),
17
17
  ...props
18
18
  });
19
19
  }
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","Icon","IconWithCurrentColor","className","props","createElement"],"sources":["@wordpress/edit-site/src/components/global-styles/icon-with-current-color.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\n\nexport function IconWithCurrentColor( { className, ...props } ) {\n\treturn (\n\t\t<Icon\n\t\t\tclassName={ classnames(\n\t\t\t\tclassName,\n\t\t\t\t'edit-site-global-styles-icon-with-current-color'\n\t\t\t) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,IAAI,QAAQ,uBAAuB;AAE5C,OAAO,SAASC,oBAAoBA,CAAE;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAG;EAC/D,OACCC,aAAA,CAACJ,IAAI;IACJE,SAAS,EAAGH,UAAU,CACrBG,SAAS,EACT,iDACD,CAAG;IAAA,GACEC;EAAK,CACV,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["clsx","Icon","IconWithCurrentColor","className","props","createElement"],"sources":["@wordpress/edit-site/src/components/global-styles/icon-with-current-color.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\n\nexport function IconWithCurrentColor( { className, ...props } ) {\n\treturn (\n\t\t<Icon\n\t\t\tclassName={ clsx(\n\t\t\t\tclassName,\n\t\t\t\t'edit-site-global-styles-icon-with-current-color'\n\t\t\t) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,IAAI,QAAQ,uBAAuB;AAE5C,OAAO,SAASC,oBAAoBA,CAAE;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAG;EAC/D,OACCC,aAAA,CAACJ,IAAI;IACJE,SAAS,EAAGH,IAAI,CACfG,SAAS,EACT,iDACD,CAAG;IAAA,GACEC;EAAK,CACV,CAAC;AAEJ","ignoreList":[]}