@wordpress/edit-site 5.11.0 → 5.12.1

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 (1056) hide show
  1. package/CHANGELOG.md +7 -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-pattern/index.js +99 -0
  5. package/build/components/add-new-pattern/index.js.map +1 -0
  6. package/build/components/add-new-template/add-custom-generic-template-modal-content.js +4 -5
  7. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  8. package/build/components/add-new-template/add-custom-template-modal-content.js +27 -44
  9. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  10. package/build/components/add-new-template/index.js +6 -15
  11. package/build/components/add-new-template/index.js.map +1 -1
  12. package/build/components/add-new-template/new-template.js +26 -35
  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/app/index.js +2 -2
  17. package/build/components/app/index.js.map +1 -1
  18. package/build/components/block-editor/back-button.js +6 -6
  19. package/build/components/block-editor/back-button.js.map +1 -1
  20. package/build/components/block-editor/block-inspector-button.js +3 -4
  21. package/build/components/block-editor/block-inspector-button.js.map +1 -1
  22. package/build/components/block-editor/constants.js +9 -0
  23. package/build/components/block-editor/constants.js.map +1 -0
  24. package/build/components/block-editor/editor-canvas.js +14 -15
  25. package/build/components/block-editor/editor-canvas.js.map +1 -1
  26. package/build/components/block-editor/get-block-editor-provider.js +42 -0
  27. package/build/components/block-editor/get-block-editor-provider.js.map +1 -0
  28. package/build/components/block-editor/index.js +6 -129
  29. package/build/components/block-editor/index.js.map +1 -1
  30. package/build/components/block-editor/inserter-media-categories.js +25 -42
  31. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  32. package/build/components/block-editor/providers/default-block-editor-provider.js +58 -0
  33. package/build/components/block-editor/providers/default-block-editor-provider.js.map +1 -0
  34. package/build/components/block-editor/providers/navigation-block-editor-provider.js +117 -0
  35. package/build/components/block-editor/providers/navigation-block-editor-provider.js.map +1 -0
  36. package/build/components/block-editor/resizable-editor.js +6 -7
  37. package/build/components/block-editor/resizable-editor.js.map +1 -1
  38. package/build/components/block-editor/resize-handle.js +5 -7
  39. package/build/components/block-editor/resize-handle.js.map +1 -1
  40. package/build/components/block-editor/site-editor-canvas.js +137 -0
  41. package/build/components/block-editor/site-editor-canvas.js.map +1 -0
  42. package/build/components/block-editor/use-site-editor-settings.js +82 -0
  43. package/build/components/block-editor/use-site-editor-settings.js.map +1 -0
  44. package/build/components/canvas-spinner/index.js +18 -1
  45. package/build/components/canvas-spinner/index.js.map +1 -1
  46. package/build/components/code-editor/code-editor-text-area.js +5 -6
  47. package/build/components/code-editor/code-editor-text-area.js.map +1 -1
  48. package/build/components/create-pattern-modal/index.js +125 -0
  49. package/build/components/create-pattern-modal/index.js.map +1 -0
  50. package/build/components/create-template-part-modal/index.js +73 -33
  51. package/build/components/create-template-part-modal/index.js.map +1 -1
  52. package/build/components/editor/index.js +43 -24
  53. package/build/components/editor/index.js.map +1 -1
  54. package/build/components/editor-canvas-container/index.js +29 -12
  55. package/build/components/editor-canvas-container/index.js.map +1 -1
  56. package/build/components/error-boundary/warning.js +8 -10
  57. package/build/components/error-boundary/warning.js.map +1 -1
  58. package/build/components/global-styles/block-preview-panel.js +7 -10
  59. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  60. package/build/components/global-styles/color-indicator-wrapper.js +7 -9
  61. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  62. package/build/components/global-styles/color-palette-panel.js +5 -6
  63. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  64. package/build/components/global-styles/dimensions-panel.js +3 -5
  65. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  66. package/build/components/global-styles/global-styles-provider.js +20 -26
  67. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  68. package/build/components/global-styles/gradients-palette-panel.js +5 -6
  69. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  70. package/build/components/global-styles/header.js +4 -5
  71. package/build/components/global-styles/header.js.map +1 -1
  72. package/build/components/global-styles/hooks.js +3 -3
  73. package/build/components/global-styles/hooks.js.map +1 -1
  74. package/build/components/global-styles/icon-with-current-color.js +7 -9
  75. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  76. package/build/components/global-styles/navigation-button.js +15 -17
  77. package/build/components/global-styles/navigation-button.js.map +1 -1
  78. package/build/components/global-styles/palette.js +12 -16
  79. package/build/components/global-styles/palette.js.map +1 -1
  80. package/build/components/global-styles/preview.js +43 -53
  81. package/build/components/global-styles/preview.js.map +1 -1
  82. package/build/components/global-styles/root-menu.js +2 -2
  83. package/build/components/global-styles/root-menu.js.map +1 -1
  84. package/build/components/global-styles/screen-block-list.js +6 -9
  85. package/build/components/global-styles/screen-block-list.js.map +1 -1
  86. package/build/components/global-styles/screen-block.js +11 -12
  87. package/build/components/global-styles/screen-block.js.map +1 -1
  88. package/build/components/global-styles/screen-color-palette.js +3 -4
  89. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  90. package/build/components/global-styles/screen-colors.js +2 -2
  91. package/build/components/global-styles/screen-colors.js.map +1 -1
  92. package/build/components/global-styles/screen-css.js +2 -2
  93. package/build/components/global-styles/screen-css.js.map +1 -1
  94. package/build/components/global-styles/screen-layout.js +2 -2
  95. package/build/components/global-styles/screen-layout.js.map +1 -1
  96. package/build/components/global-styles/screen-revisions/index.js +12 -12
  97. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  98. package/build/components/global-styles/screen-revisions/revisions-buttons.js +14 -19
  99. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  100. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +7 -13
  101. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  102. package/build/components/global-styles/screen-root.js +5 -5
  103. package/build/components/global-styles/screen-root.js.map +1 -1
  104. package/build/components/global-styles/screen-typography-element.js +3 -4
  105. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  106. package/build/components/global-styles/screen-typography.js +8 -9
  107. package/build/components/global-styles/screen-typography.js.map +1 -1
  108. package/build/components/global-styles/style-variations-container.js +15 -8
  109. package/build/components/global-styles/style-variations-container.js.map +1 -1
  110. package/build/components/global-styles/subtitle.js +4 -5
  111. package/build/components/global-styles/subtitle.js.map +1 -1
  112. package/build/components/global-styles/typography-panel.js +6 -7
  113. package/build/components/global-styles/typography-panel.js.map +1 -1
  114. package/build/components/global-styles/typography-preview.js +7 -8
  115. package/build/components/global-styles/typography-preview.js.map +1 -1
  116. package/build/components/global-styles/ui.js +123 -50
  117. package/build/components/global-styles/ui.js.map +1 -1
  118. package/build/components/global-styles/variations-panel.js +5 -6
  119. package/build/components/global-styles/variations-panel.js.map +1 -1
  120. package/build/components/global-styles-renderer/index.js +2 -2
  121. package/build/components/global-styles-renderer/index.js.map +1 -1
  122. package/build/components/header-edit-mode/document-actions/index.js +136 -24
  123. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  124. package/build/components/header-edit-mode/index.js +8 -14
  125. package/build/components/header-edit-mode/index.js.map +1 -1
  126. package/build/components/header-edit-mode/more-menu/index.js +49 -53
  127. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  128. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +4 -7
  129. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
  130. package/build/components/header-edit-mode/tools-more-menu-group/index.js +5 -14
  131. package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  132. package/build/components/header-edit-mode/undo-redo/redo.js +2 -6
  133. package/build/components/header-edit-mode/undo-redo/redo.js.map +1 -1
  134. package/build/components/header-edit-mode/undo-redo/undo.js +2 -6
  135. package/build/components/header-edit-mode/undo-redo/undo.js.map +1 -1
  136. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  137. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  138. package/build/components/keyboard-shortcut-help-modal/index.js +42 -51
  139. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  140. package/build/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  141. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  142. package/build/components/keyboard-shortcuts/edit-mode.js +7 -2
  143. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  144. package/build/components/keyboard-shortcuts/index.js +7 -2
  145. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  146. package/build/components/keyboard-shortcuts/register.js +1 -1
  147. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  148. package/build/components/layout/hooks.js +21 -0
  149. package/build/components/layout/hooks.js.map +1 -1
  150. package/build/components/layout/index.js +44 -34
  151. package/build/components/layout/index.js.map +1 -1
  152. package/build/components/list/added-by.js +13 -23
  153. package/build/components/list/added-by.js.map +1 -1
  154. package/build/components/list/header.js +4 -7
  155. package/build/components/list/header.js.map +1 -1
  156. package/build/components/list/index.js +4 -6
  157. package/build/components/list/index.js.map +1 -1
  158. package/build/components/list/table.js +35 -40
  159. package/build/components/list/table.js.map +1 -1
  160. package/build/components/page/header.js +41 -0
  161. package/build/components/page/header.js.map +1 -0
  162. package/build/components/page/index.js +49 -0
  163. package/build/components/page/index.js.map +1 -0
  164. package/build/components/page-actions/delete-page-menu-item.js +70 -0
  165. package/build/components/page-actions/delete-page-menu-item.js.map +1 -0
  166. package/build/components/page-actions/index.js +43 -0
  167. package/build/components/page-actions/index.js.map +1 -0
  168. package/build/components/page-content-focus-manager/back-to-page-notification.js +67 -0
  169. package/build/components/page-content-focus-manager/back-to-page-notification.js.map +1 -0
  170. package/build/components/page-content-focus-manager/constants.js +9 -0
  171. package/build/components/page-content-focus-manager/constants.js.map +1 -0
  172. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +60 -0
  173. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -0
  174. package/build/components/page-content-focus-manager/edit-template-notification.js +121 -0
  175. package/build/components/page-content-focus-manager/edit-template-notification.js.map +1 -0
  176. package/build/components/page-content-focus-manager/index.js +37 -0
  177. package/build/components/page-content-focus-manager/index.js.map +1 -0
  178. package/build/components/page-library/grid-item.js +165 -0
  179. package/build/components/page-library/grid-item.js.map +1 -0
  180. package/build/components/page-library/grid.js +49 -0
  181. package/build/components/page-library/grid.js.map +1 -0
  182. package/build/components/page-library/index.js +61 -0
  183. package/build/components/page-library/index.js.map +1 -0
  184. package/build/components/page-library/no-patterns.js +20 -0
  185. package/build/components/page-library/no-patterns.js.map +1 -0
  186. package/build/components/page-library/patterns-list.js +108 -0
  187. package/build/components/page-library/patterns-list.js.map +1 -0
  188. package/build/components/page-library/search-items.js +172 -0
  189. package/build/components/page-library/search-items.js.map +1 -0
  190. package/build/components/page-library/use-library-settings.js +53 -0
  191. package/build/components/page-library/use-library-settings.js.map +1 -0
  192. package/build/components/page-library/use-patterns.js +194 -0
  193. package/build/components/page-library/use-patterns.js.map +1 -0
  194. package/build/components/page-library/utils.js +30 -0
  195. package/build/components/page-library/utils.js.map +1 -0
  196. package/build/components/page-main/index.js +46 -0
  197. package/build/components/page-main/index.js.map +1 -0
  198. package/build/components/page-templates/index.js +101 -0
  199. package/build/components/page-templates/index.js.map +1 -0
  200. package/build/components/preferences-modal/enable-feature.js +4 -7
  201. package/build/components/preferences-modal/enable-feature.js.map +1 -1
  202. package/build/components/preferences-modal/index.js +4 -5
  203. package/build/components/preferences-modal/index.js.map +1 -1
  204. package/build/components/resizable-frame/index.js +25 -15
  205. package/build/components/resizable-frame/index.js.map +1 -1
  206. package/build/components/revisions/index.js +14 -17
  207. package/build/components/revisions/index.js.map +1 -1
  208. package/build/components/routes/link.js +15 -22
  209. package/build/components/routes/link.js.map +1 -1
  210. package/build/components/routes/use-title.js +3 -7
  211. package/build/components/routes/use-title.js.map +1 -1
  212. package/build/components/save-button/index.js +23 -13
  213. package/build/components/save-button/index.js.map +1 -1
  214. package/build/components/save-hub/index.js +97 -5
  215. package/build/components/save-hub/index.js.map +1 -1
  216. package/build/components/save-panel/index.js +63 -19
  217. package/build/components/save-panel/index.js.map +1 -1
  218. package/build/components/secondary-sidebar/inserter-sidebar.js +4 -8
  219. package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  220. package/build/components/secondary-sidebar/list-view-sidebar.js +51 -9
  221. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  222. package/build/components/sidebar/index.js +14 -8
  223. package/build/components/sidebar/index.js.map +1 -1
  224. package/build/components/sidebar-button/index.js +2 -4
  225. package/build/components/sidebar-button/index.js.map +1 -1
  226. package/build/components/sidebar-edit-mode/default-sidebar.js +11 -12
  227. package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  228. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +22 -8
  229. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  230. package/build/components/sidebar-edit-mode/index.js +13 -10
  231. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  232. package/build/components/sidebar-edit-mode/page-panels/edit-template.js +84 -0
  233. package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -0
  234. package/build/components/sidebar-edit-mode/page-panels/index.js +99 -0
  235. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -0
  236. package/build/components/sidebar-edit-mode/page-panels/page-content.js +35 -0
  237. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -0
  238. package/build/components/sidebar-edit-mode/page-panels/page-status.js +192 -0
  239. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -0
  240. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +45 -0
  241. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -0
  242. package/build/components/sidebar-edit-mode/page-panels/publish-date.js +98 -0
  243. package/build/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -0
  244. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +8 -12
  245. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  246. package/build/components/sidebar-edit-mode/settings-header/index.js +52 -21
  247. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  248. package/build/components/sidebar-edit-mode/sidebar-card/index.js +46 -0
  249. package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -0
  250. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +5 -6
  251. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  252. package/build/components/sidebar-edit-mode/{template-card → template-panel}/index.js +30 -22
  253. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -0
  254. package/build/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +7 -8
  255. package/{build-module/components/sidebar-edit-mode/template-revisions/index.js.map → build/components/sidebar-edit-mode/template-panel/last-revision.js.map} +1 -1
  256. package/build/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +12 -16
  257. package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -0
  258. package/build/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +15 -19
  259. package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -0
  260. package/build/components/sidebar-navigation-item/index.js +17 -14
  261. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  262. package/build/components/sidebar-navigation-screen/index.js +38 -20
  263. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  264. package/build/components/sidebar-navigation-screen-details-footer/index.js +36 -0
  265. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -0
  266. package/build/components/sidebar-navigation-screen-details-panel/index.js +58 -0
  267. package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -0
  268. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +22 -0
  269. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -0
  270. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +35 -0
  271. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -0
  272. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +22 -0
  273. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -0
  274. package/build/components/sidebar-navigation-screen-global-styles/index.js +114 -24
  275. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  276. package/build/components/sidebar-navigation-screen-library/category-item.js +48 -0
  277. package/build/components/sidebar-navigation-screen-library/category-item.js.map +1 -0
  278. package/build/components/sidebar-navigation-screen-library/index.js +112 -0
  279. package/build/components/sidebar-navigation-screen-library/index.js.map +1 -0
  280. package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +36 -0
  281. package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +1 -0
  282. package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js +76 -0
  283. package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +1 -0
  284. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js +41 -0
  285. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +1 -0
  286. package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js +40 -0
  287. package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +1 -0
  288. package/build/components/sidebar-navigation-screen-main/index.js +12 -13
  289. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  290. package/build/components/sidebar-navigation-screen-navigation-item/index.js +5 -7
  291. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  292. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +42 -0
  293. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -0
  294. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +41 -0
  295. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -0
  296. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +49 -97
  297. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  298. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +84 -0
  299. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -0
  300. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +71 -0
  301. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -0
  302. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +54 -0
  303. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -0
  304. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +49 -0
  305. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -0
  306. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +163 -0
  307. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -0
  308. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  309. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  310. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +59 -26
  311. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  312. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +75 -31
  313. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  314. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +23 -53
  315. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  316. package/build/components/sidebar-navigation-screen-page/index.js +63 -12
  317. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  318. package/build/components/sidebar-navigation-screen-page/page-details.js +150 -0
  319. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -0
  320. package/build/components/sidebar-navigation-screen-page/status-label.js +111 -0
  321. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -0
  322. package/build/components/sidebar-navigation-screen-pages/index.js +133 -21
  323. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  324. package/build/components/sidebar-navigation-screen-pattern/index.js +66 -0
  325. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -0
  326. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +41 -0
  327. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -0
  328. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +33 -0
  329. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -0
  330. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +40 -0
  331. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -0
  332. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +47 -0
  333. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -0
  334. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +82 -0
  335. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -0
  336. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +80 -0
  337. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -0
  338. package/build/components/sidebar-navigation-screen-template/home-template-details.js +212 -0
  339. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -0
  340. package/build/components/sidebar-navigation-screen-template/index.js +43 -23
  341. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  342. package/build/components/sidebar-navigation-screen-templates/index.js +23 -28
  343. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  344. package/build/components/site-hub/index.js +29 -24
  345. package/build/components/site-hub/index.js.map +1 -1
  346. package/build/components/site-icon/index.js +4 -5
  347. package/build/components/site-icon/index.js.map +1 -1
  348. package/build/components/start-template-options/index.js +15 -21
  349. package/build/components/start-template-options/index.js.map +1 -1
  350. package/build/components/style-book/index.js +45 -50
  351. package/build/components/style-book/index.js.map +1 -1
  352. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +16 -6
  353. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  354. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +4 -4
  355. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  356. package/build/components/sync-state-with-url/use-sync-path-with-url.js +21 -12
  357. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  358. package/build/components/table/index.js +29 -0
  359. package/build/components/table/index.js.map +1 -0
  360. package/build/components/{list/actions → template-actions}/index.js +34 -31
  361. package/build/components/template-actions/index.js.map +1 -0
  362. package/build/components/{list/actions → template-actions}/rename-menu-item.js +4 -5
  363. package/build/components/template-actions/rename-menu-item.js.map +1 -0
  364. package/build/components/template-part-converter/convert-to-regular.js +4 -5
  365. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  366. package/build/components/template-part-converter/convert-to-template-part.js +7 -27
  367. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  368. package/build/components/template-part-converter/index.js +12 -18
  369. package/build/components/template-part-converter/index.js.map +1 -1
  370. package/build/components/welcome-guide/editor.js +1 -1
  371. package/build/components/welcome-guide/editor.js.map +1 -1
  372. package/build/components/welcome-guide/image.js +4 -5
  373. package/build/components/welcome-guide/image.js.map +1 -1
  374. package/build/components/welcome-guide/styles.js +4 -3
  375. package/build/components/welcome-guide/styles.js.map +1 -1
  376. package/build/hooks/commands/use-common-commands.js +190 -0
  377. package/build/hooks/commands/use-common-commands.js.map +1 -0
  378. package/build/hooks/commands/use-edit-mode-commands.js +71 -29
  379. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  380. package/build/hooks/index.js +2 -0
  381. package/build/hooks/index.js.map +1 -1
  382. package/build/hooks/navigation-menu-edit.js +95 -0
  383. package/build/hooks/navigation-menu-edit.js.map +1 -0
  384. package/build/hooks/push-changes-to-global-styles/index.js +15 -10
  385. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  386. package/build/hooks/template-part-edit.js +11 -15
  387. package/build/hooks/template-part-edit.js.map +1 -1
  388. package/build/index.js +3 -6
  389. package/build/index.js.map +1 -1
  390. package/build/{private-apis.js → lock-unlock.js} +1 -1
  391. package/build/lock-unlock.js.map +1 -0
  392. package/build/store/actions.js +165 -125
  393. package/build/store/actions.js.map +1 -1
  394. package/build/store/index.js +3 -3
  395. package/build/store/index.js.map +1 -1
  396. package/build/store/private-actions.js +7 -10
  397. package/build/store/private-actions.js.map +1 -1
  398. package/build/store/reducer.js +33 -33
  399. package/build/store/reducer.js.map +1 -1
  400. package/build/store/selectors.js +70 -22
  401. package/build/store/selectors.js.map +1 -1
  402. package/build/store/utils.js +1 -3
  403. package/build/store/utils.js.map +1 -1
  404. package/build/utils/get-is-list-page.js +13 -7
  405. package/build/utils/get-is-list-page.js.map +1 -1
  406. package/build/utils/is-previewing-theme.js +2 -4
  407. package/build/utils/is-previewing-theme.js.map +1 -1
  408. package/build/utils/is-template-revertable.js +1 -1
  409. package/build/utils/is-template-revertable.js.map +1 -1
  410. package/build/utils/use-activate-theme.js +3 -3
  411. package/build/utils/use-activate-theme.js.map +1 -1
  412. package/build/utils/use-debounced-input.js +26 -0
  413. package/build/utils/use-debounced-input.js.map +1 -0
  414. package/build-module/components/add-new-page/index.js +93 -0
  415. package/build-module/components/add-new-page/index.js.map +1 -0
  416. package/build-module/components/add-new-pattern/index.js +82 -0
  417. package/build-module/components/add-new-pattern/index.js.map +1 -0
  418. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +4 -5
  419. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  420. package/build-module/components/add-new-template/add-custom-template-modal-content.js +25 -41
  421. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  422. package/build-module/components/add-new-template/index.js +6 -13
  423. package/build-module/components/add-new-template/index.js.map +1 -1
  424. package/build-module/components/add-new-template/new-template.js +22 -31
  425. package/build-module/components/add-new-template/new-template.js.map +1 -1
  426. package/build-module/components/add-new-template/utils.js +71 -120
  427. package/build-module/components/add-new-template/utils.js.map +1 -1
  428. package/build-module/components/app/index.js +1 -1
  429. package/build-module/components/app/index.js.map +1 -1
  430. package/build-module/components/block-editor/back-button.js +5 -5
  431. package/build-module/components/block-editor/back-button.js.map +1 -1
  432. package/build-module/components/block-editor/block-inspector-button.js +3 -4
  433. package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
  434. package/build-module/components/block-editor/constants.js +2 -0
  435. package/build-module/components/block-editor/constants.js.map +1 -0
  436. package/build-module/components/block-editor/editor-canvas.js +12 -12
  437. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  438. package/build-module/components/block-editor/get-block-editor-provider.js +31 -0
  439. package/build-module/components/block-editor/get-block-editor-provider.js.map +1 -0
  440. package/build-module/components/block-editor/index.js +9 -125
  441. package/build-module/components/block-editor/index.js.map +1 -1
  442. package/build-module/components/block-editor/inserter-media-categories.js +25 -42
  443. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
  444. package/build-module/components/block-editor/providers/default-block-editor-provider.js +42 -0
  445. package/build-module/components/block-editor/providers/default-block-editor-provider.js.map +1 -0
  446. package/build-module/components/block-editor/providers/navigation-block-editor-provider.js +102 -0
  447. package/build-module/components/block-editor/providers/navigation-block-editor-provider.js.map +1 -0
  448. package/build-module/components/block-editor/resizable-editor.js +6 -7
  449. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  450. package/build-module/components/block-editor/resize-handle.js +5 -7
  451. package/build-module/components/block-editor/resize-handle.js.map +1 -1
  452. package/build-module/components/block-editor/site-editor-canvas.js +115 -0
  453. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -0
  454. package/build-module/components/block-editor/use-site-editor-settings.js +67 -0
  455. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -0
  456. package/build-module/components/canvas-spinner/index.js +15 -1
  457. package/build-module/components/canvas-spinner/index.js.map +1 -1
  458. package/build-module/components/code-editor/code-editor-text-area.js +5 -6
  459. package/build-module/components/code-editor/code-editor-text-area.js.map +1 -1
  460. package/build-module/components/create-pattern-modal/index.js +113 -0
  461. package/build-module/components/create-pattern-modal/index.js.map +1 -0
  462. package/build-module/components/create-template-part-modal/index.js +70 -34
  463. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  464. package/build-module/components/editor/index.js +43 -24
  465. package/build-module/components/editor/index.js.map +1 -1
  466. package/build-module/components/editor-canvas-container/index.js +26 -10
  467. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  468. package/build-module/components/error-boundary/warning.js +8 -10
  469. package/build-module/components/error-boundary/warning.js.map +1 -1
  470. package/build-module/components/global-styles/block-preview-panel.js +7 -10
  471. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  472. package/build-module/components/global-styles/color-indicator-wrapper.js +7 -8
  473. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  474. package/build-module/components/global-styles/color-palette-panel.js +4 -5
  475. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  476. package/build-module/components/global-styles/dimensions-panel.js +2 -4
  477. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  478. package/build-module/components/global-styles/global-styles-provider.js +18 -25
  479. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  480. package/build-module/components/global-styles/gradients-palette-panel.js +4 -5
  481. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  482. package/build-module/components/global-styles/header.js +4 -5
  483. package/build-module/components/global-styles/header.js.map +1 -1
  484. package/build-module/components/global-styles/hooks.js +1 -1
  485. package/build-module/components/global-styles/hooks.js.map +1 -1
  486. package/build-module/components/global-styles/icon-with-current-color.js +7 -8
  487. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  488. package/build-module/components/global-styles/navigation-button.js +15 -14
  489. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  490. package/build-module/components/global-styles/palette.js +11 -15
  491. package/build-module/components/global-styles/palette.js.map +1 -1
  492. package/build-module/components/global-styles/preview.js +42 -52
  493. package/build-module/components/global-styles/preview.js.map +1 -1
  494. package/build-module/components/global-styles/root-menu.js +1 -1
  495. package/build-module/components/global-styles/root-menu.js.map +1 -1
  496. package/build-module/components/global-styles/screen-block-list.js +5 -8
  497. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  498. package/build-module/components/global-styles/screen-block.js +10 -11
  499. package/build-module/components/global-styles/screen-block.js.map +1 -1
  500. package/build-module/components/global-styles/screen-color-palette.js +3 -4
  501. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  502. package/build-module/components/global-styles/screen-colors.js +1 -1
  503. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  504. package/build-module/components/global-styles/screen-css.js +1 -1
  505. package/build-module/components/global-styles/screen-css.js.map +1 -1
  506. package/build-module/components/global-styles/screen-layout.js +1 -1
  507. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  508. package/build-module/components/global-styles/screen-revisions/index.js +9 -9
  509. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  510. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +14 -19
  511. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  512. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +6 -11
  513. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  514. package/build-module/components/global-styles/screen-root.js +4 -4
  515. package/build-module/components/global-styles/screen-root.js.map +1 -1
  516. package/build-module/components/global-styles/screen-typography-element.js +3 -4
  517. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  518. package/build-module/components/global-styles/screen-typography.js +6 -7
  519. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  520. package/build-module/components/global-styles/style-variations-container.js +15 -8
  521. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  522. package/build-module/components/global-styles/subtitle.js +4 -5
  523. package/build-module/components/global-styles/subtitle.js.map +1 -1
  524. package/build-module/components/global-styles/typography-panel.js +5 -6
  525. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  526. package/build-module/components/global-styles/typography-preview.js +6 -7
  527. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  528. package/build-module/components/global-styles/ui.js +123 -50
  529. package/build-module/components/global-styles/ui.js.map +1 -1
  530. package/build-module/components/global-styles/variations-panel.js +5 -6
  531. package/build-module/components/global-styles/variations-panel.js.map +1 -1
  532. package/build-module/components/global-styles-renderer/index.js +1 -1
  533. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  534. package/build-module/components/header-edit-mode/document-actions/index.js +136 -25
  535. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  536. package/build-module/components/header-edit-mode/index.js +6 -12
  537. package/build-module/components/header-edit-mode/index.js.map +1 -1
  538. package/build-module/components/header-edit-mode/more-menu/index.js +49 -53
  539. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  540. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +4 -4
  541. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
  542. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +5 -13
  543. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  544. package/build-module/components/header-edit-mode/undo-redo/redo.js +2 -3
  545. package/build-module/components/header-edit-mode/undo-redo/redo.js.map +1 -1
  546. package/build-module/components/header-edit-mode/undo-redo/undo.js +2 -3
  547. package/build-module/components/header-edit-mode/undo-redo/undo.js.map +1 -1
  548. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  549. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  550. package/build-module/components/keyboard-shortcut-help-modal/index.js +40 -49
  551. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  552. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  553. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  554. package/build-module/components/keyboard-shortcuts/edit-mode.js +7 -2
  555. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  556. package/build-module/components/keyboard-shortcuts/index.js +7 -2
  557. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  558. package/build-module/components/keyboard-shortcuts/register.js +1 -1
  559. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  560. package/build-module/components/layout/hooks.js +21 -0
  561. package/build-module/components/layout/hooks.js.map +1 -1
  562. package/build-module/components/layout/index.js +37 -28
  563. package/build-module/components/layout/index.js.map +1 -1
  564. package/build-module/components/list/added-by.js +13 -23
  565. package/build-module/components/list/added-by.js.map +1 -1
  566. package/build-module/components/list/header.js +4 -7
  567. package/build-module/components/list/header.js.map +1 -1
  568. package/build-module/components/list/index.js +3 -5
  569. package/build-module/components/list/index.js.map +1 -1
  570. package/build-module/components/list/table.js +34 -39
  571. package/build-module/components/list/table.js.map +1 -1
  572. package/build-module/components/page/header.js +33 -0
  573. package/build-module/components/page/header.js.map +1 -0
  574. package/build-module/components/page/index.js +37 -0
  575. package/build-module/components/page/index.js.map +1 -0
  576. package/build-module/components/page-actions/delete-page-menu-item.js +58 -0
  577. package/build-module/components/page-actions/delete-page-menu-item.js.map +1 -0
  578. package/build-module/components/page-actions/index.js +30 -0
  579. package/build-module/components/page-actions/index.js.map +1 -0
  580. package/build-module/components/page-content-focus-manager/back-to-page-notification.js +53 -0
  581. package/build-module/components/page-content-focus-manager/back-to-page-notification.js.map +1 -0
  582. package/build-module/components/page-content-focus-manager/constants.js +2 -0
  583. package/build-module/components/page-content-focus-manager/constants.js.map +1 -0
  584. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +45 -0
  585. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -0
  586. package/build-module/components/page-content-focus-manager/edit-template-notification.js +110 -0
  587. package/build-module/components/page-content-focus-manager/edit-template-notification.js.map +1 -0
  588. package/build-module/components/page-content-focus-manager/index.js +23 -0
  589. package/build-module/components/page-content-focus-manager/index.js.map +1 -0
  590. package/build-module/components/page-library/grid-item.js +145 -0
  591. package/build-module/components/page-library/grid-item.js.map +1 -0
  592. package/build-module/components/page-library/grid.js +38 -0
  593. package/build-module/components/page-library/grid.js.map +1 -0
  594. package/build-module/components/page-library/index.js +43 -0
  595. package/build-module/components/page-library/index.js.map +1 -0
  596. package/build-module/components/page-library/no-patterns.js +12 -0
  597. package/build-module/components/page-library/no-patterns.js.map +1 -0
  598. package/build-module/components/page-library/patterns-list.js +87 -0
  599. package/build-module/components/page-library/patterns-list.js.map +1 -0
  600. package/build-module/components/page-library/search-items.js +156 -0
  601. package/build-module/components/page-library/search-items.js.map +1 -0
  602. package/build-module/components/page-library/use-library-settings.js +40 -0
  603. package/build-module/components/page-library/use-library-settings.js.map +1 -0
  604. package/build-module/components/page-library/use-patterns.js +176 -0
  605. package/build-module/components/page-library/use-patterns.js.map +1 -0
  606. package/build-module/components/page-library/utils.js +13 -0
  607. package/build-module/components/page-library/utils.js.map +1 -0
  608. package/build-module/components/page-main/index.js +32 -0
  609. package/build-module/components/page-main/index.js.map +1 -0
  610. package/build-module/components/page-templates/index.js +80 -0
  611. package/build-module/components/page-templates/index.js.map +1 -0
  612. package/build-module/components/preferences-modal/enable-feature.js +4 -4
  613. package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
  614. package/build-module/components/preferences-modal/index.js +4 -5
  615. package/build-module/components/preferences-modal/index.js.map +1 -1
  616. package/build-module/components/resizable-frame/index.js +24 -14
  617. package/build-module/components/resizable-frame/index.js.map +1 -1
  618. package/build-module/components/revisions/index.js +12 -14
  619. package/build-module/components/revisions/index.js.map +1 -1
  620. package/build-module/components/routes/link.js +14 -18
  621. package/build-module/components/routes/link.js.map +1 -1
  622. package/build-module/components/routes/use-title.js +2 -6
  623. package/build-module/components/routes/use-title.js.map +1 -1
  624. package/build-module/components/save-button/index.js +23 -13
  625. package/build-module/components/save-button/index.js.map +1 -1
  626. package/build-module/components/save-hub/index.js +95 -8
  627. package/build-module/components/save-hub/index.js.map +1 -1
  628. package/build-module/components/save-panel/index.js +62 -20
  629. package/build-module/components/save-panel/index.js.map +1 -1
  630. package/build-module/components/secondary-sidebar/inserter-sidebar.js +4 -5
  631. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  632. package/build-module/components/secondary-sidebar/list-view-sidebar.js +48 -8
  633. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  634. package/build-module/components/sidebar/index.js +11 -7
  635. package/build-module/components/sidebar/index.js.map +1 -1
  636. package/build-module/components/sidebar-button/index.js +2 -3
  637. package/build-module/components/sidebar-button/index.js.map +1 -1
  638. package/build-module/components/sidebar-edit-mode/default-sidebar.js +11 -12
  639. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  640. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +19 -6
  641. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  642. package/build-module/components/sidebar-edit-mode/index.js +14 -11
  643. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  644. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +71 -0
  645. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -0
  646. package/build-module/components/sidebar-edit-mode/page-panels/index.js +78 -0
  647. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -0
  648. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +23 -0
  649. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -0
  650. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +176 -0
  651. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -0
  652. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +33 -0
  653. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -0
  654. package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js +85 -0
  655. package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -0
  656. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +8 -9
  657. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  658. package/build-module/components/sidebar-edit-mode/settings-header/index.js +50 -23
  659. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  660. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +35 -0
  661. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -0
  662. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +4 -5
  663. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  664. package/build-module/components/sidebar-edit-mode/template-panel/index.js +72 -0
  665. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -0
  666. package/build-module/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +7 -8
  667. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -0
  668. package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +12 -16
  669. package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -0
  670. package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +15 -19
  671. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -0
  672. package/build-module/components/sidebar-navigation-item/index.js +17 -14
  673. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  674. package/build-module/components/sidebar-navigation-screen/index.js +39 -21
  675. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  676. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +27 -0
  677. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -0
  678. package/build-module/components/sidebar-navigation-screen-details-panel/index.js +30 -0
  679. package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -0
  680. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +14 -0
  681. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -0
  682. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +24 -0
  683. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -0
  684. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +14 -0
  685. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -0
  686. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +112 -21
  687. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  688. package/build-module/components/sidebar-navigation-screen-library/category-item.js +37 -0
  689. package/build-module/components/sidebar-navigation-screen-library/category-item.js.map +1 -0
  690. package/build-module/components/sidebar-navigation-screen-library/index.js +87 -0
  691. package/build-module/components/sidebar-navigation-screen-library/index.js.map +1 -0
  692. package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +25 -0
  693. package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +1 -0
  694. package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js +61 -0
  695. package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +1 -0
  696. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js +34 -0
  697. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +1 -0
  698. package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js +27 -0
  699. package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +1 -0
  700. package/build-module/components/sidebar-navigation-screen-main/index.js +13 -13
  701. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  702. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +4 -6
  703. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  704. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +33 -0
  705. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -0
  706. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +26 -0
  707. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -0
  708. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +47 -95
  709. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  710. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +70 -0
  711. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -0
  712. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +58 -0
  713. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -0
  714. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +46 -0
  715. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -0
  716. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +35 -0
  717. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -0
  718. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +151 -0
  719. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -0
  720. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  721. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  722. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +58 -26
  723. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  724. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +73 -28
  725. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  726. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +24 -53
  727. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  728. package/build-module/components/sidebar-navigation-screen-page/index.js +59 -14
  729. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  730. package/build-module/components/sidebar-navigation-screen-page/page-details.js +131 -0
  731. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -0
  732. package/build-module/components/sidebar-navigation-screen-page/status-label.js +98 -0
  733. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -0
  734. package/build-module/components/sidebar-navigation-screen-pages/index.js +130 -22
  735. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  736. package/build-module/components/sidebar-navigation-screen-pattern/index.js +46 -0
  737. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -0
  738. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +28 -0
  739. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -0
  740. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +22 -0
  741. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -0
  742. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +27 -0
  743. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -0
  744. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +34 -0
  745. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -0
  746. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +71 -0
  747. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -0
  748. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +64 -0
  749. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -0
  750. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +192 -0
  751. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -0
  752. package/build-module/components/sidebar-navigation-screen-template/index.js +40 -23
  753. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  754. package/build-module/components/sidebar-navigation-screen-templates/index.js +23 -27
  755. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  756. package/build-module/components/site-hub/index.js +28 -22
  757. package/build-module/components/site-hub/index.js.map +1 -1
  758. package/build-module/components/site-icon/index.js +4 -5
  759. package/build-module/components/site-icon/index.js.map +1 -1
  760. package/build-module/components/start-template-options/index.js +15 -21
  761. package/build-module/components/start-template-options/index.js.map +1 -1
  762. package/build-module/components/style-book/index.js +44 -48
  763. package/build-module/components/style-book/index.js.map +1 -1
  764. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +15 -5
  765. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  766. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
  767. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  768. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +20 -11
  769. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  770. package/build-module/components/table/index.js +21 -0
  771. package/build-module/components/table/index.js.map +1 -0
  772. package/build-module/components/{list/actions → template-actions}/index.js +34 -31
  773. package/build-module/components/template-actions/index.js.map +1 -0
  774. package/build-module/components/{list/actions → template-actions}/rename-menu-item.js +4 -5
  775. package/build-module/components/template-actions/rename-menu-item.js.map +1 -0
  776. package/build-module/components/template-part-converter/convert-to-regular.js +4 -5
  777. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  778. package/build-module/components/template-part-converter/convert-to-template-part.js +8 -26
  779. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  780. package/build-module/components/template-part-converter/index.js +12 -18
  781. package/build-module/components/template-part-converter/index.js.map +1 -1
  782. package/build-module/components/welcome-guide/editor.js +1 -1
  783. package/build-module/components/welcome-guide/editor.js.map +1 -1
  784. package/build-module/components/welcome-guide/image.js +4 -5
  785. package/build-module/components/welcome-guide/image.js.map +1 -1
  786. package/build-module/components/welcome-guide/styles.js +5 -3
  787. package/build-module/components/welcome-guide/styles.js.map +1 -1
  788. package/build-module/hooks/commands/use-common-commands.js +172 -0
  789. package/build-module/hooks/commands/use-common-commands.js.map +1 -0
  790. package/build-module/hooks/commands/use-edit-mode-commands.js +72 -30
  791. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  792. package/build-module/hooks/index.js +1 -0
  793. package/build-module/hooks/index.js.map +1 -1
  794. package/build-module/hooks/navigation-menu-edit.js +77 -0
  795. package/build-module/hooks/navigation-menu-edit.js.map +1 -0
  796. package/build-module/hooks/push-changes-to-global-styles/index.js +14 -9
  797. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  798. package/build-module/hooks/template-part-edit.js +10 -11
  799. package/build-module/hooks/template-part-edit.js.map +1 -1
  800. package/build-module/index.js +3 -6
  801. package/build-module/index.js.map +1 -1
  802. package/build-module/{private-apis.js → lock-unlock.js} +1 -1
  803. package/build-module/lock-unlock.js.map +1 -0
  804. package/build-module/store/actions.js +157 -126
  805. package/build-module/store/actions.js.map +1 -1
  806. package/build-module/store/index.js +1 -1
  807. package/build-module/store/index.js.map +1 -1
  808. package/build-module/store/private-actions.js +7 -10
  809. package/build-module/store/private-actions.js.map +1 -1
  810. package/build-module/store/reducer.js +31 -33
  811. package/build-module/store/reducer.js.map +1 -1
  812. package/build-module/store/selectors.js +62 -21
  813. package/build-module/store/selectors.js.map +1 -1
  814. package/build-module/store/utils.js +1 -3
  815. package/build-module/store/utils.js.map +1 -1
  816. package/build-module/utils/get-is-list-page.js +13 -7
  817. package/build-module/utils/get-is-list-page.js.map +1 -1
  818. package/build-module/utils/is-previewing-theme.js +2 -4
  819. package/build-module/utils/is-previewing-theme.js.map +1 -1
  820. package/build-module/utils/is-template-revertable.js +1 -1
  821. package/build-module/utils/is-template-revertable.js.map +1 -1
  822. package/build-module/utils/use-activate-theme.js +2 -2
  823. package/build-module/utils/use-activate-theme.js.map +1 -1
  824. package/build-module/utils/use-debounced-input.js +17 -0
  825. package/build-module/utils/use-debounced-input.js.map +1 -0
  826. package/build-style/style-rtl.css +587 -71
  827. package/build-style/style.css +587 -71
  828. package/package.json +44 -37
  829. package/src/components/add-new-page/index.js +105 -0
  830. package/src/components/add-new-pattern/index.js +94 -0
  831. package/src/components/add-new-template/add-custom-template-modal-content.js +1 -13
  832. package/src/components/add-new-template/index.js +0 -3
  833. package/src/components/add-new-template/new-template.js +3 -3
  834. package/src/components/app/index.js +1 -1
  835. package/src/components/block-editor/back-button.js +5 -2
  836. package/src/components/block-editor/constants.js +1 -0
  837. package/src/components/block-editor/editor-canvas.js +1 -1
  838. package/src/components/block-editor/get-block-editor-provider.js +29 -0
  839. package/src/components/block-editor/index.js +15 -188
  840. package/src/components/block-editor/providers/default-block-editor-provider.js +44 -0
  841. package/src/components/block-editor/providers/navigation-block-editor-provider.js +114 -0
  842. package/src/components/block-editor/site-editor-canvas.js +155 -0
  843. package/src/components/block-editor/style.scss +6 -0
  844. package/src/components/block-editor/use-site-editor-settings.js +91 -0
  845. package/src/components/canvas-spinner/index.js +11 -1
  846. package/src/components/create-pattern-modal/index.js +134 -0
  847. package/src/components/create-pattern-modal/style.scss +3 -0
  848. package/src/components/create-template-part-modal/index.js +63 -3
  849. package/src/components/editor/index.js +32 -17
  850. package/src/components/editor/style.scss +6 -11
  851. package/src/components/editor-canvas-container/index.js +21 -4
  852. package/src/components/global-styles/color-palette-panel.js +1 -1
  853. package/src/components/global-styles/dimensions-panel.js +1 -1
  854. package/src/components/global-styles/global-styles-provider.js +10 -14
  855. package/src/components/global-styles/gradients-palette-panel.js +1 -1
  856. package/src/components/global-styles/hooks.js +1 -1
  857. package/src/components/global-styles/palette.js +2 -2
  858. package/src/components/global-styles/preview.js +1 -1
  859. package/src/components/global-styles/root-menu.js +1 -1
  860. package/src/components/global-styles/screen-block-list.js +1 -1
  861. package/src/components/global-styles/screen-block.js +1 -1
  862. package/src/components/global-styles/screen-colors.js +1 -1
  863. package/src/components/global-styles/screen-css.js +1 -1
  864. package/src/components/global-styles/screen-layout.js +1 -1
  865. package/src/components/global-styles/screen-revisions/index.js +1 -1
  866. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +8 -6
  867. package/src/components/global-styles/screen-root.js +1 -1
  868. package/src/components/global-styles/screen-typography.js +1 -1
  869. package/src/components/global-styles/stories/index.js +1 -1
  870. package/src/components/global-styles/style-variations-container.js +13 -3
  871. package/src/components/global-styles/style.scss +11 -0
  872. package/src/components/global-styles/typography-panel.js +1 -1
  873. package/src/components/global-styles/typography-preview.js +1 -1
  874. package/src/components/global-styles/ui.js +132 -45
  875. package/src/components/global-styles-renderer/index.js +1 -1
  876. package/src/components/header-edit-mode/document-actions/index.js +155 -36
  877. package/src/components/header-edit-mode/document-actions/style.scss +72 -13
  878. package/src/components/header-edit-mode/index.js +4 -4
  879. package/src/components/header-edit-mode/tools-more-menu-group/index.js +1 -6
  880. package/src/components/keyboard-shortcuts/edit-mode.js +5 -1
  881. package/src/components/keyboard-shortcuts/index.js +5 -1
  882. package/src/components/keyboard-shortcuts/register.js +1 -1
  883. package/src/components/layout/hooks.js +21 -0
  884. package/src/components/layout/index.js +92 -70
  885. package/src/components/layout/style.scss +7 -0
  886. package/src/components/list/index.js +1 -1
  887. package/src/components/list/table.js +6 -2
  888. package/src/components/page/header.js +38 -0
  889. package/src/components/page/index.js +38 -0
  890. package/src/components/page/style.scss +38 -0
  891. package/src/components/page-actions/delete-page-menu-item.js +71 -0
  892. package/src/components/page-actions/index.js +36 -0
  893. package/src/components/page-content-focus-manager/back-to-page-notification.js +65 -0
  894. package/src/components/page-content-focus-manager/constants.js +5 -0
  895. package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +52 -0
  896. package/src/components/page-content-focus-manager/edit-template-notification.js +108 -0
  897. package/src/components/page-content-focus-manager/index.js +26 -0
  898. package/src/components/page-library/grid-item.js +179 -0
  899. package/src/components/page-library/grid.js +39 -0
  900. package/src/components/page-library/index.js +39 -0
  901. package/src/components/page-library/no-patterns.js +12 -0
  902. package/src/components/page-library/patterns-list.js +114 -0
  903. package/src/components/page-library/search-items.js +171 -0
  904. package/src/components/page-library/style.scss +105 -0
  905. package/src/components/page-library/use-library-settings.js +51 -0
  906. package/src/components/page-library/use-patterns.js +238 -0
  907. package/src/components/page-library/utils.js +21 -0
  908. package/src/components/page-main/index.js +27 -0
  909. package/src/components/page-templates/index.js +104 -0
  910. package/src/components/resizable-frame/index.js +18 -6
  911. package/src/components/resizable-frame/style.scss +20 -18
  912. package/src/components/revisions/index.js +7 -8
  913. package/src/components/routes/link.js +2 -2
  914. package/src/components/routes/use-title.js +1 -1
  915. package/src/components/save-button/index.js +16 -7
  916. package/src/components/save-hub/index.js +143 -38
  917. package/src/components/save-hub/style.scss +6 -0
  918. package/src/components/save-panel/index.js +63 -16
  919. package/src/components/secondary-sidebar/list-view-sidebar.js +56 -2
  920. package/src/components/sidebar/index.js +13 -7
  921. package/src/components/sidebar/style.scss +3 -4
  922. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +42 -29
  923. package/src/components/sidebar-edit-mode/index.js +16 -14
  924. package/src/components/sidebar-edit-mode/page-panels/edit-template.js +69 -0
  925. package/src/components/sidebar-edit-mode/page-panels/index.js +89 -0
  926. package/src/components/sidebar-edit-mode/page-panels/page-content.js +27 -0
  927. package/src/components/sidebar-edit-mode/page-panels/page-status.js +233 -0
  928. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +35 -0
  929. package/src/components/sidebar-edit-mode/page-panels/publish-date.js +94 -0
  930. package/src/components/sidebar-edit-mode/page-panels/style.scss +41 -0
  931. package/src/components/sidebar-edit-mode/settings-header/index.js +61 -29
  932. package/src/components/sidebar-edit-mode/sidebar-card/index.js +34 -0
  933. package/src/components/sidebar-edit-mode/sidebar-card/style.scss +34 -0
  934. package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -1
  935. package/src/components/sidebar-edit-mode/template-panel/index.js +65 -0
  936. package/src/components/sidebar-edit-mode/{template-card → template-panel}/style.scss +2 -32
  937. package/src/components/sidebar-navigation-item/index.js +6 -2
  938. package/src/components/sidebar-navigation-item/style.scss +7 -0
  939. package/src/components/sidebar-navigation-screen/index.js +89 -53
  940. package/src/components/sidebar-navigation-screen/style.scss +66 -5
  941. package/src/components/sidebar-navigation-screen-details-footer/index.js +45 -0
  942. package/src/components/sidebar-navigation-screen-details-footer/style.scss +5 -0
  943. package/src/components/sidebar-navigation-screen-details-panel/index.js +40 -0
  944. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +14 -0
  945. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +29 -0
  946. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +14 -0
  947. package/src/components/sidebar-navigation-screen-details-panel/style.scss +25 -0
  948. package/src/components/sidebar-navigation-screen-global-styles/index.js +126 -14
  949. package/src/components/sidebar-navigation-screen-global-styles/style.scss +12 -0
  950. package/src/components/sidebar-navigation-screen-library/category-item.js +43 -0
  951. package/src/components/sidebar-navigation-screen-library/index.js +136 -0
  952. package/src/components/sidebar-navigation-screen-library/style.scss +7 -0
  953. package/src/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +32 -0
  954. package/src/components/sidebar-navigation-screen-library/use-pattern-categories.js +64 -0
  955. package/src/components/sidebar-navigation-screen-library/use-template-part-areas.js +33 -0
  956. package/src/components/sidebar-navigation-screen-library/use-theme-patterns.js +44 -0
  957. package/src/components/sidebar-navigation-screen-main/index.js +11 -14
  958. package/src/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
  959. package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +45 -0
  960. package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +24 -0
  961. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +50 -96
  962. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +89 -0
  963. package/src/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +51 -0
  964. package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +51 -0
  965. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +39 -0
  966. package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +15 -0
  967. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +175 -0
  968. package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  969. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +43 -7
  970. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +61 -2
  971. package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +25 -47
  972. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +5 -1
  973. package/src/components/sidebar-navigation-screen-page/index.js +98 -24
  974. package/src/components/sidebar-navigation-screen-page/page-details.js +166 -0
  975. package/src/components/sidebar-navigation-screen-page/status-label.js +105 -0
  976. package/src/components/sidebar-navigation-screen-page/style.scss +63 -0
  977. package/src/components/sidebar-navigation-screen-pages/index.js +181 -44
  978. package/src/components/sidebar-navigation-screen-pattern/index.js +44 -0
  979. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +28 -0
  980. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +21 -0
  981. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +30 -0
  982. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +33 -0
  983. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +71 -0
  984. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +86 -0
  985. package/src/components/sidebar-navigation-screen-template/home-template-details.js +230 -0
  986. package/src/components/sidebar-navigation-screen-template/index.js +44 -27
  987. package/src/components/sidebar-navigation-screen-template/style.scss +23 -0
  988. package/src/components/sidebar-navigation-screen-templates/index.js +19 -26
  989. package/src/components/site-hub/index.js +26 -7
  990. package/src/components/site-hub/style.scss +26 -0
  991. package/src/components/style-book/index.js +1 -1
  992. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +16 -3
  993. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
  994. package/src/components/sync-state-with-url/use-sync-path-with-url.js +11 -1
  995. package/src/components/table/index.js +33 -0
  996. package/src/components/table/style.scss +37 -0
  997. package/src/components/{list/actions → template-actions}/index.js +19 -6
  998. package/src/components/template-part-converter/convert-to-template-part.js +4 -27
  999. package/src/components/welcome-guide/editor.js +1 -1
  1000. package/src/components/welcome-guide/styles.js +5 -3
  1001. package/src/hooks/commands/use-common-commands.js +167 -0
  1002. package/src/hooks/commands/use-edit-mode-commands.js +61 -25
  1003. package/src/hooks/index.js +1 -0
  1004. package/src/hooks/navigation-menu-edit.js +95 -0
  1005. package/src/hooks/push-changes-to-global-styles/index.js +14 -8
  1006. package/src/hooks/template-part-edit.js +1 -1
  1007. package/src/store/actions.js +52 -1
  1008. package/src/store/index.js +1 -1
  1009. package/src/store/reducer.js +21 -0
  1010. package/src/store/selectors.js +54 -5
  1011. package/src/store/test/actions.js +31 -0
  1012. package/src/store/test/reducer.js +44 -0
  1013. package/src/store/test/selectors.js +57 -0
  1014. package/src/style.scss +17 -4
  1015. package/src/utils/get-is-list-page.js +16 -4
  1016. package/src/utils/is-previewing-theme.js +2 -3
  1017. package/src/utils/use-activate-theme.js +3 -2
  1018. package/src/utils/use-debounced-input.js +17 -0
  1019. package/build/components/add-new-template/new-template-part.js +0 -116
  1020. package/build/components/add-new-template/new-template-part.js.map +0 -1
  1021. package/build/components/list/actions/index.js.map +0 -1
  1022. package/build/components/list/actions/rename-menu-item.js.map +0 -1
  1023. package/build/components/sidebar-edit-mode/template-card/index.js.map +0 -1
  1024. package/build/components/sidebar-edit-mode/template-card/template-actions.js.map +0 -1
  1025. package/build/components/sidebar-edit-mode/template-card/template-areas.js.map +0 -1
  1026. package/build/components/sidebar-edit-mode/template-revisions/index.js.map +0 -1
  1027. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -53
  1028. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +0 -1
  1029. package/build/components/sidebar-navigation-subtitle/index.js +0 -18
  1030. package/build/components/sidebar-navigation-subtitle/index.js.map +0 -1
  1031. package/build/private-apis.js.map +0 -1
  1032. package/build-module/components/add-new-template/new-template-part.js +0 -96
  1033. package/build-module/components/add-new-template/new-template-part.js.map +0 -1
  1034. package/build-module/components/list/actions/index.js.map +0 -1
  1035. package/build-module/components/list/actions/rename-menu-item.js.map +0 -1
  1036. package/build-module/components/sidebar-edit-mode/template-card/index.js +0 -68
  1037. package/build-module/components/sidebar-edit-mode/template-card/index.js.map +0 -1
  1038. package/build-module/components/sidebar-edit-mode/template-card/template-actions.js.map +0 -1
  1039. package/build-module/components/sidebar-edit-mode/template-card/template-areas.js.map +0 -1
  1040. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -40
  1041. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +0 -1
  1042. package/build-module/components/sidebar-navigation-subtitle/index.js +0 -10
  1043. package/build-module/components/sidebar-navigation-subtitle/index.js.map +0 -1
  1044. package/build-module/private-apis.js.map +0 -1
  1045. package/src/components/add-new-template/new-template-part.js +0 -109
  1046. package/src/components/sidebar-edit-mode/template-card/index.js +0 -59
  1047. package/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -47
  1048. package/src/components/sidebar-navigation-screen-pages/style.scss +0 -4
  1049. package/src/components/sidebar-navigation-screen-templates/style.scss +0 -4
  1050. package/src/components/sidebar-navigation-subtitle/index.js +0 -5
  1051. package/src/components/sidebar-navigation-subtitle/style.scss +0 -7
  1052. /package/src/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +0 -0
  1053. /package/src/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +0 -0
  1054. /package/src/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +0 -0
  1055. /package/src/components/{list/actions → template-actions}/rename-menu-item.js +0 -0
  1056. /package/src/{private-apis.js → lock-unlock.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/style-variations-container.js"],"names":["classnames","store","coreStore","useSelect","useMemo","useContext","useState","ENTER","__experimentalGrid","Grid","__","privateApis","blockEditorPrivateApis","mergeBaseAndUserConfigs","StylesPreview","unlock","GlobalStylesContext","areGlobalStyleConfigsEqual","Variation","variation","isFocused","setIsFocused","base","user","setUserConfig","context","settings","styles","merged","selectVariation","selectOnEnter","event","keyCode","preventDefault","isActive","title","StyleVariationsContainer","variations","select","__experimentalGetCurrentThemeGlobalStylesVariations","withEmptyVariation","map","index"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,OAAT,EAAkBC,UAAlB,EAA8BC,QAA9B,QAA8C,oBAA9C;AACA,SAASC,KAAT,QAAsB,qBAAtB;AACA,SAASC,kBAAkB,IAAIC,IAA/B,QAA2C,uBAA3C;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASC,uBAAT,QAAwC,0BAAxC;AACA,OAAOC,aAAP,MAA0B,WAA1B;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AAAEC,EAAAA,mBAAF;AAAuBC,EAAAA;AAAvB,IAAsDF,MAAM,CACjEH,sBADiE,CAAlE;;AAIA,SAASM,SAAT,OAAoC;AAAA,MAAhB;AAAEC,I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,mEAAsB;AAHmB,OAAnB;AAAA,KAA1B,CANG,CAAP;AAYA,GAbiC,EAa/B,CAAEU,UAAF,CAb+B,CAAlC;AAeA,SACC,cAAC,IAAD;AACC,IAAA,OAAO,EAAG,CADX;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGG,kBAAkB,CAACC,GAAnB,CAAwB,CAAEtB,SAAF,EAAauB,KAAb,KACzB,cAAC,SAAD;AAAW,IAAA,GAAG,EAAGA,KAAjB;AAAyB,IAAA,SAAS,EAAGvB;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"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/style-variations-container.js"],"names":["classnames","store","coreStore","useSelect","useMemo","useContext","useState","ENTER","__experimentalGrid","Grid","__","sprintf","privateApis","blockEditorPrivateApis","mergeBaseAndUserConfigs","StylesPreview","unlock","GlobalStylesContext","areGlobalStyleConfigsEqual","Variation","variation","isFocused","setIsFocused","base","user","setUserConfig","context","settings","styles","merged","selectVariation","selectOnEnter","event","keyCode","preventDefault","isActive","label","title","description","StyleVariationsContainer","variations","select","__experimentalGetCurrentThemeGlobalStylesVariations","withEmptyVariation","map","index"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,OAAT,EAAkBC,UAAlB,EAA8BC,QAA9B,QAA8C,oBAA9C;AACA,SAASC,KAAT,QAAsB,qBAAtB;AACA,SAASC,kBAAkB,IAAIC,IAA/B,QAA2C,uBAA3C;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASC,uBAAT,QAAwC,0BAAxC;AACA,OAAOC,aAAP,MAA0B,WAA1B;AACA,SAASC,MAAT,QAAuB,mBAAvB;AAEA,MAAM;AAAEC,EAAAA,mBAAF;AAAuBC,EAAAA;AAAvB,IAAsDF,MAAM,CACjEH,sBADiE,CAAlE;;AAIA,SAASM,SAAT,CAAoB;AAAEC,EAAAA;AAAF,CAApB,EAAo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F;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,GAbiC,EAa/B,CAAEY,UAAF,CAb+B,CAAlC;AAeA,SACC,cAAC,IAAD;AACC,IAAA,OAAO,EAAG,CADX;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGG,kBAAkB,CAACC,GAAnB,CAAwB,CAAExB,SAAF,EAAayB,KAAb,KACzB,cAAC,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 { __, sprintf } 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 '../../lock-unlock';\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\tlet label = variation?.title;\n\tif ( variation?.description ) {\n\t\tlabel = sprintf(\n\t\t\t/* translators: %1$s: variation title. %2$s variation description. */\n\t\t\t__( '%1$s (%2$s)' ),\n\t\t\tvariation?.title,\n\t\t\tvariation?.description\n\t\t);\n\t}\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={ label }\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"]}
@@ -5,11 +5,10 @@ import { createElement } from "@wordpress/element";
5
5
  */
6
6
  import { __experimentalHeading as Heading } from '@wordpress/components';
7
7
 
8
- function Subtitle(_ref) {
9
- let {
10
- children,
11
- level
12
- } = _ref;
8
+ function Subtitle({
9
+ children,
10
+ level
11
+ }) {
13
12
  return createElement(Heading, {
14
13
  className: "edit-site-global-styles-subtitle",
15
14
  level: level !== null && level !== void 0 ? level : 2
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/subtitle.js"],"names":["__experimentalHeading","Heading","Subtitle","children","level"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,qBAAqB,IAAIC,OAAlC,QAAiD,uBAAjD;;AAEA,SAASC,QAAT,OAAyC;AAAA,MAAtB;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAsB;AACxC,SACC,cAAC,OAAD;AACC,IAAA,SAAS,EAAC,kCADX;AAEC,IAAA,KAAK,EAAGA,KAAH,aAAGA,KAAH,cAAGA,KAAH,GAAY;AAFlB,KAIGD,QAJH,CADD;AAQA;;AAED,eAAeD,QAAf","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":["__experimentalHeading","Heading","Subtitle","children","level"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,qBAAqB,IAAIC,OAAlC,QAAiD,uBAAjD;;AAEA,SAASC,QAAT,CAAmB;AAAEC,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,CAAnB,EAAyC;AACxC,SACC,cAAC,OAAD;AACC,IAAA,SAAS,EAAC,kCADX;AAEC,IAAA,KAAK,EAAGA,KAAH,aAAGA,KAAH,cAAGA,KAAH,GAAY;AAFlB,KAIGD,QAJH,CADD;AAQA;;AAED,eAAeD,QAAf","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"]}
@@ -8,18 +8,17 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
8
8
  * Internal dependencies
9
9
  */
10
10
 
11
- import { unlock } from '../../private-apis';
11
+ import { unlock } from '../../lock-unlock';
12
12
  const {
13
13
  useGlobalStyle,
14
14
  useGlobalSetting,
15
15
  useSettingsForBlockElement,
16
16
  TypographyPanel: StylesTypographyPanel
17
17
  } = unlock(blockEditorPrivateApis);
18
- export default function TypographyPanel(_ref) {
19
- let {
20
- element,
21
- headingLevel
22
- } = _ref;
18
+ export default function TypographyPanel({
19
+ element,
20
+ headingLevel
21
+ }) {
23
22
  let prefixParts = [];
24
23
 
25
24
  if (element === 'heading') {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/typography-panel.js"],"names":["privateApis","blockEditorPrivateApis","unlock","useGlobalStyle","useGlobalSetting","useSettingsForBlockElement","TypographyPanel","StylesTypographyPanel","element","headingLevel","prefixParts","concat","prefix","join","style","undefined","shouldDecodeEncode","inheritedStyle","setStyle","rawSettings","usedElement","settings"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AACLC,EAAAA,cADK;AAELC,EAAAA,gBAFK;AAGLC,EAAAA,0BAHK;AAILC,EAAAA,eAAe,EAAEC;AAJZ,IAKFL,MAAM,CAAED,sBAAF,CALV;AAOA,eAAe,SAASK,eAAT,OAAsD;AAAA,MAA5B;AAAEE,IAAAA,OAAF;AAAWC,IAAAA;AAAX,GAA4B;AACpE,MAAIC,WAAW,GAAG,EAAlB;;AACA,MAAKF,OAAO,KAAK,SAAjB,EAA6B;AAC5BE,IAAAA,WAAW,GAAGA,WAAW,CAACC,MAAZ,CAAoB,CAAE,UAAF,EAAcF,YAAd,CAApB,CAAd;AACA,GAFD,MAEO,IAAKD,OAAO,IAAIA,OAAO,KAAK,MAA5B,EAAqC;AAC3CE,IAAAA,WAAW,GAAGA,WAAW,CAACC,MAAZ,CAAoB,CAAE,UAAF,EAAcH,OAAd,CAApB,CAAd;AACA;;AACD,QAAMI,MAAM,GAAGF,WAAW,CAACG,IAAZ,CAAkB,GAAlB,CAAf;AAEA,QAAM,CAAEC,KAAF,IAAYX,cAAc,CAAES,MAAF,EAAUG,SAAV,EAAqB,MAArB,EAA6B;AAC5DC,IAAAA,kBAAkB,EAAE;AADwC,GAA7B,CAAhC;AAGA,QAAM,CAAEC,cAAF,EAAkBC,QAAlB,IAA+Bf,cAAc,CAClDS,MADkD,EAElDG,SAFkD,EAGlD,KAHkD,EAIlD;AACCC,IAAAA,kBAAkB,EAAE;AADrB,GAJkD,CAAnD;AAQA,QAAM,CAAEG,WAAF,IAAkBf,gBAAgB,CAAE,EAAF,CAAxC;AACA,QAAMgB,WAAW,GAAGZ,OAAO,KAAK,SAAZ,GAAwBC,YAAxB,GAAuCD,OAA3D;AACA,QAAMa,QAAQ,GAAGhB,0BAA0B,CAC1Cc,WAD0C,EAE1CJ,SAF0C,EAG1CK,WAH0C,CAA3C;AAMA,SACC,cAAC,qBAAD;AACC,IAAA,cAAc,EAAGH,cADlB;AAEC,IAAA,KAAK,EAAGH,KAFT;AAGC,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"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/typography-panel.js"],"names":["privateApis","blockEditorPrivateApis","unlock","useGlobalStyle","useGlobalSetting","useSettingsForBlockElement","TypographyPanel","StylesTypographyPanel","element","headingLevel","prefixParts","concat","prefix","join","style","undefined","shouldDecodeEncode","inheritedStyle","setStyle","rawSettings","usedElement","settings"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,mBAAvB;AAEA,MAAM;AACLC,EAAAA,cADK;AAELC,EAAAA,gBAFK;AAGLC,EAAAA,0BAHK;AAILC,EAAAA,eAAe,EAAEC;AAJZ,IAKFL,MAAM,CAAED,sBAAF,CALV;AAOA,eAAe,SAASK,eAAT,CAA0B;AAAEE,EAAAA,OAAF;AAAWC,EAAAA;AAAX,CAA1B,EAAsD;AACpE,MAAIC,WAAW,GAAG,EAAlB;;AACA,MAAKF,OAAO,KAAK,SAAjB,EAA6B;AAC5BE,IAAAA,WAAW,GAAGA,WAAW,CAACC,MAAZ,CAAoB,CAAE,UAAF,EAAcF,YAAd,CAApB,CAAd;AACA,GAFD,MAEO,IAAKD,OAAO,IAAIA,OAAO,KAAK,MAA5B,EAAqC;AAC3CE,IAAAA,WAAW,GAAGA,WAAW,CAACC,MAAZ,CAAoB,CAAE,UAAF,EAAcH,OAAd,CAApB,CAAd;AACA;;AACD,QAAMI,MAAM,GAAGF,WAAW,CAACG,IAAZ,CAAkB,GAAlB,CAAf;AAEA,QAAM,CAAEC,KAAF,IAAYX,cAAc,CAAES,MAAF,EAAUG,SAAV,EAAqB,MAArB,EAA6B;AAC5DC,IAAAA,kBAAkB,EAAE;AADwC,GAA7B,CAAhC;AAGA,QAAM,CAAEC,cAAF,EAAkBC,QAAlB,IAA+Bf,cAAc,CAClDS,MADkD,EAElDG,SAFkD,EAGlD,KAHkD,EAIlD;AACCC,IAAAA,kBAAkB,EAAE;AADrB,GAJkD,CAAnD;AAQA,QAAM,CAAEG,WAAF,IAAkBf,gBAAgB,CAAE,EAAF,CAAxC;AACA,QAAMgB,WAAW,GAAGZ,OAAO,KAAK,SAAZ,GAAwBC,YAAxB,GAAuCD,OAA3D;AACA,QAAMa,QAAQ,GAAGhB,0BAA0B,CAC1Cc,WAD0C,EAE1CJ,SAF0C,EAG1CK,WAH0C,CAA3C;AAMA,SACC,cAAC,qBAAD;AACC,IAAA,cAAc,EAAGH,cADlB;AAEC,IAAA,KAAK,EAAGH,KAFT;AAGC,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 '../../lock-unlock';\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"]}
@@ -8,16 +8,15 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
8
8
  * Internal dependencies
9
9
  */
10
10
 
11
- import { unlock } from '../../private-apis';
11
+ import { unlock } from '../../lock-unlock';
12
12
  const {
13
13
  useGlobalStyle
14
14
  } = unlock(blockEditorPrivateApis);
15
- export default function TypographyPreview(_ref) {
16
- let {
17
- name,
18
- element,
19
- headingLevel
20
- } = _ref;
15
+ export default function TypographyPreview({
16
+ name,
17
+ element,
18
+ headingLevel
19
+ }) {
21
20
  let prefix = '';
22
21
 
23
22
  if (element === 'heading') {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/typography-preview.js"],"names":["privateApis","blockEditorPrivateApis","unlock","useGlobalStyle","TypographyPreview","name","element","headingLevel","prefix","fontFamily","gradientValue","backgroundColor","color","fontSize","fontStyle","fontWeight","letterSpacing","extraStyles","textDecoration","background"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAqBD,MAAM,CAAED,sBAAF,CAAjC;AAEA,eAAe,SAASG,iBAAT,OAA8D;AAAA,MAAlC;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,OAAR;AAAiBC,IAAAA;AAAjB,GAAkC;AAC5E,MAAIC,MAAM,GAAG,EAAb;;AACA,MAAKF,OAAO,KAAK,SAAjB,EAA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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":["privateApis","blockEditorPrivateApis","unlock","useGlobalStyle","TypographyPreview","name","element","headingLevel","prefix","fontFamily","gradientValue","backgroundColor","color","fontSize","fontStyle","fontWeight","letterSpacing","extraStyles","textDecoration","background"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,mBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAqBD,MAAM,CAAED,sBAAF,CAAjC;AAEA,eAAe,SAASG,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,IAAiBN,cAAc,CACpCK,MAAM,GAAG,uBAD2B,EAEpCH,IAFoC,CAArC;AAIA,QAAM,CAAEK,aAAF,IAAoBP,cAAc,CAAEK,MAAM,GAAG,gBAAX,EAA6BH,IAA7B,CAAxC;AACA,QAAM,CAAEM,eAAF,IAAsBR,cAAc,CACzCK,MAAM,GAAG,kBADgC,EAEzCH,IAFyC,CAA1C;AAIA,QAAM,CAAEO,KAAF,IAAYT,cAAc,CAAEK,MAAM,GAAG,YAAX,EAAyBH,IAAzB,CAAhC;AACA,QAAM,CAAEQ,QAAF,IAAeV,cAAc,CAAEK,MAAM,GAAG,qBAAX,EAAkCH,IAAlC,CAAnC;AACA,QAAM,CAAES,SAAF,IAAgBX,cAAc,CACnCK,MAAM,GAAG,sBAD0B,EAEnCH,IAFmC,CAApC;AAIA,QAAM,CAAEU,UAAF,IAAiBZ,cAAc,CACpCK,MAAM,GAAG,uBAD2B,EAEpCH,IAFoC,CAArC;AAIA,QAAM,CAAEW,aAAF,IAAoBb,cAAc,CACvCK,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 '../../lock-unlock';\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,16 +1,20 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement, Fragment } from "@wordpress/element";
3
2
 
3
+ /**
4
+ * External dependencies
5
+ */
6
+ import classnames from 'classnames';
4
7
  /**
5
8
  * WordPress dependencies
6
9
  */
7
- import { __experimentalNavigatorProvider as NavigatorProvider, __experimentalNavigatorScreen as NavigatorScreen, __experimentalUseNavigator as useNavigator, createSlotFill, DropdownMenu } from '@wordpress/components';
10
+
11
+ import { __experimentalNavigatorProvider as NavigatorProvider, __experimentalNavigatorScreen as NavigatorScreen, __experimentalUseNavigator as useNavigator, createSlotFill, DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';
8
12
  import { getBlockTypes, store as blocksStore } from '@wordpress/blocks';
9
13
  import { useSelect, useDispatch } from '@wordpress/data';
10
14
  import { privateApis as blockEditorPrivateApis, store as blockEditorStore } from '@wordpress/block-editor';
11
- import { __, sprintf, _n } from '@wordpress/i18n';
15
+ import { __ } from '@wordpress/i18n';
12
16
  import { store as preferencesStore } from '@wordpress/preferences';
13
- import { moreVertical } from '@wordpress/icons';
17
+ import { backup, moreVertical } from '@wordpress/icons';
14
18
  import { store as coreStore } from '@wordpress/core-data';
15
19
  import { useEffect } from '@wordpress/element';
16
20
  /**
@@ -29,7 +33,7 @@ import ScreenStyleVariations from './screen-style-variations';
29
33
  import StyleBook from '../style-book';
30
34
  import ScreenCSS from './screen-css';
31
35
  import ScreenRevisions from './screen-revisions';
32
- import { unlock } from '../../private-apis';
36
+ import { unlock } from '../../lock-unlock';
33
37
  import { store as editSiteStore } from '../../store';
34
38
  const SLOT_FILL_NAME = 'GlobalStylesMenu';
35
39
  const {
@@ -42,10 +46,60 @@ function GlobalStylesActionMenu() {
42
46
  toggle
43
47
  } = useDispatch(preferencesStore);
44
48
  const {
45
- canEditCSS,
49
+ canEditCSS
50
+ } = useSelect(select => {
51
+ var _globalStyles$_links$;
52
+
53
+ const {
54
+ getEntityRecord,
55
+ __experimentalGetCurrentGlobalStylesId
56
+ } = select(coreStore);
57
+
58
+ const globalStylesId = __experimentalGetCurrentGlobalStylesId();
59
+
60
+ const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
61
+ return {
62
+ canEditCSS: (_globalStyles$_links$ = !!globalStyles?._links?.['wp:action-edit-css']) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : false
63
+ };
64
+ }, []);
65
+ const {
66
+ goTo
67
+ } = useNavigator();
68
+
69
+ const loadCustomCSS = () => goTo('/css');
70
+
71
+ return createElement(GlobalStylesMenuFill, null, createElement(DropdownMenu, {
72
+ icon: moreVertical,
73
+ label: __('More')
74
+ }, ({
75
+ onClose
76
+ }) => createElement(MenuGroup, null, canEditCSS && createElement(MenuItem, {
77
+ onClick: loadCustomCSS
78
+ }, __('Additional CSS')), createElement(MenuItem, {
79
+ onClick: () => {
80
+ toggle('core/edit-site', 'welcomeGuideStyles');
81
+ onClose();
82
+ }
83
+ }, __('Welcome Guide')))));
84
+ }
85
+
86
+ function RevisionsCountBadge({
87
+ className,
88
+ children
89
+ }) {
90
+ return createElement("span", {
91
+ className: classnames(className, 'edit-site-global-styles-sidebar__revisions-count-badge')
92
+ }, children);
93
+ }
94
+
95
+ function GlobalStylesRevisionsMenu() {
96
+ const {
97
+ setIsListViewOpened
98
+ } = useDispatch(editSiteStore);
99
+ const {
46
100
  revisionsCount
47
101
  } = useSelect(select => {
48
- var _globalStyles$_links$, _globalStyles$_links, _globalStyles$_links$2, _globalStyles$_links2, _globalStyles$_links3, _globalStyles$_links4;
102
+ var _globalStyles$_links$2;
49
103
 
50
104
  const {
51
105
  getEntityRecord,
@@ -56,8 +110,7 @@ function GlobalStylesActionMenu() {
56
110
 
57
111
  const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
58
112
  return {
59
- 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,
60
- revisionsCount: (_globalStyles$_links$2 = globalStyles === null || globalStyles === void 0 ? void 0 : (_globalStyles$_links2 = globalStyles._links) === null || _globalStyles$_links2 === void 0 ? void 0 : (_globalStyles$_links3 = _globalStyles$_links2['version-history']) === null || _globalStyles$_links3 === void 0 ? void 0 : (_globalStyles$_links4 = _globalStyles$_links3[0]) === null || _globalStyles$_links4 === void 0 ? void 0 : _globalStyles$_links4.count) !== null && _globalStyles$_links$2 !== void 0 ? _globalStyles$_links$2 : 0
113
+ revisionsCount: (_globalStyles$_links$2 = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$2 !== void 0 ? _globalStyles$_links$2 : 0
61
114
  };
62
115
  }, []);
63
116
  const {
@@ -71,52 +124,45 @@ function GlobalStylesActionMenu() {
71
124
  setEditorCanvasContainerView
72
125
  } = unlock(useDispatch(editSiteStore));
73
126
 
74
- const loadCustomCSS = () => goTo('/css');
75
-
76
127
  const loadRevisions = () => {
128
+ setIsListViewOpened(false);
77
129
  goTo('/revisions');
78
130
  setEditorCanvasContainerView('global-styles-revisions');
79
131
  };
80
132
 
81
133
  const hasRevisions = revisionsCount >= 2;
82
134
  return createElement(GlobalStylesMenuFill, null, createElement(DropdownMenu, {
83
- icon: moreVertical,
84
- label: __('Styles actions'),
85
- controls: [{
86
- title: __('Reset to defaults'),
87
- onClick: onReset,
88
- isDisabled: !canReset
89
- }, {
90
- title: __('Welcome Guide'),
91
- onClick: () => toggle('core/edit-site', 'welcomeGuideStyles')
92
- }, ...(canEditCSS ? [{
93
- title: __('Additional CSS'),
94
- onClick: loadCustomCSS
95
- }] : []), ...(hasRevisions ? [{
96
- title: sprintf(
97
- /* translators: %d: number of revisions */
98
- _n('%d Revision', '%d Revisions', revisionsCount), revisionsCount),
99
- onClick: loadRevisions
100
- }] : [])]
101
- }));
135
+ icon: backup,
136
+ label: __('Revisions')
137
+ }, ({
138
+ onClose
139
+ }) => createElement(MenuGroup, null, hasRevisions && createElement(MenuItem, {
140
+ onClick: loadRevisions,
141
+ icon: createElement(RevisionsCountBadge, null, revisionsCount)
142
+ }, __('Revision history')), createElement(MenuItem, {
143
+ onClick: () => {
144
+ onReset();
145
+ onClose();
146
+ },
147
+ disabled: !canReset
148
+ }, __('Reset to defaults')))));
102
149
  }
103
150
 
104
- function GlobalStylesNavigationScreen(_ref) {
105
- let {
106
- className,
151
+ function GlobalStylesNavigationScreen({
152
+ className,
153
+ ...props
154
+ }) {
155
+ return createElement(NavigatorScreen, {
156
+ className: ['edit-site-global-styles-sidebar__navigator-screen', className].filter(Boolean).join(' '),
107
157
  ...props
108
- } = _ref;
109
- return createElement(NavigatorScreen, _extends({
110
- className: ['edit-site-global-styles-sidebar__navigator-screen', className].filter(Boolean).join(' ')
111
- }, props));
158
+ });
112
159
  }
113
160
 
114
- function BlockStylesNavigationScreens(_ref2) {
115
- let {
116
- parentMenu,
117
- blockStyles,
118
- blockName
119
- } = _ref2;
161
+ function BlockStylesNavigationScreens({
162
+ parentMenu,
163
+ blockStyles,
164
+ blockName
165
+ }) {
120
166
  return blockStyles.map((style, index) => createElement(GlobalStylesNavigationScreen, {
121
167
  key: index,
122
168
  path: parentMenu + '/variations/' + style.name
@@ -126,11 +172,10 @@ function BlockStylesNavigationScreens(_ref2) {
126
172
  })));
127
173
  }
128
174
 
129
- function ContextScreens(_ref3) {
130
- let {
131
- name,
132
- parentMenu = ''
133
- } = _ref3;
175
+ function ContextScreens({
176
+ name,
177
+ parentMenu = ''
178
+ }) {
134
179
  const blockStyleVariations = useSelect(select => {
135
180
  const {
136
181
  getBlockStyles
@@ -141,7 +186,7 @@ function ContextScreens(_ref3) {
141
186
  path: parentMenu + '/colors/palette'
142
187
  }, createElement(ScreenColorPalette, {
143
188
  name: name
144
- })), !!(blockStyleVariations !== null && blockStyleVariations !== void 0 && blockStyleVariations.length) && createElement(BlockStylesNavigationScreens, {
189
+ })), !!blockStyleVariations?.length && createElement(BlockStylesNavigationScreens, {
145
190
  parentMenu: parentMenu,
146
191
  blockStyles: blockStyleVariations,
147
192
  blockName: name
@@ -205,6 +250,34 @@ function GlobalStylesBlockLink() {
205
250
  }, [selectedBlockClientId, selectedBlockName, blockHasGlobalStyles]);
206
251
  }
207
252
 
253
+ function GlobalStylesEditorCanvasContainerLink() {
254
+ const {
255
+ goTo,
256
+ location
257
+ } = useNavigator();
258
+ const editorCanvasContainerView = useSelect(select => unlock(select(editSiteStore)).getEditorCanvasContainerView(), []); // If the user switches the editor canvas container view, redirect
259
+ // to the appropriate screen. This effectively allows deep linking to the
260
+ // desired screens from outside the global styles navigation provider.
261
+
262
+ useEffect(() => {
263
+ if (editorCanvasContainerView === 'global-styles-revisions') {
264
+ // Switching to the revisions container view should
265
+ // redirect to the revisions screen.
266
+ goTo('/revisions');
267
+ } else if (!!editorCanvasContainerView && location?.path === '/revisions') {
268
+ // Switching to any container other than revisions should
269
+ // redirect from the revisions screen to the root global styles screen.
270
+ goTo('/');
271
+ } else if (editorCanvasContainerView === 'global-styles-css') {
272
+ goTo('/css');
273
+ } // location?.path is not a dependency because we don't want to track it.
274
+ // Doing so will cause an infinite loop. We could abstract logic to avoid
275
+ // having to disable the check later.
276
+ // eslint-disable-next-line react-hooks/exhaustive-deps
277
+
278
+ }, [editorCanvasContainerView, goTo]);
279
+ }
280
+
208
281
  function GlobalStylesUI() {
209
282
  const blocks = getBlockTypes();
210
283
  const editorCanvasContainerView = useSelect(select => unlock(select(editSiteStore)).getEditorCanvasContainerView(), []);
@@ -256,7 +329,7 @@ function GlobalStylesUI() {
256
329
  key: 'screens-block-' + block.name,
257
330
  name: block.name,
258
331
  parentMenu: '/blocks/' + encodeURIComponent(block.name)
259
- })), 'style-book' === editorCanvasContainerView && createElement(GlobalStylesStyleBook, null), createElement(GlobalStylesActionMenu, null), createElement(GlobalStylesBlockLink, null));
332
+ })), 'style-book' === editorCanvasContainerView && createElement(GlobalStylesStyleBook, null), createElement(GlobalStylesRevisionsMenu, null), createElement(GlobalStylesActionMenu, null), createElement(GlobalStylesBlockLink, null), createElement(GlobalStylesEditorCanvasContainerLink, null));
260
333
  }
261
334
 
262
335
  export { GlobalStylesMenuSlot };
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"names":["__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","__experimentalUseNavigator","useNavigator","createSlotFill","DropdownMenu","getBlockTypes","store","blocksStore","useSelect","useDispatch","privateApis","blockEditorPrivateApis","blockEditorStore","__","sprintf","_n","preferencesStore","moreVertical","coreStore","useEffect","ScreenRoot","useBlockHasGlobalStyles","default","ScreenBlockList","ScreenBlock","ScreenTypography","ScreenTypographyElement","ScreenColors","ScreenColorPalette","ScreenLayout","ScreenStyleVariations","StyleBook","ScreenCSS","ScreenRevisions","unlock","editSiteStore","SLOT_FILL_NAME","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","GlobalStylesActionMenu","toggle","canEditCSS","revisionsCount","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","useGlobalStylesReset","canReset","onReset","goTo","setEditorCanvasContainerView","loadCustomCSS","loadRevisions","hasRevisions","title","onClick","isDisabled","GlobalStylesNavigationScreen","className","props","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","name","ContextScreens","blockStyleVariations","getBlockStyles","length","GlobalStylesStyleBook","navigator","path","location","encodeURIComponent","startsWith","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","clientId","blockHasGlobalStyles","currentPath","newPath","skipFocus","GlobalStylesUI","blocks","editorCanvasContainerView","getEditorCanvasContainerView","block"],"mappings":";;;AAAA;AACA;AACA;AACA,SACCA,+BAA+B,IAAIC,iBADpC,EAECC,6BAA6B,IAAIC,eAFlC,EAGCC,0BAA0B,IAAIC,YAH/B,EAICC,cAJD,EAKCC,YALD,QAMO,uBANP;AAOA,SAASC,aAAT,EAAwBC,KAAK,IAAIC,WAAjC,QAAoD,mBAApD;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SACCC,WAAW,IAAIC,sBADhB,EAECL,KAAK,IAAIM,gBAFV,QAGO,yBAHP;AAIA,SAASC,EAAT,EAAaC,OAAb,EAAsBC,EAAtB,QAAgC,iBAAhC;AACA,SAAST,KAAK,IAAIU,gBAAlB,QAA0C,wBAA1C;AACA,SAASC,YAAT,QAA6B,kBAA7B;AACA,SAASX,KAAK,IAAIY,SAAlB,QAAmC,sBAAnC;AACA,SAASC,SAAT,QAA0B,oBAA1B;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,SACCC,uBADD,EAECC,OAAO,IAAIC,eAFZ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AAc4B,KAAF,IACb,cAAC,cAAD;AACC,IAAA,GAAG,EAAG,mBAAmBA,KAAK,CAACzB,IADhC;AAEC,IAAA,IAAI,EAAGyB,KAAK,CAACzB,IAFd;AAGC,IAAA,UAAU,EAAG,aAAaS,kBAAkB,CAAEgB,KAAK,CAACzB,IAAR;AAH7C,IADC,CAnEH,EA2EG,iBAAiBuB,yBAAjB,IACD,cAAC,qBAAD,OA5EF,EA+EC,cAAC,sBAAD,OA/ED,EAgFC,cAAC,qBAAD,OAhFD,CADD;AAoFA;;AACD,SAAS9D,oBAAT;AACA,eAAe4D,cAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\tcreateSlotFill,\n\tDropdownMenu,\n} from '@wordpress/components';\nimport { getBlockTypes, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ScreenRoot from './screen-root';\nimport {\n\tuseBlockHasGlobalStyles,\n\tdefault as ScreenBlockList,\n} from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenTypographyElement from './screen-typography-element';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport ScreenLayout from './screen-layout';\nimport ScreenStyleVariations from './screen-style-variations';\nimport StyleBook from '../style-book';\nimport ScreenCSS from './screen-css';\nimport ScreenRevisions from './screen-revisions';\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\n\nconst SLOT_FILL_NAME = 'GlobalStylesMenu';\nconst { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { canEditCSS, revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( 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\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t\trevisionsCount:\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0,\n\t\t};\n\t}, [] );\n\tconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { goTo } = useNavigator();\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst loadCustomCSS = () => goTo( '/css' );\n\tconst loadRevisions = () => {\n\t\tgoTo( '/revisions' );\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t};\n\tconst hasRevisions = revisionsCount >= 2;\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Styles actions' ) }\n\t\t\t\tcontrols={ [\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle: __( 'Reset to defaults' ),\n\t\t\t\t\t\tonClick: onReset,\n\t\t\t\t\t\tisDisabled: ! canReset,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle: __( 'Welcome Guide' ),\n\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\ttoggle( 'core/edit-site', 'welcomeGuideStyles' ),\n\t\t\t\t\t},\n\t\t\t\t\t...( canEditCSS\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: __( 'Additional CSS' ),\n\t\t\t\t\t\t\t\t\tonClick: loadCustomCSS,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: [] ),\n\t\t\t\t\t...( hasRevisions\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %d: number of revisions */\n\t\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t\t'%d Revision',\n\t\t\t\t\t\t\t\t\t\t\t'%d Revisions',\n\t\t\t\t\t\t\t\t\t\t\trevisionsCount\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\trevisionsCount\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tonClick: loadRevisions,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: [] ),\n\t\t\t\t] }\n\t\t\t/>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ [\n\t\t\t\t'edit-site-global-styles-sidebar__navigator-screen',\n\t\t\t\tclassName,\n\t\t\t]\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction BlockStylesNavigationScreens( {\n\tparentMenu,\n\tblockStyles,\n\tblockName,\n} ) {\n\treturn blockStyles.map( ( style, index ) => (\n\t\t<GlobalStylesNavigationScreen\n\t\t\tkey={ index }\n\t\t\tpath={ parentMenu + '/variations/' + style.name }\n\t\t>\n\t\t\t<ScreenBlock name={ blockName } variation={ style.name } />\n\t\t</GlobalStylesNavigationScreen>\n\t) );\n}\n\nfunction ContextScreens( { name, parentMenu = '' } ) {\n\tconst blockStyleVariations = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/palette' }\n\t\t\t>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ !! blockStyleVariations?.length && (\n\t\t\t\t<BlockStylesNavigationScreens\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\tblockStyles={ blockStyleVariations }\n\t\t\t\t\tblockName={ name }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction GlobalStylesStyleBook() {\n\tconst navigator = useNavigator();\n\tconst { path } = navigator.location;\n\treturn (\n\t\t<StyleBook\n\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\tpath === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\tpath.startsWith(\n\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t)\n\t\t\t}\n\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t// Now go to the selected block.\n\t\t\t\tnavigator.goTo( '/blocks/' + encodeURIComponent( blockName ) );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction GlobalStylesBlockLink() {\n\tconst navigator = useNavigator();\n\tconst { selectedBlockName, selectedBlockClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSelectedBlockClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\tselectedBlockName: getBlockName( clientId ),\n\t\t\t\tselectedBlockClientId: clientId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst blockHasGlobalStyles = useBlockHasGlobalStyles( selectedBlockName );\n\t// When we're in the `Blocks` screen enable deep linking to the selected block.\n\tuseEffect( () => {\n\t\tif ( ! selectedBlockClientId || ! blockHasGlobalStyles ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentPath = navigator.location.path;\n\t\tif (\n\t\t\tcurrentPath !== '/blocks' &&\n\t\t\t! currentPath.startsWith( '/blocks/' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst newPath = '/blocks/' + encodeURIComponent( selectedBlockName );\n\t\t// Avoid navigating to the same path. This can happen when selecting\n\t\t// a new block of the same type.\n\t\tif ( newPath !== currentPath ) {\n\t\t\tnavigator.goTo( newPath, { skipFocus: true } );\n\t\t}\n\t}, [ selectedBlockClientId, selectedBlockName, blockHasGlobalStyles ] );\n}\n\nfunction GlobalStylesUI() {\n\tconst blocks = getBlockTypes();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\treturn (\n\t\t<NavigatorProvider\n\t\t\tclassName=\"edit-site-global-styles-sidebar__navigator-provider\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<GlobalStylesNavigationScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/variations\">\n\t\t\t\t<ScreenStyleVariations />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography\">\n\t\t\t\t<ScreenTypography />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/text\">\n\t\t\t\t<ScreenTypographyElement element=\"text\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/link\">\n\t\t\t\t<ScreenTypographyElement element=\"link\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/heading\">\n\t\t\t\t<ScreenTypographyElement element=\"heading\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/caption\">\n\t\t\t\t<ScreenTypographyElement element=\"caption\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/button\">\n\t\t\t\t<ScreenTypographyElement element=\"button\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/colors\">\n\t\t\t\t<ScreenColors />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/layout\">\n\t\t\t\t<ScreenLayout />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/css\">\n\t\t\t\t<ScreenCSS />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path={ '/revisions' }>\n\t\t\t\t<ScreenRevisions />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\t\tkey={ 'menu-block-' + block.name }\n\t\t\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ block.name } />\n\t\t\t\t</GlobalStylesNavigationScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<ContextScreens\n\t\t\t\t\tkey={ 'screens-block-' + block.name }\n\t\t\t\t\tname={ block.name }\n\t\t\t\t\tparentMenu={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t/>\n\t\t\t) ) }\n\n\t\t\t{ 'style-book' === editorCanvasContainerView && (\n\t\t\t\t<GlobalStylesStyleBook />\n\t\t\t) }\n\n\t\t\t<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t</NavigatorProvider>\n\t);\n}\nexport { GlobalStylesMenuSlot };\nexport default GlobalStylesUI;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"names":["classnames","__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","__experimentalUseNavigator","useNavigator","createSlotFill","DropdownMenu","MenuGroup","MenuItem","getBlockTypes","store","blocksStore","useSelect","useDispatch","privateApis","blockEditorPrivateApis","blockEditorStore","__","preferencesStore","backup","moreVertical","coreStore","useEffect","ScreenRoot","useBlockHasGlobalStyles","default","ScreenBlockList","ScreenBlock","ScreenTypography","ScreenTypographyElement","ScreenColors","ScreenColorPalette","ScreenLayout","ScreenStyleVariations","StyleBook","ScreenCSS","ScreenRevisions","unlock","editSiteStore","SLOT_FILL_NAME","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","GlobalStylesActionMenu","toggle","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","goTo","loadCustomCSS","onClose","RevisionsCountBadge","className","children","GlobalStylesRevisionsMenu","setIsListViewOpened","revisionsCount","count","useGlobalStylesReset","canReset","onReset","setEditorCanvasContainerView","loadRevisions","hasRevisions","GlobalStylesNavigationScreen","props","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","name","ContextScreens","blockStyleVariations","getBlockStyles","length","GlobalStylesStyleBook","navigator","path","location","encodeURIComponent","startsWith","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","clientId","blockHasGlobalStyles","currentPath","newPath","skipFocus","GlobalStylesEditorCanvasContainerLink","editorCanvasContainerView","getEditorCanvasContainerView","GlobalStylesUI","blocks","block"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,+BAA+B,IAAIC,iBADpC,EAECC,6BAA6B,IAAIC,eAFlC,EAGCC,0BAA0B,IAAIC,YAH/B,EAICC,cAJD,EAKCC,YALD,EAMCC,SAND,EAOCC,QAPD,QAQO,uBARP;AASA,SAASC,aAAT,EAAwBC,KAAK,IAAIC,WAAjC,QAAoD,mBAApD;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SACCC,WAAW,IAAIC,sBADhB,EAECL,KAAK,IAAIM,gBAFV,QAGO,yBAHP;AAIA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASP,KAAK,IAAIQ,gBAAlB,QAA0C,wBAA1C;AACA,SAASC,MAAT,EAAiBC,YAAjB,QAAqC,kBAArC;AACA,SAASV,KAAK,IAAIW,SAAlB,QAAmC,sBAAnC;AACA,SAASC,SAAT,QAA0B,oBAA1B;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,SACCC,uBADD,EAECC,OAAO,IAAIC,eAFZ,QAGO,qBAHP;AAIA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,gBAAP,MAA6B,qBAA7B;AACA,OAAOC,uBAAP,MAAoC,6BAApC;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,kBAAP,MAA+B,wBAA/B;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,qBAAP,MAAkC,2BAAlC;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,SAAP,MAAsB,cAAtB;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,SAAS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AEC,IAAA,IAAI,EAAG0B,KAAK,CAAC1B,IAFd;AAGC,IAAA,UAAU,EAAG,aAAaS,kBAAkB,CAAEiB,KAAK,CAAC1B,IAAR;AAH7C,IADC,CAnEH,EA2EG,iBAAiBsB,yBAAjB,IACD,cAAC,qBAAD,OA5EF,EA+EC,cAAC,yBAAD,OA/ED,EAgFC,cAAC,sBAAD,OAhFD,EAiFC,cAAC,qBAAD,OAjFD,EAkFC,cAAC,qCAAD,OAlFD,CADD;AAsFA;;AACD,SAAS/D,oBAAT;AACA,eAAeiE,cAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\tcreateSlotFill,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n} from '@wordpress/components';\nimport { getBlockTypes, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { backup, moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ScreenRoot from './screen-root';\nimport {\n\tuseBlockHasGlobalStyles,\n\tdefault as ScreenBlockList,\n} from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenTypographyElement from './screen-typography-element';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport ScreenLayout from './screen-layout';\nimport ScreenStyleVariations from './screen-style-variations';\nimport StyleBook from '../style-book';\nimport ScreenCSS from './screen-css';\nimport ScreenRevisions from './screen-revisions';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst SLOT_FILL_NAME = 'GlobalStylesMenu';\nconst { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( 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\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t};\n\t}, [] );\n\tconst { goTo } = useNavigator();\n\tconst loadCustomCSS = () => goTo( '/css' );\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu icon={ moreVertical } label={ __( 'More' ) }>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t{ canEditCSS && (\n\t\t\t\t\t\t\t<MenuItem onClick={ loadCustomCSS }>\n\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction RevisionsCountBadge( { className, children } ) {\n\treturn (\n\t\t<span\n\t\t\tclassName={ classnames(\n\t\t\t\tclassName,\n\t\t\t\t'edit-site-global-styles-sidebar__revisions-count-badge'\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\t\t</span>\n\t);\n}\nfunction GlobalStylesRevisionsMenu() {\n\tconst { setIsListViewOpened } = useDispatch( editSiteStore );\n\tconst { revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( 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\trevisionsCount:\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0,\n\t\t};\n\t}, [] );\n\tconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { goTo } = useNavigator();\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst loadRevisions = () => {\n\t\tsetIsListViewOpened( false );\n\t\tgoTo( '/revisions' );\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t};\n\tconst hasRevisions = revisionsCount >= 2;\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu icon={ backup } label={ __( 'Revisions' ) }>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t{ hasRevisions && (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ loadRevisions }\n\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t<RevisionsCountBadge>\n\t\t\t\t\t\t\t\t\t\t{ revisionsCount }\n\t\t\t\t\t\t\t\t\t</RevisionsCountBadge>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Revision history' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonReset();\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tdisabled={ ! canReset }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Reset to defaults' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ [\n\t\t\t\t'edit-site-global-styles-sidebar__navigator-screen',\n\t\t\t\tclassName,\n\t\t\t]\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction BlockStylesNavigationScreens( {\n\tparentMenu,\n\tblockStyles,\n\tblockName,\n} ) {\n\treturn blockStyles.map( ( style, index ) => (\n\t\t<GlobalStylesNavigationScreen\n\t\t\tkey={ index }\n\t\t\tpath={ parentMenu + '/variations/' + style.name }\n\t\t>\n\t\t\t<ScreenBlock name={ blockName } variation={ style.name } />\n\t\t</GlobalStylesNavigationScreen>\n\t) );\n}\n\nfunction ContextScreens( { name, parentMenu = '' } ) {\n\tconst blockStyleVariations = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/palette' }\n\t\t\t>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ !! blockStyleVariations?.length && (\n\t\t\t\t<BlockStylesNavigationScreens\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\tblockStyles={ blockStyleVariations }\n\t\t\t\t\tblockName={ name }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction GlobalStylesStyleBook() {\n\tconst navigator = useNavigator();\n\tconst { path } = navigator.location;\n\treturn (\n\t\t<StyleBook\n\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\tpath === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\tpath.startsWith(\n\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t)\n\t\t\t}\n\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t// Now go to the selected block.\n\t\t\t\tnavigator.goTo( '/blocks/' + encodeURIComponent( blockName ) );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction GlobalStylesBlockLink() {\n\tconst navigator = useNavigator();\n\tconst { selectedBlockName, selectedBlockClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSelectedBlockClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\tselectedBlockName: getBlockName( clientId ),\n\t\t\t\tselectedBlockClientId: clientId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst blockHasGlobalStyles = useBlockHasGlobalStyles( selectedBlockName );\n\t// When we're in the `Blocks` screen enable deep linking to the selected block.\n\tuseEffect( () => {\n\t\tif ( ! selectedBlockClientId || ! blockHasGlobalStyles ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentPath = navigator.location.path;\n\t\tif (\n\t\t\tcurrentPath !== '/blocks' &&\n\t\t\t! currentPath.startsWith( '/blocks/' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst newPath = '/blocks/' + encodeURIComponent( selectedBlockName );\n\t\t// Avoid navigating to the same path. This can happen when selecting\n\t\t// a new block of the same type.\n\t\tif ( newPath !== currentPath ) {\n\t\t\tnavigator.goTo( newPath, { skipFocus: true } );\n\t\t}\n\t}, [ selectedBlockClientId, selectedBlockName, blockHasGlobalStyles ] );\n}\n\nfunction GlobalStylesEditorCanvasContainerLink() {\n\tconst { goTo, location } = useNavigator();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\n\t// If the user switches the editor canvas container view, redirect\n\t// to the appropriate screen. This effectively allows deep linking to the\n\t// desired screens from outside the global styles navigation provider.\n\tuseEffect( () => {\n\t\tif ( editorCanvasContainerView === 'global-styles-revisions' ) {\n\t\t\t// Switching to the revisions container view should\n\t\t\t// redirect to the revisions screen.\n\t\t\tgoTo( '/revisions' );\n\t\t} else if (\n\t\t\t!! editorCanvasContainerView &&\n\t\t\tlocation?.path === '/revisions'\n\t\t) {\n\t\t\t// Switching to any container other than revisions should\n\t\t\t// redirect from the revisions screen to the root global styles screen.\n\t\t\tgoTo( '/' );\n\t\t} else if ( editorCanvasContainerView === 'global-styles-css' ) {\n\t\t\tgoTo( '/css' );\n\t\t}\n\n\t\t// location?.path is not a dependency because we don't want to track it.\n\t\t// Doing so will cause an infinite loop. We could abstract logic to avoid\n\t\t// having to disable the check later.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ editorCanvasContainerView, goTo ] );\n}\n\nfunction GlobalStylesUI() {\n\tconst blocks = getBlockTypes();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\treturn (\n\t\t<NavigatorProvider\n\t\t\tclassName=\"edit-site-global-styles-sidebar__navigator-provider\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<GlobalStylesNavigationScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/variations\">\n\t\t\t\t<ScreenStyleVariations />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography\">\n\t\t\t\t<ScreenTypography />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/text\">\n\t\t\t\t<ScreenTypographyElement element=\"text\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/link\">\n\t\t\t\t<ScreenTypographyElement element=\"link\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/heading\">\n\t\t\t\t<ScreenTypographyElement element=\"heading\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/caption\">\n\t\t\t\t<ScreenTypographyElement element=\"caption\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/button\">\n\t\t\t\t<ScreenTypographyElement element=\"button\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/colors\">\n\t\t\t\t<ScreenColors />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/layout\">\n\t\t\t\t<ScreenLayout />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/css\">\n\t\t\t\t<ScreenCSS />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path={ '/revisions' }>\n\t\t\t\t<ScreenRevisions />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\t\tkey={ 'menu-block-' + block.name }\n\t\t\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ block.name } />\n\t\t\t\t</GlobalStylesNavigationScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<ContextScreens\n\t\t\t\t\tkey={ 'screens-block-' + block.name }\n\t\t\t\t\tname={ block.name }\n\t\t\t\t\tparentMenu={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t/>\n\t\t\t) ) }\n\n\t\t\t{ 'style-book' === editorCanvasContainerView && (\n\t\t\t\t<GlobalStylesStyleBook />\n\t\t\t) }\n\n\t\t\t<GlobalStylesRevisionsMenu />\n\t\t\t<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t\t<GlobalStylesEditorCanvasContainerLink />\n\t\t</NavigatorProvider>\n\t);\n}\nexport { GlobalStylesMenuSlot };\nexport default GlobalStylesUI;\n"]}
@@ -13,7 +13,7 @@ import { __experimentalItemGroup as ItemGroup } from '@wordpress/components';
13
13
  import { NavigationButtonAsItem } from './navigation-button';
14
14
 
15
15
  function getCoreBlockStyles(blockStyles) {
16
- return blockStyles === null || blockStyles === void 0 ? void 0 : blockStyles.filter(style => style.source === 'block');
16
+ return blockStyles?.filter(style => style.source === 'block');
17
17
  }
18
18
 
19
19
  export function useBlockVariations(name) {
@@ -26,16 +26,15 @@ export function useBlockVariations(name) {
26
26
  const coreBlockStyles = getCoreBlockStyles(blockStyles);
27
27
  return coreBlockStyles;
28
28
  }
29
- export function VariationsPanel(_ref) {
30
- let {
31
- name
32
- } = _ref;
29
+ export function VariationsPanel({
30
+ name
31
+ }) {
33
32
  const coreBlockStyles = useBlockVariations(name);
34
33
  return createElement(ItemGroup, {
35
34
  isBordered: true,
36
35
  isSeparated: true
37
36
  }, coreBlockStyles.map((style, index) => {
38
- if (style !== null && style !== void 0 && style.isDefault) {
37
+ if (style?.isDefault) {
39
38
  return null;
40
39
  }
41
40
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/variations-panel.js"],"names":["store","blocksStore","useSelect","__experimentalItemGroup","ItemGroup","NavigationButtonAsItem","getCoreBlockStyles","blockStyles","filter","style","source","useBlockVariations","name","select","getBlockStyles","coreBlockStyles","VariationsPanel","map","index","isDefault","encodeURIComponent","label"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,uBAAuB,IAAIC,SAApC,QAAqD,uBAArD;AACA;AACA;AACA;;AAEA,SAASC,sBAAT,QAAuC,qBAAvC;;AAEA,SAASC,kBAAT,CAA6BC,WAA7B,EAA2C;AAC1C,SAAOA,WAAP,aAAOA,WAAP,uBAAOA,WAAW,CAAEC,MAAb,CAAuBC,KAAF,IAAaA,KAAK,CAACC,MAAN,KAAiB,OAAnD,CAAP;AACA;;AAED,OAAO,SAASC,kBAAT,CAA6BC,IAA7B,EAAoC;AAC1C,QAAML,WAAW,GAAGL,SAAS,CAC1BW,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAqBD,MAAM,CAAEZ,WAAF,CAAjC;AACA,WAAOa,cAAc,CAAEF,IAAF,CAArB;AACA,GAJ2B,EAK5B,CAAEA,IAAF,CAL4B,CAA7B;AAOA,QAAMG,eAAe,GAAGT,kBAAkB,CAAEC,WAAF,CAA1C;AACA,SAAOQ,eAAP;AACA;AAED,OAAO,SAASC,eAAT,OAAqC;AAAA,MAAX;AAAEJ,IAAAA;AAAF,GAAW;AAC3C,QAAMG,eAAe,GAAGJ,kBAAkB,CAAEC,IAAF,CAA1C;AAEA,SACC,cAAC,SAAD;AAAW,IAAA,UAAU,MAArB;AAAsB,IAAA,WAAW;AAAjC,KACGG,eAAe,CAACE,GAAhB,CAAqB,CAAER,KAAF,EAASS,KAAT,KAAoB;AAC1C,QAAKT,KAAL,aAAKA,KAAL,eAAKA,KAAK,CAAEU,SAAZ,EAAwB;AACvB,aAAO,IAAP;AACA;;AACD,WACC,cAAC,sBAAD;AACC,MAAA,GAAG,EAAGD,KADP;AAEC,MAAA,IAAI,EACH,aACAE,kBAAkB,CAAER,IAAF,CADlB,GAEA,cAFA,GAGAQ,kBAAkB,CAAEX,KAAK,CAACG,IAAR,CANpB;AAQC,oBAAaH,KAAK,CAACY;AARpB,OAUGZ,KAAK,CAACY,KAVT,CADD;AAcA,GAlBC,CADH,CADD;AAuBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\n/**\n * Internal dependencies\n */\n\nimport { NavigationButtonAsItem } from './navigation-button';\n\nfunction getCoreBlockStyles( blockStyles ) {\n\treturn blockStyles?.filter( ( style ) => style.source === 'block' );\n}\n\nexport function useBlockVariations( name ) {\n\tconst blockStyles = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\tconst coreBlockStyles = getCoreBlockStyles( blockStyles );\n\treturn coreBlockStyles;\n}\n\nexport function VariationsPanel( { name } ) {\n\tconst coreBlockStyles = useBlockVariations( name );\n\n\treturn (\n\t\t<ItemGroup isBordered isSeparated>\n\t\t\t{ coreBlockStyles.map( ( style, index ) => {\n\t\t\t\tif ( style?.isDefault ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tpath={\n\t\t\t\t\t\t\t'/blocks/' +\n\t\t\t\t\t\t\tencodeURIComponent( name ) +\n\t\t\t\t\t\t\t'/variations/' +\n\t\t\t\t\t\t\tencodeURIComponent( style.name )\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-label={ style.label }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ style.label }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ItemGroup>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/variations-panel.js"],"names":["store","blocksStore","useSelect","__experimentalItemGroup","ItemGroup","NavigationButtonAsItem","getCoreBlockStyles","blockStyles","filter","style","source","useBlockVariations","name","select","getBlockStyles","coreBlockStyles","VariationsPanel","map","index","isDefault","encodeURIComponent","label"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,uBAAuB,IAAIC,SAApC,QAAqD,uBAArD;AACA;AACA;AACA;;AAEA,SAASC,sBAAT,QAAuC,qBAAvC;;AAEA,SAASC,kBAAT,CAA6BC,WAA7B,EAA2C;AAC1C,SAAOA,WAAW,EAAEC,MAAb,CAAuBC,KAAF,IAAaA,KAAK,CAACC,MAAN,KAAiB,OAAnD,CAAP;AACA;;AAED,OAAO,SAASC,kBAAT,CAA6BC,IAA7B,EAAoC;AAC1C,QAAML,WAAW,GAAGL,SAAS,CAC1BW,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAqBD,MAAM,CAAEZ,WAAF,CAAjC;AACA,WAAOa,cAAc,CAAEF,IAAF,CAArB;AACA,GAJ2B,EAK5B,CAAEA,IAAF,CAL4B,CAA7B;AAOA,QAAMG,eAAe,GAAGT,kBAAkB,CAAEC,WAAF,CAA1C;AACA,SAAOQ,eAAP;AACA;AAED,OAAO,SAASC,eAAT,CAA0B;AAAEJ,EAAAA;AAAF,CAA1B,EAAqC;AAC3C,QAAMG,eAAe,GAAGJ,kBAAkB,CAAEC,IAAF,CAA1C;AAEA,SACC,cAAC,SAAD;AAAW,IAAA,UAAU,MAArB;AAAsB,IAAA,WAAW;AAAjC,KACGG,eAAe,CAACE,GAAhB,CAAqB,CAAER,KAAF,EAASS,KAAT,KAAoB;AAC1C,QAAKT,KAAK,EAAEU,SAAZ,EAAwB;AACvB,aAAO,IAAP;AACA;;AACD,WACC,cAAC,sBAAD;AACC,MAAA,GAAG,EAAGD,KADP;AAEC,MAAA,IAAI,EACH,aACAE,kBAAkB,CAAER,IAAF,CADlB,GAEA,cAFA,GAGAQ,kBAAkB,CAAEX,KAAK,CAACG,IAAR,CANpB;AAQC,oBAAaH,KAAK,CAACY;AARpB,OAUGZ,KAAK,CAACY,KAVT,CADD;AAcA,GAlBC,CADH,CADD;AAuBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\n/**\n * Internal dependencies\n */\n\nimport { NavigationButtonAsItem } from './navigation-button';\n\nfunction getCoreBlockStyles( blockStyles ) {\n\treturn blockStyles?.filter( ( style ) => style.source === 'block' );\n}\n\nexport function useBlockVariations( name ) {\n\tconst blockStyles = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\tconst coreBlockStyles = getCoreBlockStyles( blockStyles );\n\treturn coreBlockStyles;\n}\n\nexport function VariationsPanel( { name } ) {\n\tconst coreBlockStyles = useBlockVariations( name );\n\n\treturn (\n\t\t<ItemGroup isBordered isSeparated>\n\t\t\t{ coreBlockStyles.map( ( style, index ) => {\n\t\t\t\tif ( style?.isDefault ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tpath={\n\t\t\t\t\t\t\t'/blocks/' +\n\t\t\t\t\t\t\tencodeURIComponent( name ) +\n\t\t\t\t\t\t\t'/variations/' +\n\t\t\t\t\t\t\tencodeURIComponent( style.name )\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-label={ style.label }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ style.label }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ItemGroup>\n\t);\n}\n"]}
@@ -9,7 +9,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
9
9
  */
10
10
 
11
11
  import { store as editSiteStore } from '../../store';
12
- import { unlock } from '../../private-apis';
12
+ import { unlock } from '../../lock-unlock';
13
13
  const {
14
14
  useGlobalStylesOutput
15
15
  } = unlock(blockEditorPrivateApis);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles-renderer/index.js"],"names":["useEffect","useSelect","useDispatch","privateApis","blockEditorPrivateApis","store","editSiteStore","unlock","useGlobalStylesOutput","useGlobalStylesRenderer","styles","settings","getSettings","updateSettings","currentStoreSettings","nonGlobalStyles","Object","values","filter","style","isGlobalStyles","__experimentalFeatures","GlobalStylesRenderer"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,oBAA1B;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAA4BD,MAAM,CAAEH,sBAAF,CAAxC;;AAEA,SAASK,uBAAT,GAAmC;AAClC,QAAM,CAAEC,MAAF,EAAUC,QAAV,IAAuBH,qBAAqB,EAAlD;AACA,QAAM;AAAEI,IAAAA;AAAF,MAAkBX,SAAS,CAAEK,aAAF,CAAjC;AACA,QAAM;AAAEO,IAAAA;AAAF,MAAqBX,WAAW,CAAEI,aAAF,CAAtC;AAEAN,EAAAA,SAAS,CAAE,MAAM;AAAA;;AAChB,QAAK,CAAEU,MAAF,IAAY,CAAEC,QAAnB,EAA8B;AAC7B;AACA;;AAED,UAAMG,oBAAoB,GAAGF,WAAW,EAAxC;AACA,UAAMG,eAAe,GAAGC,MAAM,CAACC,MAAP,0BACvBH,oBAAoB,CAACJ,MADE,yEACQ,EADR,EAEtBQ,MAFsB,CAEZC,KAAF,IAAa,CAAEA,KAAK,CAACC,cAFP,CAAxB;AAGAP,IAAAA,cAAc,CAAE,EACf,GAAGC,oBADY;AAEfJ,MAAAA,MAAM,EAAE,CAAE,GAAGK,eAAL,EAAsB,GAAGL,MAAzB,CAFO;AAGfW,MAAAA,sBAAsB,EAAEV;AAHT,KAAF,CAAd;AAKA,GAdQ,EAcN,CAAED,MAAF,EAAUC,QAAV,CAdM,CAAT;AAeA;;AAED,OAAO,SAASW,oBAAT,GAAgC;AACtCb,EAAAA,uBAAuB;AAEvB,SAAO,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalStylesOutput } = unlock( blockEditorPrivateApis );\n\nfunction useGlobalStylesRenderer() {\n\tconst [ styles, settings ] = useGlobalStylesOutput();\n\tconst { getSettings } = useSelect( editSiteStore );\n\tconst { updateSettings } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif ( ! styles || ! settings ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentStoreSettings = getSettings();\n\t\tconst nonGlobalStyles = Object.values(\n\t\t\tcurrentStoreSettings.styles ?? []\n\t\t).filter( ( style ) => ! style.isGlobalStyles );\n\t\tupdateSettings( {\n\t\t\t...currentStoreSettings,\n\t\t\tstyles: [ ...nonGlobalStyles, ...styles ],\n\t\t\t__experimentalFeatures: settings,\n\t\t} );\n\t}, [ styles, settings ] );\n}\n\nexport function GlobalStylesRenderer() {\n\tuseGlobalStylesRenderer();\n\n\treturn null;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles-renderer/index.js"],"names":["useEffect","useSelect","useDispatch","privateApis","blockEditorPrivateApis","store","editSiteStore","unlock","useGlobalStylesOutput","useGlobalStylesRenderer","styles","settings","getSettings","updateSettings","currentStoreSettings","nonGlobalStyles","Object","values","filter","style","isGlobalStyles","__experimentalFeatures","GlobalStylesRenderer"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,oBAA1B;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,mBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAA4BD,MAAM,CAAEH,sBAAF,CAAxC;;AAEA,SAASK,uBAAT,GAAmC;AAClC,QAAM,CAAEC,MAAF,EAAUC,QAAV,IAAuBH,qBAAqB,EAAlD;AACA,QAAM;AAAEI,IAAAA;AAAF,MAAkBX,SAAS,CAAEK,aAAF,CAAjC;AACA,QAAM;AAAEO,IAAAA;AAAF,MAAqBX,WAAW,CAAEI,aAAF,CAAtC;AAEAN,EAAAA,SAAS,CAAE,MAAM;AAAA;;AAChB,QAAK,CAAEU,MAAF,IAAY,CAAEC,QAAnB,EAA8B;AAC7B;AACA;;AAED,UAAMG,oBAAoB,GAAGF,WAAW,EAAxC;AACA,UAAMG,eAAe,GAAGC,MAAM,CAACC,MAAP,0BACvBH,oBAAoB,CAACJ,MADE,yEACQ,EADR,EAEtBQ,MAFsB,CAEZC,KAAF,IAAa,CAAEA,KAAK,CAACC,cAFP,CAAxB;AAGAP,IAAAA,cAAc,CAAE,EACf,GAAGC,oBADY;AAEfJ,MAAAA,MAAM,EAAE,CAAE,GAAGK,eAAL,EAAsB,GAAGL,MAAzB,CAFO;AAGfW,MAAAA,sBAAsB,EAAEV;AAHT,KAAF,CAAd;AAKA,GAdQ,EAcN,CAAED,MAAF,EAAUC,QAAV,CAdM,CAAT;AAeA;;AAED,OAAO,SAASW,oBAAT,GAAgC;AACtCb,EAAAA,uBAAuB;AAEvB,SAAO,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStylesOutput } = unlock( blockEditorPrivateApis );\n\nfunction useGlobalStylesRenderer() {\n\tconst [ styles, settings ] = useGlobalStylesOutput();\n\tconst { getSettings } = useSelect( editSiteStore );\n\tconst { updateSettings } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif ( ! styles || ! settings ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentStoreSettings = getSettings();\n\t\tconst nonGlobalStyles = Object.values(\n\t\t\tcurrentStoreSettings.styles ?? []\n\t\t).filter( ( style ) => ! style.isGlobalStyles );\n\t\tupdateSettings( {\n\t\t\t...currentStoreSettings,\n\t\t\tstyles: [ ...nonGlobalStyles, ...styles ],\n\t\t\t__experimentalFeatures: settings,\n\t\t} );\n\t}, [ styles, settings ] );\n}\n\nexport function GlobalStylesRenderer() {\n\tuseGlobalStylesRenderer();\n\n\treturn null;\n}\n"]}