@wordpress/edit-site 5.31.0 → 5.33.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 (906) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-page/index.js.map +1 -1
  3. package/build/components/add-new-pattern/index.js.map +1 -1
  4. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  5. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  6. package/build/components/add-new-template/index.js +282 -13
  7. package/build/components/add-new-template/index.js.map +1 -1
  8. package/build/components/add-new-template/utils.js +22 -11
  9. package/build/components/add-new-template/utils.js.map +1 -1
  10. package/build/components/app/index.js.map +1 -1
  11. package/build/components/async/index.js +51 -0
  12. package/build/components/async/index.js.map +1 -0
  13. package/build/components/block-editor/block-inspector-button.js +10 -9
  14. package/build/components/block-editor/block-inspector-button.js.map +1 -1
  15. package/build/components/block-editor/editor-canvas.js +23 -7
  16. package/build/components/block-editor/editor-canvas.js.map +1 -1
  17. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  18. package/build/components/block-editor/resizable-editor.js.map +1 -1
  19. package/build/components/block-editor/resize-handle.js.map +1 -1
  20. package/build/components/block-editor/site-editor-canvas.js +20 -5
  21. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  22. package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  23. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  24. package/build/components/canvas-loader/index.js.map +1 -1
  25. package/build/components/code-editor/index.js.map +1 -1
  26. package/build/components/create-template-part-modal/index.js.map +1 -1
  27. package/build/components/editor/index.js +47 -11
  28. package/build/components/editor/index.js.map +1 -1
  29. package/build/components/editor-canvas-container/index.js +1 -2
  30. package/build/components/editor-canvas-container/index.js.map +1 -1
  31. package/build/components/error-boundary/index.js.map +1 -1
  32. package/build/components/error-boundary/warning.js.map +1 -1
  33. package/build/components/global-styles/background-panel.js +50 -0
  34. package/build/components/global-styles/background-panel.js.map +1 -0
  35. package/build/components/global-styles/block-preview-panel.js +6 -1
  36. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  37. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  38. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  39. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  40. package/build/components/global-styles/font-families.js +2 -2
  41. package/build/components/global-styles/font-families.js.map +1 -1
  42. package/build/components/global-styles/font-family-item.js.map +1 -1
  43. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  44. package/build/components/global-styles/font-library-modal/context.js +88 -31
  45. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  46. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
  47. package/build/components/global-styles/font-library-modal/font-collection.js +11 -4
  48. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  49. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  50. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  51. package/build/components/global-styles/font-library-modal/index.js +1 -1
  52. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  53. package/build/components/global-styles/font-library-modal/installed-fonts.js +10 -9
  54. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  55. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  56. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  57. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  58. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  59. package/build/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
  60. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  61. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  62. package/build/components/global-styles/font-library-modal/utils/index.js +20 -2
  63. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  64. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  65. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  66. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  67. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
  68. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  69. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  70. package/build/components/global-styles/header.js.map +1 -1
  71. package/build/components/global-styles/highlighted-colors.js +1 -1
  72. package/build/components/global-styles/highlighted-colors.js.map +1 -1
  73. package/build/components/global-styles/hooks.js +11 -3
  74. package/build/components/global-styles/hooks.js.map +1 -1
  75. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  76. package/build/components/global-styles/index.js.map +1 -1
  77. package/build/components/global-styles/navigation-button.js.map +1 -1
  78. package/build/components/global-styles/palette.js +3 -1
  79. package/build/components/global-styles/palette.js.map +1 -1
  80. package/build/components/global-styles/preview-colors.js +2 -2
  81. package/build/components/global-styles/preview-colors.js.map +1 -1
  82. package/build/components/global-styles/preview-iframe.js.map +1 -1
  83. package/build/components/global-styles/preview-styles.js.map +1 -1
  84. package/build/components/global-styles/root-menu.js +8 -2
  85. package/build/components/global-styles/root-menu.js.map +1 -1
  86. package/build/components/global-styles/screen-background.js +34 -0
  87. package/build/components/global-styles/screen-background.js.map +1 -0
  88. package/build/components/global-styles/screen-block-list.js.map +1 -1
  89. package/build/components/global-styles/screen-block.js.map +1 -1
  90. package/build/components/global-styles/screen-color-palette.js +2 -2
  91. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  92. package/build/components/global-styles/screen-colors.js +6 -4
  93. package/build/components/global-styles/screen-colors.js.map +1 -1
  94. package/build/components/global-styles/screen-css.js.map +1 -1
  95. package/build/components/global-styles/screen-layout.js.map +1 -1
  96. package/build/components/global-styles/screen-revisions/index.js +1 -1
  97. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  98. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  99. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  100. package/build/components/global-styles/screen-root.js.map +1 -1
  101. package/build/components/global-styles/screen-style-variations.js +3 -37
  102. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  103. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  104. package/build/components/global-styles/screen-typography.js +6 -6
  105. package/build/components/global-styles/screen-typography.js.map +1 -1
  106. package/build/components/global-styles/style-variations-container.js +5 -2
  107. package/build/components/global-styles/style-variations-container.js.map +1 -1
  108. package/build/components/global-styles/subtitle.js.map +1 -1
  109. package/build/components/global-styles/typography-elements.js.map +1 -1
  110. package/build/components/global-styles/typography-example.js.map +1 -1
  111. package/build/components/global-styles/typography-panel.js.map +1 -1
  112. package/build/components/global-styles/typography-preview.js.map +1 -1
  113. package/build/components/global-styles/ui.js +5 -2
  114. package/build/components/global-styles/ui.js.map +1 -1
  115. package/build/components/global-styles/utils.js.map +1 -1
  116. package/build/components/global-styles/variations/variation.js.map +1 -1
  117. package/build/components/global-styles/variations/variations-color.js +10 -3
  118. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  119. package/build/components/global-styles/variations/variations-panel.js.map +1 -1
  120. package/build/components/global-styles/variations/variations-typography.js +9 -2
  121. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  122. package/build/components/global-styles-renderer/index.js.map +1 -1
  123. package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
  124. package/build/components/header-edit-mode/index.js +4 -4
  125. package/build/components/header-edit-mode/index.js.map +1 -1
  126. package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +1 -1
  127. package/build/components/header-edit-mode/more-menu/index.js +10 -12
  128. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  129. package/build/components/header-edit-mode/more-menu/site-export.js.map +1 -1
  130. package/build/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
  131. package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  132. package/build/components/keyboard-shortcuts/edit-mode.js +0 -23
  133. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  134. package/build/components/keyboard-shortcuts/global.js.map +1 -1
  135. package/build/components/keyboard-shortcuts/register.js +0 -18
  136. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  137. package/build/components/layout/animation.js +130 -0
  138. package/build/components/layout/animation.js.map +1 -0
  139. package/build/components/layout/hooks.js.map +1 -1
  140. package/build/components/layout/index.js +21 -64
  141. package/build/components/layout/index.js.map +1 -1
  142. package/build/components/layout/router.js +92 -23
  143. package/build/components/layout/router.js.map +1 -1
  144. package/build/components/media/index.js.map +1 -1
  145. package/build/components/page/header.js.map +1 -1
  146. package/build/components/page/index.js +5 -2
  147. package/build/components/page/index.js.map +1 -1
  148. package/build/components/page-pages/index.js +33 -33
  149. package/build/components/page-pages/index.js.map +1 -1
  150. package/build/components/page-patterns/dataviews-pattern-actions.js +5 -4
  151. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  152. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  153. package/build/components/page-patterns/header.js +2 -2
  154. package/build/components/page-patterns/header.js.map +1 -1
  155. package/build/components/page-patterns/index.js +136 -39
  156. package/build/components/page-patterns/index.js.map +1 -1
  157. package/build/components/page-patterns/rename-category-menu-item.js.map +1 -1
  158. package/build/components/page-patterns/search-items.js +18 -59
  159. package/build/components/page-patterns/search-items.js.map +1 -1
  160. package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
  161. package/build/components/page-patterns/use-patterns.js +5 -10
  162. package/build/components/page-patterns/use-patterns.js.map +1 -1
  163. package/build/components/page-patterns/utils.js.map +1 -1
  164. package/build/components/page-templates-template-parts/add-new-template-part.js +2 -1
  165. package/build/components/page-templates-template-parts/add-new-template-part.js.map +1 -1
  166. package/build/components/page-templates-template-parts/hooks.js.map +1 -1
  167. package/build/components/page-templates-template-parts/index.js +35 -80
  168. package/build/components/page-templates-template-parts/index.js.map +1 -1
  169. package/build/components/pagination/index.js.map +1 -1
  170. package/build/components/pattern-modal/duplicate.js +6 -3
  171. package/build/components/pattern-modal/duplicate.js.map +1 -1
  172. package/build/components/pattern-modal/index.js.map +1 -1
  173. package/build/components/pattern-modal/rename.js +6 -3
  174. package/build/components/pattern-modal/rename.js.map +1 -1
  175. package/build/components/plugin-template-setting-panel/index.js +12 -1
  176. package/build/components/plugin-template-setting-panel/index.js.map +1 -1
  177. package/build/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +18 -16
  178. package/build/components/rename-post-menu-item/index.js.map +1 -0
  179. package/build/components/resizable-frame/index.js +1 -5
  180. package/build/components/resizable-frame/index.js.map +1 -1
  181. package/build/components/revisions/index.js.map +1 -1
  182. package/build/components/routes/link.js.map +1 -1
  183. package/build/components/routes/use-title.js.map +1 -1
  184. package/build/components/save-button/index.js +45 -16
  185. package/build/components/save-button/index.js.map +1 -1
  186. package/build/components/save-hub/index.js +8 -112
  187. package/build/components/save-hub/index.js.map +1 -1
  188. package/build/components/save-panel/index.js +3 -3
  189. package/build/components/save-panel/index.js.map +1 -1
  190. package/build/components/sidebar/index.js +41 -79
  191. package/build/components/sidebar/index.js.map +1 -1
  192. package/build/components/sidebar-button/index.js.map +1 -1
  193. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  194. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  195. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  196. package/build/components/sidebar-dataviews/default-views.js +2 -2
  197. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  198. package/build/components/sidebar-dataviews/index.js +2 -2
  199. package/build/components/sidebar-dataviews/index.js.map +1 -1
  200. package/build/components/sidebar-edit-mode/default-sidebar.js +18 -7
  201. package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  202. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +5 -3
  203. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  204. package/build/components/sidebar-edit-mode/index.js +30 -56
  205. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  206. package/build/components/sidebar-edit-mode/page-panels/index.js +26 -15
  207. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  208. package/build/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
  209. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  210. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  211. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +2 -2
  212. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  213. package/build/components/sidebar-edit-mode/settings-header/index.js +4 -5
  214. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  215. package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
  216. package/build/components/sidebar-edit-mode/template-panel/index.js +11 -17
  217. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  218. package/build/components/sidebar-navigation-item/index.js +31 -0
  219. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  220. package/build/components/sidebar-navigation-screen/index.js +36 -9
  221. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  222. package/build/components/sidebar-navigation-screen-details-footer/index.js +5 -1
  223. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  224. package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  225. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
  226. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  227. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
  228. package/build/components/sidebar-navigation-screen-global-styles/index.js +11 -7
  229. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  230. package/build/components/sidebar-navigation-screen-main/index.js +6 -15
  231. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  232. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
  233. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  234. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +7 -2
  235. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  236. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  237. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  238. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  239. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  240. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  241. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -15
  242. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  243. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  244. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  245. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  246. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  247. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -5
  248. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  249. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  250. package/build/components/sidebar-navigation-screen-page/index.js +22 -12
  251. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  252. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  253. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  254. package/build/components/sidebar-navigation-screen-pattern/index.js +14 -5
  255. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  256. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  257. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
  258. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  259. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  260. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  261. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -1
  262. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  263. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  264. package/build/components/sidebar-navigation-screen-patterns/index.js +34 -32
  265. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  266. package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
  267. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  268. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  269. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  270. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  271. package/build/components/sidebar-navigation-screen-template/index.js +10 -7
  272. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  273. package/build/components/sidebar-navigation-screen-template/template-areas.js.map +1 -1
  274. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  275. package/build/components/sidebar-navigation-screen-templates-browse/index.js +6 -8
  276. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  277. package/build/components/site-hub/index.js +22 -21
  278. package/build/components/site-hub/index.js.map +1 -1
  279. package/build/components/site-icon/index.js.map +1 -1
  280. package/build/components/start-template-options/index.js.map +1 -1
  281. package/build/components/style-book/index.js +1 -1
  282. package/build/components/style-book/index.js.map +1 -1
  283. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +16 -7
  284. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  285. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  286. package/build/components/table/index.js.map +1 -1
  287. package/build/components/template-actions/index.js +7 -8
  288. package/build/components/template-actions/index.js.map +1 -1
  289. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  290. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  291. package/build/components/template-part-converter/index.js.map +1 -1
  292. package/build/components/use-edited-entity-record/index.js.map +1 -1
  293. package/build/components/welcome-guide/editor.js.map +1 -1
  294. package/build/components/welcome-guide/image.js.map +1 -1
  295. package/build/components/welcome-guide/index.js.map +1 -1
  296. package/build/components/welcome-guide/page.js.map +1 -1
  297. package/build/components/welcome-guide/styles.js +6 -3
  298. package/build/components/welcome-guide/styles.js.map +1 -1
  299. package/build/components/welcome-guide/template.js.map +1 -1
  300. package/build/hooks/commands/use-common-commands.js.map +1 -1
  301. package/build/hooks/commands/use-edit-mode-commands.js +10 -28
  302. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  303. package/build/hooks/components.js.map +1 -1
  304. package/build/hooks/index.js +0 -1
  305. package/build/hooks/index.js.map +1 -1
  306. package/build/hooks/push-changes-to-global-styles/index.js +3 -40
  307. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  308. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +1 -1
  309. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  310. package/build/index.js +3 -8
  311. package/build/index.js.map +1 -1
  312. package/build/lock-unlock.js.map +1 -1
  313. package/build/store/actions.js +21 -96
  314. package/build/store/actions.js.map +1 -1
  315. package/build/store/constants.js.map +1 -1
  316. package/build/store/index.js +1 -1
  317. package/build/store/index.js.map +1 -1
  318. package/build/store/private-actions.js +1 -85
  319. package/build/store/private-actions.js.map +1 -1
  320. package/build/store/private-selectors.js.map +1 -1
  321. package/build/store/reducer.js.map +1 -1
  322. package/build/store/selectors.js +1 -9
  323. package/build/store/selectors.js.map +1 -1
  324. package/build/utils/clone-deep.js.map +1 -1
  325. package/build/utils/constants.js +2 -1
  326. package/build/utils/constants.js.map +1 -1
  327. package/build/utils/get-is-list-page.js.map +1 -1
  328. package/build/utils/is-previewing-theme.js.map +1 -1
  329. package/build/utils/is-template-removable.js.map +1 -1
  330. package/build/utils/is-template-revertable.js.map +1 -1
  331. package/build/utils/math.js.map +1 -1
  332. package/build/utils/set-nested-value.js +44 -0
  333. package/build/utils/set-nested-value.js.map +1 -0
  334. package/build/utils/template-part-create.js.map +1 -1
  335. package/build/utils/use-activate-theme.js.map +1 -1
  336. package/build/utils/use-actual-current-theme.js.map +1 -1
  337. package/build-module/components/add-new-page/index.js.map +1 -1
  338. package/build-module/components/add-new-pattern/index.js.map +1 -1
  339. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  340. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  341. package/build-module/components/add-new-template/index.js +283 -14
  342. package/build-module/components/add-new-template/index.js.map +1 -1
  343. package/build-module/components/add-new-template/utils.js +21 -11
  344. package/build-module/components/add-new-template/utils.js.map +1 -1
  345. package/build-module/components/app/index.js.map +1 -1
  346. package/build-module/components/async/index.js +44 -0
  347. package/build-module/components/async/index.js.map +1 -0
  348. package/build-module/components/block-editor/block-inspector-button.js +9 -8
  349. package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
  350. package/build-module/components/block-editor/editor-canvas.js +24 -8
  351. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  352. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
  353. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  354. package/build-module/components/block-editor/resize-handle.js.map +1 -1
  355. package/build-module/components/block-editor/site-editor-canvas.js +20 -5
  356. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  357. package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  358. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  359. package/build-module/components/canvas-loader/index.js.map +1 -1
  360. package/build-module/components/code-editor/index.js.map +1 -1
  361. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  362. package/build-module/components/editor/index.js +48 -12
  363. package/build-module/components/editor/index.js.map +1 -1
  364. package/build-module/components/editor-canvas-container/index.js +1 -2
  365. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  366. package/build-module/components/error-boundary/index.js.map +1 -1
  367. package/build-module/components/error-boundary/warning.js.map +1 -1
  368. package/build-module/components/global-styles/background-panel.js +44 -0
  369. package/build-module/components/global-styles/background-panel.js.map +1 -0
  370. package/build-module/components/global-styles/block-preview-panel.js +6 -1
  371. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  372. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  373. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  374. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  375. package/build-module/components/global-styles/font-families.js +1 -1
  376. package/build-module/components/global-styles/font-families.js.map +1 -1
  377. package/build-module/components/global-styles/font-family-item.js.map +1 -1
  378. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  379. package/build-module/components/global-styles/font-library-modal/context.js +87 -31
  380. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  381. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
  382. package/build-module/components/global-styles/font-library-modal/font-collection.js +12 -5
  383. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  384. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  385. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  386. package/build-module/components/global-styles/font-library-modal/index.js +2 -2
  387. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  388. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +11 -10
  389. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  390. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  391. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  392. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  393. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  394. package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
  395. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  396. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  397. package/build-module/components/global-styles/font-library-modal/utils/index.js +20 -2
  398. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  399. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  400. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  401. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  402. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
  403. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  404. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  405. package/build-module/components/global-styles/header.js.map +1 -1
  406. package/build-module/components/global-styles/highlighted-colors.js +1 -1
  407. package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
  408. package/build-module/components/global-styles/hooks.js +11 -3
  409. package/build-module/components/global-styles/hooks.js.map +1 -1
  410. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  411. package/build-module/components/global-styles/index.js.map +1 -1
  412. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  413. package/build-module/components/global-styles/palette.js +3 -1
  414. package/build-module/components/global-styles/palette.js.map +1 -1
  415. package/build-module/components/global-styles/preview-colors.js +2 -2
  416. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  417. package/build-module/components/global-styles/preview-iframe.js.map +1 -1
  418. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  419. package/build-module/components/global-styles/root-menu.js +9 -3
  420. package/build-module/components/global-styles/root-menu.js.map +1 -1
  421. package/build-module/components/global-styles/screen-background.js +26 -0
  422. package/build-module/components/global-styles/screen-background.js.map +1 -0
  423. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  424. package/build-module/components/global-styles/screen-block.js.map +1 -1
  425. package/build-module/components/global-styles/screen-color-palette.js +2 -2
  426. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  427. package/build-module/components/global-styles/screen-colors.js +6 -4
  428. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  429. package/build-module/components/global-styles/screen-css.js.map +1 -1
  430. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  431. package/build-module/components/global-styles/screen-revisions/index.js +1 -1
  432. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  433. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  434. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  435. package/build-module/components/global-styles/screen-root.js.map +1 -1
  436. package/build-module/components/global-styles/screen-style-variations.js +4 -38
  437. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  438. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  439. package/build-module/components/global-styles/screen-typography.js +6 -6
  440. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  441. package/build-module/components/global-styles/style-variations-container.js +5 -2
  442. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  443. package/build-module/components/global-styles/subtitle.js.map +1 -1
  444. package/build-module/components/global-styles/typography-elements.js.map +1 -1
  445. package/build-module/components/global-styles/typography-example.js.map +1 -1
  446. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  447. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  448. package/build-module/components/global-styles/ui.js +4 -1
  449. package/build-module/components/global-styles/ui.js.map +1 -1
  450. package/build-module/components/global-styles/utils.js.map +1 -1
  451. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  452. package/build-module/components/global-styles/variations/variations-color.js +10 -3
  453. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  454. package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
  455. package/build-module/components/global-styles/variations/variations-typography.js +9 -2
  456. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  457. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  458. package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
  459. package/build-module/components/header-edit-mode/index.js +3 -3
  460. package/build-module/components/header-edit-mode/index.js.map +1 -1
  461. package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +1 -1
  462. package/build-module/components/header-edit-mode/more-menu/index.js +8 -8
  463. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  464. package/build-module/components/header-edit-mode/more-menu/site-export.js.map +1 -1
  465. package/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
  466. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  467. package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -23
  468. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  469. package/build-module/components/keyboard-shortcuts/global.js.map +1 -1
  470. package/build-module/components/keyboard-shortcuts/register.js +0 -18
  471. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  472. package/build-module/components/layout/animation.js +123 -0
  473. package/build-module/components/layout/animation.js.map +1 -0
  474. package/build-module/components/layout/hooks.js.map +1 -1
  475. package/build-module/components/layout/index.js +21 -64
  476. package/build-module/components/layout/index.js.map +1 -1
  477. package/build-module/components/layout/router.js +92 -23
  478. package/build-module/components/layout/router.js.map +1 -1
  479. package/build-module/components/media/index.js.map +1 -1
  480. package/build-module/components/page/header.js.map +1 -1
  481. package/build-module/components/page/index.js +5 -2
  482. package/build-module/components/page/index.js.map +1 -1
  483. package/build-module/components/page-pages/index.js +32 -32
  484. package/build-module/components/page-pages/index.js.map +1 -1
  485. package/build-module/components/page-patterns/dataviews-pattern-actions.js +5 -4
  486. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  487. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  488. package/build-module/components/page-patterns/header.js +2 -2
  489. package/build-module/components/page-patterns/header.js.map +1 -1
  490. package/build-module/components/page-patterns/index.js +139 -42
  491. package/build-module/components/page-patterns/index.js.map +1 -1
  492. package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
  493. package/build-module/components/page-patterns/search-items.js +17 -57
  494. package/build-module/components/page-patterns/search-items.js.map +1 -1
  495. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
  496. package/build-module/components/page-patterns/use-patterns.js +2 -6
  497. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  498. package/build-module/components/page-patterns/utils.js.map +1 -1
  499. package/build-module/components/page-templates-template-parts/add-new-template-part.js +3 -2
  500. package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +1 -1
  501. package/build-module/components/page-templates-template-parts/hooks.js.map +1 -1
  502. package/build-module/components/page-templates-template-parts/index.js +36 -81
  503. package/build-module/components/page-templates-template-parts/index.js.map +1 -1
  504. package/build-module/components/pagination/index.js.map +1 -1
  505. package/build-module/components/pattern-modal/duplicate.js +4 -1
  506. package/build-module/components/pattern-modal/duplicate.js.map +1 -1
  507. package/build-module/components/pattern-modal/index.js.map +1 -1
  508. package/build-module/components/pattern-modal/rename.js +4 -1
  509. package/build-module/components/pattern-modal/rename.js.map +1 -1
  510. package/build-module/components/plugin-template-setting-panel/index.js +12 -1
  511. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
  512. package/build-module/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +17 -15
  513. package/build-module/components/rename-post-menu-item/index.js.map +1 -0
  514. package/build-module/components/resizable-frame/index.js +1 -5
  515. package/build-module/components/resizable-frame/index.js.map +1 -1
  516. package/build-module/components/revisions/index.js.map +1 -1
  517. package/build-module/components/routes/link.js.map +1 -1
  518. package/build-module/components/routes/use-title.js.map +1 -1
  519. package/build-module/components/save-button/index.js +46 -17
  520. package/build-module/components/save-button/index.js.map +1 -1
  521. package/build-module/components/save-hub/index.js +10 -114
  522. package/build-module/components/save-hub/index.js.map +1 -1
  523. package/build-module/components/save-panel/index.js +2 -2
  524. package/build-module/components/save-panel/index.js.map +1 -1
  525. package/build-module/components/sidebar/index.js +42 -79
  526. package/build-module/components/sidebar/index.js.map +1 -1
  527. package/build-module/components/sidebar-button/index.js.map +1 -1
  528. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  529. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  530. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  531. package/build-module/components/sidebar-dataviews/default-views.js +2 -2
  532. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  533. package/build-module/components/sidebar-dataviews/index.js +2 -2
  534. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  535. package/build-module/components/sidebar-edit-mode/default-sidebar.js +16 -5
  536. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  537. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +5 -3
  538. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  539. package/build-module/components/sidebar-edit-mode/index.js +29 -55
  540. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  541. package/build-module/components/sidebar-edit-mode/page-panels/index.js +29 -18
  542. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  543. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
  544. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  545. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  546. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +4 -4
  547. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  548. package/build-module/components/sidebar-edit-mode/settings-header/index.js +4 -5
  549. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  550. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
  551. package/build-module/components/sidebar-edit-mode/template-panel/index.js +12 -18
  552. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  553. package/build-module/components/sidebar-navigation-item/index.js +31 -0
  554. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  555. package/build-module/components/sidebar-navigation-screen/index.js +37 -10
  556. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  557. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +5 -1
  558. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  559. package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  560. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
  561. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  562. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
  563. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +12 -8
  564. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  565. package/build-module/components/sidebar-navigation-screen-main/index.js +7 -16
  566. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  567. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
  568. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  569. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +8 -3
  570. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  571. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  572. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  573. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  574. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  575. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  576. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -15
  577. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  578. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  579. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  580. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  581. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  582. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -5
  583. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  584. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  585. package/build-module/components/sidebar-navigation-screen-page/index.js +24 -14
  586. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  587. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  588. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  589. package/build-module/components/sidebar-navigation-screen-pattern/index.js +14 -5
  590. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  591. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  592. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
  593. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  594. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  595. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  596. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -1
  597. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  598. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  599. package/build-module/components/sidebar-navigation-screen-patterns/index.js +35 -33
  600. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  601. package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
  602. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  603. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  604. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  605. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  606. package/build-module/components/sidebar-navigation-screen-template/index.js +12 -8
  607. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  608. package/build-module/components/sidebar-navigation-screen-template/template-areas.js.map +1 -1
  609. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  610. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +6 -8
  611. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  612. package/build-module/components/site-hub/index.js +22 -21
  613. package/build-module/components/site-hub/index.js.map +1 -1
  614. package/build-module/components/site-icon/index.js.map +1 -1
  615. package/build-module/components/start-template-options/index.js.map +1 -1
  616. package/build-module/components/style-book/index.js +1 -1
  617. package/build-module/components/style-book/index.js.map +1 -1
  618. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +16 -7
  619. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  620. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  621. package/build-module/components/table/index.js.map +1 -1
  622. package/build-module/components/template-actions/index.js +7 -8
  623. package/build-module/components/template-actions/index.js.map +1 -1
  624. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  625. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  626. package/build-module/components/template-part-converter/index.js.map +1 -1
  627. package/build-module/components/use-edited-entity-record/index.js.map +1 -1
  628. package/build-module/components/welcome-guide/editor.js.map +1 -1
  629. package/build-module/components/welcome-guide/image.js.map +1 -1
  630. package/build-module/components/welcome-guide/index.js.map +1 -1
  631. package/build-module/components/welcome-guide/page.js.map +1 -1
  632. package/build-module/components/welcome-guide/styles.js +6 -3
  633. package/build-module/components/welcome-guide/styles.js.map +1 -1
  634. package/build-module/components/welcome-guide/template.js.map +1 -1
  635. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  636. package/build-module/hooks/commands/use-edit-mode-commands.js +11 -29
  637. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  638. package/build-module/hooks/components.js.map +1 -1
  639. package/build-module/hooks/index.js +0 -1
  640. package/build-module/hooks/index.js.map +1 -1
  641. package/build-module/hooks/push-changes-to-global-styles/index.js +1 -38
  642. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  643. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +1 -1
  644. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  645. package/build-module/index.js +4 -6
  646. package/build-module/index.js.map +1 -1
  647. package/build-module/lock-unlock.js.map +1 -1
  648. package/build-module/store/actions.js +16 -92
  649. package/build-module/store/actions.js.map +1 -1
  650. package/build-module/store/constants.js.map +1 -1
  651. package/build-module/store/index.js.map +1 -1
  652. package/build-module/store/private-actions.js +0 -83
  653. package/build-module/store/private-actions.js.map +1 -1
  654. package/build-module/store/private-selectors.js.map +1 -1
  655. package/build-module/store/reducer.js.map +1 -1
  656. package/build-module/store/selectors.js +1 -9
  657. package/build-module/store/selectors.js.map +1 -1
  658. package/build-module/utils/clone-deep.js.map +1 -1
  659. package/build-module/utils/constants.js +1 -0
  660. package/build-module/utils/constants.js.map +1 -1
  661. package/build-module/utils/get-is-list-page.js.map +1 -1
  662. package/build-module/utils/is-previewing-theme.js.map +1 -1
  663. package/build-module/utils/is-template-removable.js.map +1 -1
  664. package/build-module/utils/is-template-revertable.js.map +1 -1
  665. package/build-module/utils/math.js.map +1 -1
  666. package/build-module/utils/set-nested-value.js +38 -0
  667. package/build-module/utils/set-nested-value.js.map +1 -0
  668. package/build-module/utils/template-part-create.js.map +1 -1
  669. package/build-module/utils/use-activate-theme.js.map +1 -1
  670. package/build-module/utils/use-actual-current-theme.js.map +1 -1
  671. package/build-style/style-rtl.css +287 -688
  672. package/build-style/style.css +287 -688
  673. package/package.json +44 -45
  674. package/src/components/add-new-template/index.js +412 -12
  675. package/src/components/add-new-template/style.scss +0 -22
  676. package/src/components/add-new-template/utils.js +44 -24
  677. package/src/components/async/index.js +43 -0
  678. package/src/components/block-editor/block-inspector-button.js +9 -11
  679. package/src/components/block-editor/editor-canvas.js +59 -23
  680. package/src/components/block-editor/site-editor-canvas.js +16 -8
  681. package/src/components/editor/index.js +61 -17
  682. package/src/components/editor-canvas-container/index.js +0 -1
  683. package/src/components/global-styles/background-panel.js +50 -0
  684. package/src/components/global-styles/block-preview-panel.js +6 -1
  685. package/src/components/global-styles/font-families.js +1 -1
  686. package/src/components/global-styles/font-library-modal/context.js +104 -50
  687. package/src/components/global-styles/font-library-modal/font-collection.js +247 -223
  688. package/src/components/global-styles/font-library-modal/index.js +2 -2
  689. package/src/components/global-styles/font-library-modal/installed-fonts.js +156 -147
  690. package/src/components/global-styles/font-library-modal/style.scss +32 -14
  691. package/src/components/global-styles/font-library-modal/utils/index.js +17 -4
  692. package/src/components/global-styles/highlighted-colors.js +1 -1
  693. package/src/components/global-styles/hooks.js +20 -3
  694. package/src/components/global-styles/palette.js +3 -1
  695. package/src/components/global-styles/preview-colors.js +2 -2
  696. package/src/components/global-styles/root-menu.js +12 -1
  697. package/src/components/global-styles/screen-background.js +29 -0
  698. package/src/components/global-styles/screen-color-palette.js +2 -2
  699. package/src/components/global-styles/screen-colors.js +4 -4
  700. package/src/components/global-styles/screen-revisions/index.js +1 -1
  701. package/src/components/global-styles/screen-style-variations.js +4 -36
  702. package/src/components/global-styles/screen-typography.js +6 -9
  703. package/src/components/global-styles/style-variations-container.js +2 -1
  704. package/src/components/global-styles/style.scss +14 -12
  705. package/src/components/global-styles/ui.js +5 -0
  706. package/src/components/global-styles/variations/style.scss +32 -17
  707. package/src/components/global-styles/variations/variations-color.js +4 -2
  708. package/src/components/global-styles/variations/variations-typography.js +4 -1
  709. package/src/components/header-edit-mode/index.js +3 -5
  710. package/src/components/header-edit-mode/more-menu/index.js +6 -17
  711. package/src/components/header-edit-mode/style.scss +29 -18
  712. package/src/components/keyboard-shortcuts/edit-mode.js +0 -29
  713. package/src/components/keyboard-shortcuts/register.js +0 -20
  714. package/src/components/layout/animation.js +125 -0
  715. package/src/components/layout/index.js +21 -74
  716. package/src/components/layout/router.js +99 -30
  717. package/src/components/layout/style.scss +17 -37
  718. package/src/components/page/index.js +7 -2
  719. package/src/components/page-pages/index.js +59 -65
  720. package/src/components/page-pages/style.scss +29 -22
  721. package/src/components/page-patterns/dataviews-pattern-actions.js +5 -6
  722. package/src/components/page-patterns/header.js +4 -2
  723. package/src/components/page-patterns/index.js +182 -78
  724. package/src/components/page-patterns/search-items.js +16 -58
  725. package/src/components/page-patterns/style.scss +7 -6
  726. package/src/components/page-patterns/use-patterns.js +2 -6
  727. package/src/components/page-templates-template-parts/add-new-template-part.js +4 -2
  728. package/src/components/page-templates-template-parts/index.js +44 -103
  729. package/src/components/page-templates-template-parts/style.scss +5 -0
  730. package/src/components/pattern-modal/duplicate.js +2 -1
  731. package/src/components/pattern-modal/rename.js +2 -1
  732. package/src/components/plugin-template-setting-panel/index.js +14 -1
  733. package/src/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +20 -24
  734. package/src/components/resizable-frame/index.js +2 -6
  735. package/src/components/save-button/index.js +55 -26
  736. package/src/components/save-hub/index.js +20 -164
  737. package/src/components/save-panel/index.js +2 -2
  738. package/src/components/sidebar/index.js +52 -105
  739. package/src/components/sidebar/style.scss +41 -6
  740. package/src/components/sidebar-dataviews/default-views.js +2 -2
  741. package/src/components/sidebar-dataviews/index.js +2 -2
  742. package/src/components/sidebar-edit-mode/default-sidebar.js +13 -6
  743. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +7 -3
  744. package/src/components/sidebar-edit-mode/index.js +39 -77
  745. package/src/components/sidebar-edit-mode/page-panels/index.js +52 -60
  746. package/src/components/sidebar-edit-mode/page-panels/page-content.js +10 -10
  747. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +20 -12
  748. package/src/components/sidebar-edit-mode/page-panels/style.scss +0 -6
  749. package/src/components/sidebar-edit-mode/settings-header/index.js +4 -5
  750. package/src/components/sidebar-edit-mode/style.scss +1 -1
  751. package/src/components/sidebar-edit-mode/template-panel/index.js +24 -34
  752. package/src/components/sidebar-edit-mode/template-panel/style.scss +1 -29
  753. package/src/components/sidebar-navigation-item/index.js +29 -0
  754. package/src/components/sidebar-navigation-screen/index.js +29 -12
  755. package/src/components/sidebar-navigation-screen/style.scss +13 -30
  756. package/src/components/sidebar-navigation-screen-details-footer/index.js +6 -2
  757. package/src/components/sidebar-navigation-screen-global-styles/index.js +9 -24
  758. package/src/components/sidebar-navigation-screen-main/index.js +11 -23
  759. package/src/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
  760. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +7 -6
  761. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  762. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +14 -14
  763. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  764. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +4 -5
  765. package/src/components/sidebar-navigation-screen-page/index.js +23 -13
  766. package/src/components/sidebar-navigation-screen-page/style.scss +8 -2
  767. package/src/components/sidebar-navigation-screen-pattern/index.js +9 -6
  768. package/src/components/sidebar-navigation-screen-patterns/index.js +70 -67
  769. package/src/components/sidebar-navigation-screen-patterns/style.scss +5 -0
  770. package/src/components/sidebar-navigation-screen-template/index.js +8 -12
  771. package/src/components/sidebar-navigation-screen-templates-browse/index.js +2 -7
  772. package/src/components/site-hub/index.js +80 -90
  773. package/src/components/site-hub/style.scss +14 -34
  774. package/src/components/style-book/index.js +1 -3
  775. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +52 -37
  776. package/src/components/template-actions/index.js +8 -11
  777. package/src/components/welcome-guide/style.scss +1 -1
  778. package/src/components/welcome-guide/styles.js +6 -5
  779. package/src/hooks/commands/use-edit-mode-commands.js +12 -33
  780. package/src/hooks/index.js +0 -1
  781. package/src/hooks/push-changes-to-global-styles/index.js +1 -40
  782. package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +4 -0
  783. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +5 -1
  784. package/src/index.js +9 -10
  785. package/src/store/actions.js +25 -141
  786. package/src/store/private-actions.js +0 -133
  787. package/src/store/selectors.js +3 -15
  788. package/src/store/test/actions.js +7 -2
  789. package/src/style.scss +0 -3
  790. package/src/utils/constants.js +1 -0
  791. package/src/utils/set-nested-value.js +39 -0
  792. package/build/components/actions/index.js +0 -319
  793. package/build/components/actions/index.js.map +0 -1
  794. package/build/components/add-new-template/new-template.js +0 -298
  795. package/build/components/add-new-template/new-template.js.map +0 -1
  796. package/build/components/add-new-template/template-actions-loading-screen.js +0 -27
  797. package/build/components/add-new-template/template-actions-loading-screen.js.map +0 -1
  798. package/build/components/header-edit-mode/plugin-more-menu-item/index.js +0 -78
  799. package/build/components/header-edit-mode/plugin-more-menu-item/index.js.map +0 -1
  800. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -71
  801. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +0 -1
  802. package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
  803. package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  804. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -48
  805. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  806. package/build/components/keyboard-shortcut-help-modal/index.js +0 -116
  807. package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  808. package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -54
  809. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  810. package/build/components/page-actions/index.js +0 -35
  811. package/build/components/page-actions/index.js.map +0 -1
  812. package/build/components/page-actions/trash-page-menu-item.js +0 -54
  813. package/build/components/page-actions/trash-page-menu-item.js.map +0 -1
  814. package/build/components/page-templates-template-parts/actions.js +0 -194
  815. package/build/components/page-templates-template-parts/actions.js.map +0 -1
  816. package/build/components/preferences-modal/index.js +0 -38
  817. package/build/components/preferences-modal/index.js.map +0 -1
  818. package/build/components/sidebar-edit-mode/constants.js +0 -9
  819. package/build/components/sidebar-edit-mode/constants.js.map +0 -1
  820. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -89
  821. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +0 -1
  822. package/build/components/sidebar-edit-mode/sidebar-card/index.js +0 -48
  823. package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
  824. package/build/components/sidebar-edit-mode/template-panel/template-areas.js +0 -70
  825. package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +0 -1
  826. package/build/components/sidebar-navigation-screen-navigation-item/index.js +0 -54
  827. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +0 -1
  828. package/build/components/sidebar-navigation-screen-pages/index.js +0 -175
  829. package/build/components/sidebar-navigation-screen-pages/index.js.map +0 -1
  830. package/build/components/sync-state-with-url/use-sync-path-with-url.js +0 -132
  831. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +0 -1
  832. package/build/components/template-actions/rename-menu-item.js.map +0 -1
  833. package/build/hooks/template-part-edit.js +0 -82
  834. package/build/hooks/template-part-edit.js.map +0 -1
  835. package/build/store/utils.js +0 -71
  836. package/build/store/utils.js.map +0 -1
  837. package/build-module/components/actions/index.js +0 -308
  838. package/build-module/components/actions/index.js.map +0 -1
  839. package/build-module/components/add-new-template/new-template.js +0 -290
  840. package/build-module/components/add-new-template/new-template.js.map +0 -1
  841. package/build-module/components/add-new-template/template-actions-loading-screen.js +0 -20
  842. package/build-module/components/add-new-template/template-actions-loading-screen.js.map +0 -1
  843. package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js +0 -73
  844. package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js.map +0 -1
  845. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -65
  846. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +0 -1
  847. package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
  848. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  849. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -40
  850. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  851. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -107
  852. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  853. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -47
  854. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  855. package/build-module/components/page-actions/index.js +0 -27
  856. package/build-module/components/page-actions/index.js.map +0 -1
  857. package/build-module/components/page-actions/trash-page-menu-item.js +0 -47
  858. package/build-module/components/page-actions/trash-page-menu-item.js.map +0 -1
  859. package/build-module/components/page-templates-template-parts/actions.js +0 -185
  860. package/build-module/components/page-templates-template-parts/actions.js.map +0 -1
  861. package/build-module/components/preferences-modal/index.js +0 -30
  862. package/build-module/components/preferences-modal/index.js.map +0 -1
  863. package/build-module/components/sidebar-edit-mode/constants.js +0 -3
  864. package/build-module/components/sidebar-edit-mode/constants.js.map +0 -1
  865. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -83
  866. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +0 -1
  867. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +0 -40
  868. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
  869. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js +0 -63
  870. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +0 -1
  871. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +0 -46
  872. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +0 -1
  873. package/build-module/components/sidebar-navigation-screen-pages/index.js +0 -167
  874. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +0 -1
  875. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +0 -124
  876. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +0 -1
  877. package/build-module/components/template-actions/rename-menu-item.js.map +0 -1
  878. package/build-module/hooks/template-part-edit.js +0 -75
  879. package/build-module/hooks/template-part-edit.js.map +0 -1
  880. package/build-module/store/utils.js +0 -64
  881. package/build-module/store/utils.js.map +0 -1
  882. package/src/components/actions/index.js +0 -409
  883. package/src/components/add-new-template/new-template.js +0 -429
  884. package/src/components/add-new-template/template-actions-loading-screen.js +0 -23
  885. package/src/components/header-edit-mode/plugin-more-menu-item/index.js +0 -73
  886. package/src/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -64
  887. package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
  888. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
  889. package/src/components/keyboard-shortcut-help-modal/index.js +0 -147
  890. package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -70
  891. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
  892. package/src/components/page-actions/index.js +0 -30
  893. package/src/components/page-actions/trash-page-menu-item.js +0 -63
  894. package/src/components/page-templates-template-parts/actions.js +0 -262
  895. package/src/components/preferences-modal/index.js +0 -29
  896. package/src/components/sidebar-edit-mode/constants.js +0 -2
  897. package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -80
  898. package/src/components/sidebar-edit-mode/sidebar-card/index.js +0 -53
  899. package/src/components/sidebar-edit-mode/sidebar-card/style.scss +0 -36
  900. package/src/components/sidebar-edit-mode/template-panel/template-areas.js +0 -86
  901. package/src/components/sidebar-navigation-screen-navigation-item/index.js +0 -59
  902. package/src/components/sidebar-navigation-screen-pages/index.js +0 -238
  903. package/src/components/sync-state-with-url/use-sync-path-with-url.js +0 -147
  904. package/src/hooks/template-part-edit.js +0 -89
  905. package/src/store/test/utils.js +0 -191
  906. package/src/store/utils.js +0 -69
@@ -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;A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rC,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,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"}
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;AACpC,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,YAAY;AACjC,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAiB,CAAC,GAAGD,MAAM,CAAEF,sBAAuB,CAAC;AAC7D,MAAMI,kBAAkB,GAAG;EAAEC,SAAS,EAAE,cAAc;EAAEC,MAAM,EAAE;AAAE,CAAC;AAEnE,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,eAAe,SAASC,oBAAoBA,CAAE;EAAEC;AAAK,CAAC,EAAG;EACxD,MAAM,CAAEC,cAAc,EAAEC,iBAAiB,CAAE,GAAGR,gBAAgB,CAC7D,uBAAuB,EACvBM,IACD,CAAC;EACD,MAAM,CAAEG,kBAAkB,CAAE,GAAGT,gBAAgB,CAC9C,uBAAuB,EACvBM,IAAI,EACJ,MACD,CAAC;EACD,MAAM,CAAEI,gBAAgB,EAAEC,mBAAmB,CAAE,GAAGX,gBAAgB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Stack","VStack","__experimentalSpacer","Spacer","__experimentalHeading","Heading","__experimentalView","View","__experimentalNavigatorToParentButton","NavigatorToParentButton","isRTL","__","chevronRight","chevronLeft","ScreenHeader","title","description","onBack","createElement","spacing","marginBottom","paddingX","paddingY","style","minWidth","padding","icon","size","label","onClick","className","level"],"sources":["@wordpress/edit-site/src/components/global-styles/header.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalHeading as Heading,\n\t__experimentalView as View,\n\t__experimentalNavigatorToParentButton as NavigatorToParentButton,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\n\nfunction ScreenHeader( { title, description, onBack } ) {\n\treturn (\n\t\t<VStack spacing={ 0 }>\n\t\t\t<View>\n\t\t\t\t<Spacer marginBottom={ 0 } paddingX={ 4 } paddingY={ 3 }>\n\t\t\t\t\t<HStack spacing={ 2 }>\n\t\t\t\t\t\t<NavigatorToParentButton\n\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t// TODO: This style override is also used in ToolsPanelHeader.\n\t\t\t\t\t\t\t\t// It should be supported out-of-the-box by Button.\n\t\t\t\t\t\t\t\t{ minWidth: 24, padding: 0 }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\tonClick={ onBack }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Spacer>\n\t\t\t\t\t\t\t<Heading\n\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-header\"\n\t\t\t\t\t\t\t\tlevel={ 2 }\n\t\t\t\t\t\t\t\tsize={ 13 }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t</HStack>\n\t\t\t\t</Spacer>\n\t\t\t</View>\n\t\t\t{ description && (\n\t\t\t\t<p className=\"edit-site-global-styles-header__description\">\n\t\t\t\t\t{ description }\n\t\t\t\t</p>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport default ScreenHeader;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,qBAAqB,IAAIC,OAAO,EAChCC,kBAAkB,IAAIC,IAAI,EAC1BC,qCAAqC,IAAIC,uBAAuB,QAC1D,uBAAuB;AAC9B,SAASC,KAAK,EAAEC,EAAE,QAAQ,iBAAiB;AAC3C,SAASC,YAAY,EAAEC,WAAW,QAAQ,kBAAkB;AAE5D,SAASC,YAAYA,CAAE;EAAEC,KAAK;EAAEC,WAAW;EAAEC;AAAO,CAAC,EAAG;EACvD,OACCC,aAAA,CAACjB,MAAM;IAACkB,OAAO,EAAG;EAAG,GACpBD,aAAA,CAACX,IAAI,QACJW,aAAA,CAACf,MAAM;IAACiB,YAAY,EAAG,CAAG;IAACC,QAAQ,EAAG,CAAG;IAACC,QAAQ,EAAG;EAAG,GACvDJ,aAAA,CAACnB,MAAM;IAACoB,OAAO,EAAG;EAAG,GACpBD,aAAA,CAACT,uBAAuB;IACvBc,KAAK;IACJ;IACA;IACA;MAAEC,QAAQ,EAAE,EAAE;MAAEC,OAAO,EAAE;IAAE,CAC3B;IACDC,IAAI,EAAGhB,KAAK,CAAC,CAAC,GAAGE,YAAY,GAAGC,WAAa;IAC7Cc,IAAI,EAAC,OAAO;IACZC,KAAK,EAAGjB,EAAE,CAAE,MAAO,CAAG;IACtBkB,OAAO,EAAGZ;EAAQ,CAClB,CAAC,EACFC,aAAA,CAACf,MAAM,QACNe,aAAA,CAACb,OAAO;IACPyB,SAAS,EAAC,gCAAgC;IAC1CC,KAAK,EAAG,CAAG;IACXJ,IAAI,EAAG;EAAI,GAETZ,KACM,CACF,CACD,CACD,CACH,CAAC,EACLC,WAAW,IACZE,aAAA;IAAGY,SAAS,EAAC;EAA6C,GACvDd,WACA,CAEG,CAAC;AAEX;AAEA,eAAeF,YAAY"}
1
+ {"version":3,"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalSpacer","Spacer","__experimentalHeading","Heading","__experimentalView","View","__experimentalNavigatorToParentButton","NavigatorToParentButton","isRTL","__","chevronRight","chevronLeft","ScreenHeader","title","description","onBack","createElement","spacing","marginBottom","paddingX","paddingY","style","minWidth","padding","icon","size","label","onClick","className","level"],"sources":["@wordpress/edit-site/src/components/global-styles/header.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalHeading as Heading,\n\t__experimentalView as View,\n\t__experimentalNavigatorToParentButton as NavigatorToParentButton,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\n\nfunction ScreenHeader( { title, description, onBack } ) {\n\treturn (\n\t\t<VStack spacing={ 0 }>\n\t\t\t<View>\n\t\t\t\t<Spacer marginBottom={ 0 } paddingX={ 4 } paddingY={ 3 }>\n\t\t\t\t\t<HStack spacing={ 2 }>\n\t\t\t\t\t\t<NavigatorToParentButton\n\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t// TODO: This style override is also used in ToolsPanelHeader.\n\t\t\t\t\t\t\t\t// It should be supported out-of-the-box by Button.\n\t\t\t\t\t\t\t\t{ minWidth: 24, padding: 0 }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\tonClick={ onBack }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Spacer>\n\t\t\t\t\t\t\t<Heading\n\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-header\"\n\t\t\t\t\t\t\t\tlevel={ 2 }\n\t\t\t\t\t\t\t\tsize={ 13 }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t</HStack>\n\t\t\t\t</Spacer>\n\t\t\t</View>\n\t\t\t{ description && (\n\t\t\t\t<p className=\"edit-site-global-styles-header__description\">\n\t\t\t\t\t{ description }\n\t\t\t\t</p>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport default ScreenHeader;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,qBAAqB,IAAIC,OAAO,EAChCC,kBAAkB,IAAIC,IAAI,EAC1BC,qCAAqC,IAAIC,uBAAuB,QAC1D,uBAAuB;AAC9B,SAASC,KAAK,EAAEC,EAAE,QAAQ,iBAAiB;AAC3C,SAASC,YAAY,EAAEC,WAAW,QAAQ,kBAAkB;AAE5D,SAASC,YAAYA,CAAE;EAAEC,KAAK;EAAEC,WAAW;EAAEC;AAAO,CAAC,EAAG;EACvD,OACCC,aAAA,CAACjB,MAAM;IAACkB,OAAO,EAAG;EAAG,GACpBD,aAAA,CAACX,IAAI,QACJW,aAAA,CAACf,MAAM;IAACiB,YAAY,EAAG,CAAG;IAACC,QAAQ,EAAG,CAAG;IAACC,QAAQ,EAAG;EAAG,GACvDJ,aAAA,CAACnB,MAAM;IAACoB,OAAO,EAAG;EAAG,GACpBD,aAAA,CAACT,uBAAuB;IACvBc,KAAK;IACJ;IACA;IACA;MAAEC,QAAQ,EAAE,EAAE;MAAEC,OAAO,EAAE;IAAE,CAC3B;IACDC,IAAI,EAAGhB,KAAK,CAAC,CAAC,GAAGE,YAAY,GAAGC,WAAa;IAC7Cc,IAAI,EAAC,OAAO;IACZC,KAAK,EAAGjB,EAAE,CAAE,MAAO,CAAG;IACtBkB,OAAO,EAAGZ;EAAQ,CAClB,CAAC,EACFC,aAAA,CAACf,MAAM,QACNe,aAAA,CAACb,OAAO;IACPyB,SAAS,EAAC,gCAAgC;IAC1CC,KAAK,EAAG,CAAG;IACXJ,IAAI,EAAG;EAAI,GAETZ,KACM,CACF,CACD,CACD,CACH,CAAC,EACLC,WAAW,IACZE,aAAA;IAAGY,SAAS,EAAC;EAA6C,GACvDd,WACA,CAEG,CAAC;AAEX;AAEA,eAAeF,YAAY","ignoreList":[]}
@@ -20,7 +20,7 @@ export default function HighlightedColors({
20
20
  slug,
21
21
  color
22
22
  }, index) => createElement(motion.div, {
23
- key: slug,
23
+ key: `${slug}-${index}`,
24
24
  style: {
25
25
  height: scaledSwatchSize,
26
26
  width: scaledSwatchSize,
@@ -1 +1 @@
1
- {"version":3,"names":["__unstableMotion","motion","useStylesPreviewColors","HighlightedColors","normalizedColorSwatchSize","ratio","highlightedColors","scaledSwatchSize","map","slug","color","index","createElement","div","key","style","height","width","background","borderRadius","animate","scale","opacity","initial","transition","delay"],"sources":["@wordpress/edit-site/src/components/global-styles/highlighted-colors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __unstableMotion as motion } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { useStylesPreviewColors } from './hooks';\n\nexport default function HighlightedColors( {\n\tnormalizedColorSwatchSize,\n\tratio,\n} ) {\n\tconst { highlightedColors } = useStylesPreviewColors();\n\tconst scaledSwatchSize = normalizedColorSwatchSize * ratio;\n\treturn highlightedColors.map( ( { slug, color }, index ) => (\n\t\t<motion.div\n\t\t\tkey={ slug }\n\t\t\tstyle={ {\n\t\t\t\theight: scaledSwatchSize,\n\t\t\t\twidth: scaledSwatchSize,\n\t\t\t\tbackground: color,\n\t\t\t\tborderRadius: scaledSwatchSize / 2,\n\t\t\t} }\n\t\t\tanimate={ {\n\t\t\t\tscale: 1,\n\t\t\t\topacity: 1,\n\t\t\t} }\n\t\t\tinitial={ {\n\t\t\t\tscale: 0.1,\n\t\t\t\topacity: 0,\n\t\t\t} }\n\t\t\ttransition={ {\n\t\t\t\tdelay: index === 1 ? 0.2 : 0.1,\n\t\t\t} }\n\t\t/>\n\t) );\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,gBAAgB,IAAIC,MAAM,QAAQ,uBAAuB;;AAElE;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,SAAS;AAEhD,eAAe,SAASC,iBAAiBA,CAAE;EAC1CC,yBAAyB;EACzBC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC;EAAkB,CAAC,GAAGJ,sBAAsB,CAAC,CAAC;EACtD,MAAMK,gBAAgB,GAAGH,yBAAyB,GAAGC,KAAK;EAC1D,OAAOC,iBAAiB,CAACE,GAAG,CAAE,CAAE;IAAEC,IAAI;IAAEC;EAAM,CAAC,EAAEC,KAAK,KACrDC,aAAA,CAACX,MAAM,CAACY,GAAG;IACVC,GAAG,EAAGL,IAAM;IACZM,KAAK,EAAG;MACPC,MAAM,EAAET,gBAAgB;MACxBU,KAAK,EAAEV,gBAAgB;MACvBW,UAAU,EAAER,KAAK;MACjBS,YAAY,EAAEZ,gBAAgB,GAAG;IAClC,CAAG;IACHa,OAAO,EAAG;MACTC,KAAK,EAAE,CAAC;MACRC,OAAO,EAAE;IACV,CAAG;IACHC,OAAO,EAAG;MACTF,KAAK,EAAE,GAAG;MACVC,OAAO,EAAE;IACV,CAAG;IACHE,UAAU,EAAG;MACZC,KAAK,EAAEd,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG;IAC5B;EAAG,CACH,CACA,CAAC;AACJ"}
1
+ {"version":3,"names":["__unstableMotion","motion","useStylesPreviewColors","HighlightedColors","normalizedColorSwatchSize","ratio","highlightedColors","scaledSwatchSize","map","slug","color","index","createElement","div","key","style","height","width","background","borderRadius","animate","scale","opacity","initial","transition","delay"],"sources":["@wordpress/edit-site/src/components/global-styles/highlighted-colors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __unstableMotion as motion } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { useStylesPreviewColors } from './hooks';\n\nexport default function HighlightedColors( {\n\tnormalizedColorSwatchSize,\n\tratio,\n} ) {\n\tconst { highlightedColors } = useStylesPreviewColors();\n\tconst scaledSwatchSize = normalizedColorSwatchSize * ratio;\n\treturn highlightedColors.map( ( { slug, color }, index ) => (\n\t\t<motion.div\n\t\t\tkey={ `${ slug }-${ index }` }\n\t\t\tstyle={ {\n\t\t\t\theight: scaledSwatchSize,\n\t\t\t\twidth: scaledSwatchSize,\n\t\t\t\tbackground: color,\n\t\t\t\tborderRadius: scaledSwatchSize / 2,\n\t\t\t} }\n\t\t\tanimate={ {\n\t\t\t\tscale: 1,\n\t\t\t\topacity: 1,\n\t\t\t} }\n\t\t\tinitial={ {\n\t\t\t\tscale: 0.1,\n\t\t\t\topacity: 0,\n\t\t\t} }\n\t\t\ttransition={ {\n\t\t\t\tdelay: index === 1 ? 0.2 : 0.1,\n\t\t\t} }\n\t\t/>\n\t) );\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,gBAAgB,IAAIC,MAAM,QAAQ,uBAAuB;;AAElE;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,SAAS;AAEhD,eAAe,SAASC,iBAAiBA,CAAE;EAC1CC,yBAAyB;EACzBC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC;EAAkB,CAAC,GAAGJ,sBAAsB,CAAC,CAAC;EACtD,MAAMK,gBAAgB,GAAGH,yBAAyB,GAAGC,KAAK;EAC1D,OAAOC,iBAAiB,CAACE,GAAG,CAAE,CAAE;IAAEC,IAAI;IAAEC;EAAM,CAAC,EAAEC,KAAK,KACrDC,aAAA,CAACX,MAAM,CAACY,GAAG;IACVC,GAAG,EAAI,GAAGL,IAAM,IAAIE,KAAO,EAAG;IAC9BI,KAAK,EAAG;MACPC,MAAM,EAAET,gBAAgB;MACxBU,KAAK,EAAEV,gBAAgB;MACvBW,UAAU,EAAER,KAAK;MACjBS,YAAY,EAAEZ,gBAAgB,GAAG;IAClC,CAAG;IACHa,OAAO,EAAG;MACTC,KAAK,EAAE,CAAC;MACRC,OAAO,EAAE;IACV,CAAG;IACHC,OAAO,EAAG;MACTF,KAAK,EAAE,GAAG;MACVC,OAAO,EAAE;IACV,CAAG;IACHE,UAAU,EAAG;MACZC,KAAK,EAAEd,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG;IAC5B;EAAG,CACH,CACA,CAAC;AACJ","ignoreList":[]}
@@ -53,15 +53,23 @@ export function useStylesPreviewColors() {
53
53
  const [textColor = 'black'] = useGlobalStyle('color.text');
54
54
  const [backgroundColor = 'white'] = useGlobalStyle('color.background');
55
55
  const [headingColor = textColor] = useGlobalStyle('elements.h1.color.text');
56
+ const [linkColor = headingColor] = useGlobalStyle('elements.link.color.text');
57
+ const [buttonBackgroundColor = linkColor] = useGlobalStyle('elements.button.color.background');
56
58
  const [coreColors] = useGlobalSetting('color.palette.core');
57
59
  const [themeColors] = useGlobalSetting('color.palette.theme');
58
60
  const [customColors] = useGlobalSetting('color.palette.custom');
59
61
  const paletteColors = (themeColors !== null && themeColors !== void 0 ? themeColors : []).concat(customColors !== null && customColors !== void 0 ? customColors : []).concat(coreColors !== null && coreColors !== void 0 ? coreColors : []);
60
- const highlightedColors = paletteColors.filter(
61
- // we exclude these two colors because they are already visible in the preview.
62
+ const textColorObject = paletteColors.filter(({
63
+ color
64
+ }) => color === textColor);
65
+ const buttonBackgroundColorObject = paletteColors.filter(({
66
+ color
67
+ }) => color === buttonBackgroundColor);
68
+ const highlightedColors = textColorObject.concat(buttonBackgroundColorObject).concat(paletteColors).filter(
69
+ // we exclude these background color because it is already visible in the preview.
62
70
  ({
63
71
  color
64
- }) => color !== backgroundColor && color !== headingColor).slice(0, 2);
72
+ }) => color !== backgroundColor).slice(0, 2);
65
73
  return {
66
74
  paletteColors,
67
75
  highlightedColors
@@ -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","coreColors","customColors","paletteColors","concat","highlightedColors","filter","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 [ 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\tconst highlightedColors = paletteColors\n\t\t.filter(\n\t\t\t// we exclude these two colors because they are already visible in the preview.\n\t\t\t( { color } ) => color !== backgroundColor && color !== headingColor\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;\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G,CACD,GAAGE,iBAAiB,EAAElD,IAAM,IAAIiD,cAAc,EAAEjD,IAAM,EAAC,CACxD,GAAGqC,SAAS;IACd,CAAC,MAAM,IACNa,iBAAiB,EAAElD,IAAI,IACvBiD,cAAc,EAAEjD,IAAI,IACpB,CAAEgD,GAAG,CACH,GAAGE,iBAAiB,EAAElD,IAAM,IAAIiD,cAAc,EAAEjD,IAAM,EAAC,CACxD,EACA;MACDgD,GAAG,CACD,GAAGE,iBAAiB,EAAElD,IAAM,IAAIiD,cAAc,EAAEjD,IAAM,EAAC,CACxD,GAAGqC,SAAS;IACd;IACA,OAAOW,GAAG;EACX,CAAC,EAAE,CAAC,CAAE,CACN,CAAC,GACD,EAAE;AACN"}
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;EAAE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AAiB,EAAEtD,IAAI,IACvBqD,cAAc,EAAErD,IAAI,IACpB,CAAEoD,GAAG,CACH,GAAGE,iBAAiB,EAAEtD,IAAM,IAAIqD,cAAc,EAAErD,IAAM,EAAC,CACxD,EACA;MACDoD,GAAG,CACD,GAAGE,iBAAiB,EAAEtD,IAAM,IAAIqD,cAAc,EAAErD,IAAM,EAAC,CACxD,GAAGyC,SAAS;IACd;IACA,OAAOW,GAAG;EACX,CAAC,EAAE,CAAC,CAAE,CACN,CAAC,GACD,EAAE;AACN","ignoreList":[]}
@@ -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"}
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 +1 @@
1
- {"version":3,"names":["default","GlobalStylesUI"],"sources":["@wordpress/edit-site/src/components/global-styles/index.js"],"sourcesContent":["export { default as GlobalStylesUI } from './ui';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,cAAc,QAAQ,MAAM"}
1
+ {"version":3,"names":["default","GlobalStylesUI"],"sources":["@wordpress/edit-site/src/components/global-styles/index.js"],"sourcesContent":["export { default as GlobalStylesUI } from './ui';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,cAAc,QAAQ,MAAM","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalNavigatorButton","NavigatorButton","__experimentalNavigatorToParentButton","NavigatorToParentButton","__experimentalItem","Item","FlexItem","__experimentalHStack","HStack","IconWithCurrentColor","GenericNavigationButton","icon","children","props","createElement","justify","size","NavigationButtonAsItem","as","NavigationBackButtonAsItem"],"sources":["@wordpress/edit-site/src/components/global-styles/navigation-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorButton as NavigatorButton,\n\t__experimentalNavigatorToParentButton as NavigatorToParentButton,\n\t__experimentalItem as Item,\n\tFlexItem,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { IconWithCurrentColor } from './icon-with-current-color';\n\nfunction GenericNavigationButton( { icon, children, ...props } ) {\n\treturn (\n\t\t<Item { ...props }>\n\t\t\t{ icon && (\n\t\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t\t<IconWithCurrentColor icon={ icon } size={ 24 } />\n\t\t\t\t\t<FlexItem>{ children }</FlexItem>\n\t\t\t\t</HStack>\n\t\t\t) }\n\t\t\t{ ! icon && children }\n\t\t</Item>\n\t);\n}\n\nfunction NavigationButtonAsItem( props ) {\n\treturn <NavigatorButton as={ GenericNavigationButton } { ...props } />;\n}\n\nfunction NavigationBackButtonAsItem( props ) {\n\treturn (\n\t\t<NavigatorToParentButton as={ GenericNavigationButton } { ...props } />\n\t);\n}\n\nexport { NavigationButtonAsItem, NavigationBackButtonAsItem };\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,6BAA6B,IAAIC,eAAe,EAChDC,qCAAqC,IAAIC,uBAAuB,EAChEC,kBAAkB,IAAIC,IAAI,EAC1BC,QAAQ,EACRC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;;AAE9B;AACA;AACA;AACA,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE,SAASC,uBAAuBA,CAAE;EAAEC,IAAI;EAAEC,QAAQ;EAAE,GAAGC;AAAM,CAAC,EAAG;EAChE,OACCC,aAAA,CAACT,IAAI;IAAA,GAAMQ;EAAK,GACbF,IAAI,IACLG,aAAA,CAACN,MAAM;IAACO,OAAO,EAAC;EAAY,GAC3BD,aAAA,CAACL,oBAAoB;IAACE,IAAI,EAAGA,IAAM;IAACK,IAAI,EAAG;EAAI,CAAE,CAAC,EAClDF,aAAA,CAACR,QAAQ,QAAGM,QAAoB,CACzB,CACR,EACC,CAAED,IAAI,IAAIC,QACP,CAAC;AAET;AAEA,SAASK,sBAAsBA,CAAEJ,KAAK,EAAG;EACxC,OAAOC,aAAA,CAACb,eAAe;IAACiB,EAAE,EAAGR,uBAAyB;IAAA,GAAMG;EAAK,CAAI,CAAC;AACvE;AAEA,SAASM,0BAA0BA,CAAEN,KAAK,EAAG;EAC5C,OACCC,aAAA,CAACX,uBAAuB;IAACe,EAAE,EAAGR,uBAAyB;IAAA,GAAMG;EAAK,CAAI,CAAC;AAEzE;AAEA,SAASI,sBAAsB,EAAEE,0BAA0B"}
1
+ {"version":3,"names":["__experimentalNavigatorButton","NavigatorButton","__experimentalNavigatorToParentButton","NavigatorToParentButton","__experimentalItem","Item","FlexItem","__experimentalHStack","HStack","IconWithCurrentColor","GenericNavigationButton","icon","children","props","createElement","justify","size","NavigationButtonAsItem","as","NavigationBackButtonAsItem"],"sources":["@wordpress/edit-site/src/components/global-styles/navigation-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorButton as NavigatorButton,\n\t__experimentalNavigatorToParentButton as NavigatorToParentButton,\n\t__experimentalItem as Item,\n\tFlexItem,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { IconWithCurrentColor } from './icon-with-current-color';\n\nfunction GenericNavigationButton( { icon, children, ...props } ) {\n\treturn (\n\t\t<Item { ...props }>\n\t\t\t{ icon && (\n\t\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t\t<IconWithCurrentColor icon={ icon } size={ 24 } />\n\t\t\t\t\t<FlexItem>{ children }</FlexItem>\n\t\t\t\t</HStack>\n\t\t\t) }\n\t\t\t{ ! icon && children }\n\t\t</Item>\n\t);\n}\n\nfunction NavigationButtonAsItem( props ) {\n\treturn <NavigatorButton as={ GenericNavigationButton } { ...props } />;\n}\n\nfunction NavigationBackButtonAsItem( props ) {\n\treturn (\n\t\t<NavigatorToParentButton as={ GenericNavigationButton } { ...props } />\n\t);\n}\n\nexport { NavigationButtonAsItem, NavigationBackButtonAsItem };\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,6BAA6B,IAAIC,eAAe,EAChDC,qCAAqC,IAAIC,uBAAuB,EAChEC,kBAAkB,IAAIC,IAAI,EAC1BC,QAAQ,EACRC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;;AAE9B;AACA;AACA;AACA,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE,SAASC,uBAAuBA,CAAE;EAAEC,IAAI;EAAEC,QAAQ;EAAE,GAAGC;AAAM,CAAC,EAAG;EAChE,OACCC,aAAA,CAACT,IAAI;IAAA,GAAMQ;EAAK,GACbF,IAAI,IACLG,aAAA,CAACN,MAAM;IAACO,OAAO,EAAC;EAAY,GAC3BD,aAAA,CAACL,oBAAoB;IAACE,IAAI,EAAGA,IAAM;IAACK,IAAI,EAAG;EAAI,CAAE,CAAC,EAClDF,aAAA,CAACR,QAAQ,QAAGM,QAAoB,CACzB,CACR,EACC,CAAED,IAAI,IAAIC,QACP,CAAC;AAET;AAEA,SAASK,sBAAsBA,CAAEJ,KAAK,EAAG;EACxC,OAAOC,aAAA,CAACb,eAAe;IAACiB,EAAE,EAAGR,uBAAyB;IAAA,GAAMG;EAAK,CAAI,CAAC;AACvE;AAEA,SAASM,0BAA0BA,CAAEN,KAAK,EAAG;EAC5C,OACCC,aAAA,CAACX,uBAAuB;IAACe,EAAE,EAAGR,uBAAyB;IAAA,GAAMG;EAAK,CAAI,CAAC;AAEzE;AAEA,SAASI,sBAAsB,EAAEE,0BAA0B","ignoreList":[]}
@@ -54,7 +54,9 @@ function Palette({
54
54
  key: `${color}-${index}`
55
55
  }, createElement(ColorIndicator, {
56
56
  colorValue: color
57
- })))), createElement(FlexItem, null, paletteButtonText)))), window.__experimentalEnableColorRandomizer && themeColors?.length > 0 && createElement(Button, {
57
+ })))), createElement(FlexItem, {
58
+ className: "edit-site-global-styles-screen-colors__palette-count"
59
+ }, paletteButtonText)))), window.__experimentalEnableColorRandomizer && themeColors?.length > 0 && createElement(Button, {
58
60
  variant: "secondary",
59
61
  icon: shuffle,
60
62
  onClick: randomizeThemeColors
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalItemGroup","ItemGroup","FlexItem","__experimentalHStack","HStack","__experimentalZStack","ZStack","__experimentalVStack","VStack","ColorIndicator","Button","__","_n","sprintf","shuffle","useMemo","privateApis","blockEditorPrivateApis","Subtitle","NavigationButtonAsItem","useColorRandomizer","ColorIndicatorWrapper","unlock","useGlobalSetting","EMPTY_COLORS","Palette","name","customColors","themeColors","defaultColors","defaultPaletteEnabled","randomizeThemeColors","colors","screenPath","encodeURIComponent","paletteButtonText","length","createElement","spacing","level","isBordered","isSeparated","path","direction","isLayered","offset","slice","map","color","index","key","colorValue","window","__experimentalEnableColorRandomizer","variant","icon","onClick"],"sources":["@wordpress/edit-site/src/components/global-styles/palette.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tFlexItem,\n\t__experimentalHStack as HStack,\n\t__experimentalZStack as ZStack,\n\t__experimentalVStack as VStack,\n\tColorIndicator,\n\tButton,\n} from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { shuffle } from '@wordpress/icons';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport Subtitle from './subtitle';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { useColorRandomizer } from './hooks';\nimport ColorIndicatorWrapper from './color-indicator-wrapper';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\nconst EMPTY_COLORS = [];\n\nfunction Palette( { name } ) {\n\tconst [ customColors ] = useGlobalSetting( 'color.palette.custom' );\n\tconst [ themeColors ] = useGlobalSetting( 'color.palette.theme' );\n\tconst [ defaultColors ] = useGlobalSetting( 'color.palette.default' );\n\n\tconst [ defaultPaletteEnabled ] = useGlobalSetting(\n\t\t'color.defaultPalette',\n\t\tname\n\t);\n\n\tconst [ randomizeThemeColors ] = useColorRandomizer();\n\n\tconst colors = useMemo(\n\t\t() => [\n\t\t\t...( customColors || EMPTY_COLORS ),\n\t\t\t...( themeColors || EMPTY_COLORS ),\n\t\t\t...( defaultColors && defaultPaletteEnabled\n\t\t\t\t? defaultColors\n\t\t\t\t: EMPTY_COLORS ),\n\t\t],\n\t\t[ customColors, themeColors, defaultColors, defaultPaletteEnabled ]\n\t);\n\n\tconst screenPath = ! name\n\t\t? '/colors/palette'\n\t\t: '/blocks/' + encodeURIComponent( name ) + '/colors/palette';\n\tconst paletteButtonText =\n\t\tcolors.length > 0\n\t\t\t? sprintf(\n\t\t\t\t\t// Translators: %d: Number of palette colors.\n\t\t\t\t\t_n( '%d color', '%d colors', colors.length ),\n\t\t\t\t\tcolors.length\n\t\t\t )\n\t\t\t: __( 'Add custom colors' );\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<Subtitle level={ 3 }>{ __( 'Palette' ) }</Subtitle>\n\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\tpath={ screenPath }\n\t\t\t\t\taria-label={ __( 'Color palettes' ) }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tdirection={\n\t\t\t\t\t\t\tcolors.length === 0 ? 'row-reverse' : 'row'\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ZStack isLayered={ false } offset={ -8 }>\n\t\t\t\t\t\t\t{ colors\n\t\t\t\t\t\t\t\t.slice( 0, 5 )\n\t\t\t\t\t\t\t\t.map( ( { color }, index ) => (\n\t\t\t\t\t\t\t\t\t<ColorIndicatorWrapper\n\t\t\t\t\t\t\t\t\t\tkey={ `${ color }-${ index }` }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<ColorIndicator colorValue={ color } />\n\t\t\t\t\t\t\t\t\t</ColorIndicatorWrapper>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</ZStack>\n\t\t\t\t\t\t<FlexItem>{ paletteButtonText }</FlexItem>\n\t\t\t\t\t</HStack>\n\t\t\t\t</NavigationButtonAsItem>\n\t\t\t</ItemGroup>\n\t\t\t{ window.__experimentalEnableColorRandomizer &&\n\t\t\t\tthemeColors?.length > 0 && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\ticon={ shuffle }\n\t\t\t\t\t\tonClick={ randomizeThemeColors }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Randomize colors' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport default Palette;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAAS,EACpCC,QAAQ,EACRC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,cAAc,EACdC,MAAM,QACA,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,YAAY;AACjC,SAASC,sBAAsB,QAAQ,qBAAqB;AAC5D,SAASC,kBAAkB,QAAQ,SAAS;AAC5C,OAAOC,qBAAqB,MAAM,2BAA2B;AAC7D,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAiB,CAAC,GAAGD,MAAM,CAAEL,sBAAuB,CAAC;AAE7D,MAAMO,YAAY,GAAG,EAAE;AAEvB,SAASC,OAAOA,CAAE;EAAEC;AAAK,CAAC,EAAG;EAC5B,MAAM,CAAEC,YAAY,CAAE,GAAGJ,gBAAgB,CAAE,sBAAuB,CAAC;EACnE,MAAM,CAAEK,WAAW,CAAE,GAAGL,gBAAgB,CAAE,qBAAsB,CA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AC/B,MAAM;IAACsC,SAAS,EAAG,KAAO;IAACC,MAAM,EAAG,CAAC;EAAG,GACtCb,MAAM,CACNc,KAAK,CAAE,CAAC,EAAE,CAAE,CAAC,CACbC,GAAG,CAAE,CAAE;IAAEC;EAAM,CAAC,EAAEC,KAAK,KACvBZ,aAAA,CAAChB,qBAAqB;IACrB6B,GAAG,EAAI,GAAGF,KAAO,IAAIC,KAAO;EAAG,GAE/BZ,aAAA,CAAC5B,cAAc;IAAC0C,UAAU,EAAGH;EAAO,CAAE,CAChB,CACtB,CACI,CAAC,EACTX,aAAA,CAACnC,QAAQ,QAAGiC,iBAA6B,CAClC,CACe,CACd,CAAC,EACViB,MAAM,CAACC,mCAAmC,IAC3CzB,WAAW,EAAEQ,MAAM,GAAG,CAAC,IACtBC,aAAA,CAAC3B,MAAM;IACN4C,OAAO,EAAC,WAAW;IACnBC,IAAI,EAAGzC,OAAS;IAChB0C,OAAO,EAAGzB;EAAsB,GAE9BpB,EAAE,CAAE,kBAAmB,CAClB,CAEH,CAAC;AAEX;AAEA,eAAec,OAAO"}
1
+ {"version":3,"names":["__experimentalItemGroup","ItemGroup","FlexItem","__experimentalHStack","HStack","__experimentalZStack","ZStack","__experimentalVStack","VStack","ColorIndicator","Button","__","_n","sprintf","shuffle","useMemo","privateApis","blockEditorPrivateApis","Subtitle","NavigationButtonAsItem","useColorRandomizer","ColorIndicatorWrapper","unlock","useGlobalSetting","EMPTY_COLORS","Palette","name","customColors","themeColors","defaultColors","defaultPaletteEnabled","randomizeThemeColors","colors","screenPath","encodeURIComponent","paletteButtonText","length","createElement","spacing","level","isBordered","isSeparated","path","direction","isLayered","offset","slice","map","color","index","key","colorValue","className","window","__experimentalEnableColorRandomizer","variant","icon","onClick"],"sources":["@wordpress/edit-site/src/components/global-styles/palette.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tFlexItem,\n\t__experimentalHStack as HStack,\n\t__experimentalZStack as ZStack,\n\t__experimentalVStack as VStack,\n\tColorIndicator,\n\tButton,\n} from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { shuffle } from '@wordpress/icons';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport Subtitle from './subtitle';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { useColorRandomizer } from './hooks';\nimport ColorIndicatorWrapper from './color-indicator-wrapper';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\nconst EMPTY_COLORS = [];\n\nfunction Palette( { name } ) {\n\tconst [ customColors ] = useGlobalSetting( 'color.palette.custom' );\n\tconst [ themeColors ] = useGlobalSetting( 'color.palette.theme' );\n\tconst [ defaultColors ] = useGlobalSetting( 'color.palette.default' );\n\n\tconst [ defaultPaletteEnabled ] = useGlobalSetting(\n\t\t'color.defaultPalette',\n\t\tname\n\t);\n\n\tconst [ randomizeThemeColors ] = useColorRandomizer();\n\n\tconst colors = useMemo(\n\t\t() => [\n\t\t\t...( customColors || EMPTY_COLORS ),\n\t\t\t...( themeColors || EMPTY_COLORS ),\n\t\t\t...( defaultColors && defaultPaletteEnabled\n\t\t\t\t? defaultColors\n\t\t\t\t: EMPTY_COLORS ),\n\t\t],\n\t\t[ customColors, themeColors, defaultColors, defaultPaletteEnabled ]\n\t);\n\n\tconst screenPath = ! name\n\t\t? '/colors/palette'\n\t\t: '/blocks/' + encodeURIComponent( name ) + '/colors/palette';\n\tconst paletteButtonText =\n\t\tcolors.length > 0\n\t\t\t? sprintf(\n\t\t\t\t\t// Translators: %d: Number of palette colors.\n\t\t\t\t\t_n( '%d color', '%d colors', colors.length ),\n\t\t\t\t\tcolors.length\n\t\t\t )\n\t\t\t: __( 'Add custom colors' );\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<Subtitle level={ 3 }>{ __( 'Palette' ) }</Subtitle>\n\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\tpath={ screenPath }\n\t\t\t\t\taria-label={ __( 'Color palettes' ) }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tdirection={\n\t\t\t\t\t\t\tcolors.length === 0 ? 'row-reverse' : 'row'\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ZStack isLayered={ false } offset={ -8 }>\n\t\t\t\t\t\t\t{ colors\n\t\t\t\t\t\t\t\t.slice( 0, 5 )\n\t\t\t\t\t\t\t\t.map( ( { color }, index ) => (\n\t\t\t\t\t\t\t\t\t<ColorIndicatorWrapper\n\t\t\t\t\t\t\t\t\t\tkey={ `${ color }-${ index }` }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<ColorIndicator colorValue={ color } />\n\t\t\t\t\t\t\t\t\t</ColorIndicatorWrapper>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</ZStack>\n\t\t\t\t\t\t<FlexItem className=\"edit-site-global-styles-screen-colors__palette-count\">\n\t\t\t\t\t\t\t{ paletteButtonText }\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t</HStack>\n\t\t\t\t</NavigationButtonAsItem>\n\t\t\t</ItemGroup>\n\t\t\t{ window.__experimentalEnableColorRandomizer &&\n\t\t\t\tthemeColors?.length > 0 && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\ticon={ shuffle }\n\t\t\t\t\t\tonClick={ randomizeThemeColors }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Randomize colors' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport default Palette;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAAS,EACpCC,QAAQ,EACRC,oBAAoB,IAAIC,MAAM,EAC9BC,oB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EQ,MAAM,GAAG,CAAC,IACtBC,aAAA,CAAC3B,MAAM;IACN6C,OAAO,EAAC,WAAW;IACnBC,IAAI,EAAG1C,OAAS;IAChB2C,OAAO,EAAG1B;EAAsB,GAE9BpB,EAAE,CAAE,kBAAmB,CAClB,CAEH,CAAC;AAEX;AAEA,eAAec,OAAO","ignoreList":[]}
@@ -39,14 +39,14 @@ const StylesPreviewColors = ({
39
39
  overflow: 'hidden'
40
40
  }
41
41
  }, createElement(HStack, {
42
- spacing: 10 * ratio,
42
+ spacing: 5 * ratio,
43
43
  justify: "center",
44
44
  style: {
45
45
  height: '100%',
46
46
  overflow: 'hidden'
47
47
  }
48
48
  }, createElement(HighlightedColors, {
49
- normalizedColorSwatchSize: 66,
49
+ normalizedColorSwatchSize: 56,
50
50
  ratio: ratio
51
51
  }))));
52
52
  };
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalHStack","HStack","__unstableMotion","motion","HighlightedColors","PreviewIframe","firstFrameVariants","start","scale","opacity","hover","StylesPreviewColors","label","isFocused","withHoverView","createElement","ratio","key","div","variants","style","height","overflow","spacing","justify","normalizedColorSwatchSize"],"sources":["@wordpress/edit-site/src/components/global-styles/preview-colors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport HighlightedColors from './highlighted-colors';\nimport PreviewIframe from './preview-iframe';\n\nconst firstFrameVariants = {\n\tstart: {\n\t\tscale: 1,\n\t\topacity: 1,\n\t},\n\thover: {\n\t\tscale: 0,\n\t\topacity: 0,\n\t},\n};\n\nconst StylesPreviewColors = ( { label, isFocused, withHoverView } ) => {\n\treturn (\n\t\t<PreviewIframe\n\t\t\tlabel={ label }\n\t\t\tisFocused={ isFocused }\n\t\t\twithHoverView={ withHoverView }\n\t\t>\n\t\t\t{ ( { ratio, key } ) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvariants={ firstFrameVariants }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tspacing={ 10 * ratio }\n\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<HighlightedColors\n\t\t\t\t\t\t\tnormalizedColorSwatchSize={ 66 }\n\t\t\t\t\t\t\tratio={ ratio }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</HStack>\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t</PreviewIframe>\n\t);\n};\n\nexport default StylesPreviewColors;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MAAM,EAC9BC,gBAAgB,IAAIC,MAAM,QACpB,uBAAuB;;AAE9B;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,sBAAsB;AACpD,OAAOC,aAAa,MAAM,kBAAkB;AAE5C,MAAMC,kBAAkB,GAAG;EAC1BC,KAAK,EAAE;IACNC,KAAK,EAAE,CAAC;IACRC,OAAO,EAAE;EACV,CAAC;EACDC,KAAK,EAAE;IACNF,KAAK,EAAE,CAAC;IACRC,OAAO,EAAE;EACV;AACD,CAAC;AAED,MAAME,mBAAmB,GAAGA,CAAE;EAAEC,KAAK;EAAEC,SAAS;EAAEC;AAAc,CAAC,KAAM;EACtE,OACCC,aAAA,CAACV,aAAa;IACbO,KAAK,EAAGA,KAAO;IACfC,SAAS,EAAGA,SAAW;IACvBC,aAAa,EAAGA;EAAe,GAE7B,CAAE;IAAEE,KAAK;IAAEC;EAAI,CAAC,KACjBF,aAAA,CAACZ,MAAM,CAACe,GAAG;IACVD,GAAG,EAAGA,GAAK;IACXE,QAAQ,EAAGb,kBAAoB;IAC/Bc,KAAK,EAAG;MACPC,MAAM,EAAE,MAAM;MACdC,QAAQ,EAAE;IACX;EAAG,GAEHP,aAAA,CAACd,MAAM;IACNsB,OAAO,EAAG,EAAE,GAAGP,KAAO;IACtBQ,OAAO,EAAC,QAAQ;IAChBJ,KAAK,EAAG;MACPC,MAAM,EAAE,MAAM;MACdC,QAAQ,EAAE;IACX;EAAG,GAEHP,aAAA,CAACX,iBAAiB;IACjBqB,yBAAyB,EAAG,EAAI;IAChCT,KAAK,EAAGA;EAAO,CACf,CACM,CACG,CAEC,CAAC;AAElB,CAAC;AAED,eAAeL,mBAAmB"}
1
+ {"version":3,"names":["__experimentalHStack","HStack","__unstableMotion","motion","HighlightedColors","PreviewIframe","firstFrameVariants","start","scale","opacity","hover","StylesPreviewColors","label","isFocused","withHoverView","createElement","ratio","key","div","variants","style","height","overflow","spacing","justify","normalizedColorSwatchSize"],"sources":["@wordpress/edit-site/src/components/global-styles/preview-colors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport HighlightedColors from './highlighted-colors';\nimport PreviewIframe from './preview-iframe';\n\nconst firstFrameVariants = {\n\tstart: {\n\t\tscale: 1,\n\t\topacity: 1,\n\t},\n\thover: {\n\t\tscale: 0,\n\t\topacity: 0,\n\t},\n};\n\nconst StylesPreviewColors = ( { label, isFocused, withHoverView } ) => {\n\treturn (\n\t\t<PreviewIframe\n\t\t\tlabel={ label }\n\t\t\tisFocused={ isFocused }\n\t\t\twithHoverView={ withHoverView }\n\t\t>\n\t\t\t{ ( { ratio, key } ) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvariants={ firstFrameVariants }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tspacing={ 5 * ratio }\n\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<HighlightedColors\n\t\t\t\t\t\t\tnormalizedColorSwatchSize={ 56 }\n\t\t\t\t\t\t\tratio={ ratio }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</HStack>\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t</PreviewIframe>\n\t);\n};\n\nexport default StylesPreviewColors;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MAAM,EAC9BC,gBAAgB,IAAIC,MAAM,QACpB,uBAAuB;;AAE9B;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,sBAAsB;AACpD,OAAOC,aAAa,MAAM,kBAAkB;AAE5C,MAAMC,kBAAkB,GAAG;EAC1BC,KAAK,EAAE;IACNC,KAAK,EAAE,CAAC;IACRC,OAAO,EAAE;EACV,CAAC;EACDC,KAAK,EAAE;IACNF,KAAK,EAAE,CAAC;IACRC,OAAO,EAAE;EACV;AACD,CAAC;AAED,MAAME,mBAAmB,GAAGA,CAAE;EAAEC,KAAK;EAAEC,SAAS;EAAEC;AAAc,CAAC,KAAM;EACtE,OACCC,aAAA,CAACV,aAAa;IACbO,KAAK,EAAGA,KAAO;IACfC,SAAS,EAAGA,SAAW;IACvBC,aAAa,EAAGA;EAAe,GAE7B,CAAE;IAAEE,KAAK;IAAEC;EAAI,CAAC,KACjBF,aAAA,CAACZ,MAAM,CAACe,GAAG;IACVD,GAAG,EAAGA,GAAK;IACXE,QAAQ,EAAGb,kBAAoB;IAC/Bc,KAAK,EAAG;MACPC,MAAM,EAAE,MAAM;MACdC,QAAQ,EAAE;IACX;EAAG,GAEHP,aAAA,CAACd,MAAM;IACNsB,OAAO,EAAG,CAAC,GAAGP,KAAO;IACrBQ,OAAO,EAAC,QAAQ;IAChBJ,KAAK,EAAG;MACPC,MAAM,EAAE,MAAM;MACdC,QAAQ,EAAE;IACX;EAAG,GAEHP,aAAA,CAACX,iBAAiB;IACjBqB,yBAAyB,EAAG,EAAI;IAChCT,KAAK,EAAGA;EAAO,CACf,CACM,CACG,CAEC,CAAC;AAElB,CAAC;AAED,eAAeL,mBAAmB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__unstableIframe","Iframe","__unstableEditorStyles","EditorStyles","privateApis","blockEditorPrivateApis","__unstableMotion","motion","useThrottle","useReducedMotion","useResizeObserver","useLayoutEffect","useState","useMemo","unlock","useGlobalStyle","useGlobalStylesOutput","normalizedWidth","normalizedHeight","THROTTLE_OPTIONS","leading","trailing","PreviewIframe","children","label","isFocused","withHoverView","backgroundColor","gradientValue","styles","disableMotion","isHovered","setIsHovered","containerResizeListener","width","throttledWidth","setThrottledWidthState","ratioState","setRatioState","setThrottledWidth","newRatio","ratioDiff","isRatioDiffBigEnough","Math","abs","fallbackRatio","ratio","editorStyles","css","isGlobalStyles","isReady","createElement","Fragment","style","position","className","height","onMouseEnter","onMouseLeave","tabIndex","div","background","cursor","undefined","initial","animate","concat","map","child","key"],"sources":["@wordpress/edit-site/src/components/global-styles/preview-iframe.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__unstableIframe as Iframe,\n\t__unstableEditorStyles as EditorStyles,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport {\n\tuseThrottle,\n\tuseReducedMotion,\n\tuseResizeObserver,\n} from '@wordpress/compose';\nimport { useLayoutEffect, useState, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStyle, useGlobalStylesOutput } = unlock(\n\tblockEditorPrivateApis\n);\n\nconst normalizedWidth = 248;\nconst normalizedHeight = 152;\n\n// Throttle options for useThrottle. Must be defined outside of the component,\n// so that the object reference is the same on each render.\nconst THROTTLE_OPTIONS = {\n\tleading: true,\n\ttrailing: true,\n};\n\nexport default function PreviewIframe( {\n\tchildren,\n\tlabel,\n\tisFocused,\n\twithHoverView,\n} ) {\n\tconst [ backgroundColor = 'white' ] = useGlobalStyle( 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( 'color.gradient' );\n\tconst [ styles ] = useGlobalStylesOutput();\n\tconst disableMotion = useReducedMotion();\n\tconst [ isHovered, setIsHovered ] = useState( false );\n\tconst [ containerResizeListener, { width } ] = useResizeObserver();\n\tconst [ throttledWidth, setThrottledWidthState ] = useState( width );\n\tconst [ ratioState, setRatioState ] = useState();\n\n\tconst setThrottledWidth = useThrottle(\n\t\tsetThrottledWidthState,\n\t\t250,\n\t\tTHROTTLE_OPTIONS\n\t);\n\n\t// Must use useLayoutEffect to avoid a flash of the iframe at the wrong\n\t// size before the width is set.\n\tuseLayoutEffect( () => {\n\t\tif ( width ) {\n\t\t\tsetThrottledWidth( width );\n\t\t}\n\t}, [ width, setThrottledWidth ] );\n\n\t// Must use useLayoutEffect to avoid a flash of the iframe at the wrong\n\t// size before the width is set.\n\tuseLayoutEffect( () => {\n\t\tconst newRatio = throttledWidth ? throttledWidth / normalizedWidth : 1;\n\t\tconst ratioDiff = newRatio - ( ratioState || 0 );\n\n\t\t// Only update the ratio state if the difference is big enough\n\t\t// or if the ratio state is not yet set. This is to avoid an\n\t\t// endless loop of updates at particular viewport heights when the\n\t\t// presence of a scrollbar causes the width to change slightly.\n\t\tconst isRatioDiffBigEnough = Math.abs( ratioDiff ) > 0.1;\n\n\t\tif ( isRatioDiffBigEnough || ! ratioState ) {\n\t\t\tsetRatioState( newRatio );\n\t\t}\n\t}, [ throttledWidth, ratioState ] );\n\n\t// Set a fallbackRatio to use before the throttled ratio has been set.\n\tconst fallbackRatio = width ? width / normalizedWidth : 1;\n\t/*\n\t * Use the throttled ratio if it has been calculated, otherwise\n\t * use the fallback ratio. The throttled ratio is used to avoid\n\t * an endless loop of updates at particular viewport heights.\n\t * See: https://github.com/WordPress/gutenberg/issues/55112\n\t */\n\tconst ratio = ratioState ? ratioState : fallbackRatio;\n\n\t/*\n\t * Reset leaked styles from WP common.css and remove main content layout padding and border.\n\t * Add pointer cursor to the body to indicate the iframe is interactive,\n\t * similar to Typography variation previews.\n\t */\n\tconst editorStyles = useMemo( () => {\n\t\tif ( styles ) {\n\t\t\treturn [\n\t\t\t\t...styles,\n\t\t\t\t{\n\t\t\t\t\tcss: 'html{overflow:hidden}body{min-width: 0;padding: 0;border: none;cursor: pointer;}',\n\t\t\t\t\tisGlobalStyles: true,\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\treturn styles;\n\t}, [ styles ] );\n\tconst isReady = !! width;\n\n\treturn (\n\t\t<>\n\t\t\t<div style={ { position: 'relative' } }>\n\t\t\t\t{ containerResizeListener }\n\t\t\t</div>\n\t\t\t{ isReady && (\n\t\t\t\t<Iframe\n\t\t\t\t\tclassName=\"edit-site-global-styles-preview__iframe\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: normalizedHeight * ratio,\n\t\t\t\t\t} }\n\t\t\t\t\tonMouseEnter={ () => setIsHovered( true ) }\n\t\t\t\t\tonMouseLeave={ () => setIsHovered( false ) }\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t>\n\t\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: normalizedHeight * ratio,\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\t\t\t\tcursor: withHoverView ? 'pointer' : undefined,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tinitial=\"start\"\n\t\t\t\t\t\tanimate={\n\t\t\t\t\t\t\t( isHovered || isFocused ) &&\n\t\t\t\t\t\t\t! disableMotion &&\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t? 'hover'\n\t\t\t\t\t\t\t\t: 'start'\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ []\n\t\t\t\t\t\t\t.concat( children ) // This makes sure children is always an array.\n\t\t\t\t\t\t\t.map( ( child, key ) => child( { ratio, key } ) ) }\n\t\t\t\t\t</motion.div>\n\t\t\t\t</Iframe>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,gBAAgB,IAAIC,MAAM,EAC1BC,sBAAsB,IAAIC,YAAY,EACtCC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,gBAAgB,IAAIC,MAAM,QAAQ,uBAAuB;AAClE,SACCC,WAAW,EACXC,gBAAgB,EAChBC,iBAAiB,QACX,oBAAoB;AAC3B,SAASC,eAAe,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;;AAEvE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC,cAAc;EAAEC;AAAsB,CAAC,GAAGF,MAAM,CACvDT,sBACD,CAAC;AAED,MAAMY,eAAe,GAAG,GAAG;AAC3B,MAAMC,gBAAgB,GAAG,GAAG;;AAE5B;AACA;AACA,MAAMC,gBAAgB,GAAG;EACxBC,OAAO,EAAE,IAAI;EACbC,QAAQ,EAAE;AACX,CAAC;AAED,eAAe,SAASC,aAAaA,CAAE;EACtCC,QAAQ;EACRC,KAAK;EACLC,SAAS;EACTC;AACD,CAAC,EAAG;EACH,MAAM,CAAEC,eAAe,GAAG,OAAO,CAAE,GAAGZ,cAAc,CAAE,kBAAmB,CAAC;EAC1E,MAAM,CAAEa,aAAa,CAAE,GAAGb,cAAc,CAAE,gBAAiB,CAAC;EAC5D,MAAM,CAAEc,MAAM,CAAE,GAAGb,qBAAqB,CAAC,CAAC;EAC1C,MAAMc,aAAa,GAAGrB,gBAAgB,CAAC,CA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IAAEuB;EAAI,CAAE,CAAE,CACtC,CACL,CAER,CAAC;AAEL"}
1
+ {"version":3,"names":["__unstableIframe","Iframe","__unstableEditorStyles","EditorStyles","privateApis","blockEditorPrivateApis","__unstableMotion","motion","useThrottle","useReducedMotion","useResizeObserver","useLayoutEffect","useState","useMemo","unlock","useGlobalStyle","useGlobalStylesOutput","normalizedWidth","normalizedHeight","THROTTLE_OPTIONS","leading","trailing","PreviewIframe","children","label","isFocused","withHoverView","backgroundColor","gradientValue","styles","disableMotion","isHovered","setIsHovered","containerResizeListener","width","throttledWidth","setThrottledWidthState","ratioState","setRatioState","setThrottledWidth","newRatio","ratioDiff","isRatioDiffBigEnough","Math","abs","fallbackRatio","ratio","editorStyles","css","isGlobalStyles","isReady","createElement","Fragment","style","position","className","height","onMouseEnter","onMouseLeave","tabIndex","div","background","cursor","undefined","initial","animate","concat","map","child","key"],"sources":["@wordpress/edit-site/src/components/global-styles/preview-iframe.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__unstableIframe as Iframe,\n\t__unstableEditorStyles as EditorStyles,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport {\n\tuseThrottle,\n\tuseReducedMotion,\n\tuseResizeObserver,\n} from '@wordpress/compose';\nimport { useLayoutEffect, useState, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStyle, useGlobalStylesOutput } = unlock(\n\tblockEditorPrivateApis\n);\n\nconst normalizedWidth = 248;\nconst normalizedHeight = 152;\n\n// Throttle options for useThrottle. Must be defined outside of the component,\n// so that the object reference is the same on each render.\nconst THROTTLE_OPTIONS = {\n\tleading: true,\n\ttrailing: true,\n};\n\nexport default function PreviewIframe( {\n\tchildren,\n\tlabel,\n\tisFocused,\n\twithHoverView,\n} ) {\n\tconst [ backgroundColor = 'white' ] = useGlobalStyle( 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( 'color.gradient' );\n\tconst [ styles ] = useGlobalStylesOutput();\n\tconst disableMotion = useReducedMotion();\n\tconst [ isHovered, setIsHovered ] = useState( false );\n\tconst [ containerResizeListener, { width } ] = useResizeObserver();\n\tconst [ throttledWidth, setThrottledWidthState ] = useState( width );\n\tconst [ ratioState, setRatioState ] = useState();\n\n\tconst setThrottledWidth = useThrottle(\n\t\tsetThrottledWidthState,\n\t\t250,\n\t\tTHROTTLE_OPTIONS\n\t);\n\n\t// Must use useLayoutEffect to avoid a flash of the iframe at the wrong\n\t// size before the width is set.\n\tuseLayoutEffect( () => {\n\t\tif ( width ) {\n\t\t\tsetThrottledWidth( width );\n\t\t}\n\t}, [ width, setThrottledWidth ] );\n\n\t// Must use useLayoutEffect to avoid a flash of the iframe at the wrong\n\t// size before the width is set.\n\tuseLayoutEffect( () => {\n\t\tconst newRatio = throttledWidth ? throttledWidth / normalizedWidth : 1;\n\t\tconst ratioDiff = newRatio - ( ratioState || 0 );\n\n\t\t// Only update the ratio state if the difference is big enough\n\t\t// or if the ratio state is not yet set. This is to avoid an\n\t\t// endless loop of updates at particular viewport heights when the\n\t\t// presence of a scrollbar causes the width to change slightly.\n\t\tconst isRatioDiffBigEnough = Math.abs( ratioDiff ) > 0.1;\n\n\t\tif ( isRatioDiffBigEnough || ! ratioState ) {\n\t\t\tsetRatioState( newRatio );\n\t\t}\n\t}, [ throttledWidth, ratioState ] );\n\n\t// Set a fallbackRatio to use before the throttled ratio has been set.\n\tconst fallbackRatio = width ? width / normalizedWidth : 1;\n\t/*\n\t * Use the throttled ratio if it has been calculated, otherwise\n\t * use the fallback ratio. The throttled ratio is used to avoid\n\t * an endless loop of updates at particular viewport heights.\n\t * See: https://github.com/WordPress/gutenberg/issues/55112\n\t */\n\tconst ratio = ratioState ? ratioState : fallbackRatio;\n\n\t/*\n\t * Reset leaked styles from WP common.css and remove main content layout padding and border.\n\t * Add pointer cursor to the body to indicate the iframe is interactive,\n\t * similar to Typography variation previews.\n\t */\n\tconst editorStyles = useMemo( () => {\n\t\tif ( styles ) {\n\t\t\treturn [\n\t\t\t\t...styles,\n\t\t\t\t{\n\t\t\t\t\tcss: 'html{overflow:hidden}body{min-width: 0;padding: 0;border: none;cursor: pointer;}',\n\t\t\t\t\tisGlobalStyles: true,\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\treturn styles;\n\t}, [ styles ] );\n\tconst isReady = !! width;\n\n\treturn (\n\t\t<>\n\t\t\t<div style={ { position: 'relative' } }>\n\t\t\t\t{ containerResizeListener }\n\t\t\t</div>\n\t\t\t{ isReady && (\n\t\t\t\t<Iframe\n\t\t\t\t\tclassName=\"edit-site-global-styles-preview__iframe\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: normalizedHeight * ratio,\n\t\t\t\t\t} }\n\t\t\t\t\tonMouseEnter={ () => setIsHovered( true ) }\n\t\t\t\t\tonMouseLeave={ () => setIsHovered( false ) }\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t>\n\t\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: normalizedHeight * ratio,\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\t\t\t\tcursor: withHoverView ? 'pointer' : undefined,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tinitial=\"start\"\n\t\t\t\t\t\tanimate={\n\t\t\t\t\t\t\t( isHovered || isFocused ) &&\n\t\t\t\t\t\t\t! disableMotion &&\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t? 'hover'\n\t\t\t\t\t\t\t\t: 'start'\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ []\n\t\t\t\t\t\t\t.concat( children ) // This makes sure children is always an array.\n\t\t\t\t\t\t\t.map( ( child, key ) => child( { ratio, key } ) ) }\n\t\t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CAAEhB,KAAK;EAExB,OACCiB,aAAA,CAAAC,QAAA,QACCD,aAAA;IAAKE,KAAK,EAAG;MAAEC,QAAQ,EAAE;IAAW;EAAG,GACpCrB,uBACE,CAAC,EACJiB,OAAO,IACRC,aAAA,CAAClD,MAAM;IACNsD,SAAS,EAAC,yCAAyC;IACnDF,KAAK,EAAG;MACPG,MAAM,EAAEtC,gBAAgB,GAAG4B;IAC5B,CAAG;IACHW,YAAY,EAAGA,CAAA,KAAMzB,YAAY,CAAE,IAAK,CAAG;IAC3C0B,YAAY,EAAGA,CAAA,KAAM1B,YAAY,CAAE,KAAM,CAAG;IAC5C2B,QAAQ,EAAG,CAAC;EAAG,GAEfR,aAAA,CAAChD,YAAY;IAAC0B,MAAM,EAAGkB;EAAc,CAAE,CAAC,EACxCI,aAAA,CAAC5C,MAAM,CAACqD,GAAG;IACVP,KAAK,EAAG;MACPG,MAAM,EAAEtC,gBAAgB,GAAG4B,KAAK;MAChCZ,KAAK,EAAE,MAAM;MACb2B,UAAU,EAAEjC,aAAa,aAAbA,aAAa,cAAbA,aAAa,GAAID,eAAe;MAC5CmC,MAAM,EAAEpC,aAAa,GAAG,SAAS,GAAGqC;IACrC,CAAG;IACHC,OAAO,EAAC,OAAO;IACfC,OAAO,EACN,CAAElC,SAAS,IAAIN,SAAS,KACxB,CAAEK,aAAa,IACfN,KAAK,GACF,OAAO,GACP;EACH,GAEC,EAAE,CACF0C,MAAM,CAAE3C,QAAS,CAAC,CAAC;EAAA,CACnB4C,GAAG,CAAE,CAAEC,KAAK,EAAEC,GAAG,KAAMD,KAAK,CAAE;IAAEtB,KAAK;IAAEuB;EAAI,CAAE,CAAE,CACtC,CACL,CAER,CAAC;AAEL","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["privateApis","blockEditorPrivateApis","__experimentalHStack","HStack","__experimentalVStack","VStack","__unstableMotion","motion","unlock","useStylesPreviewColors","TypographyExample","HighlightedColors","PreviewIframe","useGlobalStyle","firstFrameVariants","start","scale","opacity","hover","midFrameVariants","secondFrameVariants","PreviewStyles","label","isFocused","withHoverView","variation","fontWeight","fontFamily","headingFontFamily","headingFontWeight","textColor","headingColor","paletteColors","createElement","ratio","key","div","variants","style","height","overflow","spacing","justify","fontSize","normalizedColorSwatchSize","width","position","top","filter","slice","map","color","index","background","flexGrow","padding","boxSizing","lineHeight","textAlign"],"sources":["@wordpress/edit-site/src/components/global-styles/preview-styles.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { useStylesPreviewColors } from './hooks';\nimport TypographyExample from './typography-example';\nimport HighlightedColors from './highlighted-colors';\nimport PreviewIframe from './preview-iframe';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nconst firstFrameVariants = {\n\tstart: {\n\t\tscale: 1,\n\t\topacity: 1,\n\t},\n\thover: {\n\t\tscale: 0,\n\t\topacity: 0,\n\t},\n};\n\nconst midFrameVariants = {\n\thover: {\n\t\topacity: 1,\n\t},\n\tstart: {\n\t\topacity: 0.5,\n\t},\n};\n\nconst secondFrameVariants = {\n\thover: {\n\t\tscale: 1,\n\t\topacity: 1,\n\t},\n\tstart: {\n\t\tscale: 0,\n\t\topacity: 0,\n\t},\n};\n\nconst PreviewStyles = ( { label, isFocused, withHoverView, variation } ) => {\n\tconst [ fontWeight ] = useGlobalStyle( 'typography.fontWeight' );\n\tconst [ fontFamily = 'serif' ] = useGlobalStyle( 'typography.fontFamily' );\n\tconst [ headingFontFamily = fontFamily ] = useGlobalStyle(\n\t\t'elements.h1.typography.fontFamily'\n\t);\n\tconst [ headingFontWeight = fontWeight ] = useGlobalStyle(\n\t\t'elements.h1.typography.fontWeight'\n\t);\n\tconst [ textColor = 'black' ] = useGlobalStyle( 'color.text' );\n\tconst [ headingColor = textColor ] = useGlobalStyle(\n\t\t'elements.h1.color.text'\n\t);\n\n\tconst { paletteColors } = useStylesPreviewColors();\n\n\treturn (\n\t\t<PreviewIframe\n\t\t\tlabel={ label }\n\t\t\tisFocused={ isFocused }\n\t\t\twithHoverView={ withHoverView }\n\t\t>\n\t\t\t{ ( { ratio, key } ) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvariants={ firstFrameVariants }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tspacing={ 10 * ratio }\n\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TypographyExample\n\t\t\t\t\t\t\tfontSize={ 65 * ratio }\n\t\t\t\t\t\t\tvariation={ variation }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<VStack spacing={ 4 * ratio }>\n\t\t\t\t\t\t\t<HighlightedColors\n\t\t\t\t\t\t\t\tnormalizedColorSwatchSize={ 32 }\n\t\t\t\t\t\t\t\tratio={ ratio }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t\t{ ( { key } ) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvariants={ withHoverView && midFrameVariants }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\tfilter: 'blur(60px)',\n\t\t\t\t\t\topacity: 0.1,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ paletteColors\n\t\t\t\t\t\t\t.slice( 0, 4 )\n\t\t\t\t\t\t\t.map( ( { color }, index ) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t\t\tbackground: color,\n\t\t\t\t\t\t\t\t\t\tflexGrow: 1,\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</HStack>\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t\t{ ( { ratio, key } ) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvariants={ secondFrameVariants }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing={ 3 * ratio }\n\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t\tpadding: 10 * ratio,\n\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tfontSize: 40 * ratio,\n\t\t\t\t\t\t\t\t\tfontFamily: headingFontFamily,\n\t\t\t\t\t\t\t\t\tcolor: headingColor,\n\t\t\t\t\t\t\t\t\tfontWeight: headingFontWeight,\n\t\t\t\t\t\t\t\t\tlineHeight: '1em',\n\t\t\t\t\t\t\t\t\ttextAlign: 'center',\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{ label }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t</PreviewIframe>\n\t);\n};\n\nexport default PreviewStyles;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,gBAAgB,IAAIC,MAAM,QACpB,uBAAuB;;AAE9B;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,sBAAsB,QAAQ,SAAS;AAChD,OAAOC,iBAAiB,MAAM,sBAAsB;AACpD,OAAOC,iBAAiB,MAAM,sBAAsB;AACpD,OAAOC,aAAa,MAAM,kBAAkB;AAE5C,MAAM;EAAEC;AAAe,CAAC,GAAGL,MAAM,CAAEP,sBAAuB,CAAC;AAE3D,MAAMa,kBAAkB,GAAG;EAC1BC,KAAK,EAAE;IACNC,KAAK,EAAE,CAAC;IACRC,OAAO,EAAE;EACV,CAAC;EACDC,KAAK,EAAE;IACNF,KAAK,EAAE,CAAC;IACRC,OAAO,EAAE;EACV;AACD,CAAC;AAED,MAAME,gBAAgB,GAAG;EACxBD,KAAK,EAAE;IACND,OAAO,EAAE;EACV,CAAC;EACDF,KAAK,EAAE;IACNE,OAAO,EAAE;EACV;AACD,CAA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QAAQ,EAAGjB,mBAAqB;IAChCkB,KAAK,EAAG;MACPC,MAAM,EAAE,MAAM;MACdM,KAAK,EAAE,MAAM;MACbL,QAAQ,EAAE,QAAQ;MAClBM,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE;IACN;EAAG,GAEHd,aAAA,CAAC5B,MAAM;IACNoC,OAAO,EAAG,CAAC,GAAGP,KAAO;IACrBQ,OAAO,EAAC,QAAQ;IAChBJ,KAAK,EAAG;MACPC,MAAM,EAAE,MAAM;MACdC,QAAQ,EAAE,QAAQ;MAClBe,OAAO,EAAE,EAAE,GAAGrB,KAAK;MACnBsB,SAAS,EAAE;IACZ;EAAG,GAEDlC,KAAK,IACNW,aAAA;IACCK,KAAK,EAAG;MACPK,QAAQ,EAAE,EAAE,GAAGT,KAAK;MACpBP,UAAU,EAAEC,iBAAiB;MAC7BuB,KAAK,EAAEpB,YAAY;MACnBL,UAAU,EAAEG,iBAAiB;MAC7B4B,UAAU,EAAE,KAAK;MACjBC,SAAS,EAAE;IACZ;EAAG,GAEDpC,KACE,CAEC,CACG,CAEC,CAAC;AAElB,CAAC;AAED,eAAeD,aAAa"}
1
+ {"version":3,"names":["privateApis","blockEditorPrivateApis","__experimentalHStack","HStack","__experimentalVStack","VStack","__unstableMotion","motion","unlock","useStylesPreviewColors","TypographyExample","HighlightedColors","PreviewIframe","useGlobalStyle","firstFrameVariants","start","scale","opacity","hover","midFrameVariants","secondFrameVariants","PreviewStyles","label","isFocused","withHoverView","variation","fontWeight","fontFamily","headingFontFamily","headingFontWeight","textColor","headingColor","paletteColors","createElement","ratio","key","div","variants","style","height","overflow","spacing","justify","fontSize","normalizedColorSwatchSize","width","position","top","filter","slice","map","color","index","background","flexGrow","padding","boxSizing","lineHeight","textAlign"],"sources":["@wordpress/edit-site/src/components/global-styles/preview-styles.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { useStylesPreviewColors } from './hooks';\nimport TypographyExample from './typography-example';\nimport HighlightedColors from './highlighted-colors';\nimport PreviewIframe from './preview-iframe';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nconst firstFrameVariants = {\n\tstart: {\n\t\tscale: 1,\n\t\topacity: 1,\n\t},\n\thover: {\n\t\tscale: 0,\n\t\topacity: 0,\n\t},\n};\n\nconst midFrameVariants = {\n\thover: {\n\t\topacity: 1,\n\t},\n\tstart: {\n\t\topacity: 0.5,\n\t},\n};\n\nconst secondFrameVariants = {\n\thover: {\n\t\tscale: 1,\n\t\topacity: 1,\n\t},\n\tstart: {\n\t\tscale: 0,\n\t\topacity: 0,\n\t},\n};\n\nconst PreviewStyles = ( { label, isFocused, withHoverView, variation } ) => {\n\tconst [ fontWeight ] = useGlobalStyle( 'typography.fontWeight' );\n\tconst [ fontFamily = 'serif' ] = useGlobalStyle( 'typography.fontFamily' );\n\tconst [ headingFontFamily = fontFamily ] = useGlobalStyle(\n\t\t'elements.h1.typography.fontFamily'\n\t);\n\tconst [ headingFontWeight = fontWeight ] = useGlobalStyle(\n\t\t'elements.h1.typography.fontWeight'\n\t);\n\tconst [ textColor = 'black' ] = useGlobalStyle( 'color.text' );\n\tconst [ headingColor = textColor ] = useGlobalStyle(\n\t\t'elements.h1.color.text'\n\t);\n\n\tconst { paletteColors } = useStylesPreviewColors();\n\n\treturn (\n\t\t<PreviewIframe\n\t\t\tlabel={ label }\n\t\t\tisFocused={ isFocused }\n\t\t\twithHoverView={ withHoverView }\n\t\t>\n\t\t\t{ ( { ratio, key } ) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvariants={ firstFrameVariants }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tspacing={ 10 * ratio }\n\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TypographyExample\n\t\t\t\t\t\t\tfontSize={ 65 * ratio }\n\t\t\t\t\t\t\tvariation={ variation }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<VStack spacing={ 4 * ratio }>\n\t\t\t\t\t\t\t<HighlightedColors\n\t\t\t\t\t\t\t\tnormalizedColorSwatchSize={ 32 }\n\t\t\t\t\t\t\t\tratio={ ratio }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t\t{ ( { key } ) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvariants={ withHoverView && midFrameVariants }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\tfilter: 'blur(60px)',\n\t\t\t\t\t\topacity: 0.1,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ paletteColors\n\t\t\t\t\t\t\t.slice( 0, 4 )\n\t\t\t\t\t\t\t.map( ( { color }, index ) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t\t\tbackground: color,\n\t\t\t\t\t\t\t\t\t\tflexGrow: 1,\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</HStack>\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t\t{ ( { ratio, key } ) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvariants={ secondFrameVariants }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing={ 3 * ratio }\n\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t\tpadding: 10 * ratio,\n\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tfontSize: 40 * ratio,\n\t\t\t\t\t\t\t\t\tfontFamily: headingFontFamily,\n\t\t\t\t\t\t\t\t\tcolor: headingColor,\n\t\t\t\t\t\t\t\t\tfontWeight: headingFontWeight,\n\t\t\t\t\t\t\t\t\tlineHeight: '1em',\n\t\t\t\t\t\t\t\t\ttextAlign: 'center',\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{ label }\n\t\t\t\t\t\t\t</div>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B,KAAK;MACnBsB,SAAS,EAAE;IACZ;EAAG,GAEDlC,KAAK,IACNW,aAAA;IACCK,KAAK,EAAG;MACPK,QAAQ,EAAE,EAAE,GAAGT,KAAK;MACpBP,UAAU,EAAEC,iBAAiB;MAC7BuB,KAAK,EAAEpB,YAAY;MACnBL,UAAU,EAAEG,iBAAiB;MAC7B4B,UAAU,EAAE,KAAK;MACjBC,SAAS,EAAE;IACZ;EAAG,GAEDpC,KACE,CAEC,CACG,CAEC,CAAC;AAElB,CAAC;AAED,eAAeD,aAAa","ignoreList":[]}
@@ -3,7 +3,7 @@ import { createElement, Fragment } from "react";
3
3
  * WordPress dependencies
4
4
  */
5
5
  import { __experimentalItemGroup as ItemGroup } from '@wordpress/components';
6
- import { typography, color, layout } from '@wordpress/icons';
6
+ import { typography, color, layout, image } from '@wordpress/icons';
7
7
  import { __ } from '@wordpress/i18n';
8
8
  import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
9
9
 
@@ -17,7 +17,8 @@ const {
17
17
  useHasTypographyPanel,
18
18
  useHasColorPanel,
19
19
  useGlobalSetting,
20
- useSettingsForBlockElement
20
+ useSettingsForBlockElement,
21
+ useHasBackgroundPanel
21
22
  } = unlock(blockEditorPrivateApis);
22
23
  function RootMenu() {
23
24
  const [rawSettings] = useGlobalSetting('');
@@ -26,6 +27,7 @@ function RootMenu() {
26
27
  const hasColorPanel = useHasColorPanel(settings);
27
28
  const hasDimensionsPanel = useHasDimensionsPanel(settings);
28
29
  const hasLayoutPanel = hasDimensionsPanel;
30
+ const hasBackgroundPanel = useHasBackgroundPanel(settings);
29
31
  return createElement(Fragment, null, createElement(ItemGroup, null, hasTypographyPanel && createElement(NavigationButtonAsItem, {
30
32
  icon: typography,
31
33
  path: "/typography",
@@ -38,7 +40,11 @@ function RootMenu() {
38
40
  icon: layout,
39
41
  path: "/layout",
40
42
  "aria-label": __('Layout styles')
41
- }, __('Layout'))));
43
+ }, __('Layout')), hasBackgroundPanel && createElement(NavigationButtonAsItem, {
44
+ icon: image,
45
+ path: "/background",
46
+ "aria-label": __('Background image styles')
47
+ }, __('Background image'))));
42
48
  }
43
49
  export default RootMenu;
44
50
  //# sourceMappingURL=root-menu.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalItemGroup","ItemGroup","typography","color","layout","__","privateApis","blockEditorPrivateApis","NavigationButtonAsItem","unlock","useHasDimensionsPanel","useHasTypographyPanel","useHasColorPanel","useGlobalSetting","useSettingsForBlockElement","RootMenu","rawSettings","settings","hasTypographyPanel","hasColorPanel","hasDimensionsPanel","hasLayoutPanel","createElement","Fragment","icon","path"],"sources":["@wordpress/edit-site/src/components/global-styles/root-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { typography, color, layout } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tuseHasDimensionsPanel,\n\tuseHasTypographyPanel,\n\tuseHasColorPanel,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n} = unlock( blockEditorPrivateApis );\n\nfunction RootMenu() {\n\tconst [ rawSettings ] = useGlobalSetting( '' );\n\tconst settings = useSettingsForBlockElement( rawSettings );\n\tconst hasTypographyPanel = useHasTypographyPanel( settings );\n\tconst hasColorPanel = useHasColorPanel( settings );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\tconst hasLayoutPanel = hasDimensionsPanel;\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ hasTypographyPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ typography }\n\t\t\t\t\t\tpath=\"/typography\"\n\t\t\t\t\t\taria-label={ __( 'Typography styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Typography' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasColorPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ color }\n\t\t\t\t\t\tpath=\"/colors\"\n\t\t\t\t\t\taria-label={ __( 'Colors styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Colors' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasLayoutPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t\tpath=\"/layout\"\n\t\t\t\t\t\taria-label={ __( 'Layout styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Layout' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t</ItemGroup>\n\t\t</>\n\t);\n}\n\nexport default RootMenu;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,uBAAuB,IAAIC,SAAS,QAAQ,uBAAuB;AAC5E,SAASC,UAAU,EAAEC,KAAK,EAAEC,MAAM,QAAQ,kBAAkB;AAC5D,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,qBAAqB;AAC5D,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EACLC,qBAAqB;EACrBC,qBAAqB;EACrBC,gBAAgB;EAChBC,gBAAgB;EAChBC;AACD,CAAC,GAAGL,MAAM,CAAEF,sBAAuB,CAAC;AAEpC,SAASQ,QAAQA,CAAA,EAAG;EACnB,MAAM,CAAEC,WAAW,CAAE,GAAGH,gBAAgB,CAAE,EAAG,CAAC;EAC9C,MAAMI,QAAQ,GAAGH,0BAA0B,CAAEE,WAAY,CAAC;EAC1D,MAAME,kBAAkB,GAAGP,qBAAqB,CAAEM,QAAS,CAAC;EAC5D,MAAME,aAAa,GAAGP,gBAAgB,CAAEK,QAAS,CAAC;EAClD,MAAMG,kBAAkB,GAAGV,qBAAqB,CAAEO,QAAS,CAAC;EAC5D,MAAMI,cAAc,GAAGD,kBAAkB;EAEzC,OACCE,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACrB,SAAS,QACPiB,kBAAkB,IACnBI,aAAA,CAACd,sBAAsB;IACtBgB,IAAI,EAAGtB,UAAY;IACnBuB,IAAI,EAAC,aAAa;IAClB,cAAapB,EAAE,CAAE,mBAAoB;EAAG,GAEtCA,EAAE,CAAE,YAAa,CACI,CACxB,EACCc,aAAa,IACdG,aAAA,CAACd,sBAAsB;IACtBgB,IAAI,EAAGrB,KAAO;IACdsB,IAAI,EAAC,SAAS;IACd,cAAapB,EAAE,CAAE,eAAgB;EAAG,GAElCA,EAAE,CAAE,QAAS,CACQ,CACxB,EACCgB,cAAc,IACfC,aAAA,CAACd,sBAAsB;IACtBgB,IAAI,EAAGpB,MAAQ;IACfqB,IAAI,EAAC,SAAS;IACd,cAAapB,EAAE,CAAE,eAAgB;EAAG,GAElCA,EAAE,CAAE,QAAS,CACQ,CAEf,CACV,CAAC;AAEL;AAEA,eAAeU,QAAQ"}
1
+ {"version":3,"names":["__experimentalItemGroup","ItemGroup","typography","color","layout","image","__","privateApis","blockEditorPrivateApis","NavigationButtonAsItem","unlock","useHasDimensionsPanel","useHasTypographyPanel","useHasColorPanel","useGlobalSetting","useSettingsForBlockElement","useHasBackgroundPanel","RootMenu","rawSettings","settings","hasTypographyPanel","hasColorPanel","hasDimensionsPanel","hasLayoutPanel","hasBackgroundPanel","createElement","Fragment","icon","path"],"sources":["@wordpress/edit-site/src/components/global-styles/root-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { typography, color, layout, image } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tuseHasDimensionsPanel,\n\tuseHasTypographyPanel,\n\tuseHasColorPanel,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tuseHasBackgroundPanel,\n} = unlock( blockEditorPrivateApis );\n\nfunction RootMenu() {\n\tconst [ rawSettings ] = useGlobalSetting( '' );\n\tconst settings = useSettingsForBlockElement( rawSettings );\n\tconst hasTypographyPanel = useHasTypographyPanel( settings );\n\tconst hasColorPanel = useHasColorPanel( settings );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\tconst hasLayoutPanel = hasDimensionsPanel;\n\tconst hasBackgroundPanel = useHasBackgroundPanel( settings );\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ hasTypographyPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ typography }\n\t\t\t\t\t\tpath=\"/typography\"\n\t\t\t\t\t\taria-label={ __( 'Typography styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Typography' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasColorPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ color }\n\t\t\t\t\t\tpath=\"/colors\"\n\t\t\t\t\t\taria-label={ __( 'Colors styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Colors' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasLayoutPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t\tpath=\"/layout\"\n\t\t\t\t\t\taria-label={ __( 'Layout styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Layout' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasBackgroundPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ image }\n\t\t\t\t\t\tpath=\"/background\"\n\t\t\t\t\t\taria-label={ __( 'Background image styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Background image' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t</ItemGroup>\n\t\t</>\n\t);\n}\n\nexport default RootMenu;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,uBAAuB,IAAIC,SAAS,QAAQ,uBAAuB;AAC5E,SAASC,UAAU,EAAEC,KAAK,EAAEC,MAAM,EAAEC,KAAK,QAAQ,kBAAkB;AACnE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,qBAAqB;AAC5D,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EACLC,qBAAqB;EACrBC,qBAAqB;EACrBC,gBAAgB;EAChBC,gBAAgB;EAChBC,0BAA0B;EAC1BC;AACD,CAAC,GAAGN,MAAM,CAAEF,sBAAuB,CAAC;AAEpC,SAASS,QAAQA,CAAA,EAAG;EACnB,MAAM,CAAEC,WAAW,CAAE,GAAGJ,gBAAgB,CAAE,EAAG,CAAC;EAC9C,MAAMK,QAAQ,GAAGJ,0BAA0B,CAAEG,WAAY,CAAC;EAC1D,MAAME,kBAAkB,GAAGR,qBAAqB,CAAEO,QAAS,CAAC;EAC5D,MAAME,aAAa,GAAGR,gBAAgB,CAAEM,QAAS,CAAC;EAClD,MAAMG,kBAAkB,GAAGX,qBAAqB,CAAEQ,QAAS,CAAC;EAC5D,MAAMI,cAAc,GAAGD,kBAAkB;EACzC,MAAME,kBAAkB,GAAGR,qBAAqB,CAAEG,QAAS,CAAC;EAE5D,OACCM,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACxB,SAAS,QACPmB,kBAAkB,IACnBK,aAAA,CAAChB,sBAAsB;IACtBkB,IAAI,EAAGzB,UAAY;IACnB0B,IAAI,EAAC,aAAa;IAClB,cAAatB,EAAE,CAAE,mBAAoB;EAAG,GAEtCA,EAAE,CAAE,YAAa,CACI,CACxB,EACCe,aAAa,IACdI,aAAA,CAAChB,sBAAsB;IACtBkB,IAAI,EAAGxB,KAAO;IACdyB,IAAI,EAAC,SAAS;IACd,cAAatB,EAAE,CAAE,eAAgB;EAAG,GAElCA,EAAE,CAAE,QAAS,CACQ,CACxB,EACCiB,cAAc,IACfE,aAAA,CAAChB,sBAAsB;IACtBkB,IAAI,EAAGvB,MAAQ;IACfwB,IAAI,EAAC,SAAS;IACd,cAAatB,EAAE,CAAE,eAAgB;EAAG,GAElCA,EAAE,CAAE,QAAS,CACQ,CACxB,EACCkB,kBAAkB,IACnBC,aAAA,CAAChB,sBAAsB;IACtBkB,IAAI,EAAGtB,KAAO;IACduB,IAAI,EAAC,aAAa;IAClB,cAAatB,EAAE,CAAE,yBAA0B;EAAG,GAE5CA,EAAE,CAAE,kBAAmB,CACF,CAEf,CACV,CAAC;AAEL;AAEA,eAAeW,QAAQ","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ import { createElement, Fragment } from "react";
2
+ /**
3
+ * WordPress dependencies
4
+ */
5
+ import { __ } from '@wordpress/i18n';
6
+ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
7
+
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import BackgroundPanel from './background-panel';
12
+ import ScreenHeader from './header';
13
+ import { unlock } from '../../lock-unlock';
14
+ const {
15
+ useHasBackgroundPanel,
16
+ useGlobalSetting
17
+ } = unlock(blockEditorPrivateApis);
18
+ function ScreenBackground() {
19
+ const [settings] = useGlobalSetting('');
20
+ const hasBackgroundPanel = useHasBackgroundPanel(settings);
21
+ return createElement(Fragment, null, createElement(ScreenHeader, {
22
+ title: __('Background image')
23
+ }), hasBackgroundPanel && createElement(BackgroundPanel, null));
24
+ }
25
+ export default ScreenBackground;
26
+ //# sourceMappingURL=screen-background.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__","privateApis","blockEditorPrivateApis","BackgroundPanel","ScreenHeader","unlock","useHasBackgroundPanel","useGlobalSetting","ScreenBackground","settings","hasBackgroundPanel","createElement","Fragment","title"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-background.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport BackgroundPanel from './background-panel';\nimport ScreenHeader from './header';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHasBackgroundPanel, useGlobalSetting } = unlock(\n\tblockEditorPrivateApis\n);\n\nfunction ScreenBackground() {\n\tconst [ settings ] = useGlobalSetting( '' );\n\tconst hasBackgroundPanel = useHasBackgroundPanel( settings );\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader title={ __( 'Background image' ) } />\n\t\t\t{ hasBackgroundPanel && <BackgroundPanel /> }\n\t\t</>\n\t);\n}\n\nexport default ScreenBackground;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,OAAOC,eAAe,MAAM,oBAAoB;AAChD,OAAOC,YAAY,MAAM,UAAU;AACnC,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC,qBAAqB;EAAEC;AAAiB,CAAC,GAAGF,MAAM,CACzDH,sBACD,CAAC;AAED,SAASM,gBAAgBA,CAAA,EAAG;EAC3B,MAAM,CAAEC,QAAQ,CAAE,GAAGF,gBAAgB,CAAE,EAAG,CAAC;EAC3C,MAAMG,kBAAkB,GAAGJ,qBAAqB,CAAEG,QAAS,CAAC;EAC5D,OACCE,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACP,YAAY;IAACS,KAAK,EAAGb,EAAE,CAAE,kBAAmB;EAAG,CAAE,CAAC,EACjDU,kBAAkB,IAAIC,aAAA,CAACR,eAAe,MAAE,CACzC,CAAC;AAEL;AAEA,eAAeK,gBAAgB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["store","blocksStore","__","sprintf","_n","FlexItem","SearchControl","__experimentalHStack","HStack","useSelect","useState","useEffect","useRef","useDeferredValue","memo","BlockIcon","privateApis","blockEditorPrivateApis","useDebounce","speak","useBlockVariations","ScreenHeader","NavigationButtonAsItem","unlock","useHasDimensionsPanel","useHasTypographyPanel","useHasBorderPanel","useGlobalSetting","useSettingsForBlockElement","useHasColorPanel","useSortedBlockTypes","blockItems","select","getBlockTypes","groupByType","blocks","block","core","noncore","type","name","startsWith","push","coreItems","nonCoreItems","reduce","useBlockHasGlobalStyles","blockName","rawSettings","settings","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel","hasVariationsPanel","length","hasGlobalStyles","BlockMenuItem","hasBlockMenuItem","navigationButtonLabel","title","createElement","path","encodeURIComponent","justify","icon","BlockList","filterValue","sortedBlockTypes","debouncedSpeak","isMatchingSearchTerm","filteredBlockTypes","filter","blockType","blockTypesListRef","count","current","childElementCount","resultsFoundMessage","ref","className","map","key","MemoizedBlockList","ScreenBlockList","setFilterValue","deferredFilterValue","Fragment","description","__nextHasNoMarginBottom","onChange","value","label","placeholder"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-block-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport {\n\tFlexItem,\n\tSearchControl,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tuseDeferredValue,\n\tmemo,\n} from '@wordpress/element';\nimport {\n\tBlockIcon,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useDebounce } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { useBlockVariations } from './variations/variations-panel';\nimport ScreenHeader from './header';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tuseHasDimensionsPanel,\n\tuseHasTypographyPanel,\n\tuseHasBorderPanel,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tuseHasColorPanel,\n} = unlock( blockEditorPrivateApis );\n\nfunction useSortedBlockTypes() {\n\tconst blockItems = useSelect(\n\t\t( select ) => select( blocksStore ).getBlockTypes(),\n\t\t[]\n\t);\n\t// Ensure core blocks are prioritized in the returned results,\n\t// because third party blocks can be registered earlier than\n\t// the core blocks (usually by using the `init` action),\n\t// thus affecting the display order.\n\t// We don't sort reusable blocks as they are handled differently.\n\tconst groupByType = ( blocks, block ) => {\n\t\tconst { core, noncore } = blocks;\n\t\tconst type = block.name.startsWith( 'core/' ) ? core : noncore;\n\t\ttype.push( block );\n\t\treturn blocks;\n\t};\n\tconst { core: coreItems, noncore: nonCoreItems } = blockItems.reduce(\n\t\tgroupByType,\n\t\t{ core: [], noncore: [] }\n\t);\n\treturn [ ...coreItems, ...nonCoreItems ];\n}\n\nexport function useBlockHasGlobalStyles( blockName ) {\n\tconst [ rawSettings ] = useGlobalSetting( '', blockName );\n\tconst settings = useSettingsForBlockElement( rawSettings, blockName );\n\tconst hasTypographyPanel = useHasTypographyPanel( settings );\n\tconst hasColorPanel = useHasColorPanel( settings );\n\tconst hasBorderPanel = useHasBorderPanel( settings );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\tconst hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;\n\tconst hasVariationsPanel = !! useBlockVariations( blockName )?.length;\n\tconst hasGlobalStyles =\n\t\thasTypographyPanel ||\n\t\thasColorPanel ||\n\t\thasLayoutPanel ||\n\t\thasVariationsPanel;\n\treturn hasGlobalStyles;\n}\n\nfunction BlockMenuItem( { block } ) {\n\tconst hasBlockMenuItem = useBlockHasGlobalStyles( block.name );\n\tif ( ! hasBlockMenuItem ) {\n\t\treturn null;\n\t}\n\n\tconst navigationButtonLabel = sprintf(\n\t\t// translators: %s: is the name of a block e.g., 'Image' or 'Table'.\n\t\t__( '%s block styles' ),\n\t\tblock.title\n\t);\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\taria-label={ navigationButtonLabel }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<BlockIcon icon={ block.icon } />\n\t\t\t\t<FlexItem>{ block.title }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction BlockList( { filterValue } ) {\n\tconst sortedBlockTypes = useSortedBlockTypes();\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst { isMatchingSearchTerm } = useSelect( blocksStore );\n\n\tconst filteredBlockTypes = ! filterValue\n\t\t? sortedBlockTypes\n\t\t: sortedBlockTypes.filter( ( blockType ) =>\n\t\t\t\tisMatchingSearchTerm( blockType, filterValue )\n\t\t );\n\n\tconst blockTypesListRef = useRef();\n\n\t// Announce search results on change\n\tuseEffect( () => {\n\t\tif ( ! filterValue ) {\n\t\t\treturn;\n\t\t}\n\t\t// We extract the results from the wrapper div's `ref` because\n\t\t// filtered items can contain items that will eventually not\n\t\t// render and there is no reliable way to detect when a child\n\t\t// will return `null`.\n\t\t// TODO: We should find a better way of handling this as it's\n\t\t// fragile and depends on the number of rendered elements of `BlockMenuItem`,\n\t\t// which is now one.\n\t\t// @see https://github.com/WordPress/gutenberg/pull/39117#discussion_r816022116\n\t\tconst count = blockTypesListRef.current.childElementCount;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage, count );\n\t}, [ filterValue, debouncedSpeak ] );\n\n\treturn (\n\t\t<div\n\t\t\tref={ blockTypesListRef }\n\t\t\tclassName=\"edit-site-block-types-item-list\"\n\t\t>\n\t\t\t{ filteredBlockTypes.map( ( block ) => (\n\t\t\t\t<BlockMenuItem\n\t\t\t\t\tblock={ block }\n\t\t\t\t\tkey={ 'menu-itemblock-' + block.name }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</div>\n\t);\n}\n\nconst MemoizedBlockList = memo( BlockList );\n\nfunction ScreenBlockList() {\n\tconst [ filterValue, setFilterValue ] = useState( '' );\n\tconst deferredFilterValue = useDeferredValue( filterValue );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Blocks' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Customize the appearance of specific blocks and for the whole site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tclassName=\"edit-site-block-types-search\"\n\t\t\t\tonChange={ setFilterValue }\n\t\t\t\tvalue={ filterValue }\n\t\t\t\tlabel={ __( 'Search for blocks' ) }\n\t\t\t\tplaceholder={ __( 'Search' ) }\n\t\t\t/>\n\t\t\t<MemoizedBlockList filterValue={ deferredFilterValue } />\n\t\t</>\n\t);\n}\n\nexport default ScreenBlockList;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,EAAE,EAAEC,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AACjD,SACCC,QAAQ,EACRC,aAAa,EACbC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,QAAQ,EACRC,SAAS,EACTC,MAAM,EACNC,gBAAgB,EAChBC,IAAI,QACE,o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AE,EAAG,CAAC;EACtD,MAAM6E,mBAAmB,GAAG1E,gBAAgB,CAAEuD,WAAY,CAAC;EAE3D,OACCN,aAAA,CAAA0B,QAAA,QACC1B,aAAA,CAACzC,YAAY;IACZwC,KAAK,EAAG3D,EAAE,CAAE,QAAS,CAAG;IACxBuF,WAAW,EAAGvF,EAAE,CACf,qEACD;EAAG,CACH,CAAC,EACF4D,aAAA,CAACxD,aAAa;IACboF,uBAAuB;IACvBT,SAAS,EAAC,8BAA8B;IACxCU,QAAQ,EAAGL,cAAgB;IAC3BM,KAAK,EAAGxB,WAAa;IACrByB,KAAK,EAAG3F,EAAE,CAAE,mBAAoB,CAAG;IACnC4F,WAAW,EAAG5F,EAAE,CAAE,QAAS;EAAG,CAC9B,CAAC,EACF4D,aAAA,CAACsB,iBAAiB;IAAChB,WAAW,EAAGmB;EAAqB,CAAE,CACvD,CAAC;AAEL;AAEA,eAAeF,eAAe"}
1
+ {"version":3,"names":["store","blocksStore","__","sprintf","_n","FlexItem","SearchControl","__experimentalHStack","HStack","useSelect","useState","useEffect","useRef","useDeferredValue","memo","BlockIcon","privateApis","blockEditorPrivateApis","useDebounce","speak","useBlockVariations","ScreenHeader","NavigationButtonAsItem","unlock","useHasDimensionsPanel","useHasTypographyPanel","useHasBorderPanel","useGlobalSetting","useSettingsForBlockElement","useHasColorPanel","useSortedBlockTypes","blockItems","select","getBlockTypes","groupByType","blocks","block","core","noncore","type","name","startsWith","push","coreItems","nonCoreItems","reduce","useBlockHasGlobalStyles","blockName","rawSettings","settings","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel","hasVariationsPanel","length","hasGlobalStyles","BlockMenuItem","hasBlockMenuItem","navigationButtonLabel","title","createElement","path","encodeURIComponent","justify","icon","BlockList","filterValue","sortedBlockTypes","debouncedSpeak","isMatchingSearchTerm","filteredBlockTypes","filter","blockType","blockTypesListRef","count","current","childElementCount","resultsFoundMessage","ref","className","map","key","MemoizedBlockList","ScreenBlockList","setFilterValue","deferredFilterValue","Fragment","description","__nextHasNoMarginBottom","onChange","value","label","placeholder"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-block-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport {\n\tFlexItem,\n\tSearchControl,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tuseDeferredValue,\n\tmemo,\n} from '@wordpress/element';\nimport {\n\tBlockIcon,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useDebounce } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { useBlockVariations } from './variations/variations-panel';\nimport ScreenHeader from './header';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tuseHasDimensionsPanel,\n\tuseHasTypographyPanel,\n\tuseHasBorderPanel,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tuseHasColorPanel,\n} = unlock( blockEditorPrivateApis );\n\nfunction useSortedBlockTypes() {\n\tconst blockItems = useSelect(\n\t\t( select ) => select( blocksStore ).getBlockTypes(),\n\t\t[]\n\t);\n\t// Ensure core blocks are prioritized in the returned results,\n\t// because third party blocks can be registered earlier than\n\t// the core blocks (usually by using the `init` action),\n\t// thus affecting the display order.\n\t// We don't sort reusable blocks as they are handled differently.\n\tconst groupByType = ( blocks, block ) => {\n\t\tconst { core, noncore } = blocks;\n\t\tconst type = block.name.startsWith( 'core/' ) ? core : noncore;\n\t\ttype.push( block );\n\t\treturn blocks;\n\t};\n\tconst { core: coreItems, noncore: nonCoreItems } = blockItems.reduce(\n\t\tgroupByType,\n\t\t{ core: [], noncore: [] }\n\t);\n\treturn [ ...coreItems, ...nonCoreItems ];\n}\n\nexport function useBlockHasGlobalStyles( blockName ) {\n\tconst [ rawSettings ] = useGlobalSetting( '', blockName );\n\tconst settings = useSettingsForBlockElement( rawSettings, blockName );\n\tconst hasTypographyPanel = useHasTypographyPanel( settings );\n\tconst hasColorPanel = useHasColorPanel( settings );\n\tconst hasBorderPanel = useHasBorderPanel( settings );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\tconst hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;\n\tconst hasVariationsPanel = !! useBlockVariations( blockName )?.length;\n\tconst hasGlobalStyles =\n\t\thasTypographyPanel ||\n\t\thasColorPanel ||\n\t\thasLayoutPanel ||\n\t\thasVariationsPanel;\n\treturn hasGlobalStyles;\n}\n\nfunction BlockMenuItem( { block } ) {\n\tconst hasBlockMenuItem = useBlockHasGlobalStyles( block.name );\n\tif ( ! hasBlockMenuItem ) {\n\t\treturn null;\n\t}\n\n\tconst navigationButtonLabel = sprintf(\n\t\t// translators: %s: is the name of a block e.g., 'Image' or 'Table'.\n\t\t__( '%s block styles' ),\n\t\tblock.title\n\t);\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\taria-label={ navigationButtonLabel }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<BlockIcon icon={ block.icon } />\n\t\t\t\t<FlexItem>{ block.title }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction BlockList( { filterValue } ) {\n\tconst sortedBlockTypes = useSortedBlockTypes();\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst { isMatchingSearchTerm } = useSelect( blocksStore );\n\n\tconst filteredBlockTypes = ! filterValue\n\t\t? sortedBlockTypes\n\t\t: sortedBlockTypes.filter( ( blockType ) =>\n\t\t\t\tisMatchingSearchTerm( blockType, filterValue )\n\t\t );\n\n\tconst blockTypesListRef = useRef();\n\n\t// Announce search results on change\n\tuseEffect( () => {\n\t\tif ( ! filterValue ) {\n\t\t\treturn;\n\t\t}\n\t\t// We extract the results from the wrapper div's `ref` because\n\t\t// filtered items can contain items that will eventually not\n\t\t// render and there is no reliable way to detect when a child\n\t\t// will return `null`.\n\t\t// TODO: We should find a better way of handling this as it's\n\t\t// fragile and depends on the number of rendered elements of `BlockMenuItem`,\n\t\t// which is now one.\n\t\t// @see https://github.com/WordPress/gutenberg/pull/39117#discussion_r816022116\n\t\tconst count = blockTypesListRef.current.childElementCount;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage, count );\n\t}, [ filterValue, debouncedSpeak ] );\n\n\treturn (\n\t\t<div\n\t\t\tref={ blockTypesListRef }\n\t\t\tclassName=\"edit-site-block-types-item-list\"\n\t\t>\n\t\t\t{ filteredBlockTypes.map( ( block ) => (\n\t\t\t\t<BlockMenuItem\n\t\t\t\t\tblock={ block }\n\t\t\t\t\tkey={ 'menu-itemblock-' + block.name }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</div>\n\t);\n}\n\nconst MemoizedBlockList = memo( BlockList );\n\nfunction ScreenBlockList() {\n\tconst [ filterValue, setFilterValue ] = useState( '' );\n\tconst deferredFilterValue = useDeferredValue( filterValue );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Blocks' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Customize the appearance of specific blocks and for the whole site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tclassName=\"edit-site-block-types-search\"\n\t\t\t\tonChange={ setFilterValue }\n\t\t\t\tvalue={ filterValue }\n\t\t\t\tlabel={ __( 'Search for blocks' ) }\n\t\t\t\tplaceholder={ __( 'Search' ) }\n\t\t\t/>\n\t\t\t<MemoizedBlockList filterVal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