@wordpress/edit-site 5.10.0 → 5.12.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 (678) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-page/index.js +105 -0
  3. package/build/components/add-new-page/index.js.map +1 -0
  4. package/build/components/add-new-template/{add-custom-generic-template-modal.js → add-custom-generic-template-modal-content.js} +9 -25
  5. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -0
  6. package/build/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +28 -41
  7. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -0
  8. package/build/components/add-new-template/index.js +4 -5
  9. package/build/components/add-new-template/index.js.map +1 -1
  10. package/build/components/add-new-template/new-template-part.js +9 -12
  11. package/build/components/add-new-template/new-template-part.js.map +1 -1
  12. package/build/components/add-new-template/new-template.js +106 -80
  13. package/build/components/add-new-template/new-template.js.map +1 -1
  14. package/build/components/add-new-template/utils.js +71 -120
  15. package/build/components/add-new-template/utils.js.map +1 -1
  16. package/build/components/block-editor/back-button.js +1 -3
  17. package/build/components/block-editor/back-button.js.map +1 -1
  18. package/build/components/block-editor/block-inspector-button.js +3 -4
  19. package/build/components/block-editor/block-inspector-button.js.map +1 -1
  20. package/build/components/block-editor/editor-canvas.js +6 -7
  21. package/build/components/block-editor/editor-canvas.js.map +1 -1
  22. package/build/components/block-editor/index.js +14 -13
  23. package/build/components/block-editor/index.js.map +1 -1
  24. package/build/components/block-editor/inserter-media-categories.js +25 -42
  25. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  26. package/build/components/block-editor/resizable-editor.js +6 -7
  27. package/build/components/block-editor/resizable-editor.js.map +1 -1
  28. package/build/components/block-editor/resize-handle.js +5 -7
  29. package/build/components/block-editor/resize-handle.js.map +1 -1
  30. package/build/components/code-editor/code-editor-text-area.js +5 -6
  31. package/build/components/code-editor/code-editor-text-area.js.map +1 -1
  32. package/build/components/create-template-part-modal/index.js +30 -35
  33. package/build/components/create-template-part-modal/index.js.map +1 -1
  34. package/build/components/editor/index.js +37 -53
  35. package/build/components/editor/index.js.map +1 -1
  36. package/build/components/editor-canvas-container/index.js +15 -9
  37. package/build/components/editor-canvas-container/index.js.map +1 -1
  38. package/build/components/error-boundary/warning.js +8 -10
  39. package/build/components/error-boundary/warning.js.map +1 -1
  40. package/build/components/global-styles/block-preview-panel.js +7 -10
  41. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  42. package/build/components/global-styles/color-indicator-wrapper.js +4 -5
  43. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  44. package/build/components/global-styles/color-palette-panel.js +3 -4
  45. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  46. package/build/components/global-styles/dimensions-panel.js +1 -3
  47. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  48. package/build/components/global-styles/global-styles-provider.js +8 -10
  49. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  50. package/build/components/global-styles/gradients-palette-panel.js +3 -4
  51. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  52. package/build/components/global-styles/header.js +4 -5
  53. package/build/components/global-styles/header.js.map +1 -1
  54. package/build/components/global-styles/icon-with-current-color.js +4 -5
  55. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  56. package/build/components/global-styles/navigation-button.js +5 -6
  57. package/build/components/global-styles/navigation-button.js.map +1 -1
  58. package/build/components/global-styles/palette.js +10 -14
  59. package/build/components/global-styles/palette.js.map +1 -1
  60. package/build/components/global-styles/preview.js +41 -51
  61. package/build/components/global-styles/preview.js.map +1 -1
  62. package/build/components/global-styles/screen-block-list.js +4 -7
  63. package/build/components/global-styles/screen-block-list.js.map +1 -1
  64. package/build/components/global-styles/screen-block.js +88 -12
  65. package/build/components/global-styles/screen-block.js.map +1 -1
  66. package/build/components/global-styles/screen-color-palette.js +3 -4
  67. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  68. package/build/components/global-styles/screen-revisions/index.js +10 -17
  69. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  70. package/build/components/global-styles/screen-revisions/revisions-buttons.js +26 -33
  71. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  72. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +20 -35
  73. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  74. package/build/components/global-styles/screen-root.js +5 -5
  75. package/build/components/global-styles/screen-root.js.map +1 -1
  76. package/build/components/global-styles/screen-typography-element.js +3 -4
  77. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  78. package/build/components/global-styles/screen-typography.js +5 -6
  79. package/build/components/global-styles/screen-typography.js.map +1 -1
  80. package/build/components/global-styles/style-variations-container.js +11 -16
  81. package/build/components/global-styles/style-variations-container.js.map +1 -1
  82. package/build/components/global-styles/subtitle.js +4 -5
  83. package/build/components/global-styles/subtitle.js.map +1 -1
  84. package/build/components/global-styles/typography-panel.js +4 -5
  85. package/build/components/global-styles/typography-panel.js.map +1 -1
  86. package/build/components/global-styles/typography-preview.js +5 -6
  87. package/build/components/global-styles/typography-preview.js.map +1 -1
  88. package/build/components/global-styles/ui.js +49 -30
  89. package/build/components/global-styles/ui.js.map +1 -1
  90. package/build/components/global-styles/variations-panel.js +5 -6
  91. package/build/components/global-styles/variations-panel.js.map +1 -1
  92. package/build/components/header-edit-mode/document-actions/index.js +99 -95
  93. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  94. package/build/components/header-edit-mode/index.js +16 -7
  95. package/build/components/header-edit-mode/index.js.map +1 -1
  96. package/build/components/header-edit-mode/more-menu/index.js +49 -53
  97. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  98. package/build/components/header-edit-mode/tools-more-menu-group/index.js +5 -14
  99. package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  100. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  101. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  102. package/build/components/keyboard-shortcut-help-modal/index.js +41 -51
  103. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  104. package/build/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  105. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  106. package/build/components/layout/hooks.js +54 -0
  107. package/build/components/layout/hooks.js.map +1 -0
  108. package/build/components/layout/index.js +33 -94
  109. package/build/components/layout/index.js.map +1 -1
  110. package/build/components/list/added-by.js +13 -23
  111. package/build/components/list/added-by.js.map +1 -1
  112. package/build/components/list/header.js +4 -7
  113. package/build/components/list/header.js.map +1 -1
  114. package/build/components/list/index.js +2 -4
  115. package/build/components/list/index.js.map +1 -1
  116. package/build/components/list/table.js +35 -40
  117. package/build/components/list/table.js.map +1 -1
  118. package/build/components/page-actions/delete-page-menu-item.js +70 -0
  119. package/build/components/page-actions/delete-page-menu-item.js.map +1 -0
  120. package/build/components/page-actions/index.js +43 -0
  121. package/build/components/page-actions/index.js.map +1 -0
  122. package/build/components/page-content-lock/constants.js +9 -0
  123. package/build/components/page-content-lock/constants.js.map +1 -0
  124. package/build/components/page-content-lock/index.js +29 -0
  125. package/build/components/page-content-lock/index.js.map +1 -0
  126. package/build/components/page-content-lock/use-disable-non-content-blocks.js +49 -0
  127. package/build/components/page-content-lock/use-disable-non-content-blocks.js.map +1 -0
  128. package/build/components/page-content-lock/use-page-content-lock-notifications.js +112 -0
  129. package/build/components/page-content-lock/use-page-content-lock-notifications.js.map +1 -0
  130. package/build/components/preferences-modal/index.js +4 -5
  131. package/build/components/preferences-modal/index.js.map +1 -1
  132. package/build/components/resizable-frame/index.js +250 -0
  133. package/build/components/resizable-frame/index.js.map +1 -0
  134. package/build/components/revisions/index.js +13 -15
  135. package/build/components/revisions/index.js.map +1 -1
  136. package/build/components/routes/link.js +8 -12
  137. package/build/components/routes/link.js.map +1 -1
  138. package/build/components/routes/use-title.js +1 -5
  139. package/build/components/routes/use-title.js.map +1 -1
  140. package/build/components/save-button/index.js +13 -7
  141. package/build/components/save-button/index.js.map +1 -1
  142. package/build/components/save-hub/index.js +97 -5
  143. package/build/components/save-hub/index.js.map +1 -1
  144. package/build/components/save-panel/index.js +63 -17
  145. package/build/components/save-panel/index.js.map +1 -1
  146. package/build/components/secondary-sidebar/list-view-sidebar.js +12 -6
  147. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  148. package/build/components/sidebar/index.js +11 -9
  149. package/build/components/sidebar/index.js.map +1 -1
  150. package/build/components/sidebar-edit-mode/default-sidebar.js +11 -12
  151. package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  152. package/build/components/sidebar-edit-mode/index.js +13 -10
  153. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  154. package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js +79 -0
  155. package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +1 -0
  156. package/build/components/sidebar-edit-mode/page-panels/index.js +86 -0
  157. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -0
  158. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -5
  159. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  160. package/build/components/sidebar-edit-mode/settings-header/index.js +39 -21
  161. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  162. package/build/components/sidebar-edit-mode/sidebar-card/index.js +46 -0
  163. package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -0
  164. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +3 -4
  165. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  166. package/build/components/sidebar-edit-mode/{template-card → template-panel}/index.js +22 -18
  167. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -0
  168. package/build/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +7 -8
  169. package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -0
  170. package/build/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +12 -16
  171. package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -0
  172. package/build/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +15 -19
  173. package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -0
  174. package/build/components/sidebar-navigation-item/index.js +7 -8
  175. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  176. package/build/components/sidebar-navigation-screen/index.js +21 -14
  177. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  178. package/build/components/sidebar-navigation-screen-global-styles/index.js +166 -12
  179. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  180. package/build/components/sidebar-navigation-screen-main/index.js +24 -33
  181. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  182. package/build/components/sidebar-navigation-screen-navigation-item/index.js +3 -5
  183. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  184. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +159 -0
  185. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -0
  186. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +17 -0
  187. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -0
  188. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +51 -107
  189. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  190. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +84 -0
  191. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -0
  192. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +16 -74
  193. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  194. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +52 -0
  195. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -0
  196. package/build/components/sidebar-navigation-screen-page/index.js +81 -10
  197. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  198. package/build/components/sidebar-navigation-screen-page/page-details.js +148 -0
  199. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -0
  200. package/build/components/sidebar-navigation-screen-page/status-label.js +110 -0
  201. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -0
  202. package/build/components/sidebar-navigation-screen-pages/index.js +128 -17
  203. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  204. package/build/components/sidebar-navigation-screen-template/index.js +22 -16
  205. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  206. package/build/components/sidebar-navigation-screen-template-part/index.js +105 -0
  207. package/build/components/sidebar-navigation-screen-template-part/index.js.map +1 -0
  208. package/build/components/sidebar-navigation-screen-templates/index.js +44 -24
  209. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  210. package/build/components/sidebar-navigation-subtitle/index.js +3 -4
  211. package/build/components/sidebar-navigation-subtitle/index.js.map +1 -1
  212. package/build/components/site-hub/index.js +20 -15
  213. package/build/components/site-hub/index.js.map +1 -1
  214. package/build/components/site-icon/index.js +4 -5
  215. package/build/components/site-icon/index.js.map +1 -1
  216. package/build/components/start-template-options/index.js +15 -21
  217. package/build/components/start-template-options/index.js.map +1 -1
  218. package/build/components/style-book/index.js +107 -37
  219. package/build/components/style-book/index.js.map +1 -1
  220. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +2 -2
  221. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  222. package/build/components/sync-state-with-url/use-sync-path-with-url.js +9 -10
  223. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  224. package/build/components/{list/actions → template-actions}/index.js +39 -33
  225. package/build/components/template-actions/index.js.map +1 -0
  226. package/build/components/{list/actions → template-actions}/rename-menu-item.js +4 -5
  227. package/build/components/template-actions/rename-menu-item.js.map +1 -0
  228. package/build/components/template-part-converter/convert-to-regular.js +4 -5
  229. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  230. package/build/components/template-part-converter/convert-to-template-part.js +8 -10
  231. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  232. package/build/components/template-part-converter/index.js +12 -18
  233. package/build/components/template-part-converter/index.js.map +1 -1
  234. package/build/components/use-edited-entity-record/index.js +8 -4
  235. package/build/components/use-edited-entity-record/index.js.map +1 -1
  236. package/build/components/welcome-guide/image.js +4 -5
  237. package/build/components/welcome-guide/image.js.map +1 -1
  238. package/build/hooks/commands/use-edit-mode-commands.js +103 -0
  239. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -0
  240. package/build/hooks/push-changes-to-global-styles/index.js +11 -8
  241. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  242. package/build/hooks/template-part-edit.js +5 -6
  243. package/build/hooks/template-part-edit.js.map +1 -1
  244. package/build/index.js +3 -6
  245. package/build/index.js.map +1 -1
  246. package/build/store/actions.js +131 -125
  247. package/build/store/actions.js.map +1 -1
  248. package/build/store/private-actions.js +7 -10
  249. package/build/store/private-actions.js.map +1 -1
  250. package/build/store/reducer.js +32 -33
  251. package/build/store/reducer.js.map +1 -1
  252. package/build/store/selectors.js +35 -11
  253. package/build/store/selectors.js.map +1 -1
  254. package/build/store/utils.js +1 -3
  255. package/build/store/utils.js.map +1 -1
  256. package/build/utils/get-is-list-page.js +3 -4
  257. package/build/utils/get-is-list-page.js.map +1 -1
  258. package/build/utils/is-previewing-theme.js +1 -3
  259. package/build/utils/is-previewing-theme.js.map +1 -1
  260. package/build/utils/is-template-revertable.js +1 -1
  261. package/build/utils/is-template-revertable.js.map +1 -1
  262. package/build-module/components/add-new-page/index.js +93 -0
  263. package/build-module/components/add-new-page/index.js.map +1 -0
  264. package/build-module/components/add-new-template/{add-custom-generic-template-modal.js → add-custom-generic-template-modal-content.js} +10 -23
  265. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -0
  266. package/build-module/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +30 -42
  267. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -0
  268. package/build-module/components/add-new-template/index.js +4 -5
  269. package/build-module/components/add-new-template/index.js.map +1 -1
  270. package/build-module/components/add-new-template/new-template-part.js +9 -12
  271. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  272. package/build-module/components/add-new-template/new-template.js +105 -82
  273. package/build-module/components/add-new-template/new-template.js.map +1 -1
  274. package/build-module/components/add-new-template/utils.js +71 -120
  275. package/build-module/components/add-new-template/utils.js.map +1 -1
  276. package/build-module/components/block-editor/back-button.js +1 -3
  277. package/build-module/components/block-editor/back-button.js.map +1 -1
  278. package/build-module/components/block-editor/block-inspector-button.js +3 -4
  279. package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
  280. package/build-module/components/block-editor/editor-canvas.js +6 -7
  281. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  282. package/build-module/components/block-editor/index.js +13 -13
  283. package/build-module/components/block-editor/index.js.map +1 -1
  284. package/build-module/components/block-editor/inserter-media-categories.js +25 -42
  285. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
  286. package/build-module/components/block-editor/resizable-editor.js +6 -7
  287. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  288. package/build-module/components/block-editor/resize-handle.js +5 -7
  289. package/build-module/components/block-editor/resize-handle.js.map +1 -1
  290. package/build-module/components/code-editor/code-editor-text-area.js +5 -6
  291. package/build-module/components/code-editor/code-editor-text-area.js.map +1 -1
  292. package/build-module/components/create-template-part-modal/index.js +31 -36
  293. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  294. package/build-module/components/editor/index.js +38 -56
  295. package/build-module/components/editor/index.js.map +1 -1
  296. package/build-module/components/editor-canvas-container/index.js +12 -9
  297. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  298. package/build-module/components/error-boundary/warning.js +8 -10
  299. package/build-module/components/error-boundary/warning.js.map +1 -1
  300. package/build-module/components/global-styles/block-preview-panel.js +7 -10
  301. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  302. package/build-module/components/global-styles/color-indicator-wrapper.js +4 -5
  303. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  304. package/build-module/components/global-styles/color-palette-panel.js +3 -4
  305. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  306. package/build-module/components/global-styles/dimensions-panel.js +1 -3
  307. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  308. package/build-module/components/global-styles/global-styles-provider.js +8 -10
  309. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  310. package/build-module/components/global-styles/gradients-palette-panel.js +3 -4
  311. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  312. package/build-module/components/global-styles/header.js +4 -5
  313. package/build-module/components/global-styles/header.js.map +1 -1
  314. package/build-module/components/global-styles/icon-with-current-color.js +4 -5
  315. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  316. package/build-module/components/global-styles/navigation-button.js +5 -6
  317. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  318. package/build-module/components/global-styles/palette.js +10 -14
  319. package/build-module/components/global-styles/palette.js.map +1 -1
  320. package/build-module/components/global-styles/preview.js +41 -51
  321. package/build-module/components/global-styles/preview.js.map +1 -1
  322. package/build-module/components/global-styles/screen-block-list.js +4 -7
  323. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  324. package/build-module/components/global-styles/screen-block.js +90 -13
  325. package/build-module/components/global-styles/screen-block.js.map +1 -1
  326. package/build-module/components/global-styles/screen-color-palette.js +3 -4
  327. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  328. package/build-module/components/global-styles/screen-revisions/index.js +10 -17
  329. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  330. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +26 -34
  331. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  332. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +20 -34
  333. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  334. package/build-module/components/global-styles/screen-root.js +5 -5
  335. package/build-module/components/global-styles/screen-root.js.map +1 -1
  336. package/build-module/components/global-styles/screen-typography-element.js +3 -4
  337. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  338. package/build-module/components/global-styles/screen-typography.js +5 -6
  339. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  340. package/build-module/components/global-styles/style-variations-container.js +12 -17
  341. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  342. package/build-module/components/global-styles/subtitle.js +4 -5
  343. package/build-module/components/global-styles/subtitle.js.map +1 -1
  344. package/build-module/components/global-styles/typography-panel.js +4 -5
  345. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  346. package/build-module/components/global-styles/typography-preview.js +5 -6
  347. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  348. package/build-module/components/global-styles/ui.js +50 -31
  349. package/build-module/components/global-styles/ui.js.map +1 -1
  350. package/build-module/components/global-styles/variations-panel.js +5 -6
  351. package/build-module/components/global-styles/variations-panel.js.map +1 -1
  352. package/build-module/components/header-edit-mode/document-actions/index.js +99 -97
  353. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  354. package/build-module/components/header-edit-mode/index.js +16 -8
  355. package/build-module/components/header-edit-mode/index.js.map +1 -1
  356. package/build-module/components/header-edit-mode/more-menu/index.js +49 -53
  357. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  358. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +5 -13
  359. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  360. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  361. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  362. package/build-module/components/keyboard-shortcut-help-modal/index.js +39 -49
  363. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  364. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  365. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  366. package/build-module/components/layout/hooks.js +41 -0
  367. package/build-module/components/layout/hooks.js.map +1 -0
  368. package/build-module/components/layout/index.js +34 -97
  369. package/build-module/components/layout/index.js.map +1 -1
  370. package/build-module/components/list/added-by.js +13 -23
  371. package/build-module/components/list/added-by.js.map +1 -1
  372. package/build-module/components/list/header.js +4 -7
  373. package/build-module/components/list/header.js.map +1 -1
  374. package/build-module/components/list/index.js +2 -4
  375. package/build-module/components/list/index.js.map +1 -1
  376. package/build-module/components/list/table.js +34 -39
  377. package/build-module/components/list/table.js.map +1 -1
  378. package/build-module/components/page-actions/delete-page-menu-item.js +58 -0
  379. package/build-module/components/page-actions/delete-page-menu-item.js.map +1 -0
  380. package/build-module/components/page-actions/index.js +30 -0
  381. package/build-module/components/page-actions/index.js.map +1 -0
  382. package/build-module/components/page-content-lock/constants.js +2 -0
  383. package/build-module/components/page-content-lock/constants.js.map +1 -0
  384. package/build-module/components/page-content-lock/index.js +14 -0
  385. package/build-module/components/page-content-lock/index.js.map +1 -0
  386. package/build-module/components/page-content-lock/use-disable-non-content-blocks.js +36 -0
  387. package/build-module/components/page-content-lock/use-disable-non-content-blocks.js.map +1 -0
  388. package/build-module/components/page-content-lock/use-page-content-lock-notifications.js +98 -0
  389. package/build-module/components/page-content-lock/use-page-content-lock-notifications.js.map +1 -0
  390. package/build-module/components/preferences-modal/index.js +4 -5
  391. package/build-module/components/preferences-modal/index.js.map +1 -1
  392. package/build-module/components/resizable-frame/index.js +236 -0
  393. package/build-module/components/resizable-frame/index.js.map +1 -0
  394. package/build-module/components/revisions/index.js +13 -14
  395. package/build-module/components/revisions/index.js.map +1 -1
  396. package/build-module/components/routes/link.js +8 -12
  397. package/build-module/components/routes/link.js.map +1 -1
  398. package/build-module/components/routes/use-title.js +1 -5
  399. package/build-module/components/routes/use-title.js.map +1 -1
  400. package/build-module/components/save-button/index.js +13 -7
  401. package/build-module/components/save-button/index.js.map +1 -1
  402. package/build-module/components/save-hub/index.js +95 -8
  403. package/build-module/components/save-hub/index.js.map +1 -1
  404. package/build-module/components/save-panel/index.js +62 -19
  405. package/build-module/components/save-panel/index.js.map +1 -1
  406. package/build-module/components/secondary-sidebar/list-view-sidebar.js +12 -6
  407. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  408. package/build-module/components/sidebar/index.js +9 -8
  409. package/build-module/components/sidebar/index.js.map +1 -1
  410. package/build-module/components/sidebar-edit-mode/default-sidebar.js +11 -12
  411. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  412. package/build-module/components/sidebar-edit-mode/index.js +14 -11
  413. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  414. package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js +67 -0
  415. package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +1 -0
  416. package/build-module/components/sidebar-edit-mode/page-panels/index.js +67 -0
  417. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -0
  418. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -5
  419. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  420. package/build-module/components/sidebar-edit-mode/settings-header/index.js +36 -22
  421. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  422. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +35 -0
  423. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -0
  424. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +3 -4
  425. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  426. package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/index.js +20 -19
  427. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -0
  428. package/build-module/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +7 -8
  429. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -0
  430. package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +12 -16
  431. package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -0
  432. package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +15 -19
  433. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -0
  434. package/build-module/components/sidebar-navigation-item/index.js +7 -8
  435. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  436. package/build-module/components/sidebar-navigation-screen/index.js +22 -15
  437. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  438. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +161 -15
  439. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  440. package/build-module/components/sidebar-navigation-screen-main/index.js +21 -32
  441. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  442. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +3 -5
  443. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  444. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +138 -0
  445. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -0
  446. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +10 -0
  447. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -0
  448. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +49 -106
  449. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  450. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +68 -0
  451. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -0
  452. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +14 -74
  453. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  454. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +39 -0
  455. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -0
  456. package/build-module/components/sidebar-navigation-screen-page/index.js +79 -14
  457. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  458. package/build-module/components/sidebar-navigation-screen-page/page-details.js +131 -0
  459. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -0
  460. package/build-module/components/sidebar-navigation-screen-page/status-label.js +97 -0
  461. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -0
  462. package/build-module/components/sidebar-navigation-screen-pages/index.js +125 -19
  463. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  464. package/build-module/components/sidebar-navigation-screen-template/index.js +22 -17
  465. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  466. package/build-module/components/sidebar-navigation-screen-template-part/index.js +86 -0
  467. package/build-module/components/sidebar-navigation-screen-template-part/index.js.map +1 -0
  468. package/build-module/components/sidebar-navigation-screen-templates/index.js +43 -24
  469. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  470. package/build-module/components/sidebar-navigation-subtitle/index.js +3 -4
  471. package/build-module/components/sidebar-navigation-subtitle/index.js.map +1 -1
  472. package/build-module/components/site-hub/index.js +21 -16
  473. package/build-module/components/site-hub/index.js.map +1 -1
  474. package/build-module/components/site-icon/index.js +4 -5
  475. package/build-module/components/site-icon/index.js.map +1 -1
  476. package/build-module/components/start-template-options/index.js +15 -21
  477. package/build-module/components/start-template-options/index.js.map +1 -1
  478. package/build-module/components/style-book/index.js +107 -38
  479. package/build-module/components/style-book/index.js.map +1 -1
  480. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +2 -2
  481. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  482. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +9 -10
  483. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  484. package/build-module/components/template-actions/index.js +92 -0
  485. package/build-module/components/template-actions/index.js.map +1 -0
  486. package/build-module/components/{list/actions → template-actions}/rename-menu-item.js +4 -5
  487. package/build-module/components/template-actions/rename-menu-item.js.map +1 -0
  488. package/build-module/components/template-part-converter/convert-to-regular.js +4 -5
  489. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  490. package/build-module/components/template-part-converter/convert-to-template-part.js +8 -10
  491. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  492. package/build-module/components/template-part-converter/index.js +12 -18
  493. package/build-module/components/template-part-converter/index.js.map +1 -1
  494. package/build-module/components/use-edited-entity-record/index.js +8 -4
  495. package/build-module/components/use-edited-entity-record/index.js.map +1 -1
  496. package/build-module/components/welcome-guide/image.js +4 -5
  497. package/build-module/components/welcome-guide/image.js.map +1 -1
  498. package/build-module/hooks/commands/use-edit-mode-commands.js +84 -0
  499. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -0
  500. package/build-module/hooks/push-changes-to-global-styles/index.js +11 -8
  501. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  502. package/build-module/hooks/template-part-edit.js +5 -6
  503. package/build-module/hooks/template-part-edit.js.map +1 -1
  504. package/build-module/index.js +3 -6
  505. package/build-module/index.js.map +1 -1
  506. package/build-module/store/actions.js +127 -126
  507. package/build-module/store/actions.js.map +1 -1
  508. package/build-module/store/private-actions.js +7 -10
  509. package/build-module/store/private-actions.js.map +1 -1
  510. package/build-module/store/reducer.js +30 -33
  511. package/build-module/store/reducer.js.map +1 -1
  512. package/build-module/store/selectors.js +31 -11
  513. package/build-module/store/selectors.js.map +1 -1
  514. package/build-module/store/utils.js +1 -3
  515. package/build-module/store/utils.js.map +1 -1
  516. package/build-module/utils/get-is-list-page.js +3 -4
  517. package/build-module/utils/get-is-list-page.js.map +1 -1
  518. package/build-module/utils/is-previewing-theme.js +1 -3
  519. package/build-module/utils/is-previewing-theme.js.map +1 -1
  520. package/build-module/utils/is-template-revertable.js +1 -1
  521. package/build-module/utils/is-template-revertable.js.map +1 -1
  522. package/build-style/style-rtl.css +477 -232
  523. package/build-style/style.css +478 -232
  524. package/package.json +40 -37
  525. package/src/components/add-new-page/index.js +105 -0
  526. package/src/components/add-new-template/add-custom-generic-template-modal-content.js +82 -0
  527. package/src/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +13 -26
  528. package/src/components/add-new-template/new-template.js +141 -154
  529. package/src/components/add-new-template/style.scss +79 -66
  530. package/src/components/block-editor/index.js +27 -17
  531. package/src/components/create-template-part-modal/index.js +19 -25
  532. package/src/components/editor/index.js +30 -53
  533. package/src/components/editor/style.scss +11 -1
  534. package/src/components/editor-canvas-container/index.js +28 -19
  535. package/src/components/global-styles/screen-block.js +74 -3
  536. package/src/components/global-styles/screen-revisions/index.js +3 -11
  537. package/src/components/global-styles/screen-revisions/revisions-buttons.js +33 -25
  538. package/src/components/global-styles/screen-revisions/style.scss +3 -2
  539. package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +16 -3
  540. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +22 -24
  541. package/src/components/global-styles/screen-root.js +5 -3
  542. package/src/components/global-styles/style-variations-container.js +13 -18
  543. package/src/components/global-styles/style.scss +3 -0
  544. package/src/components/global-styles/ui.js +39 -9
  545. package/src/components/header-edit-mode/document-actions/index.js +112 -121
  546. package/src/components/header-edit-mode/document-actions/style.scss +78 -54
  547. package/src/components/header-edit-mode/index.js +18 -0
  548. package/src/components/header-edit-mode/style.scss +1 -0
  549. package/src/components/header-edit-mode/tools-more-menu-group/index.js +1 -6
  550. package/src/components/layout/hooks.js +46 -0
  551. package/src/components/layout/index.js +47 -122
  552. package/src/components/layout/style.scss +8 -2
  553. package/src/components/list/style.scss +1 -0
  554. package/src/components/list/table.js +6 -2
  555. package/src/components/page-actions/delete-page-menu-item.js +71 -0
  556. package/src/components/page-actions/index.js +36 -0
  557. package/src/components/page-content-lock/constants.js +5 -0
  558. package/src/components/page-content-lock/index.js +14 -0
  559. package/src/components/page-content-lock/use-disable-non-content-blocks.js +44 -0
  560. package/src/components/page-content-lock/use-page-content-lock-notifications.js +128 -0
  561. package/src/components/resizable-frame/index.js +263 -0
  562. package/src/components/resizable-frame/style.scss +71 -0
  563. package/src/components/revisions/index.js +7 -7
  564. package/src/components/save-button/index.js +6 -0
  565. package/src/components/save-hub/index.js +143 -38
  566. package/src/components/save-hub/style.scss +6 -0
  567. package/src/components/save-panel/index.js +62 -15
  568. package/src/components/secondary-sidebar/list-view-sidebar.js +10 -2
  569. package/src/components/sidebar/index.js +10 -8
  570. package/src/components/sidebar/style.scss +3 -4
  571. package/src/components/sidebar-edit-mode/index.js +16 -14
  572. package/src/components/sidebar-edit-mode/page-panels/content-blocks-list.js +77 -0
  573. package/src/components/sidebar-edit-mode/page-panels/index.js +89 -0
  574. package/src/components/sidebar-edit-mode/page-panels/style.scss +10 -0
  575. package/src/components/sidebar-edit-mode/settings-header/index.js +51 -28
  576. package/src/components/sidebar-edit-mode/sidebar-card/index.js +34 -0
  577. package/src/components/sidebar-edit-mode/sidebar-card/style.scss +34 -0
  578. package/src/components/sidebar-edit-mode/{template-card → template-panel}/index.js +22 -19
  579. package/src/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +1 -2
  580. package/src/components/sidebar-edit-mode/{template-card → template-panel}/style.scss +2 -32
  581. package/src/components/sidebar-navigation-item/style.scss +9 -0
  582. package/src/components/sidebar-navigation-screen/index.js +74 -50
  583. package/src/components/sidebar-navigation-screen/style.scss +46 -6
  584. package/src/components/sidebar-navigation-screen-global-styles/index.js +212 -21
  585. package/src/components/sidebar-navigation-screen-global-styles/style.scss +15 -0
  586. package/src/components/sidebar-navigation-screen-main/index.js +35 -52
  587. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +157 -0
  588. package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +9 -0
  589. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +63 -117
  590. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +83 -0
  591. package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +6 -72
  592. package/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +47 -0
  593. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +7 -21
  594. package/src/components/sidebar-navigation-screen-page/index.js +137 -24
  595. package/src/components/sidebar-navigation-screen-page/page-details.js +163 -0
  596. package/src/components/sidebar-navigation-screen-page/status-label.js +101 -0
  597. package/src/components/sidebar-navigation-screen-page/style.scss +80 -0
  598. package/src/components/sidebar-navigation-screen-pages/index.js +180 -44
  599. package/src/components/sidebar-navigation-screen-template/index.js +25 -22
  600. package/src/components/sidebar-navigation-screen-template-part/index.js +103 -0
  601. package/src/components/sidebar-navigation-screen-templates/index.js +52 -13
  602. package/src/components/sidebar-navigation-subtitle/style.scss +2 -2
  603. package/src/components/site-hub/index.js +29 -15
  604. package/src/components/site-hub/style.scss +26 -0
  605. package/src/components/start-template-options/style.scss +20 -21
  606. package/src/components/style-book/index.js +132 -43
  607. package/src/components/style-book/style.scss +19 -0
  608. package/src/components/{list/actions → template-actions}/index.js +31 -11
  609. package/src/components/use-edited-entity-record/index.js +12 -3
  610. package/src/hooks/commands/use-edit-mode-commands.js +79 -0
  611. package/src/hooks/push-changes-to-global-styles/index.js +13 -7
  612. package/src/store/actions.js +24 -6
  613. package/src/store/reducer.js +20 -0
  614. package/src/store/selectors.js +24 -0
  615. package/src/store/test/actions.js +31 -0
  616. package/src/store/test/reducer.js +44 -0
  617. package/src/store/test/selectors.js +57 -0
  618. package/src/store/test/utils.js +15 -5
  619. package/src/style.scss +6 -3
  620. package/src/utils/is-previewing-theme.js +1 -4
  621. package/build/components/add-new-template/add-custom-generic-template-modal.js.map +0 -1
  622. package/build/components/add-new-template/add-custom-template-modal.js.map +0 -1
  623. package/build/components/global-styles/border-panel.js +0 -135
  624. package/build/components/global-styles/border-panel.js.map +0 -1
  625. package/build/components/list/actions/index.js.map +0 -1
  626. package/build/components/list/actions/rename-menu-item.js.map +0 -1
  627. package/build/components/navigate-to-link/index.js +0 -51
  628. package/build/components/navigate-to-link/index.js.map +0 -1
  629. package/build/components/sidebar-edit-mode/template-card/index.js.map +0 -1
  630. package/build/components/sidebar-edit-mode/template-card/template-actions.js.map +0 -1
  631. package/build/components/sidebar-edit-mode/template-card/template-areas.js.map +0 -1
  632. package/build/components/sidebar-edit-mode/template-revisions/index.js.map +0 -1
  633. package/build/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -19
  634. package/build/components/sidebar-navigation-screen-navigation-menus/loader.js.map +0 -1
  635. package/build/components/template-details/edit-template-title.js +0 -42
  636. package/build/components/template-details/edit-template-title.js.map +0 -1
  637. package/build/components/template-details/index.js +0 -103
  638. package/build/components/template-details/index.js.map +0 -1
  639. package/build/components/template-details/template-areas.js +0 -166
  640. package/build/components/template-details/template-areas.js.map +0 -1
  641. package/build/components/template-details/template-part-area-selector.js +0 -48
  642. package/build/components/template-details/template-part-area-selector.js.map +0 -1
  643. package/build-module/components/add-new-template/add-custom-generic-template-modal.js.map +0 -1
  644. package/build-module/components/add-new-template/add-custom-template-modal.js.map +0 -1
  645. package/build-module/components/global-styles/border-panel.js +0 -125
  646. package/build-module/components/global-styles/border-panel.js.map +0 -1
  647. package/build-module/components/list/actions/index.js +0 -86
  648. package/build-module/components/list/actions/index.js.map +0 -1
  649. package/build-module/components/list/actions/rename-menu-item.js.map +0 -1
  650. package/build-module/components/navigate-to-link/index.js +0 -39
  651. package/build-module/components/navigate-to-link/index.js.map +0 -1
  652. package/build-module/components/sidebar-edit-mode/template-card/index.js.map +0 -1
  653. package/build-module/components/sidebar-edit-mode/template-card/template-actions.js.map +0 -1
  654. package/build-module/components/sidebar-edit-mode/template-card/template-areas.js.map +0 -1
  655. package/build-module/components/sidebar-edit-mode/template-revisions/index.js.map +0 -1
  656. package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -11
  657. package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js.map +0 -1
  658. package/build-module/components/template-details/edit-template-title.js +0 -33
  659. package/build-module/components/template-details/edit-template-title.js.map +0 -1
  660. package/build-module/components/template-details/index.js +0 -83
  661. package/build-module/components/template-details/index.js.map +0 -1
  662. package/build-module/components/template-details/template-areas.js +0 -145
  663. package/build-module/components/template-details/template-areas.js.map +0 -1
  664. package/build-module/components/template-details/template-part-area-selector.js +0 -36
  665. package/build-module/components/template-details/template-part-area-selector.js.map +0 -1
  666. package/src/components/add-new-template/add-custom-generic-template-modal.js +0 -101
  667. package/src/components/global-styles/border-panel.js +0 -114
  668. package/src/components/navigate-to-link/index.js +0 -46
  669. package/src/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -9
  670. package/src/components/sidebar-navigation-screen-pages/style.scss +0 -4
  671. package/src/components/template-details/edit-template-title.js +0 -41
  672. package/src/components/template-details/index.js +0 -113
  673. package/src/components/template-details/style.scss +0 -72
  674. package/src/components/template-details/template-areas.js +0 -167
  675. package/src/components/template-details/template-part-area-selector.js +0 -39
  676. /package/src/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +0 -0
  677. /package/src/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +0 -0
  678. /package/src/components/{list/actions → template-actions}/rename-menu-item.js +0 -0
@@ -13,18 +13,12 @@ var _element = require("@wordpress/element");
13
13
 
14
14
  var _blockEditor = require("@wordpress/block-editor");
15
15
 
16
- var _lodash = require("lodash");
17
-
18
16
  var _privateApis = require("../../../private-apis");
19
17
 
20
18
  /**
21
19
  * WordPress dependencies
22
20
  */
23
21
 
24
- /**
25
- * External dependencies
26
- */
27
-
28
22
  /**
29
23
  * Internal dependencies
30
24
  */
@@ -34,6 +28,7 @@ const SITE_EDITOR_AUTHORS_QUERY = {
34
28
  context: 'view',
35
29
  capabilities: ['edit_theme_options']
36
30
  };
31
+ const EMPTY_ARRAY = [];
37
32
  const {
38
33
  GlobalStylesContext
39
34
  } = (0, _privateApis.unlock)(_blockEditor.privateApis);
@@ -46,15 +41,13 @@ function useGlobalStylesRevisions() {
46
41
  authors,
47
42
  currentUser,
48
43
  isDirty,
49
- revisions,
50
- isLoading
44
+ revisions
51
45
  } = (0, _data.useSelect)(select => {
52
46
  const {
53
47
  __experimentalGetDirtyEntityRecords,
54
48
  getCurrentUser,
55
49
  getUsers,
56
- getCurrentThemeGlobalStylesRevisions,
57
- isResolving
50
+ getCurrentThemeGlobalStylesRevisions
58
51
  } = select(_coreData.store);
59
52
 
60
53
  const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
@@ -63,56 +56,48 @@ function useGlobalStylesRevisions() {
63
56
 
64
57
  const _isDirty = dirtyEntityRecords.length > 0;
65
58
 
66
- const globalStylesRevisions = getCurrentThemeGlobalStylesRevisions() || [];
59
+ const globalStylesRevisions = getCurrentThemeGlobalStylesRevisions() || EMPTY_ARRAY;
67
60
 
68
- const _authors = getUsers(SITE_EDITOR_AUTHORS_QUERY);
61
+ const _authors = getUsers(SITE_EDITOR_AUTHORS_QUERY) || EMPTY_ARRAY;
69
62
 
70
63
  return {
71
64
  authors: _authors,
72
65
  currentUser: _currentUser,
73
66
  isDirty: _isDirty,
74
- revisions: globalStylesRevisions,
75
- isLoading: !globalStylesRevisions.length || isResolving('getUsers', [SITE_EDITOR_AUTHORS_QUERY])
67
+ revisions: globalStylesRevisions
76
68
  };
77
69
  }, []);
78
70
  return (0, _element.useMemo)(() => {
79
- var _modifiedRevisions$;
80
-
81
71
  let _modifiedRevisions = [];
82
72
 
83
- if (isLoading || !revisions.length) {
73
+ if (!authors.length || !revisions.length) {
84
74
  return {
85
75
  revisions: _modifiedRevisions,
86
76
  hasUnsavedChanges: isDirty,
87
- isLoading
77
+ isLoading: true
88
78
  };
89
- }
90
- /*
91
- * Adds a flag to the first revision, which is the latest.
92
- * Also adds author information to the revision.
93
- * Then, if there are unsaved changes in the editor, create a
94
- * new "revision" item that represents the unsaved changes.
95
- */
79
+ } // Adds author details to each revision.
96
80
 
97
81
 
98
82
  _modifiedRevisions = revisions.map(revision => {
99
83
  return { ...revision,
100
84
  author: authors.find(author => author.id === revision.author)
101
85
  };
102
- });
86
+ }); // Flags the most current saved revision.
103
87
 
104
- if (((_modifiedRevisions$ = _modifiedRevisions[0]) === null || _modifiedRevisions$ === void 0 ? void 0 : _modifiedRevisions$.id) !== 'unsaved') {
88
+ if (_modifiedRevisions[0].id !== 'unsaved') {
105
89
  _modifiedRevisions[0].isLatest = true;
106
- }
90
+ } // Adds an item for unsaved changes.
91
+
107
92
 
108
- if (isDirty && !(0, _lodash.isEmpty)(userConfig) && currentUser) {
93
+ if (isDirty && userConfig && Object.keys(userConfig).length > 0 && currentUser) {
109
94
  const unsavedRevision = {
110
95
  id: 'unsaved',
111
- styles: userConfig === null || userConfig === void 0 ? void 0 : userConfig.styles,
112
- settings: userConfig === null || userConfig === void 0 ? void 0 : userConfig.settings,
96
+ styles: userConfig?.styles,
97
+ settings: userConfig?.settings,
113
98
  author: {
114
- name: currentUser === null || currentUser === void 0 ? void 0 : currentUser.name,
115
- avatar_urls: currentUser === null || currentUser === void 0 ? void 0 : currentUser.avatar_urls
99
+ name: currentUser?.name,
100
+ avatar_urls: currentUser?.avatar_urls
116
101
  },
117
102
  modified: new Date()
118
103
  };
@@ -123,8 +108,8 @@ function useGlobalStylesRevisions() {
123
108
  return {
124
109
  revisions: _modifiedRevisions,
125
110
  hasUnsavedChanges: isDirty,
126
- isLoading
111
+ isLoading: false
127
112
  };
128
- }, [revisions.length, isDirty, isLoading]);
113
+ }, [isDirty, revisions, currentUser, authors, userConfig]);
129
114
  }
130
115
  //# sourceMappingURL=use-global-styles-revisions.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/use-global-styles-revisions.js"],"names":["SITE_EDITOR_AUTHORS_QUERY","per_page","_fields","context","capabilities","GlobalStylesContext","blockEditorPrivateApis","useGlobalStylesRevisions","user","userConfig","authors","currentUser","isDirty","revisions","isLoading","select","__experimentalGetDirtyEntityRecords","getCurrentUser","getUsers","getCurrentThemeGlobalStylesRevisions","isResolving","coreStore","dirtyEntityRecords","_currentUser","_isDirty","length","globalStylesRevisions","_authors","_modifiedRevisions","hasUnsavedChanges","map","revision","author","find","id","isLatest","unsavedRevision","styles","settings","name","avatar_urls","modified","Date","unshift"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AAIA;;AAIA;;AAdA;AACA;AACA;;AAKA;AACA;AACA;;AAEA;AACA;AACA;AAGA,MAAMA,yBAAyB,GAAG;AACjCC,EAAAA,QAAQ,EAAE,CAAC,CADsB;AAEjCC,EAAAA,OAAO,EAAE,qBAFwB;AAGjCC,EAAAA,OAAO,EAAE,MAHwB;AAIjCC,EAAAA,YAAY,EAAE,CAAE,oBAAF;AAJmB,CAAlC;AAOA,MAAM;AAAEC,EAAAA;AAAF,IAA0B,yBAAQC,wBAAR,CAAhC;;AACe,SAASC,wBAAT,GAAoC;AAClD,QAAM;AAAEC,IAAAA,IAAI,EAAEC;AAAR,MAAuB,yBAAYJ,mBAAZ,CAA7B;AACA,QAAM;AAAEK,IAAAA,OAAF;AAAWC,IAAAA,WAAX;AAAwBC,IAAAA,OAAxB;AAAiCC,IAAAA,SAAjC;AAA4CC,IAAAA;AAA5C,MAA0D,qBAC7DC,MAAF,IAAc;AACb,UAAM;AACLC,MAAAA,mCADK;AAELC,MAAAA,cAFK;AAGLC,MAAAA,QAHK;AAILC,MAAAA,oCAJK;AAKLC,MAAAA;AALK,QAMFL,MAAM,CAAEM,eAAF,CANV;;AAOA,UAAMC,kBAAkB,GAAGN,mCAAmC,EAA9D;;AACA,UAAMO,YAAY,GAAGN,cAAc,EAAnC;;AACA,UAAMO,QAAQ,GAAGF,kBAAkB,CAACG,MAAnB,GAA4B,CAA7C;;AACA,UAAMC,qBAAqB,GAC1BP,oCAAoC,MAAM,EAD3C;;AAEA,UAAMQ,QAAQ,GAAGT,QAAQ,CAAElB,yBAAF,CAAzB;;AAEA,WAAO;AACNU,MAAAA,OAAO,EAAEiB,QADH;AAENhB,MAAAA,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M,EAAE;AACPO,UAAAA,IAAI,EAAE5B,WAAF,aAAEA,WAAF,uBAAEA,WAAW,CAAE4B,IADZ;AAEPC,UAAAA,WAAW,EAAE7B,WAAF,aAAEA,WAAF,uBAAEA,WAAW,CAAE6B;AAFnB,SAJe;AAQvBC,QAAAA,QAAQ,EAAE,IAAIC,IAAJ;AARa,OAAxB;;AAWAd,MAAAA,kBAAkB,CAACe,OAAnB,CAA4BP,eAA5B;AACA;;AACD,WAAO;AACNvB,MAAAA,SAAS,EAAEe,kBADL;AAENC,MAAAA,iBAAiB,EAAEjB,OAFb;AAGNE,MAAAA;AAHM,KAAP;AAKA,GA/CM,EA+CJ,CAAED,SAAS,CAACY,MAAZ,EAAoBb,OAApB,EAA6BE,SAA7B,CA/CI,CAAP;AAgDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../private-apis';\n\nconst SITE_EDITOR_AUTHORS_QUERY = {\n\tper_page: -1,\n\t_fields: 'id,name,avatar_urls',\n\tcontext: 'view',\n\tcapabilities: [ 'edit_theme_options' ],\n};\n\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\nexport default function useGlobalStylesRevisions() {\n\tconst { user: userConfig } = useContext( GlobalStylesContext );\n\tconst { authors, currentUser, isDirty, revisions, isLoading } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tgetCurrentUser,\n\t\t\t\tgetUsers,\n\t\t\t\tgetCurrentThemeGlobalStylesRevisions,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst _currentUser = getCurrentUser();\n\t\t\tconst _isDirty = dirtyEntityRecords.length > 0;\n\t\t\tconst globalStylesRevisions =\n\t\t\t\tgetCurrentThemeGlobalStylesRevisions() || [];\n\t\t\tconst _authors = getUsers( SITE_EDITOR_AUTHORS_QUERY );\n\n\t\t\treturn {\n\t\t\t\tauthors: _authors,\n\t\t\t\tcurrentUser: _currentUser,\n\t\t\t\tisDirty: _isDirty,\n\t\t\t\trevisions: globalStylesRevisions,\n\t\t\t\tisLoading:\n\t\t\t\t\t! globalStylesRevisions.length ||\n\t\t\t\t\tisResolving( 'getUsers', [ SITE_EDITOR_AUTHORS_QUERY ] ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\treturn useMemo( () => {\n\t\tlet _modifiedRevisions = [];\n\t\tif ( isLoading || ! revisions.length ) {\n\t\t\treturn {\n\t\t\t\trevisions: _modifiedRevisions,\n\t\t\t\thasUnsavedChanges: isDirty,\n\t\t\t\tisLoading,\n\t\t\t};\n\t\t}\n\t\t/*\n\t\t * Adds a flag to the first revision, which is the latest.\n\t\t * Also adds author information to the revision.\n\t\t * Then, if there are unsaved changes in the editor, create a\n\t\t * new \"revision\" item that represents the unsaved changes.\n\t\t */\n\t\t_modifiedRevisions = revisions.map( ( revision ) => {\n\t\t\treturn {\n\t\t\t\t...revision,\n\t\t\t\tauthor: authors.find(\n\t\t\t\t\t( author ) => author.id === revision.author\n\t\t\t\t),\n\t\t\t};\n\t\t} );\n\n\t\tif ( _modifiedRevisions[ 0 ]?.id !== 'unsaved' ) {\n\t\t\t_modifiedRevisions[ 0 ].isLatest = true;\n\t\t}\n\n\t\tif ( isDirty && ! isEmpty( userConfig ) && currentUser ) {\n\t\t\tconst unsavedRevision = {\n\t\t\t\tid: 'unsaved',\n\t\t\t\tstyles: userConfig?.styles,\n\t\t\t\tsettings: userConfig?.settings,\n\t\t\t\tauthor: {\n\t\t\t\t\tname: currentUser?.name,\n\t\t\t\t\tavatar_urls: currentUser?.avatar_urls,\n\t\t\t\t},\n\t\t\t\tmodified: new Date(),\n\t\t\t};\n\n\t\t\t_modifiedRevisions.unshift( unsavedRevision );\n\t\t}\n\t\treturn {\n\t\t\trevisions: _modifiedRevisions,\n\t\t\thasUnsavedChanges: isDirty,\n\t\t\tisLoading,\n\t\t};\n\t}, [ revisions.length, isDirty, isLoading ] );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/use-global-styles-revisions.js"],"names":["SITE_EDITOR_AUTHORS_QUERY","per_page","_fields","context","capabilities","EMPTY_ARRAY","GlobalStylesContext","blockEditorPrivateApis","useGlobalStylesRevisions","user","userConfig","authors","currentUser","isDirty","revisions","select","__experimentalGetDirtyEntityRecords","getCurrentUser","getUsers","getCurrentThemeGlobalStylesRevisions","coreStore","dirtyEntityRecords","_currentUser","_isDirty","length","globalStylesRevisions","_authors","_modifiedRevisions","hasUnsavedChanges","isLoading","map","revision","author","find","id","isLatest","Object","keys","unsavedRevision","styles","settings","name","avatar_urls","modified","Date","unshift"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGA,MAAMA,yBAAyB,GAAG;AACjCC,EAAAA,QAAQ,EAAE,CAAC,CADsB;AAEjCC,EAAAA,OAAO,EAAE,qBAFwB;AAGjCC,EAAAA,OAAO,EAAE,MAHwB;AAIjCC,EAAAA,YAAY,EAAE,CAAE,oBAAF;AAJmB,CAAlC;AAMA,MAAMC,WAAW,GAAG,EAApB;AACA,MAAM;AAAEC,EAAAA;AAAF,IAA0B,yBAAQC,wBAAR,CAAhC;;AACe,SAASC,wBAAT,GAAoC;AAClD,QAAM;AAAEC,IAAAA,IAAI,EAAEC;AAAR,MAAuB,yBAAYJ,mBAAZ,CAA7B;AACA,QAAM;AAAEK,IAAAA,OAAF;AAAWC,IAAAA,WAAX;AAAwBC,IAAAA,OAAxB;AAAiCC,IAAAA;AAAjC,MAA+C,qBAClDC,MAAF,IAAc;AACb,UAAM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AAwBQ,QAAxB,GAAmC,IAAnC;AACA,KAvBoB,CAyBrB;;;AACA,QACCtB,OAAO,IACPH,UADA,IAEA0B,MAAM,CAACC,IAAP,CAAa3B,UAAb,EAA0Bc,MAA1B,GAAmC,CAFnC,IAGAZ,WAJD,EAKE;AACD,YAAM0B,eAAe,GAAG;AACvBJ,QAAAA,EAAE,EAAE,SADmB;AAEvBK,QAAAA,MAAM,EAAE7B,UAAU,EAAE6B,MAFG;AAGvBC,QAAAA,QAAQ,EAAE9B,UAAU,EAAE8B,QAHC;AAIvBR,QAAAA,MAAM,EAAE;AACPS,UAAAA,IAAI,EAAE7B,WAAW,EAAE6B,IADZ;AAEPC,UAAAA,WAAW,EAAE9B,WAAW,EAAE8B;AAFnB,SAJe;AAQvBC,QAAAA,QAAQ,EAAE,IAAIC,IAAJ;AARa,OAAxB;;AAWAjB,MAAAA,kBAAkB,CAACkB,OAAnB,CAA4BP,eAA5B;AACA;;AAED,WAAO;AACNxB,MAAAA,SAAS,EAAEa,kBADL;AAENC,MAAAA,iBAAiB,EAAEf,OAFb;AAGNgB,MAAAA,SAAS,EAAE;AAHL,KAAP;AAKA,GAnDM,EAmDJ,CAAEhB,OAAF,EAAWC,SAAX,EAAsBF,WAAtB,EAAmCD,OAAnC,EAA4CD,UAA5C,CAnDI,CAAP;AAoDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../private-apis';\n\nconst SITE_EDITOR_AUTHORS_QUERY = {\n\tper_page: -1,\n\t_fields: 'id,name,avatar_urls',\n\tcontext: 'view',\n\tcapabilities: [ 'edit_theme_options' ],\n};\nconst EMPTY_ARRAY = [];\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\nexport default function useGlobalStylesRevisions() {\n\tconst { user: userConfig } = useContext( GlobalStylesContext );\n\tconst { authors, currentUser, isDirty, revisions } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tgetCurrentUser,\n\t\t\t\tgetUsers,\n\t\t\t\tgetCurrentThemeGlobalStylesRevisions,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst _currentUser = getCurrentUser();\n\t\t\tconst _isDirty = dirtyEntityRecords.length > 0;\n\t\t\tconst globalStylesRevisions =\n\t\t\t\tgetCurrentThemeGlobalStylesRevisions() || EMPTY_ARRAY;\n\t\t\tconst _authors =\n\t\t\t\tgetUsers( SITE_EDITOR_AUTHORS_QUERY ) || EMPTY_ARRAY;\n\n\t\t\treturn {\n\t\t\t\tauthors: _authors,\n\t\t\t\tcurrentUser: _currentUser,\n\t\t\t\tisDirty: _isDirty,\n\t\t\t\trevisions: globalStylesRevisions,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\treturn useMemo( () => {\n\t\tlet _modifiedRevisions = [];\n\t\tif ( ! authors.length || ! revisions.length ) {\n\t\t\treturn {\n\t\t\t\trevisions: _modifiedRevisions,\n\t\t\t\thasUnsavedChanges: isDirty,\n\t\t\t\tisLoading: true,\n\t\t\t};\n\t\t}\n\n\t\t// Adds author details to each revision.\n\t\t_modifiedRevisions = revisions.map( ( revision ) => {\n\t\t\treturn {\n\t\t\t\t...revision,\n\t\t\t\tauthor: authors.find(\n\t\t\t\t\t( author ) => author.id === revision.author\n\t\t\t\t),\n\t\t\t};\n\t\t} );\n\n\t\t// Flags the most current saved revision.\n\t\tif ( _modifiedRevisions[ 0 ].id !== 'unsaved' ) {\n\t\t\t_modifiedRevisions[ 0 ].isLatest = true;\n\t\t}\n\n\t\t// Adds an item for unsaved changes.\n\t\tif (\n\t\t\tisDirty &&\n\t\t\tuserConfig &&\n\t\t\tObject.keys( userConfig ).length > 0 &&\n\t\t\tcurrentUser\n\t\t) {\n\t\t\tconst unsavedRevision = {\n\t\t\t\tid: 'unsaved',\n\t\t\t\tstyles: userConfig?.styles,\n\t\t\t\tsettings: userConfig?.settings,\n\t\t\t\tauthor: {\n\t\t\t\t\tname: currentUser?.name,\n\t\t\t\t\tavatar_urls: currentUser?.avatar_urls,\n\t\t\t\t},\n\t\t\t\tmodified: new Date(),\n\t\t\t};\n\n\t\t\t_modifiedRevisions.unshift( unsavedRevision );\n\t\t}\n\n\t\treturn {\n\t\t\trevisions: _modifiedRevisions,\n\t\t\thasUnsavedChanges: isDirty,\n\t\t\tisLoading: false,\n\t\t};\n\t}, [ isDirty, revisions, currentUser, authors, userConfig ] );\n}\n"]}
@@ -44,10 +44,10 @@ function ScreenRoot() {
44
44
  } = (0, _privateApis.unlock)(_blockEditor.privateApis);
45
45
  const [customCSS] = useGlobalStyle('css');
46
46
  const {
47
- variations,
47
+ hasVariations,
48
48
  canEditCSS
49
49
  } = (0, _data.useSelect)(select => {
50
- var _globalStyles$_links$, _globalStyles$_links;
50
+ var _globalStyles$_links$;
51
51
 
52
52
  const {
53
53
  getEntityRecord,
@@ -59,8 +59,8 @@ function ScreenRoot() {
59
59
 
60
60
  const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
61
61
  return {
62
- variations: __experimentalGetCurrentThemeGlobalStylesVariations(),
63
- canEditCSS: (_globalStyles$_links$ = !!(globalStyles !== null && globalStyles !== void 0 && (_globalStyles$_links = globalStyles._links) !== null && _globalStyles$_links !== void 0 && _globalStyles$_links['wp:action-edit-css'])) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : false
62
+ hasVariations: !!__experimentalGetCurrentThemeGlobalStylesVariations()?.length,
63
+ canEditCSS: (_globalStyles$_links$ = !!globalStyles?._links?.['wp:action-edit-css']) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : false
64
64
  };
65
65
  }, []);
66
66
  return (0, _element.createElement)(_components.Card, {
@@ -68,7 +68,7 @@ function ScreenRoot() {
68
68
  className: "edit-site-global-styles-screen-root"
69
69
  }, (0, _element.createElement)(_components.CardBody, null, (0, _element.createElement)(_components.__experimentalVStack, {
70
70
  spacing: 4
71
- }, (0, _element.createElement)(_components.Card, null, (0, _element.createElement)(_components.CardMedia, null, (0, _element.createElement)(_preview.default, null))), !!(variations !== null && variations !== void 0 && variations.length) && (0, _element.createElement)(_components.__experimentalItemGroup, null, (0, _element.createElement)(_navigationButton.NavigationButtonAsItem, {
71
+ }, (0, _element.createElement)(_components.Card, null, (0, _element.createElement)(_components.CardMedia, null, (0, _element.createElement)(_preview.default, null))), hasVariations && (0, _element.createElement)(_components.__experimentalItemGroup, null, (0, _element.createElement)(_navigationButton.NavigationButtonAsItem, {
72
72
  path: "/variations",
73
73
  "aria-label": (0, _i18n.__)('Browse styles')
74
74
  }, (0, _element.createElement)(_components.__experimentalHStack, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"names":["ScreenRoot","useGlobalStyle","blockEditorPrivateApis","customCSS","variations","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","__experimentalGetCurrentThemeGlobalStylesVariations","coreStore","globalStylesId","globalStyles","undefined","_links","length","chevronLeft","chevronRight"],"mappings":";;;;;;;;;;;AAGA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AA3BA;AACA;AACA;;AAkBA;AACA;AACA;AAOA,SAASA,UAAT,GAAsB;AACrB,QAAM;AAAEC,IAAAA;AAAF,MAAqB,yBAAQC,wBAAR,CAA3B;AACA,QAAM,CAAEC,SAAF,IAAgBF,cAAc,CAAE,KAAF,CAApC;AAEA,QAAM;AAAEG,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MAA6B,qBAAaC,MAAF,IAAc;AAAA;;AAC3D,UAAM;AACLC,MAAAA,eADK;AAELC,MAAAA,sCAFK;AAGLC,MAAAA;AA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EAAC,MARV;AASC,IAAA,YAAY,EAAG;AAThB,KAWG,cACD,iEADC,CAXH,CADD,EAgBC,4BAAC,mCAAD,QACC,4BAAC,wCAAD;AACC,IAAA,IAAI,EAAC,SADN;AAEC,kBAAa,cAAI,eAAJ;AAFd,KAIC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,oBAAD,QAAY,cAAI,QAAJ,CAAZ,CADD,EAEC,4BAAC,0CAAD;AACC,IAAA,IAAI,EAAG,qBAAUD,kBAAV,GAAwBC;AADhC,IAFD,CAJD,CADD,CAhBD,CAjCD,EAgEGZ,UAAU,IAAI,CAAC,CAAEF,SAAjB,IACD,qDACC,4BAAC,uBAAD,OADD,EAEC,4BAAC,oBAAD,QACC,4BAAC,gCAAD;AACC,IAAA,EAAE,EAAC,GADJ;AAEC,IAAA,UAAU,EAAG,CAFd;AAGC,IAAA,QAAQ,EAAC,MAHV;AAIC,IAAA,YAAY,EAAG;AAJhB,KAMG,cACD,uEADC,CANH,CADD,EAWC,4BAAC,mCAAD,QACC,4BAAC,wCAAD;AACC,IAAA,IAAI,EAAC,MADN;AAEC,kBAAa,cAAI,gBAAJ;AAFd,KAIC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,oBAAD,QACG,cAAI,gBAAJ,CADH,CADD,EAIC,4BAAC,0CAAD;AACC,IAAA,IAAI,EACH,qBAAUa,kBAAV,GAAwBC;AAF1B,IAJD,CAJD,CADD,CAXD,CAFD,CAjEF,CADD;AAqGA;;eAEcjB,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalVStack as VStack,\n\tFlexItem,\n\tCardBody,\n\tCard,\n\tCardDivider,\n\tCardMedia,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronLeft, chevronRight } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { IconWithCurrentColor } from './icon-with-current-color';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport RootMenu from './root-menu';\nimport StylesPreview from './preview';\nimport { unlock } from '../../private-apis';\n\nfunction ScreenRoot() {\n\tconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\tconst [ customCSS ] = useGlobalStyle( 'css' );\n\n\tconst { variations, canEditCSS } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEntityRecord,\n\t\t\t__experimentalGetCurrentGlobalStylesId,\n\t\t\t__experimentalGetCurrentThemeGlobalStylesVariations,\n\t\t} = select( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tvariations: __experimentalGetCurrentThemeGlobalStylesVariations(),\n\t\t\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Card size=\"small\" className=\"edit-site-global-styles-screen-root\">\n\t\t\t<CardBody>\n\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t<Card>\n\t\t\t\t\t\t<CardMedia>\n\t\t\t\t\t\t\t<StylesPreview />\n\t\t\t\t\t\t</CardMedia>\n\t\t\t\t\t</Card>\n\t\t\t\t\t{ !! variations?.length && (\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\tpath=\"/variations\"\n\t\t\t\t\t\t\t\taria-label={ __( 'Browse styles' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Browse styles' ) }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t) }\n\t\t\t\t\t<RootMenu />\n\t\t\t\t</VStack>\n\t\t\t</CardBody>\n\n\t\t\t<CardDivider />\n\n\t\t\t<CardBody>\n\t\t\t\t<Spacer\n\t\t\t\t\tas=\"p\"\n\t\t\t\t\tpaddingTop={ 2 }\n\t\t\t\t\t/*\n\t\t\t\t\t * 13px matches the text inset of the NavigationButton (12px padding, plus the width of the button's border).\n\t\t\t\t\t * This is an ad hoc override for this instance and the Addtional CSS option below. Other options for matching the\n\t\t\t\t\t * the nav button inset should be looked at before reusing further.\n\t\t\t\t\t */\n\t\t\t\t\tpaddingX=\"13px\"\n\t\t\t\t\tmarginBottom={ 4 }\n\t\t\t\t>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Customize the appearance of specific blocks for the whole site.'\n\t\t\t\t\t) }\n\t\t\t\t</Spacer>\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tpath=\"/blocks\"\n\t\t\t\t\t\taria-label={ __( 'Blocks styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t<FlexItem>{ __( 'Blocks' ) }</FlexItem>\n\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\ticon={ isRTL() ? chevronLeft : chevronRight }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t</ItemGroup>\n\t\t\t</CardBody>\n\n\t\t\t{ canEditCSS && !! customCSS && (\n\t\t\t\t<>\n\t\t\t\t\t<CardDivider />\n\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t<Spacer\n\t\t\t\t\t\t\tas=\"p\"\n\t\t\t\t\t\t\tpaddingTop={ 2 }\n\t\t\t\t\t\t\tpaddingX=\"13px\"\n\t\t\t\t\t\t\tmarginBottom={ 4 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Add your own CSS to customize the appearance and layout of your site.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\tpath=\"/css\"\n\t\t\t\t\t\t\t\taria-label={ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</CardBody>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</Card>\n\t);\n}\n\nexport default ScreenRoot;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"names":["ScreenRoot","useGlobalStyle","blockEditorPrivateApis","customCSS","hasVariations","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","__experimentalGetCurrentThemeGlobalStylesVariations","coreStore","globalStylesId","globalStyles","undefined","length","_links","chevronLeft","chevronRight"],"mappings":";;;;;;;;;;;AAGA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AA3BA;AACA;AACA;;AAkBA;AACA;AACA;AAOA,SAASA,UAAT,GAAsB;AACrB,QAAM;AAAEC,IAAAA;AAAF,MAAqB,yBAAQC,wBAAR,CAA3B;AACA,QAAM,CAAEC,SAAF,IAAgBF,cAAc,CAAE,KAAF,CAApC;AAEA,QAAM;AAAEG,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,MAAgC,qBAAaC,MAAF,IAAc;AAAA;;AAC9D,UAAM;AACLC,MAAAA,eADK;AAELC,MAAAA,sCAFK;AAGLC,MAAAA;AAHK,QAIFH,MAAM,CAAEI,eAAF,CAJV;;AAMA,UAAMC,cAAc,GAAGH,sCAAsC,EAA7D;;AACA,UAAMI,YAAY,GAAGD,cAAc,GAChCJ,eAAe,CAAE,MAAF,EAAU,cAAV,EAA0BI,cAA1B,CADiB,GAEhCE,SAFH;AAIA,WAAO;AACNT,MAAAA,aAAa,EACZ,CAAC,CAAEK,mDAAmD,IACnDK,MAHE;AAINT,MAAAA,UAAU,2BACT,CAAC,CAAEO,YAAY,EAAEG,MAAd,GAAwB,oBAAxB,CADM,yEAC4C;AALhD,KAAP;AAOA,GAnBqC,EAmBnC,EAnBmC,CAAtC;AAqBA,SACC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAC,OAAX;AAAmB,IAAA,SAAS,EAAC;AAA7B,KACC,4BAAC,oBAAD,QACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,gBAAD,QACC,4BAAC,qBAAD,QACC,4BAAC,gBAAD,OADD,CADD,CADD,EAMGX,aAAa,IACd,4BAAC,mCAAD,QACC,4BAAC,wCAAD;AACC,IAAA,IA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AAC;AAAhB,KACC,4BAAC,oBAAD,QACG,cAAI,gBAAJ,CADH,CADD,EAIC,4BAAC,0CAAD;AACC,IAAA,IAAI,EACH,qBAAUa,kBAAV,GAAwBC;AAF1B,IAJD,CAJD,CADD,CAXD,CAFD,CAjEF,CADD;AAqGA;;eAEcjB,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalVStack as VStack,\n\tFlexItem,\n\tCardBody,\n\tCard,\n\tCardDivider,\n\tCardMedia,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronLeft, chevronRight } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { IconWithCurrentColor } from './icon-with-current-color';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport RootMenu from './root-menu';\nimport StylesPreview from './preview';\nimport { unlock } from '../../private-apis';\n\nfunction ScreenRoot() {\n\tconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\tconst [ customCSS ] = useGlobalStyle( 'css' );\n\n\tconst { hasVariations, canEditCSS } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEntityRecord,\n\t\t\t__experimentalGetCurrentGlobalStylesId,\n\t\t\t__experimentalGetCurrentThemeGlobalStylesVariations,\n\t\t} = select( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\thasVariations:\n\t\t\t\t!! __experimentalGetCurrentThemeGlobalStylesVariations()\n\t\t\t\t\t?.length,\n\t\t\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Card size=\"small\" className=\"edit-site-global-styles-screen-root\">\n\t\t\t<CardBody>\n\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t<Card>\n\t\t\t\t\t\t<CardMedia>\n\t\t\t\t\t\t\t<StylesPreview />\n\t\t\t\t\t\t</CardMedia>\n\t\t\t\t\t</Card>\n\t\t\t\t\t{ hasVariations && (\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\tpath=\"/variations\"\n\t\t\t\t\t\t\t\taria-label={ __( 'Browse styles' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Browse styles' ) }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t) }\n\t\t\t\t\t<RootMenu />\n\t\t\t\t</VStack>\n\t\t\t</CardBody>\n\n\t\t\t<CardDivider />\n\n\t\t\t<CardBody>\n\t\t\t\t<Spacer\n\t\t\t\t\tas=\"p\"\n\t\t\t\t\tpaddingTop={ 2 }\n\t\t\t\t\t/*\n\t\t\t\t\t * 13px matches the text inset of the NavigationButton (12px padding, plus the width of the button's border).\n\t\t\t\t\t * This is an ad hoc override for this instance and the Addtional CSS option below. Other options for matching the\n\t\t\t\t\t * the nav button inset should be looked at before reusing further.\n\t\t\t\t\t */\n\t\t\t\t\tpaddingX=\"13px\"\n\t\t\t\t\tmarginBottom={ 4 }\n\t\t\t\t>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Customize the appearance of specific blocks for the whole site.'\n\t\t\t\t\t) }\n\t\t\t\t</Spacer>\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tpath=\"/blocks\"\n\t\t\t\t\t\taria-label={ __( 'Blocks styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t<FlexItem>{ __( 'Blocks' ) }</FlexItem>\n\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\ticon={ isRTL() ? chevronLeft : chevronRight }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t</ItemGroup>\n\t\t\t</CardBody>\n\n\t\t\t{ canEditCSS && !! customCSS && (\n\t\t\t\t<>\n\t\t\t\t\t<CardDivider />\n\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t<Spacer\n\t\t\t\t\t\t\tas=\"p\"\n\t\t\t\t\t\t\tpaddingTop={ 2 }\n\t\t\t\t\t\t\tpaddingX=\"13px\"\n\t\t\t\t\t\t\tmarginBottom={ 4 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Add your own CSS to customize the appearance and layout of your site.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\tpath=\"/css\"\n\t\t\t\t\t\t\t\taria-label={ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</CardBody>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</Card>\n\t);\n}\n\nexport default ScreenRoot;\n"]}
@@ -49,10 +49,9 @@ const elements = {
49
49
  }
50
50
  };
51
51
 
52
- function ScreenTypographyElement(_ref) {
53
- let {
54
- element
55
- } = _ref;
52
+ function ScreenTypographyElement({
53
+ element
54
+ }) {
56
55
  const [headingLevel, setHeadingLevel] = (0, _element.useState)('heading');
57
56
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
58
57
  title: elements[element].title,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography-element.js"],"names":["elements","text","description","title","link","heading","caption","button","ScreenTypographyElement","element","headingLevel","setHeadingLevel"],"mappings":";;;;;;;;;AASA;;AANA;;AACA;;AAUA;;AACA;;AACA;;AAhBA;AACA;AACA;;AASA;AACA;AACA;AAKA,MAAMA,QAAQ,GAAG;AAChBC,EAAAA,IAAI,EAAE;AACLC,IAAAA,WAAW,EAAE,cAAI,oCAAJ,CADR;AAELC,IAAAA,KAAK,EAAE,cAAI,MAAJ;AAFF,GADU;AAKhBC,EAAAA,IAAI,EAAE;AACLF,IAAAA,WAAW,EAAE,cAAI,oDAAJ,CADR;AAELC,IAAAA,KAAK,EAAE,cAAI,OAAJ;AAFF,GALU;AAShBE,EAAAA,OAAO,EAAE;AACRH,IAAAA,WAAW,EAAE,cAAI,mDAAJ,CADL;AAERC,IAAAA,KAAK,EAAE,cAAI,UAAJ;AAFC,GATO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I,IAAJ;AAFT,IAfD,EAmBC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAG,cAAI,IAAJ;AAFT,IAnBD,EAuBC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAG,cAAI,IAAJ;AAFT,IAvBD,EA2BC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAG,cAAI,IAAJ;AAFT,IA3BD,EA+BC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAG,cAAI,IAAJ;AAFT,IA/BD,EAmCC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAG,cAAI,IAAJ;AAFT,IAnCD,CADD,CAZF,EAuDC,4BAAC,wBAAD;AACC,IAAA,OAAO,EAAGF,OADX;AAEC,IAAA,YAAY,EAAGC;AAFhB,IAvDD,CADD;AA8DA;;eAEcF,uB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalSpacer as Spacer,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport TypographyPanel from './typography-panel';\nimport ScreenHeader from './header';\nimport TypographyPreview from './typography-preview';\n\nconst elements = {\n\ttext: {\n\t\tdescription: __( 'Manage the fonts used on the site.' ),\n\t\ttitle: __( 'Text' ),\n\t},\n\tlink: {\n\t\tdescription: __( 'Manage the fonts and typography used on the links.' ),\n\t\ttitle: __( 'Links' ),\n\t},\n\theading: {\n\t\tdescription: __( 'Manage the fonts and typography used on headings.' ),\n\t\ttitle: __( 'Headings' ),\n\t},\n\tcaption: {\n\t\tdescription: __( 'Manage the fonts and typography used on captions.' ),\n\t\ttitle: __( 'Captions' ),\n\t},\n\tbutton: {\n\t\tdescription: __( 'Manage the fonts and typography used on buttons.' ),\n\t\ttitle: __( 'Buttons' ),\n\t},\n};\n\nfunction ScreenTypographyElement( { element } ) {\n\tconst [ headingLevel, setHeadingLevel ] = useState( 'heading' );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ elements[ element ].title }\n\t\t\t\tdescription={ elements[ element ].description }\n\t\t\t/>\n\t\t\t<Spacer marginX={ 4 }>\n\t\t\t\t<TypographyPreview\n\t\t\t\t\telement={ element }\n\t\t\t\t\theadingLevel={ headingLevel }\n\t\t\t\t/>\n\t\t\t</Spacer>\n\t\t\t{ element === 'heading' && (\n\t\t\t\t<Spacer marginX={ 4 } marginBottom=\"1em\">\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\tlabel={ __( 'Select heading level' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tvalue={ headingLevel }\n\t\t\t\t\t\tonChange={ setHeadingLevel }\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"heading\"\n\t\t\t\t\t\t\t/* translators: 'All' refers to selecting all heading levels \n\t\t\t\t\t\t\tand applying the same style to h1-h6. */\n\t\t\t\t\t\t\tlabel={ __( 'All' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h1\"\n\t\t\t\t\t\t\tlabel={ __( 'H1' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h2\"\n\t\t\t\t\t\t\tlabel={ __( 'H2' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h3\"\n\t\t\t\t\t\t\tlabel={ __( 'H3' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h4\"\n\t\t\t\t\t\t\tlabel={ __( 'H4' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h5\"\n\t\t\t\t\t\t\tlabel={ __( 'H5' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h6\"\n\t\t\t\t\t\t\tlabel={ __( 'H6' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t</Spacer>\n\t\t\t) }\n\t\t\t<TypographyPanel\n\t\t\t\telement={ element }\n\t\t\t\theadingLevel={ headingLevel }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenTypographyElement;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography-element.js"],"names":["elements","text","description","title","link","heading","caption","button","ScreenTypographyElement","element","headingLevel","setHeadingLevel"],"mappings":";;;;;;;;;AASA;;AANA;;AACA;;AAUA;;AACA;;AACA;;AAhBA;AACA;AACA;;AASA;AACA;AACA;AAKA,MAAMA,QAAQ,GAAG;AAChBC,EAAAA,IAAI,EAAE;AACLC,IAAAA,WAAW,EAAE,cAAI,oCAAJ,CADR;AAELC,IAAAA,KAAK,EAAE,cAAI,MAAJ;AAFF,GADU;AAKhBC,EAAAA,IAAI,EAAE;AACLF,IAAAA,WAAW,EAAE,cAAI,oDAAJ,CADR;AAELC,IAAAA,KAAK,EAAE,cAAI,OAAJ;AAFF,GALU;AAShBE,EAAAA,OAAO,EAAE;AACRH,IAAAA,WAAW,EAAE,cAAI,mDAAJ,CADL;AAERC,IAAAA,KAAK,EAAE,cAAI,UAAJ;AAFC,GATO;AAahBG,EAAAA,OAAO,EAAE;AACRJ,IAAAA,WAA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AAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAG,cAAI,IAAJ;AAFT,IAnBD,EAuBC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAG,cAAI,IAAJ;AAFT,IAvBD,EA2BC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAG,cAAI,IAAJ;AAFT,IA3BD,EA+BC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAG,cAAI,IAAJ;AAFT,IA/BD,EAmCC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAG,cAAI,IAAJ;AAFT,IAnCD,CADD,CAZF,EAuDC,4BAAC,wBAAD;AACC,IAAA,OAAO,EAAGF,OADX;AAEC,IAAA,YAAY,EAAGC;AAFhB,IAvDD,CADD;AA8DA;;eAEcF,uB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalSpacer as Spacer,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport TypographyPanel from './typography-panel';\nimport ScreenHeader from './header';\nimport TypographyPreview from './typography-preview';\n\nconst elements = {\n\ttext: {\n\t\tdescription: __( 'Manage the fonts used on the site.' ),\n\t\ttitle: __( 'Text' ),\n\t},\n\tlink: {\n\t\tdescription: __( 'Manage the fonts and typography used on the links.' ),\n\t\ttitle: __( 'Links' ),\n\t},\n\theading: {\n\t\tdescription: __( 'Manage the fonts and typography used on headings.' ),\n\t\ttitle: __( 'Headings' ),\n\t},\n\tcaption: {\n\t\tdescription: __( 'Manage the fonts and typography used on captions.' ),\n\t\ttitle: __( 'Captions' ),\n\t},\n\tbutton: {\n\t\tdescription: __( 'Manage the fonts and typography used on buttons.' ),\n\t\ttitle: __( 'Buttons' ),\n\t},\n};\n\nfunction ScreenTypographyElement( { element } ) {\n\tconst [ headingLevel, setHeadingLevel ] = useState( 'heading' );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ elements[ element ].title }\n\t\t\t\tdescription={ elements[ element ].description }\n\t\t\t/>\n\t\t\t<Spacer marginX={ 4 }>\n\t\t\t\t<TypographyPreview\n\t\t\t\t\telement={ element }\n\t\t\t\t\theadingLevel={ headingLevel }\n\t\t\t\t/>\n\t\t\t</Spacer>\n\t\t\t{ element === 'heading' && (\n\t\t\t\t<Spacer marginX={ 4 } marginBottom=\"1em\">\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\tlabel={ __( 'Select heading level' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tvalue={ headingLevel }\n\t\t\t\t\t\tonChange={ setHeadingLevel }\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"heading\"\n\t\t\t\t\t\t\t/* translators: 'All' refers to selecting all heading levels \n\t\t\t\t\t\t\tand applying the same style to h1-h6. */\n\t\t\t\t\t\t\tlabel={ __( 'All' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h1\"\n\t\t\t\t\t\t\tlabel={ __( 'H1' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h2\"\n\t\t\t\t\t\t\tlabel={ __( 'H2' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h3\"\n\t\t\t\t\t\t\tlabel={ __( 'H3' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h4\"\n\t\t\t\t\t\t\tlabel={ __( 'H4' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h5\"\n\t\t\t\t\t\t\tlabel={ __( 'H5' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h6\"\n\t\t\t\t\t\t\tlabel={ __( 'H6' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t</Spacer>\n\t\t\t) }\n\t\t\t<TypographyPanel\n\t\t\t\telement={ element }\n\t\t\t\theadingLevel={ headingLevel }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenTypographyElement;\n"]}
@@ -36,12 +36,11 @@ const {
36
36
  useGlobalStyle
37
37
  } = (0, _privateApis.unlock)(_blockEditor.privateApis);
38
38
 
39
- function Item(_ref) {
40
- let {
41
- parentMenu,
42
- element,
43
- label
44
- } = _ref;
39
+ function Item({
40
+ parentMenu,
41
+ element,
42
+ label
43
+ }) {
45
44
  const prefix = element === 'text' || !element ? '' : `elements.${element}.`;
46
45
  const extraStyles = element === 'link' ? {
47
46
  textDecoration: 'underline'
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography.js"],"names":["useGlobalStyle","blockEditorPrivateApis","Item","parentMenu","element","label","prefix","extraStyles","textDecoration","fontFamily","fontStyle","fontWeight","letterSpacing","backgroundColor","gradientValue","color","navigationButtonLabel","background","ScreenTypography"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAMA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAUA;AACA;AACA;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAqB,yBAAQC,wBAAR,CAA3B;;AAEA,SAASC,IAAT,OAAgD;AA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,OAAO,EAAC,QAFT;AAGC,IAAA,KAAK,EAAG,cAAI,SAAJ;AAHT,IArBD,CAFD,CADD,CAVD,CADD;AA6CA;;eAEce,gB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tFlexItem,\n} from '@wordpress/components';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport Subtitle from './subtitle';\nimport BlockPreviewPanel from './block-preview-panel';\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction Item( { parentMenu, element, label } ) {\n\tconst prefix =\n\t\telement === 'text' || ! element ? '' : `elements.${ element }.`;\n\tconst extraStyles =\n\t\telement === 'link'\n\t\t\t? {\n\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t }\n\t\t\t: {};\n\tconst [ fontFamily ] = useGlobalStyle( prefix + 'typography.fontFamily' );\n\tconst [ fontStyle ] = useGlobalStyle( prefix + 'typography.fontStyle' );\n\tconst [ fontWeight ] = useGlobalStyle( prefix + 'typography.fontWeight' );\n\tconst [ letterSpacing ] = useGlobalStyle(\n\t\tprefix + 'typography.letterSpacing'\n\t);\n\tconst [ backgroundColor ] = useGlobalStyle( prefix + 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient' );\n\tconst [ color ] = useGlobalStyle( prefix + 'color.text' );\n\n\tconst navigationButtonLabel = sprintf(\n\t\t// translators: %s: is a subset of Typography, e.g., 'text' or 'links'.\n\t\t__( 'Typography %s styles' ),\n\t\tlabel\n\t);\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ parentMenu + '/typography/' + element }\n\t\t\taria-label={ navigationButtonLabel }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem\n\t\t\t\t\tclassName=\"edit-site-global-styles-screen-typography__indicator\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tfontFamily: fontFamily ?? 'serif',\n\t\t\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tfontStyle,\n\t\t\t\t\t\tfontWeight,\n\t\t\t\t\t\tletterSpacing,\n\t\t\t\t\t\t...extraStyles,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Aa' ) }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ label }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction ScreenTypography() {\n\tconst parentMenu = '';\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Manage the typography settings for different elements.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<BlockPreviewPanel />\n\n\t\t\t<div className=\"edit-site-global-styles-screen-typography\">\n\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t<Subtitle level={ 3 }>{ __( 'Elements' ) }</Subtitle>\n\t\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"text\"\n\t\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"link\"\n\t\t\t\t\t\t\tlabel={ __( 'Links' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"heading\"\n\t\t\t\t\t\t\tlabel={ __( 'Headings' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"caption\"\n\t\t\t\t\t\t\tlabel={ __( 'Captions' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"button\"\n\t\t\t\t\t\t\tlabel={ __( 'Buttons' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t</VStack>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default ScreenTypography;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography.js"],"names":["useGlobalStyle","blockEditorPrivateApis","Item","parentMenu","element","label","prefix","extraStyles","textDecoration","fontFamily","fontStyle","fontWeight","letterSpacing","backgroundColor","gradientValue","color","navigationButtonLabel","background","ScreenTypography"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAMA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAUA;AACA;AACA;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAqB,yBAAQC,wBAAR,CAA3B;;AAEA,SAASC,IAAT,CAAe;AAAEC,EAAAA,UAAF;AAAcC,EAAAA,OAAd;AAAuBC,EAAAA;AAAvB,CAAf,EAAgD;AAC/C,QAAMC,MAAM,GACXF,OAAO,KAAK,MAAZ,IAAsB,CAAEA,OAAxB,GAAkC,EAAlC,GAAwC,YAAYA,OAAS,GAD9D;AAEA,QAAMG,WAAW,GAChBH,OAAO,KAAK,MAAZ,GACG;AACAI,IAAAA,cAAc,EAAE;AADhB,GADH,GAIG,EALJ;AAMA,QAAM,CAAEC,UAAF,IAAiBT,cAAc,CAAEM,MAAM,GAAG,uBAAX,CAArC;AACA,QAAM,CAAEI,SAAF,IAAgBV,cAAc,CAAEM,MAAM,GAAG,sBAAX,CAApC;AACA,QAAM,CA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AAC;AAAf,KACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,iBAAD;AAAU,IAAA,KAAK,EAAG;AAAlB,KAAwB,cAAI,UAAJ,CAAxB,CADD,EAEC,4BAAC,mCAAD;AAAW,IAAA,UAAU,MAArB;AAAsB,IAAA,WAAW;AAAjC,KACC,4BAAC,IAAD;AACC,IAAA,UAAU,EAAGA,UADd;AAEC,IAAA,OAAO,EAAC,MAFT;AAGC,IAAA,KAAK,EAAG,cAAI,MAAJ;AAHT,IADD,EAMC,4BAAC,IAAD;AACC,IAAA,UAAU,EAAGA,UADd;AAEC,IAAA,OAAO,EAAC,MAFT;AAGC,IAAA,KAAK,EAAG,cAAI,OAAJ;AAHT,IAND,EAWC,4BAAC,IAAD;AACC,IAAA,UAAU,EAAGA,UADd;AAEC,IAAA,OAAO,EAAC,SAFT;AAGC,IAAA,KAAK,EAAG,cAAI,UAAJ;AAHT,IAXD,EAgBC,4BAAC,IAAD;AACC,IAAA,UAAU,EAAGA,UADd;AAEC,IAAA,OAAO,EAAC,SAFT;AAGC,IAAA,KAAK,EAAG,cAAI,UAAJ;AAHT,IAhBD,EAqBC,4BAAC,IAAD;AACC,IAAA,UAAU,EAAGA,UADd;AAEC,IAAA,OAAO,EAAC,QAFT;AAGC,IAAA,KAAK,EAAG,cAAI,SAAJ;AAHT,IArBD,CAFD,CADD,CAVD,CADD;AA6CA;;eAEce,gB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tFlexItem,\n} from '@wordpress/components';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport Subtitle from './subtitle';\nimport BlockPreviewPanel from './block-preview-panel';\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction Item( { parentMenu, element, label } ) {\n\tconst prefix =\n\t\telement === 'text' || ! element ? '' : `elements.${ element }.`;\n\tconst extraStyles =\n\t\telement === 'link'\n\t\t\t? {\n\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t }\n\t\t\t: {};\n\tconst [ fontFamily ] = useGlobalStyle( prefix + 'typography.fontFamily' );\n\tconst [ fontStyle ] = useGlobalStyle( prefix + 'typography.fontStyle' );\n\tconst [ fontWeight ] = useGlobalStyle( prefix + 'typography.fontWeight' );\n\tconst [ letterSpacing ] = useGlobalStyle(\n\t\tprefix + 'typography.letterSpacing'\n\t);\n\tconst [ backgroundColor ] = useGlobalStyle( prefix + 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient' );\n\tconst [ color ] = useGlobalStyle( prefix + 'color.text' );\n\n\tconst navigationButtonLabel = sprintf(\n\t\t// translators: %s: is a subset of Typography, e.g., 'text' or 'links'.\n\t\t__( 'Typography %s styles' ),\n\t\tlabel\n\t);\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ parentMenu + '/typography/' + element }\n\t\t\taria-label={ navigationButtonLabel }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem\n\t\t\t\t\tclassName=\"edit-site-global-styles-screen-typography__indicator\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tfontFamily: fontFamily ?? 'serif',\n\t\t\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tfontStyle,\n\t\t\t\t\t\tfontWeight,\n\t\t\t\t\t\tletterSpacing,\n\t\t\t\t\t\t...extraStyles,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Aa' ) }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ label }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction ScreenTypography() {\n\tconst parentMenu = '';\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Manage the typography settings for different elements.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<BlockPreviewPanel />\n\n\t\t\t<div className=\"edit-site-global-styles-screen-typography\">\n\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t<Subtitle level={ 3 }>{ __( 'Elements' ) }</Subtitle>\n\t\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"text\"\n\t\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"link\"\n\t\t\t\t\t\t\tlabel={ __( 'Links' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"heading\"\n\t\t\t\t\t\t\tlabel={ __( 'Headings' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"caption\"\n\t\t\t\t\t\t\tlabel={ __( 'Captions' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"button\"\n\t\t\t\t\t\t\tlabel={ __( 'Buttons' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t</VStack>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default ScreenTypography;\n"]}
@@ -45,10 +45,9 @@ const {
45
45
  areGlobalStyleConfigsEqual
46
46
  } = (0, _privateApis.unlock)(_blockEditor.privateApis);
47
47
 
48
- function Variation(_ref) {
49
- let {
50
- variation
51
- } = _ref;
48
+ function Variation({
49
+ variation
50
+ }) {
52
51
  const [isFocused, setIsFocused] = (0, _element.useState)(false);
53
52
  const {
54
53
  base,
@@ -98,33 +97,29 @@ function Variation(_ref) {
98
97
  onClick: selectVariation,
99
98
  onKeyDown: selectOnEnter,
100
99
  tabIndex: "0",
101
- "aria-label": variation === null || variation === void 0 ? void 0 : variation.title,
100
+ "aria-label": variation?.title,
102
101
  "aria-current": isActive,
103
102
  onFocus: () => setIsFocused(true),
104
103
  onBlur: () => setIsFocused(false)
105
104
  }, (0, _element.createElement)("div", {
106
105
  className: "edit-site-global-styles-variations_item-preview"
107
106
  }, (0, _element.createElement)(_preview.default, {
108
- label: variation === null || variation === void 0 ? void 0 : variation.title,
107
+ label: variation?.title,
109
108
  isFocused: isFocused,
110
109
  withHoverView: true
111
110
  }))));
112
111
  }
113
112
 
114
113
  function StyleVariationsContainer() {
115
- const {
116
- variations
117
- } = (0, _data.useSelect)(select => {
118
- return {
119
- variations: select(_coreData.store).__experimentalGetCurrentThemeGlobalStylesVariations() || []
120
- };
114
+ const variations = (0, _data.useSelect)(select => {
115
+ return select(_coreData.store).__experimentalGetCurrentThemeGlobalStylesVariations();
121
116
  }, []);
122
117
  const withEmptyVariation = (0, _element.useMemo)(() => {
123
118
  return [{
124
119
  title: (0, _i18n.__)('Default'),
125
120
  settings: {},
126
121
  styles: {}
127
- }, ...variations.map(variation => {
122
+ }, ...(variations !== null && variations !== void 0 ? variations : []).map(variation => {
128
123
  var _variation$settings2, _variation$styles2;
129
124
 
130
125
  return { ...variation,
@@ -133,12 +128,12 @@ function StyleVariationsContainer() {
133
128
  };
134
129
  })];
135
130
  }, [variations]);
136
- return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.__experimentalGrid, {
131
+ return (0, _element.createElement)(_components.__experimentalGrid, {
137
132
  columns: 2,
138
133
  className: "edit-site-global-styles-style-variations-container"
139
- }, withEmptyVariation === null || withEmptyVariation === void 0 ? void 0 : withEmptyVariation.map((variation, index) => (0, _element.createElement)(Variation, {
134
+ }, withEmptyVariation.map((variation, index) => (0, _element.createElement)(Variation, {
140
135
  key: index,
141
136
  variation: variation
142
- }))));
137
+ })));
143
138
  }
144
139
  //# sourceMappingURL=style-variations-container.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/style-variations-container.js"],"names":["GlobalStylesContext","areGlobalStyleConfigsEqual","blockEditorPrivateApis","Variation","variation","isFocused","setIsFocused","base","user","setUserConfig","context","settings","styles","merged","selectVariation","selectOnEnter","event","keyCode","ENTER","preventDefault","isActive","title","StyleVariationsContainer","variations","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","withEmptyVariation","map","index"],"mappings":";;;;;;;;;AAUA;;AAPA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AAKA,MAAM;AAAEA,EAAAA,mBAAF;AAAuBC,EAAAA;AAAvB,IAAsD,yBAC3DC,wBAD2D,CAA5D;;AAIA,SAASC,SAAT,OAAoC;AAAA,MAAhB;AAAEC,IAAAA;AAAF,GAAgB;AACnC,QAAM,CAAEC,SAAF,EAAaC,YAAb,IAA8B,uBAAU,KAAV,CAApC;AACA,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA;AAAd,MAAgC,yBAAYT,mBAAZ,CAAtC;AACA,QAAMU,OAAO,GAAG,sBAAS,MAAM;AAAA;;AAC9B,WAAO;AACNF,MAAAA,IAAI,EAAE;AACLG,QAAAA,QAAQ,yBAAEP,SAAS,CAACO,QAAZ,qEAAwB,EAD3B;AAELC,QAAAA,MAAM,uBAAER,SAAS,CAACQ,MAAZ,iEAAsB;AAFvB,OADA;AAKNL,MAAAA,IALM;A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AAGF,SAAH,aAAGA,SAAH,uBAAGA,SAAS,CAAEiB,KADpB;AAEC,IAAA,SAAS,EAAGhB,SAFb;AAGC,IAAA,aAAa;AAHd,IADD,CAhBD,CADD,CADD;AA4BA;;AAEc,SAASiB,wBAAT,GAAoC;AAClD,QAAM;AAAEC,IAAAA;AAAF,MAAiB,qBAAaC,MAAF,IAAc;AAC/C,WAAO;AACND,MAAAA,UAAU,EACTC,MAAM,CACLC,eADK,CAAN,CAEEC,mDAFF,MAE2D;AAJtD,KAAP;AAMA,GAPsB,EAOpB,EAPoB,CAAvB;AASA,QAAMC,kBAAkB,GAAG,sBAAS,MAAM;AACzC,WAAO,CACN;AACCN,MAAAA,KAAK,EAAE,cAAI,SAAJ,CADR;AAECV,MAAAA,QAAQ,EAAE,EAFX;AAGCC,MAAAA,MAAM,EAAE;AAHT,KADM,EAMN,GAAGW,UAAU,CAACK,GAAX,CAAkBxB,SAAF;AAAA;;AAAA,aAAmB,EACrC,GAAGA,SADkC;AAErCO,QAAAA,QAAQ,0BAAEP,SAAS,CAACO,QAAZ,uEAAwB,EAFK;AAGrCC,QAAAA,MAAM,wBAAER,SAAS,CAACQ,MAAZ,mEAAsB;AAHS,OAAnB;AAAA,KAAhB,CANG,CAAP;AAYA,GAb0B,EAaxB,CAAEW,UAAF,CAbwB,CAA3B;AAeA,SACC,qDACC,4BAAC,8BAAD;AACC,IAAA,OAAO,EAAG,CADX;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGI,kBAJH,aAIGA,kBAJH,uBAIGA,kBAAkB,CAAEC,GAApB,CAAyB,CAAExB,SAAF,EAAayB,KAAb,KAC1B,4BAAC,SAAD;AAAW,IAAA,GAAG,EAAGA,KAAjB;AAAyB,IAAA,SAAS,EAAGzB;AAArC,IADC,CAJH,CADD,CADD;AAYA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, useContext, useState } from '@wordpress/element';\nimport { ENTER } from '@wordpress/keycodes';\nimport { __experimentalGrid as Grid } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { mergeBaseAndUserConfigs } from './global-styles-provider';\nimport StylesPreview from './preview';\nimport { unlock } from '../../private-apis';\n\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\n\nfunction Variation( { variation } ) {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\tconst { base, user, setUserConfig } = useContext( GlobalStylesContext );\n\tconst context = useMemo( () => {\n\t\treturn {\n\t\t\tuser: {\n\t\t\t\tsettings: variation.settings ?? {},\n\t\t\t\tstyles: variation.styles ?? {},\n\t\t\t},\n\t\t\tbase,\n\t\t\tmerged: mergeBaseAndUserConfigs( base, variation ),\n\t\t\tsetUserConfig: () => {},\n\t\t};\n\t}, [ variation, base ] );\n\n\tconst selectVariation = () => {\n\t\tsetUserConfig( () => {\n\t\t\treturn {\n\t\t\t\tsettings: variation.settings,\n\t\t\t\tstyles: variation.styles,\n\t\t\t};\n\t\t} );\n\t};\n\n\tconst selectOnEnter = ( event ) => {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tselectVariation();\n\t\t}\n\t};\n\n\tconst isActive = useMemo( () => {\n\t\treturn areGlobalStyleConfigsEqual( user, variation );\n\t}, [ user, variation ] );\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ context }>\n\t\t\t<div\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-global-styles-variations_item',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-active': isActive,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\trole=\"button\"\n\t\t\t\tonClick={ selectVariation }\n\t\t\t\tonKeyDown={ selectOnEnter }\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\taria-label={ variation?.title }\n\t\t\t\taria-current={ isActive }\n\t\t\t\tonFocus={ () => setIsFocused( true ) }\n\t\t\t\tonBlur={ () => setIsFocused( false ) }\n\t\t\t>\n\t\t\t\t<div className=\"edit-site-global-styles-variations_item-preview\">\n\t\t\t\t\t<StylesPreview\n\t\t\t\t\t\tlabel={ variation?.title }\n\t\t\t\t\t\tisFocused={ isFocused }\n\t\t\t\t\t\twithHoverView\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n\nexport default function StyleVariationsContainer() {\n\tconst { variations } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tvariations:\n\t\t\t\tselect(\n\t\t\t\t\tcoreStore\n\t\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations() || [],\n\t\t};\n\t}, [] );\n\n\tconst withEmptyVariation = useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: __( 'Default' ),\n\t\t\t\tsettings: {},\n\t\t\t\tstyles: {},\n\t\t\t},\n\t\t\t...variations.map( ( variation ) => ( {\n\t\t\t\t...variation,\n\t\t\t\tsettings: variation.settings ?? {},\n\t\t\t\tstyles: variation.styles ?? {},\n\t\t\t} ) ),\n\t\t];\n\t}, [ variations ] );\n\n\treturn (\n\t\t<>\n\t\t\t<Grid\n\t\t\t\tcolumns={ 2 }\n\t\t\t\tclassName=\"edit-site-global-styles-style-variations-container\"\n\t\t\t>\n\t\t\t\t{ withEmptyVariation?.map( ( variation, index ) => (\n\t\t\t\t\t<Variation key={ index } variation={ variation } />\n\t\t\t\t) ) }\n\t\t\t</Grid>\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/style-variations-container.js"],"names":["GlobalStylesContext","areGlobalStyleConfigsEqual","blockEditorPrivateApis","Variation","variation","isFocused","setIsFocused","base","user","setUserConfig","context","settings","styles","merged","selectVariation","selectOnEnter","event","keyCode","ENTER","preventDefault","isActive","title","StyleVariationsContainer","variations","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","withEmptyVariation","map","index"],"mappings":";;;;;;;;;AAUA;;AAPA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AAKA,MAAM;AAAEA,EAAAA,mBAAF;AAAuBC,EAAAA;AAAvB,IAAsD,yBAC3DC,wBAD2D,CAA5D;;AAIA,SAASC,SAAT,CAAoB;AAAEC,EAAAA;AAAF,CAApB,EAAoC;AACnC,QAAM,CAAEC,SAAF,EAAaC,YAAb,IAA8B,uBAAU,KAAV,CAApC;AACA,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA;AAAd,MAAgC,yBAAYT,mBAAZ,CAAtC;AACA,QAAMU,OAAO,GAAG,sBAAS,MAAM;AAAA;;AAC9B,WAAO;AACNF,MAAAA,IAAI,EAAE;AACLG,QAAAA,QAAQ,yBAAEP,SAAS,CAACO,QAAZ,qEAAwB,EAD3B;AAELC,QAAAA,MAAM,uBAAER,SAAS,CAACQ,MAAZ,iEAAsB;AAFvB,OADA;AAKNL,MAAAA,IALM;AAMNM,MAAAA,MAAM,EAAE,mDAAyBN,IAAzB,EAA+BH,SAA/B,CANF;AAONK,MAAAA,aAAa,EAAE,MAAM,CAAE;AAPjB,KAAP;AASA,GAVe,EAUb,CAAEL,SAAF,EAAaG,IAAb,CAVa,CAAhB;;AAYA,QAAMO,eAAe,GAAG,MAAM;AAC7BL,IAAAA,aAAa,CAAE,MAAM;AACpB,aAAO;AACNE,QAAAA,QAAQ,EAAEP,SAAS,CAACO,QADd;AAENC,QAAAA,MAAM,EAAER,SAAS,CAACQ;AAFZ,OAAP;AAIA,KALY,CAAb;AAMA,GAPD;;AASA,QAAMG,aAAa,GAAKC,KAAF,IAAa;AAClC,QAAKA,KAAK,CAACC,OAAN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AAF,aAAEA,UAAF,cAAEA,UAAF,GAAgB,EAAhB,EAAqBK,GAArB,CAA4BxB,SAAF;AAAA;;AAAA,aAAmB,EAC/C,GAAGA,SAD4C;AAE/CO,QAAAA,QAAQ,0BAAEP,SAAS,CAACO,QAAZ,uEAAwB,EAFe;AAG/CC,QAAAA,MAAM,wBAAER,SAAS,CAACQ,MAAZ,mEAAsB;AAHmB,OAAnB;AAAA,KAA1B,CANG,CAAP;AAYA,GAb0B,EAaxB,CAAEW,UAAF,CAbwB,CAA3B;AAeA,SACC,4BAAC,8BAAD;AACC,IAAA,OAAO,EAAG,CADX;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGI,kBAAkB,CAACC,GAAnB,CAAwB,CAAExB,SAAF,EAAayB,KAAb,KACzB,4BAAC,SAAD;AAAW,IAAA,GAAG,EAAGA,KAAjB;AAAyB,IAAA,SAAS,EAAGzB;AAArC,IADC,CAJH,CADD;AAUA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, useContext, useState } from '@wordpress/element';\nimport { ENTER } from '@wordpress/keycodes';\nimport { __experimentalGrid as Grid } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { mergeBaseAndUserConfigs } from './global-styles-provider';\nimport StylesPreview from './preview';\nimport { unlock } from '../../private-apis';\n\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\n\nfunction Variation( { variation } ) {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\tconst { base, user, setUserConfig } = useContext( GlobalStylesContext );\n\tconst context = useMemo( () => {\n\t\treturn {\n\t\t\tuser: {\n\t\t\t\tsettings: variation.settings ?? {},\n\t\t\t\tstyles: variation.styles ?? {},\n\t\t\t},\n\t\t\tbase,\n\t\t\tmerged: mergeBaseAndUserConfigs( base, variation ),\n\t\t\tsetUserConfig: () => {},\n\t\t};\n\t}, [ variation, base ] );\n\n\tconst selectVariation = () => {\n\t\tsetUserConfig( () => {\n\t\t\treturn {\n\t\t\t\tsettings: variation.settings,\n\t\t\t\tstyles: variation.styles,\n\t\t\t};\n\t\t} );\n\t};\n\n\tconst selectOnEnter = ( event ) => {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tselectVariation();\n\t\t}\n\t};\n\n\tconst isActive = useMemo( () => {\n\t\treturn areGlobalStyleConfigsEqual( user, variation );\n\t}, [ user, variation ] );\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ context }>\n\t\t\t<div\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-global-styles-variations_item',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-active': isActive,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\trole=\"button\"\n\t\t\t\tonClick={ selectVariation }\n\t\t\t\tonKeyDown={ selectOnEnter }\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\taria-label={ variation?.title }\n\t\t\t\taria-current={ isActive }\n\t\t\t\tonFocus={ () => setIsFocused( true ) }\n\t\t\t\tonBlur={ () => setIsFocused( false ) }\n\t\t\t>\n\t\t\t\t<div className=\"edit-site-global-styles-variations_item-preview\">\n\t\t\t\t\t<StylesPreview\n\t\t\t\t\t\tlabel={ variation?.title }\n\t\t\t\t\t\tisFocused={ isFocused }\n\t\t\t\t\t\twithHoverView\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n\nexport default function StyleVariationsContainer() {\n\tconst variations = useSelect( ( select ) => {\n\t\treturn select(\n\t\t\tcoreStore\n\t\t).__experimentalGetCurrentThemeGlobalStylesVariations();\n\t}, [] );\n\n\tconst withEmptyVariation = useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: __( 'Default' ),\n\t\t\t\tsettings: {},\n\t\t\t\tstyles: {},\n\t\t\t},\n\t\t\t...( variations ?? [] ).map( ( variation ) => ( {\n\t\t\t\t...variation,\n\t\t\t\tsettings: variation.settings ?? {},\n\t\t\t\tstyles: variation.styles ?? {},\n\t\t\t} ) ),\n\t\t];\n\t}, [ variations ] );\n\n\treturn (\n\t\t<Grid\n\t\t\tcolumns={ 2 }\n\t\t\tclassName=\"edit-site-global-styles-style-variations-container\"\n\t\t>\n\t\t\t{ withEmptyVariation.map( ( variation, index ) => (\n\t\t\t\t<Variation key={ index } variation={ variation } />\n\t\t\t) ) }\n\t\t</Grid>\n\t);\n}\n"]}
@@ -12,11 +12,10 @@ var _components = require("@wordpress/components");
12
12
  /**
13
13
  * WordPress dependencies
14
14
  */
15
- function Subtitle(_ref) {
16
- let {
17
- children,
18
- level
19
- } = _ref;
15
+ function Subtitle({
16
+ children,
17
+ level
18
+ }) {
20
19
  return (0, _element.createElement)(_components.__experimentalHeading, {
21
20
  className: "edit-site-global-styles-subtitle",
22
21
  level: level !== null && level !== void 0 ? level : 2
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/subtitle.js"],"names":["Subtitle","children","level"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,SAASA,QAAT,OAAyC;AAAA,MAAtB;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAsB;AACxC,SACC,4BAAC,iCAAD;AACC,IAAA,SAAS,EAAC,kCADX;AAEC,IAAA,KAAK,EAAGA,KAAH,aAAGA,KAAH,cAAGA,KAAH,GAAY;AAFlB,KAIGD,QAJH,CADD;AAQA;;eAEcD,Q","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n\nfunction Subtitle( { children, level } ) {\n\treturn (\n\t\t<Heading\n\t\t\tclassName=\"edit-site-global-styles-subtitle\"\n\t\t\tlevel={ level ?? 2 }\n\t\t>\n\t\t\t{ children }\n\t\t</Heading>\n\t);\n}\n\nexport default Subtitle;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/subtitle.js"],"names":["Subtitle","children","level"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,SAASA,QAAT,CAAmB;AAAEC,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,CAAnB,EAAyC;AACxC,SACC,4BAAC,iCAAD;AACC,IAAA,SAAS,EAAC,kCADX;AAEC,IAAA,KAAK,EAAGA,KAAH,aAAGA,KAAH,cAAGA,KAAH,GAAY;AAFlB,KAIGD,QAJH,CADD;AAQA;;eAEcD,Q","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n\nfunction Subtitle( { children, level } ) {\n\treturn (\n\t\t<Heading\n\t\t\tclassName=\"edit-site-global-styles-subtitle\"\n\t\t\tlevel={ level ?? 2 }\n\t\t>\n\t\t\t{ children }\n\t\t</Heading>\n\t);\n}\n\nexport default Subtitle;\n"]}
@@ -25,11 +25,10 @@ const {
25
25
  TypographyPanel: StylesTypographyPanel
26
26
  } = (0, _privateApis.unlock)(_blockEditor.privateApis);
27
27
 
28
- function TypographyPanel(_ref) {
29
- let {
30
- element,
31
- headingLevel
32
- } = _ref;
28
+ function TypographyPanel({
29
+ element,
30
+ headingLevel
31
+ }) {
33
32
  let prefixParts = [];
34
33
 
35
34
  if (element === 'heading') {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/typography-panel.js"],"names":["useGlobalStyle","useGlobalSetting","useSettingsForBlockElement","TypographyPanel","StylesTypographyPanel","blockEditorPrivateApis","element","headingLevel","prefixParts","concat","prefix","join","style","undefined","shouldDecodeEncode","inheritedStyle","setStyle","rawSettings","usedElement","settings"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAM;AACLA,EAA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HZ;AAIC,IAAA,QAAQ,EAAGG;AAJZ,IADD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst {\n\tuseGlobalStyle,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tTypographyPanel: StylesTypographyPanel,\n} = unlock( blockEditorPrivateApis );\n\nexport default function TypographyPanel( { element, headingLevel } ) {\n\tlet prefixParts = [];\n\tif ( element === 'heading' ) {\n\t\tprefixParts = prefixParts.concat( [ 'elements', headingLevel ] );\n\t} else if ( element && element !== 'text' ) {\n\t\tprefixParts = prefixParts.concat( [ 'elements', element ] );\n\t}\n\tconst prefix = prefixParts.join( '.' );\n\n\tconst [ style ] = useGlobalStyle( prefix, undefined, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle(\n\t\tprefix,\n\t\tundefined,\n\t\t'all',\n\t\t{\n\t\t\tshouldDecodeEncode: false,\n\t\t}\n\t);\n\tconst [ rawSettings ] = useGlobalSetting( '' );\n\tconst usedElement = element === 'heading' ? headingLevel : element;\n\tconst settings = useSettingsForBlockElement(\n\t\trawSettings,\n\t\tundefined,\n\t\tusedElement\n\t);\n\n\treturn (\n\t\t<StylesTypographyPanel\n\t\t\tinheritedValue={ inheritedStyle }\n\t\t\tvalue={ style }\n\t\t\tonChange={ setStyle }\n\t\t\tsettings={ settings }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/typography-panel.js"],"names":["useGlobalStyle","useGlobalSetting","useSettingsForBlockElement","TypographyPanel","StylesTypographyPanel","blockEditorPrivateApis","element","headingLevel","prefixParts","concat","prefix","join","style","undefined","shouldDecodeEncode","inheritedStyle","setStyle","rawSettings","usedElement","settings"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;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C,IAAA,QAAQ,EAAGI,QAHZ;AAIC,IAAA,QAAQ,EAAGG;AAJZ,IADD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst {\n\tuseGlobalStyle,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tTypographyPanel: StylesTypographyPanel,\n} = unlock( blockEditorPrivateApis );\n\nexport default function TypographyPanel( { element, headingLevel } ) {\n\tlet prefixParts = [];\n\tif ( element === 'heading' ) {\n\t\tprefixParts = prefixParts.concat( [ 'elements', headingLevel ] );\n\t} else if ( element && element !== 'text' ) {\n\t\tprefixParts = prefixParts.concat( [ 'elements', element ] );\n\t}\n\tconst prefix = prefixParts.join( '.' );\n\n\tconst [ style ] = useGlobalStyle( prefix, undefined, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle(\n\t\tprefix,\n\t\tundefined,\n\t\t'all',\n\t\t{\n\t\t\tshouldDecodeEncode: false,\n\t\t}\n\t);\n\tconst [ rawSettings ] = useGlobalSetting( '' );\n\tconst usedElement = element === 'heading' ? headingLevel : element;\n\tconst settings = useSettingsForBlockElement(\n\t\trawSettings,\n\t\tundefined,\n\t\tusedElement\n\t);\n\n\treturn (\n\t\t<StylesTypographyPanel\n\t\t\tinheritedValue={ inheritedStyle }\n\t\t\tvalue={ style }\n\t\t\tonChange={ setStyle }\n\t\t\tsettings={ settings }\n\t\t/>\n\t);\n}\n"]}
@@ -22,12 +22,11 @@ const {
22
22
  useGlobalStyle
23
23
  } = (0, _privateApis.unlock)(_blockEditor.privateApis);
24
24
 
25
- function TypographyPreview(_ref) {
26
- let {
27
- name,
28
- element,
29
- headingLevel
30
- } = _ref;
25
+ function TypographyPreview({
26
+ name,
27
+ element,
28
+ headingLevel
29
+ }) {
31
30
  let prefix = '';
32
31
 
33
32
  if (element === 'heading') {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/typography-preview.js"],"names":["useGlobalStyle","blockEditorPrivateApis","TypographyPreview","name","element","headingLevel","prefix","fontFamily","gradientValue","backgroundColor","color","fontSize","fontStyle","fontWeight","letterSpacing","extraStyles","textDecoration","background"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAM;AAAEA,EAAAA;AAAF,IAAqB,yBAAQC,wBAAR,CAA3B;;AAEe,SAASC,iBAAT,OAA8D;AAAA,MAAlC;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,OAAR;AAAiBC,IAAAA;AAAjB,GAAkC;AAC5E,MAAIC,MAAM,GAAG,EAAb;;AACA,MAAKF,OAAO,KAAK,SAAjB,EAA6B;AAC5BE,IAAAA,MAAM,GAAI,YAAYD,YAAc,GAApC;AACA,GAFD,MAEO,IAAKD,OAAO,IAAIA,OAAO,KAAK,MAA5B,EAAqC;AAC3CE,IAAAA,MAAM,GAAI,YAAYF,OAAS,GAA/B;AACA;;AAED,QAAM,CAAEG,UAAF,IAAiBP,cAAc,CACpCM,MAAM,GAAG,uBAD2B,EAEpCH,IAFoC,CAArC;AAIA,QAAM,CAAEK,aAAF,IAAoBR,cAAc,CAAEM,MAAM,GAAG,gBAAX,EAA6BH,IAA7B,CAAxC;AACA,QAAM,CAAEM,eAAF,IAAsBT,cAAc,CACzCM,MAAM,GAAG,kBADgC,EAEzCH,IAFyC,CAA1C;AAIA,QAAM,CAAEO,KAAF,IAAYV,cAAc,CAAEM,MAAM,GAAG,YAAX,EAAyBH,IAAzB,CAAhC;AACA,QAAM,CAAEQ,QAAF,IAAeX,cAAc,CAAEM,MAAM,GAAG,qBAAX,EAAkCH,IAAlC,CAAnC;AACA,QAAM,CAAES,SAAF,IAAgBZ,cAAc,CACnCM,MAAM,GAAG,sBAD0B,EAEnCH,IAFmC,CAApC;AAIA,QAAM,CAAEU,UAAF,IAAiBb,cAAc,CACpCM,MAAM,GAAG,uBAD2B,EAEpCH,IAFoC,CAArC;AAIA,QAAM,CAAEW,aAAF,IAAoBd,cAAc,CACvCM,MAAM,GAAG,0BAD8B,EAEvCH,IAFuC,CAAxC;AAIA,QAAMY,WAAW,GAChBX,OAAO,KAAK,MAAZ,GACG;AACAY,IAAAA,cAAc,EAAE;AADhB,GADH,GAIG,EALJ;AAOA,SACC;AACC,IAAA,SAAS,EAAC,8BADX;AAEC,IAAA,KAAK,EAAG;AACPT,MAAAA,UAAU,EAAEA,UAAF,aAAEA,UAAF,cAAEA,UAAF,GAAgB,OADnB;AAEPU,MAAAA,UAAU,EAAET,aAAF,aAAEA,aAAF,cAAEA,aAAF,GAAmBC,eAFtB;AAGPC,MAAAA,KAHO;AAIPC,MAAAA,QAJO;AAKPC,MAAAA,SALO;AAMPC,MAAAA,UANO;AAOPC,MAAAA,aAPO;AAQP,SAAGC;AARI;AAFT,UADD;AAiBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nexport default function TypographyPreview( { name, element, headingLevel } ) {\n\tlet prefix = '';\n\tif ( element === 'heading' ) {\n\t\tprefix = `elements.${ headingLevel }.`;\n\t} else if ( element && element !== 'text' ) {\n\t\tprefix = `elements.${ element }.`;\n\t}\n\n\tconst [ fontFamily ] = useGlobalStyle(\n\t\tprefix + 'typography.fontFamily',\n\t\tname\n\t);\n\tconst [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient', name );\n\tconst [ backgroundColor ] = useGlobalStyle(\n\t\tprefix + 'color.background',\n\t\tname\n\t);\n\tconst [ color ] = useGlobalStyle( prefix + 'color.text', name );\n\tconst [ fontSize ] = useGlobalStyle( prefix + 'typography.fontSize', name );\n\tconst [ fontStyle ] = useGlobalStyle(\n\t\tprefix + 'typography.fontStyle',\n\t\tname\n\t);\n\tconst [ fontWeight ] = useGlobalStyle(\n\t\tprefix + 'typography.fontWeight',\n\t\tname\n\t);\n\tconst [ letterSpacing ] = useGlobalStyle(\n\t\tprefix + 'typography.letterSpacing',\n\t\tname\n\t);\n\tconst extraStyles =\n\t\telement === 'link'\n\t\t\t? {\n\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t }\n\t\t\t: {};\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"edit-site-typography-preview\"\n\t\t\tstyle={ {\n\t\t\t\tfontFamily: fontFamily ?? 'serif',\n\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\tcolor,\n\t\t\t\tfontSize,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tletterSpacing,\n\t\t\t\t...extraStyles,\n\t\t\t} }\n\t\t>\n\t\t\tAa\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/typography-preview.js"],"names":["useGlobalStyle","blockEditorPrivateApis","TypographyPreview","name","element","headingLevel","prefix","fontFamily","gradientValue","backgroundColor","color","fontSize","fontStyle","fontWeight","letterSpacing","extraStyles","textDecoration","background"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAM;AAAEA,EAAAA;AAAF,IAAqB,yBAAQC,wBAAR,CAA3B;;AAEe,SAASC,iBAAT,CAA4B;AAAEC,EAAAA,IAAF;AAAQC,EAAAA,OAAR;AAAiBC,EAAAA;AAAjB,CAA5B,EAA8D;AAC5E,MAAIC,MAAM,GAAG,EAAb;;AACA,MAAKF,OAAO,KAAK,SAAjB,EAA6B;AAC5BE,IAAAA,MAAM,GAAI,YAAYD,YAAc,GAApC;AACA,GAFD,MAEO,IAAKD,OAAO,IAAIA,OAAO,KAAK,MAA5B,EAAqC;AAC3CE,IAAAA,MAAM,GAAI,YAAYF,OAAS,GAA/B;AACA;;AAED,QAAM,CAAEG,UAAF,IAAiBP,cAAc,CACpCM,MAAM,GAAG,uBAD2B,EAEpCH,IAFoC,CAArC;AAIA,QAAM,CAAEK,aAAF,IAAoBR,cAAc,CAAEM,MAAM,GAAG,gBAAX,EAA6BH,IAA7B,CAAxC;AACA,QAAM,CAAEM,eAAF,IAAsBT,cAAc,CACzCM,MAAM,GAAG,kBADgC,EAEzCH,IAFyC,CAA1C;AAIA,QAAM,CAAEO,KAAF,IAAYV,cAAc,CAAEM,MAAM,GAAG,YAAX,EAAyBH,IAAzB,CAAhC;AACA,QAAM,CAAEQ,QAAF,IAAeX,cAAc,CAAEM,MAAM,GAAG,qBAAX,EAAkCH,IAAlC,CAAnC;AACA,QAAM,CAAES,SAAF,IAAgBZ,cAAc,CACnCM,MAAM,GAAG,sBAD0B,EAEnCH,IAFmC,CAApC;AAIA,QAAM,CAAEU,UAAF,IAAiBb,cAAc,CACpCM,MAAM,GAAG,uBAD2B,EAEpCH,IAFoC,CAArC;AAIA,QAAM,CAAEW,aAAF,IAAoBd,cAAc,CACvCM,MAAM,GAAG,0BAD8B,EAEvCH,IAFuC,CAAxC;AAIA,QAAMY,WAAW,GAChBX,OAAO,KAAK,MAAZ,GACG;AACAY,IAAAA,cAAc,EAAE;AADhB,GADH,GAIG,EALJ;AAOA,SACC;AACC,IAAA,SAAS,EAAC,8BADX;AAEC,IAAA,KAAK,EAAG;AACPT,MAAAA,UAAU,EAAEA,UAAF,aAAEA,UAAF,cAAEA,UAAF,GAAgB,OADnB;AAEPU,MAAAA,UAAU,EAAET,aAAF,aAAEA,aAAF,cAAEA,aAAF,GAAmBC,eAFtB;AAGPC,MAAAA,KAHO;AAIPC,MAAAA,QAJO;AAKPC,MAAAA,SALO;AAMPC,MAAAA,UANO;AAOPC,MAAAA,aAPO;AAQP,SAAGC;AARI;AAFT,UADD;AAiBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nexport default function TypographyPreview( { name, element, headingLevel } ) {\n\tlet prefix = '';\n\tif ( element === 'heading' ) {\n\t\tprefix = `elements.${ headingLevel }.`;\n\t} else if ( element && element !== 'text' ) {\n\t\tprefix = `elements.${ element }.`;\n\t}\n\n\tconst [ fontFamily ] = useGlobalStyle(\n\t\tprefix + 'typography.fontFamily',\n\t\tname\n\t);\n\tconst [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient', name );\n\tconst [ backgroundColor ] = useGlobalStyle(\n\t\tprefix + 'color.background',\n\t\tname\n\t);\n\tconst [ color ] = useGlobalStyle( prefix + 'color.text', name );\n\tconst [ fontSize ] = useGlobalStyle( prefix + 'typography.fontSize', name );\n\tconst [ fontStyle ] = useGlobalStyle(\n\t\tprefix + 'typography.fontStyle',\n\t\tname\n\t);\n\tconst [ fontWeight ] = useGlobalStyle(\n\t\tprefix + 'typography.fontWeight',\n\t\tname\n\t);\n\tconst [ letterSpacing ] = useGlobalStyle(\n\t\tprefix + 'typography.letterSpacing',\n\t\tname\n\t);\n\tconst extraStyles =\n\t\telement === 'link'\n\t\t\t? {\n\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t }\n\t\t\t: {};\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"edit-site-typography-preview\"\n\t\t\tstyle={ {\n\t\t\t\tfontFamily: fontFamily ?? 'serif',\n\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\tcolor,\n\t\t\t\tfontSize,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tletterSpacing,\n\t\t\t\t...extraStyles,\n\t\t\t} }\n\t\t>\n\t\t\tAa\n\t\t</div>\n\t);\n}\n"]}