@wordpress/edit-site 5.24.1 → 5.25.1-next.79a6196f.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (652) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/LICENSE.md +1 -1
  3. package/build/components/add-new-template/add-custom-template-modal-content.js +2 -3
  4. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  5. package/build/components/block-editor/back-button.js +3 -2
  6. package/build/components/block-editor/back-button.js.map +1 -1
  7. package/build/components/block-editor/editor-canvas.js +48 -23
  8. package/build/components/block-editor/editor-canvas.js.map +1 -1
  9. package/build/components/block-editor/resizable-editor.js +2 -2
  10. package/build/components/block-editor/resizable-editor.js.map +1 -1
  11. package/build/components/block-editor/site-editor-canvas.js +5 -54
  12. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  13. package/build/components/block-editor/use-post-link-props.js +27 -0
  14. package/build/components/block-editor/use-post-link-props.js.map +1 -0
  15. package/build/components/block-editor/use-site-editor-settings.js +15 -23
  16. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  17. package/build/components/create-template-part-modal/index.js +15 -7
  18. package/build/components/create-template-part-modal/index.js.map +1 -1
  19. package/build/components/editor/index.js +21 -33
  20. package/build/components/editor/index.js.map +1 -1
  21. package/build/components/editor-canvas-container/index.js +9 -7
  22. package/build/components/editor-canvas-container/index.js.map +1 -1
  23. package/build/components/global-styles/font-library-modal/collection-font-variant.js +11 -7
  24. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  25. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
  26. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
  27. package/build/components/global-styles/font-library-modal/context.js +6 -6
  28. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  29. package/build/components/global-styles/font-library-modal/font-collection.js +8 -4
  30. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  31. package/build/components/global-styles/font-library-modal/index.js +38 -21
  32. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  33. package/build/components/global-styles/font-library-modal/installed-fonts.js +2 -2
  34. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  35. package/build/components/global-styles/font-library-modal/library-font-variant.js +11 -7
  36. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  37. package/build/components/global-styles/font-library-modal/local-fonts.js +26 -10
  38. package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  39. package/build/components/global-styles/font-library-modal/resolvers.js +6 -6
  40. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  41. package/build/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
  42. package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
  43. package/build/components/global-styles/font-library-modal/utils/index.js +35 -38
  44. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  45. package/build/components/global-styles/preview.js +43 -1
  46. package/build/components/global-styles/preview.js.map +1 -1
  47. package/build/components/global-styles/screen-color-palette.js +16 -12
  48. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  49. package/build/components/global-styles/screen-revisions/index.js +54 -58
  50. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  51. package/build/components/global-styles/screen-revisions/revisions-buttons.js +56 -15
  52. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  53. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
  54. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  55. package/build/components/global-styles/ui.js +13 -62
  56. package/build/components/global-styles/ui.js.map +1 -1
  57. package/build/components/header-edit-mode/document-tools/index.js +15 -106
  58. package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
  59. package/build/components/header-edit-mode/index.js +21 -47
  60. package/build/components/header-edit-mode/index.js.map +1 -1
  61. package/build/components/header-edit-mode/mode-switcher/index.js +0 -2
  62. package/build/components/header-edit-mode/mode-switcher/index.js.map +1 -1
  63. package/build/components/header-edit-mode/more-menu/index.js +19 -14
  64. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  65. package/build/components/keyboard-shortcuts/edit-mode.js +0 -23
  66. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  67. package/build/components/keyboard-shortcuts/register.js +0 -36
  68. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  69. package/build/components/layout/index.js +15 -21
  70. package/build/components/layout/index.js.map +1 -1
  71. package/build/components/page/header.js +2 -1
  72. package/build/components/page/header.js.map +1 -1
  73. package/build/components/page-main/index.js +4 -4
  74. package/build/components/page-main/index.js.map +1 -1
  75. package/build/components/page-pages/index.js +102 -52
  76. package/build/components/page-pages/index.js.map +1 -1
  77. package/build/components/page-patterns/dataviews-pattern-actions.js +305 -0
  78. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
  79. package/build/components/page-patterns/dataviews-patterns.js +307 -0
  80. package/build/components/page-patterns/dataviews-patterns.js.map +1 -0
  81. package/build/components/page-patterns/duplicate-menu-item.js +1 -1
  82. package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
  83. package/build/components/page-patterns/grid-item.js +4 -3
  84. package/build/components/page-patterns/grid-item.js.map +1 -1
  85. package/build/components/page-patterns/patterns-list.js +3 -3
  86. package/build/components/page-patterns/patterns-list.js.map +1 -1
  87. package/build/components/page-patterns/rename-menu-item.js +3 -0
  88. package/build/components/page-patterns/rename-menu-item.js.map +1 -1
  89. package/build/components/page-patterns/use-patterns.js +23 -13
  90. package/build/components/page-patterns/use-patterns.js.map +1 -1
  91. package/build/components/page-templates/index.js +312 -36
  92. package/build/components/page-templates/index.js.map +1 -1
  93. package/build/components/{page-patterns/pagination.js → pagination/index.js} +25 -12
  94. package/build/components/pagination/index.js.map +1 -0
  95. package/build/components/{page-pages/side-editor.js → post-preview/index.js} +8 -4
  96. package/build/components/post-preview/index.js.map +1 -0
  97. package/build/components/preferences-modal/enable-feature.js +3 -2
  98. package/build/components/preferences-modal/enable-feature.js.map +1 -1
  99. package/build/components/preferences-modal/enable-panel-option.js +33 -0
  100. package/build/components/preferences-modal/enable-panel-option.js.map +1 -0
  101. package/build/components/preferences-modal/index.js +89 -25
  102. package/build/components/preferences-modal/index.js.map +1 -1
  103. package/build/components/revisions/index.js +3 -7
  104. package/build/components/revisions/index.js.map +1 -1
  105. package/build/components/routes/link.js +6 -2
  106. package/build/components/routes/link.js.map +1 -1
  107. package/build/components/routes/use-title.js +3 -4
  108. package/build/components/routes/use-title.js.map +1 -1
  109. package/build/components/save-button/index.js +8 -4
  110. package/build/components/save-button/index.js.map +1 -1
  111. package/build/components/sidebar/index.js +26 -20
  112. package/build/components/sidebar/index.js.map +1 -1
  113. package/build/components/sidebar-dataviews/add-new-view.js +2 -2
  114. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  115. package/build/components/sidebar-dataviews/dataview-item.js +2 -10
  116. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  117. package/build/components/sidebar-dataviews/default-views.js +19 -6
  118. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  119. package/build/components/sidebar-dataviews/index.js +3 -3
  120. package/build/components/sidebar-dataviews/index.js.map +1 -1
  121. package/build/components/sidebar-edit-mode/default-sidebar.js +1 -5
  122. package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  123. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +62 -10
  124. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  125. package/build/components/sidebar-edit-mode/page-panels/index.js +10 -4
  126. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  127. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +1 -2
  128. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  129. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
  130. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  131. package/build/components/sidebar-edit-mode/template-panel/index.js +4 -13
  132. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  133. package/build/components/sidebar-navigation-screen-details-footer/index.js +1 -1
  134. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  135. package/build/components/sidebar-navigation-screen-global-styles/index.js +5 -2
  136. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  137. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -0
  138. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  139. package/build/components/sidebar-navigation-screen-page/index.js +4 -1
  140. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  141. package/build/components/sidebar-navigation-screen-pages-dataviews/index.js +69 -0
  142. package/build/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
  143. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
  144. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  145. package/build/components/sidebar-navigation-screen-template/home-template-details.js +3 -89
  146. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  147. package/build/components/sidebar-navigation-screen-template/index.js +2 -1
  148. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  149. package/build/components/sidebar-navigation-screen-template/template-areas.js +117 -0
  150. package/build/components/sidebar-navigation-screen-template/template-areas.js.map +1 -0
  151. package/build/components/sidebar-navigation-screen-templates/index.js +63 -8
  152. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  153. package/build/components/site-hub/index.js +6 -3
  154. package/build/components/site-hub/index.js.map +1 -1
  155. package/build/components/style-book/index.js +38 -8
  156. package/build/components/style-book/index.js.map +1 -1
  157. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
  158. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  159. package/build/components/template-actions/rename-menu-item.js +3 -0
  160. package/build/components/template-actions/rename-menu-item.js.map +1 -1
  161. package/build/components/welcome-guide/styles.js +1 -1
  162. package/build/components/welcome-guide/styles.js.map +1 -1
  163. package/build/hooks/commands/use-common-commands.js +9 -1
  164. package/build/hooks/commands/use-common-commands.js.map +1 -1
  165. package/build/hooks/commands/use-edit-mode-commands.js +11 -6
  166. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  167. package/build/hooks/navigation-menu-edit.js +1 -1
  168. package/build/hooks/navigation-menu-edit.js.map +1 -1
  169. package/build/hooks/template-part-edit.js +1 -1
  170. package/build/hooks/template-part-edit.js.map +1 -1
  171. package/build/index.js +12 -7
  172. package/build/index.js.map +1 -1
  173. package/build/store/actions.js +54 -52
  174. package/build/store/actions.js.map +1 -1
  175. package/build/store/private-actions.js +6 -2
  176. package/build/store/private-actions.js.map +1 -1
  177. package/build/store/reducer.js +0 -64
  178. package/build/store/reducer.js.map +1 -1
  179. package/build/store/selectors.js +44 -47
  180. package/build/store/selectors.js.map +1 -1
  181. package/build/utils/constants.js +15 -1
  182. package/build/utils/constants.js.map +1 -1
  183. package/build/utils/get-is-list-page.js +1 -1
  184. package/build/utils/get-is-list-page.js.map +1 -1
  185. package/build-module/components/add-new-template/add-custom-template-modal-content.js +1 -1
  186. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  187. package/build-module/components/block-editor/back-button.js +4 -3
  188. package/build-module/components/block-editor/back-button.js.map +1 -1
  189. package/build-module/components/block-editor/editor-canvas.js +50 -25
  190. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  191. package/build-module/components/block-editor/resizable-editor.js +2 -2
  192. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  193. package/build-module/components/block-editor/site-editor-canvas.js +8 -56
  194. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  195. package/build-module/components/block-editor/use-post-link-props.js +20 -0
  196. package/build-module/components/block-editor/use-post-link-props.js.map +1 -0
  197. package/build-module/components/block-editor/use-site-editor-settings.js +16 -24
  198. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  199. package/build-module/components/create-template-part-modal/index.js +14 -7
  200. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  201. package/build-module/components/editor/index.js +25 -37
  202. package/build-module/components/editor/index.js.map +1 -1
  203. package/build-module/components/editor-canvas-container/index.js +9 -7
  204. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  205. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +13 -8
  206. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  207. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
  208. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
  209. package/build-module/components/global-styles/font-library-modal/context.js +8 -8
  210. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  211. package/build-module/components/global-styles/font-library-modal/font-collection.js +8 -4
  212. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  213. package/build-module/components/global-styles/font-library-modal/index.js +39 -22
  214. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  215. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +2 -2
  216. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  217. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +13 -8
  218. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  219. package/build-module/components/global-styles/font-library-modal/local-fonts.js +27 -11
  220. package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  221. package/build-module/components/global-styles/font-library-modal/resolvers.js +5 -5
  222. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  223. package/build-module/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
  224. package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
  225. package/build-module/components/global-styles/font-library-modal/utils/index.js +34 -36
  226. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  227. package/build-module/components/global-styles/preview.js +45 -3
  228. package/build-module/components/global-styles/preview.js.map +1 -1
  229. package/build-module/components/global-styles/screen-color-palette.js +17 -13
  230. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  231. package/build-module/components/global-styles/screen-revisions/index.js +55 -59
  232. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  233. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +56 -15
  234. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  235. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
  236. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  237. package/build-module/components/global-styles/ui.js +15 -64
  238. package/build-module/components/global-styles/ui.js.map +1 -1
  239. package/build-module/components/header-edit-mode/document-tools/index.js +19 -109
  240. package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
  241. package/build-module/components/header-edit-mode/index.js +25 -51
  242. package/build-module/components/header-edit-mode/index.js.map +1 -1
  243. package/build-module/components/header-edit-mode/mode-switcher/index.js +0 -2
  244. package/build-module/components/header-edit-mode/mode-switcher/index.js.map +1 -1
  245. package/build-module/components/header-edit-mode/more-menu/index.js +20 -15
  246. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  247. package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -23
  248. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  249. package/build-module/components/keyboard-shortcuts/register.js +0 -36
  250. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  251. package/build-module/components/layout/index.js +15 -21
  252. package/build-module/components/layout/index.js.map +1 -1
  253. package/build-module/components/page/header.js +2 -1
  254. package/build-module/components/page/header.js.map +1 -1
  255. package/build-module/components/page-main/index.js +4 -4
  256. package/build-module/components/page-main/index.js.map +1 -1
  257. package/build-module/components/page-pages/index.js +101 -51
  258. package/build-module/components/page-pages/index.js.map +1 -1
  259. package/build-module/components/page-patterns/dataviews-pattern-actions.js +292 -0
  260. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
  261. package/build-module/components/page-patterns/dataviews-patterns.js +299 -0
  262. package/build-module/components/page-patterns/dataviews-patterns.js.map +1 -0
  263. package/build-module/components/page-patterns/duplicate-menu-item.js +1 -1
  264. package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -1
  265. package/build-module/components/page-patterns/grid-item.js +4 -3
  266. package/build-module/components/page-patterns/grid-item.js.map +1 -1
  267. package/build-module/components/page-patterns/patterns-list.js +3 -3
  268. package/build-module/components/page-patterns/patterns-list.js.map +1 -1
  269. package/build-module/components/page-patterns/rename-menu-item.js +3 -0
  270. package/build-module/components/page-patterns/rename-menu-item.js.map +1 -1
  271. package/build-module/components/page-patterns/use-patterns.js +23 -13
  272. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  273. package/build-module/components/page-templates/index.js +314 -38
  274. package/build-module/components/page-templates/index.js.map +1 -1
  275. package/build-module/components/{page-patterns/pagination.js → pagination/index.js} +24 -12
  276. package/build-module/components/pagination/index.js.map +1 -0
  277. package/build-module/components/{page-pages/side-editor.js → post-preview/index.js} +7 -3
  278. package/build-module/components/post-preview/index.js.map +1 -0
  279. package/build-module/components/preferences-modal/enable-feature.js +3 -2
  280. package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
  281. package/build-module/components/preferences-modal/enable-panel-option.js +26 -0
  282. package/build-module/components/preferences-modal/enable-panel-option.js.map +1 -0
  283. package/build-module/components/preferences-modal/index.js +90 -26
  284. package/build-module/components/preferences-modal/index.js.map +1 -1
  285. package/build-module/components/revisions/index.js +4 -8
  286. package/build-module/components/revisions/index.js.map +1 -1
  287. package/build-module/components/routes/link.js +5 -2
  288. package/build-module/components/routes/link.js.map +1 -1
  289. package/build-module/components/routes/use-title.js +3 -4
  290. package/build-module/components/routes/use-title.js.map +1 -1
  291. package/build-module/components/save-button/index.js +8 -4
  292. package/build-module/components/save-button/index.js.map +1 -1
  293. package/build-module/components/sidebar/index.js +26 -20
  294. package/build-module/components/sidebar/index.js.map +1 -1
  295. package/build-module/components/sidebar-dataviews/add-new-view.js +1 -1
  296. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  297. package/build-module/components/sidebar-dataviews/dataview-item.js +2 -10
  298. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  299. package/build-module/components/sidebar-dataviews/default-views.js +17 -5
  300. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  301. package/build-module/components/sidebar-dataviews/index.js +2 -2
  302. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  303. package/build-module/components/sidebar-edit-mode/default-sidebar.js +1 -5
  304. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  305. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +64 -12
  306. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  307. package/build-module/components/sidebar-edit-mode/page-panels/index.js +10 -4
  308. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  309. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +2 -3
  310. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  311. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
  312. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  313. package/build-module/components/sidebar-edit-mode/template-panel/index.js +6 -15
  314. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  315. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +1 -1
  316. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  317. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +5 -2
  318. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  319. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -0
  320. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  321. package/build-module/components/sidebar-navigation-screen-page/index.js +4 -1
  322. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  323. package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js +61 -0
  324. package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
  325. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
  326. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  327. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +5 -90
  328. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  329. package/build-module/components/sidebar-navigation-screen-template/index.js +2 -1
  330. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  331. package/build-module/components/sidebar-navigation-screen-template/template-areas.js +109 -0
  332. package/build-module/components/sidebar-navigation-screen-template/template-areas.js.map +1 -0
  333. package/build-module/components/sidebar-navigation-screen-templates/index.js +64 -9
  334. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  335. package/build-module/components/site-hub/index.js +6 -3
  336. package/build-module/components/site-hub/index.js.map +1 -1
  337. package/build-module/components/style-book/index.js +40 -10
  338. package/build-module/components/style-book/index.js.map +1 -1
  339. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
  340. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  341. package/build-module/components/template-actions/rename-menu-item.js +3 -0
  342. package/build-module/components/template-actions/rename-menu-item.js.map +1 -1
  343. package/build-module/components/welcome-guide/styles.js +1 -1
  344. package/build-module/components/welcome-guide/styles.js.map +1 -1
  345. package/build-module/hooks/commands/use-common-commands.js +9 -1
  346. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  347. package/build-module/hooks/commands/use-edit-mode-commands.js +11 -6
  348. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  349. package/build-module/hooks/navigation-menu-edit.js +1 -1
  350. package/build-module/hooks/navigation-menu-edit.js.map +1 -1
  351. package/build-module/hooks/template-part-edit.js +1 -1
  352. package/build-module/hooks/template-part-edit.js.map +1 -1
  353. package/build-module/index.js +12 -7
  354. package/build-module/index.js.map +1 -1
  355. package/build-module/store/actions.js +49 -47
  356. package/build-module/store/actions.js.map +1 -1
  357. package/build-module/store/private-actions.js +6 -2
  358. package/build-module/store/private-actions.js.map +1 -1
  359. package/build-module/store/reducer.js +0 -61
  360. package/build-module/store/reducer.js.map +1 -1
  361. package/build-module/store/selectors.js +40 -41
  362. package/build-module/store/selectors.js.map +1 -1
  363. package/build-module/utils/constants.js +8 -0
  364. package/build-module/utils/constants.js.map +1 -1
  365. package/build-module/utils/get-is-list-page.js +1 -1
  366. package/build-module/utils/get-is-list-page.js.map +1 -1
  367. package/build-style/style-rtl.css +607 -561
  368. package/build-style/style.css +607 -561
  369. package/package.json +42 -42
  370. package/src/components/add-new-template/add-custom-template-modal-content.js +1 -1
  371. package/src/components/add-new-template/style.scss +2 -1
  372. package/src/components/block-editor/back-button.js +4 -2
  373. package/src/components/block-editor/editor-canvas.js +63 -47
  374. package/src/components/block-editor/resizable-editor.js +1 -1
  375. package/src/components/block-editor/site-editor-canvas.js +32 -96
  376. package/src/components/block-editor/style.scss +7 -14
  377. package/src/components/block-editor/use-post-link-props.js +20 -0
  378. package/src/components/block-editor/use-site-editor-settings.js +38 -58
  379. package/src/components/code-editor/style.scss +0 -4
  380. package/src/components/create-template-part-modal/index.js +83 -82
  381. package/src/components/editor/index.js +34 -47
  382. package/src/components/editor-canvas-container/index.js +8 -6
  383. package/src/components/global-styles/font-library-modal/collection-font-variant.js +18 -7
  384. package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
  385. package/src/components/global-styles/font-library-modal/context.js +8 -8
  386. package/src/components/global-styles/font-library-modal/font-collection.js +10 -5
  387. package/src/components/global-styles/font-library-modal/index.js +44 -24
  388. package/src/components/global-styles/font-library-modal/installed-fonts.js +3 -3
  389. package/src/components/global-styles/font-library-modal/library-font-variant.js +18 -7
  390. package/src/components/global-styles/font-library-modal/local-fonts.js +53 -26
  391. package/src/components/global-styles/font-library-modal/resolvers.js +5 -5
  392. package/src/components/global-styles/font-library-modal/style.scss +5 -2
  393. package/src/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +9 -3
  394. package/src/components/global-styles/font-library-modal/utils/index.js +21 -23
  395. package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamily.spec.js +58 -0
  396. package/src/components/global-styles/preview.js +55 -3
  397. package/src/components/global-styles/screen-color-palette.js +16 -26
  398. package/src/components/global-styles/screen-revisions/index.js +93 -101
  399. package/src/components/global-styles/screen-revisions/revisions-buttons.js +85 -17
  400. package/src/components/global-styles/screen-revisions/style.scss +86 -21
  401. package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +67 -0
  402. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +73 -46
  403. package/src/components/global-styles/ui.js +13 -74
  404. package/src/components/header-edit-mode/document-tools/index.js +35 -167
  405. package/src/components/header-edit-mode/index.js +33 -78
  406. package/src/components/header-edit-mode/mode-switcher/index.js +0 -4
  407. package/src/components/header-edit-mode/more-menu/index.js +25 -27
  408. package/src/components/header-edit-mode/style.scss +46 -68
  409. package/src/components/keyboard-shortcuts/edit-mode.js +1 -26
  410. package/src/components/keyboard-shortcuts/register.js +0 -43
  411. package/src/components/layout/index.js +29 -47
  412. package/src/components/layout/style.scss +10 -3
  413. package/src/components/page/header.js +2 -1
  414. package/src/components/page/style.scss +3 -3
  415. package/src/components/page-main/index.js +8 -8
  416. package/src/components/page-pages/index.js +157 -62
  417. package/src/components/page-pages/style.scss +4 -1
  418. package/src/components/page-patterns/dataviews-pattern-actions.js +329 -0
  419. package/src/components/page-patterns/dataviews-patterns.js +380 -0
  420. package/src/components/page-patterns/duplicate-menu-item.js +1 -1
  421. package/src/components/page-patterns/grid-item.js +3 -2
  422. package/src/components/page-patterns/patterns-list.js +7 -3
  423. package/src/components/page-patterns/rename-menu-item.js +7 -1
  424. package/src/components/page-patterns/style.scss +89 -26
  425. package/src/components/page-patterns/use-patterns.js +24 -15
  426. package/src/components/page-templates/index.js +399 -64
  427. package/src/components/{page-patterns/pagination.js → pagination/index.js} +21 -10
  428. package/src/components/pagination/style.scss +5 -0
  429. package/src/components/post-preview/index.js +16 -0
  430. package/src/components/preferences-modal/enable-feature.js +9 -5
  431. package/src/components/preferences-modal/enable-panel-option.js +23 -0
  432. package/src/components/preferences-modal/index.js +151 -40
  433. package/src/components/revisions/index.js +8 -15
  434. package/src/components/routes/link.js +11 -3
  435. package/src/components/routes/use-title.js +3 -10
  436. package/src/components/save-button/index.js +17 -3
  437. package/src/components/sidebar/index.js +45 -35
  438. package/src/components/sidebar/style.scss +10 -12
  439. package/src/components/sidebar-dataviews/add-new-view.js +1 -1
  440. package/src/components/sidebar-dataviews/dataview-item.js +3 -7
  441. package/src/components/sidebar-dataviews/default-views.js +23 -6
  442. package/src/components/sidebar-dataviews/index.js +2 -2
  443. package/src/components/sidebar-edit-mode/default-sidebar.js +0 -12
  444. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +85 -14
  445. package/src/components/sidebar-edit-mode/page-panels/index.js +53 -25
  446. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +2 -2
  447. package/src/components/sidebar-edit-mode/page-panels/style.scss +1 -42
  448. package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -12
  449. package/src/components/sidebar-edit-mode/style.scss +0 -10
  450. package/src/components/sidebar-edit-mode/template-panel/index.js +44 -40
  451. package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -4
  452. package/src/components/sidebar-navigation-screen-details-footer/index.js +1 -1
  453. package/src/components/sidebar-navigation-screen-global-styles/index.js +3 -2
  454. package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +7 -1
  455. package/src/components/sidebar-navigation-screen-page/index.js +2 -1
  456. package/src/components/sidebar-navigation-screen-pages-dataviews/index.js +77 -0
  457. package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
  458. package/src/components/sidebar-navigation-screen-template/home-template-details.js +1 -96
  459. package/src/components/sidebar-navigation-screen-template/index.js +8 -2
  460. package/src/components/sidebar-navigation-screen-template/template-areas.js +135 -0
  461. package/src/components/sidebar-navigation-screen-templates/index.js +85 -28
  462. package/src/components/sidebar-navigation-screen-templates/style.scss +9 -0
  463. package/src/components/site-hub/index.js +4 -5
  464. package/src/components/site-hub/style.scss +5 -2
  465. package/src/components/style-book/index.js +65 -21
  466. package/src/components/style-book/style.scss +3 -3
  467. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +4 -1
  468. package/src/components/template-actions/rename-menu-item.js +7 -1
  469. package/src/components/welcome-guide/styles.js +1 -1
  470. package/src/hooks/commands/use-common-commands.js +10 -5
  471. package/src/hooks/commands/use-edit-mode-commands.js +8 -12
  472. package/src/hooks/navigation-menu-edit.js +1 -1
  473. package/src/hooks/template-part-edit.js +1 -1
  474. package/src/index.js +11 -5
  475. package/src/store/actions.js +50 -50
  476. package/src/store/private-actions.js +7 -3
  477. package/src/store/reducer.js +0 -62
  478. package/src/store/selectors.js +47 -41
  479. package/src/store/test/actions.js +11 -39
  480. package/src/store/test/reducer.js +1 -82
  481. package/src/store/test/selectors.js +0 -24
  482. package/src/style.scss +3 -3
  483. package/src/utils/constants.js +8 -0
  484. package/src/utils/get-is-list-page.js +2 -3
  485. package/build/components/dataviews/add-filter.js +0 -91
  486. package/build/components/dataviews/add-filter.js.map +0 -1
  487. package/build/components/dataviews/constants.js +0 -14
  488. package/build/components/dataviews/constants.js.map +0 -1
  489. package/build/components/dataviews/dataviews.js +0 -99
  490. package/build/components/dataviews/dataviews.js.map +0 -1
  491. package/build/components/dataviews/filter-summary.js +0 -62
  492. package/build/components/dataviews/filter-summary.js.map +0 -1
  493. package/build/components/dataviews/filters.js +0 -63
  494. package/build/components/dataviews/filters.js.map +0 -1
  495. package/build/components/dataviews/index.js +0 -21
  496. package/build/components/dataviews/index.js.map +0 -1
  497. package/build/components/dataviews/item-actions.js +0 -184
  498. package/build/components/dataviews/item-actions.js.map +0 -1
  499. package/build/components/dataviews/pagination.js +0 -123
  500. package/build/components/dataviews/pagination.js.map +0 -1
  501. package/build/components/dataviews/reset-filters.js +0 -33
  502. package/build/components/dataviews/reset-filters.js.map +0 -1
  503. package/build/components/dataviews/search.js +0 -51
  504. package/build/components/dataviews/search.js.map +0 -1
  505. package/build/components/dataviews/view-actions.js +0 -244
  506. package/build/components/dataviews/view-actions.js.map +0 -1
  507. package/build/components/dataviews/view-grid.js +0 -82
  508. package/build/components/dataviews/view-grid.js.map +0 -1
  509. package/build/components/dataviews/view-list.js +0 -399
  510. package/build/components/dataviews/view-list.js.map +0 -1
  511. package/build/components/dataviews/view-side-by-side.js +0 -20
  512. package/build/components/dataviews/view-side-by-side.js.map +0 -1
  513. package/build/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
  514. package/build/components/header-edit-mode/document-actions/index.js +0 -172
  515. package/build/components/header-edit-mode/document-actions/index.js.map +0 -1
  516. package/build/components/header-edit-mode/undo-redo/redo.js +0 -41
  517. package/build/components/header-edit-mode/undo-redo/redo.js.map +0 -1
  518. package/build/components/header-edit-mode/undo-redo/undo.js +0 -40
  519. package/build/components/header-edit-mode/undo-redo/undo.js.map +0 -1
  520. package/build/components/page-content-focus-notifications/back-to-page-notification.js +0 -61
  521. package/build/components/page-content-focus-notifications/back-to-page-notification.js.map +0 -1
  522. package/build/components/page-content-focus-notifications/edit-template-notification.js +0 -102
  523. package/build/components/page-content-focus-notifications/edit-template-notification.js.map +0 -1
  524. package/build/components/page-content-focus-notifications/index.js +0 -22
  525. package/build/components/page-content-focus-notifications/index.js.map +0 -1
  526. package/build/components/page-pages/side-editor.js.map +0 -1
  527. package/build/components/page-patterns/pagination.js.map +0 -1
  528. package/build/components/page-templates/dataviews-templates.js +0 -316
  529. package/build/components/page-templates/dataviews-templates.js.map +0 -1
  530. package/build/components/secondary-sidebar/inserter-sidebar.js +0 -60
  531. package/build/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
  532. package/build/components/secondary-sidebar/list-view-sidebar.js +0 -109
  533. package/build/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
  534. package/build/components/sidebar-edit-mode/page-panels/edit-template.js +0 -101
  535. package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +0 -1
  536. package/build/components/sidebar-edit-mode/page-panels/hooks.js +0 -79
  537. package/build/components/sidebar-edit-mode/page-panels/hooks.js.map +0 -1
  538. package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js +0 -48
  539. package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +0 -1
  540. package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js +0 -84
  541. package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +0 -1
  542. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -35
  543. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
  544. package/build/components/sidebar-edit-mode/template-panel/last-revision.js +0 -73
  545. package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
  546. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -219
  547. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
  548. package/build/utils/use-debounced-input.js +0 -22
  549. package/build/utils/use-debounced-input.js.map +0 -1
  550. package/build-module/components/dataviews/add-filter.js +0 -84
  551. package/build-module/components/dataviews/add-filter.js.map +0 -1
  552. package/build-module/components/dataviews/constants.js +0 -6
  553. package/build-module/components/dataviews/constants.js.map +0 -1
  554. package/build-module/components/dataviews/dataviews.js +0 -90
  555. package/build-module/components/dataviews/dataviews.js.map +0 -1
  556. package/build-module/components/dataviews/filter-summary.js +0 -55
  557. package/build-module/components/dataviews/filter-summary.js.map +0 -1
  558. package/build-module/components/dataviews/filters.js +0 -55
  559. package/build-module/components/dataviews/filters.js.map +0 -1
  560. package/build-module/components/dataviews/index.js +0 -2
  561. package/build-module/components/dataviews/index.js.map +0 -1
  562. package/build-module/components/dataviews/item-actions.js +0 -177
  563. package/build-module/components/dataviews/item-actions.js.map +0 -1
  564. package/build-module/components/dataviews/pagination.js +0 -115
  565. package/build-module/components/dataviews/pagination.js.map +0 -1
  566. package/build-module/components/dataviews/reset-filters.js +0 -26
  567. package/build-module/components/dataviews/reset-filters.js.map +0 -1
  568. package/build-module/components/dataviews/search.js +0 -43
  569. package/build-module/components/dataviews/search.js.map +0 -1
  570. package/build-module/components/dataviews/view-actions.js +0 -237
  571. package/build-module/components/dataviews/view-actions.js.map +0 -1
  572. package/build-module/components/dataviews/view-grid.js +0 -74
  573. package/build-module/components/dataviews/view-grid.js.map +0 -1
  574. package/build-module/components/dataviews/view-list.js +0 -390
  575. package/build-module/components/dataviews/view-list.js.map +0 -1
  576. package/build-module/components/dataviews/view-side-by-side.js +0 -12
  577. package/build-module/components/dataviews/view-side-by-side.js.map +0 -1
  578. package/build-module/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
  579. package/build-module/components/header-edit-mode/document-actions/index.js +0 -164
  580. package/build-module/components/header-edit-mode/document-actions/index.js.map +0 -1
  581. package/build-module/components/header-edit-mode/undo-redo/redo.js +0 -33
  582. package/build-module/components/header-edit-mode/undo-redo/redo.js.map +0 -1
  583. package/build-module/components/header-edit-mode/undo-redo/undo.js +0 -32
  584. package/build-module/components/header-edit-mode/undo-redo/undo.js.map +0 -1
  585. package/build-module/components/page-content-focus-notifications/back-to-page-notification.js +0 -54
  586. package/build-module/components/page-content-focus-notifications/back-to-page-notification.js.map +0 -1
  587. package/build-module/components/page-content-focus-notifications/edit-template-notification.js +0 -96
  588. package/build-module/components/page-content-focus-notifications/edit-template-notification.js.map +0 -1
  589. package/build-module/components/page-content-focus-notifications/index.js +0 -14
  590. package/build-module/components/page-content-focus-notifications/index.js.map +0 -1
  591. package/build-module/components/page-pages/side-editor.js.map +0 -1
  592. package/build-module/components/page-patterns/pagination.js.map +0 -1
  593. package/build-module/components/page-templates/dataviews-templates.js +0 -308
  594. package/build-module/components/page-templates/dataviews-templates.js.map +0 -1
  595. package/build-module/components/secondary-sidebar/inserter-sidebar.js +0 -53
  596. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
  597. package/build-module/components/secondary-sidebar/list-view-sidebar.js +0 -102
  598. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
  599. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +0 -93
  600. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +0 -1
  601. package/build-module/components/sidebar-edit-mode/page-panels/hooks.js +0 -69
  602. package/build-module/components/sidebar-edit-mode/page-panels/hooks.js.map +0 -1
  603. package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js +0 -41
  604. package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +0 -1
  605. package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js +0 -77
  606. package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +0 -1
  607. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -27
  608. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
  609. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +0 -65
  610. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
  611. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -209
  612. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
  613. package/build-module/utils/use-debounced-input.js +0 -15
  614. package/build-module/utils/use-debounced-input.js.map +0 -1
  615. package/src/components/dataviews/README.md +0 -191
  616. package/src/components/dataviews/add-filter.js +0 -108
  617. package/src/components/dataviews/constants.js +0 -5
  618. package/src/components/dataviews/dataviews.js +0 -99
  619. package/src/components/dataviews/filter-summary.js +0 -79
  620. package/src/components/dataviews/filters.js +0 -65
  621. package/src/components/dataviews/index.js +0 -1
  622. package/src/components/dataviews/item-actions.js +0 -208
  623. package/src/components/dataviews/pagination.js +0 -144
  624. package/src/components/dataviews/reset-filters.js +0 -26
  625. package/src/components/dataviews/search.js +0 -42
  626. package/src/components/dataviews/style.scss +0 -131
  627. package/src/components/dataviews/view-actions.js +0 -319
  628. package/src/components/dataviews/view-grid.js +0 -90
  629. package/src/components/dataviews/view-list.js +0 -512
  630. package/src/components/dataviews/view-side-by-side.js +0 -9
  631. package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +0 -62
  632. package/src/components/global-styles/font-library-modal/utils/test/wpKebabCase.spec.js +0 -28
  633. package/src/components/header-edit-mode/document-actions/index.js +0 -204
  634. package/src/components/header-edit-mode/document-actions/style.scss +0 -145
  635. package/src/components/header-edit-mode/undo-redo/redo.js +0 -38
  636. package/src/components/header-edit-mode/undo-redo/undo.js +0 -34
  637. package/src/components/page-content-focus-notifications/back-to-page-notification.js +0 -58
  638. package/src/components/page-content-focus-notifications/edit-template-notification.js +0 -104
  639. package/src/components/page-content-focus-notifications/index.js +0 -14
  640. package/src/components/page-pages/side-editor.js +0 -14
  641. package/src/components/page-templates/dataviews-templates.js +0 -345
  642. package/src/components/secondary-sidebar/inserter-sidebar.js +0 -66
  643. package/src/components/secondary-sidebar/list-view-sidebar.js +0 -123
  644. package/src/components/secondary-sidebar/style.scss +0 -65
  645. package/src/components/sidebar-edit-mode/page-panels/edit-template.js +0 -108
  646. package/src/components/sidebar-edit-mode/page-panels/hooks.js +0 -99
  647. package/src/components/sidebar-edit-mode/page-panels/reset-default-template.js +0 -45
  648. package/src/components/sidebar-edit-mode/page-panels/swap-template-button.js +0 -83
  649. package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -26
  650. package/src/components/sidebar-edit-mode/template-panel/last-revision.js +0 -82
  651. package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -279
  652. package/src/utils/use-debounced-input.js +0 -18
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_i18n","_components","_date","_coreData","_data","DAY_IN_MILLISECONDS","getRevisionLabel","id","isLatest","authorDisplayName","formattedModifiedDate","__","sprintf","RevisionsButtons","userRevisions","selectedRevisionId","onChange","currentThemeName","currentUser","useSelect","select","getCurrentTheme","getCurrentUser","coreStore","currentTheme","name","rendered","stylesheet","dateNowInMs","getDate","getTime","date","dateFormat","datetimeAbbreviated","getSettings","formats","_react","createElement","className","role","map","revision","index","author","modified","isUnsaved","revisionAuthor","authorAvatar","avatar_urls","isSelected","isReset","modifiedDate","displayDate","dateI18n","humanTimeDiff","revisionLabel","classnames","key","Button","disabled","onClick","label","dateTime","alt","src","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/revisions-buttons.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nconst DAY_IN_MILLISECONDS = 60 * 60 * 1000 * 24;\n\n/**\n * Returns a button label for the revision.\n *\n * @param {string|number} id A revision object.\n * @param {boolean} isLatest Whether the revision is the most current.\n * @param {string} authorDisplayName Author name.\n * @param {string} formattedModifiedDate Revision modified date formatted.\n * @return {string} Translated label.\n */\nfunction getRevisionLabel(\n\tid,\n\tisLatest,\n\tauthorDisplayName,\n\tformattedModifiedDate\n) {\n\tif ( 'parent' === id ) {\n\t\treturn __( 'Reset the styles to the theme defaults' );\n\t}\n\n\tif ( 'unsaved' === id ) {\n\t\treturn sprintf(\n\t\t\t/* translators: %s author display name */\n\t\t\t__( 'Unsaved changes by %s' ),\n\t\t\tauthorDisplayName\n\t\t);\n\t}\n\n\treturn isLatest\n\t\t? sprintf(\n\t\t\t\t/* translators: %1$s author display name, %2$s: revision creation date */\n\t\t\t\t__( 'Changes saved by %1$s on %2$s (current)' ),\n\t\t\t\tauthorDisplayName,\n\t\t\t\tformattedModifiedDate\n\t\t )\n\t\t: sprintf(\n\t\t\t\t/* translators: %1$s author display name, %2$s: revision creation date */\n\t\t\t\t__( 'Changes saved by %1$s on %2$s' ),\n\t\t\t\tauthorDisplayName,\n\t\t\t\tformattedModifiedDate\n\t\t );\n}\n\n/**\n * Returns a rendered list of revisions buttons.\n *\n * @typedef {Object} props\n * @property {Array<Object>} userRevisions A collection of user revisions.\n * @property {number} selectedRevisionId The id of the currently-selected revision.\n * @property {Function} onChange Callback fired when a revision is selected.\n *\n * @param {props} Component props.\n * @return {JSX.Element} The modal component.\n */\nfunction RevisionsButtons( { userRevisions, selectedRevisionId, onChange } ) {\n\tconst { currentThemeName, currentUser } = useSelect( ( select ) => {\n\t\tconst { getCurrentTheme, getCurrentUser } = select( coreStore );\n\t\tconst currentTheme = getCurrentTheme();\n\t\treturn {\n\t\t\tcurrentThemeName:\n\t\t\t\tcurrentTheme?.name?.rendered || currentTheme?.stylesheet,\n\t\t\tcurrentUser: getCurrentUser(),\n\t\t};\n\t}, [] );\n\tconst dateNowInMs = getDate().getTime();\n\tconst { date: dateFormat, datetimeAbbreviated } = getSettings().formats;\n\n\treturn (\n\t\t<ol\n\t\t\tclassName=\"edit-site-global-styles-screen-revisions__revisions-list\"\n\t\t\taria-label={ __( 'Global styles revisions' ) }\n\t\t\trole=\"group\"\n\t\t>\n\t\t\t{ userRevisions.map( ( revision, index ) => {\n\t\t\t\tconst { id, isLatest, author, modified } = revision;\n\t\t\t\tconst isUnsaved = 'unsaved' === id;\n\t\t\t\t// Unsaved changes are created by the current user.\n\t\t\t\tconst revisionAuthor = isUnsaved ? currentUser : author;\n\t\t\t\tconst authorDisplayName = revisionAuthor?.name || __( 'User' );\n\t\t\t\tconst authorAvatar = revisionAuthor?.avatar_urls?.[ '48' ];\n\t\t\t\tconst isSelected = selectedRevisionId\n\t\t\t\t\t? selectedRevisionId === id\n\t\t\t\t\t: index === 0;\n\t\t\t\tconst isReset = 'parent' === id;\n\t\t\t\tconst modifiedDate = getDate( modified );\n\t\t\t\tconst displayDate =\n\t\t\t\t\tmodified &&\n\t\t\t\t\tdateNowInMs - modifiedDate.getTime() > DAY_IN_MILLISECONDS\n\t\t\t\t\t\t? dateI18n( dateFormat, modifiedDate )\n\t\t\t\t\t\t: humanTimeDiff( modified );\n\t\t\t\tconst revisionLabel = getRevisionLabel(\n\t\t\t\t\tid,\n\t\t\t\t\tisLatest,\n\t\t\t\t\tauthorDisplayName,\n\t\t\t\t\tdateI18n( datetimeAbbreviated, modifiedDate )\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<li\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'edit-site-global-styles-screen-revisions__revision-item',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'is-selected': isSelected,\n\t\t\t\t\t\t\t\t'is-reset': isReset,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__revision-button\"\n\t\t\t\t\t\t\tdisabled={ isSelected }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonChange( revision );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ revisionLabel }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ isReset ? (\n\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__description\">\n\t\t\t\t\t\t\t\t\t{ __( 'Default styles' ) }\n\t\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__meta\">\n\t\t\t\t\t\t\t\t\t\t{ currentThemeName }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__description\">\n\t\t\t\t\t\t\t\t\t{ isUnsaved ? (\n\t\t\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__date\">\n\t\t\t\t\t\t\t\t\t\t\t{ __( '(Unsaved)' ) }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<time\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__date\"\n\t\t\t\t\t\t\t\t\t\t\tdateTime={ modified }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ displayDate }\n\t\t\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__meta\">\n\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\talt={ authorDisplayName }\n\t\t\t\t\t\t\t\t\t\t\tsrc={ authorAvatar }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{ authorDisplayName }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</li>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ol>\n\t);\n}\n\nexport default RevisionsButtons;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAGA;AACA;AACA;;AAOA,MAAMM,mBAAmB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SA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AG;MACHO,GAAG,EAAGlD;IAAI,GAEV,IAAA6B,MAAA,CAAAC,aAAA,EAACpC,WAAA,CAAAyD,MAAM;MACNpB,SAAS,EAAC,2DAA2D;MACrEqB,QAAQ,EAAGV,UAAY;MACvBW,OAAO,EAAGA,CAAA,KAAM;QACf5C,QAAQ,CAAEyB,QAAS,CAAC;MACrB,CAAG;MACHoB,KAAK,EAAGN;IAAe,GAErBL,OAAO,GACR,IAAAd,MAAA,CAAAC,aAAA;MAAMC,SAAS,EAAC;IAAuD,GACpE,IAAA3B,QAAE,EAAE,gBAAiB,CAAC,EACxB,IAAAyB,MAAA,CAAAC,aAAA;MAAMC,SAAS,EAAC;IAAgD,GAC7DrB,gBACG,CACD,CAAC,GAEP,IAAAmB,MAAA,CAAAC,aAAA;MAAMC,SAAS,EAAC;IAAuD,GACpEO,SAAS,GACV,IAAAT,MAAA,CAAAC,aAAA;MAAMC,SAAS,EAAC;IAAgD,GAC7D,IAAA3B,QAAE,EAAE,WAAY,CACb,CAAC,GAEP,IAAAyB,MAAA,CAAAC,aAAA;MACCC,SAAS,EAAC,gDAAgD;MAC1DwB,QAAQ,EAAGlB;IAAU,GAEnBQ,WACG,CACN,EACD,IAAAhB,MAAA,CAAAC,aAAA;MAAMC,SAAS,EAAC;IAAgD,GAC/D,IAAAF,MAAA,CAAAC,aAAA;MACC0B,GAAG,EAAGtD,iBAAmB;MACzBuD,GAAG,EAAGjB;IAAc,CACpB,CAAC,EACAtC,iBACG,CACD,CAEA,CACL,CAAC;EAEP,CAAE,CACC,CAAC;AAEP;AAAC,IAAAwD,QAAA,GAEcpD,gBAAgB;AAAAqD,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_i18n","_components","_date","_coreData","_data","_blockEditor","_lockUnlock","DAY_IN_MILLISECONDS","getGlobalStylesChanges","unlock","blockEditorPrivateApis","ChangesSummary","revision","previousRevision","changes","maxResults","changesLength","length","_react","createElement","className","join","getRevisionLabel","id","authorDisplayName","formattedModifiedDate","areStylesEqual","__","sprintf","RevisionsButtons","userRevisions","selectedRevisionId","onChange","canApplyRevision","onApplyRevision","currentThemeName","currentUser","useSelect","select","getCurrentTheme","getCurrentUser","coreStore","currentTheme","name","rendered","stylesheet","dateNowInMs","getDate","getTime","datetimeAbbreviated","getSettings","formats","role","map","index","author","modified","isUnsaved","revisionAuthor","authorAvatar","avatar_urls","isFirstItem","isSelected","isReset","modifiedDate","displayDate","dateI18n","humanTimeDiff","revisionLabel","classnames","key","Button","disabled","onClick","dateTime","alt","src","variant","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/revisions-buttons.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst DAY_IN_MILLISECONDS = 60 * 60 * 1000 * 24;\nconst { getGlobalStylesChanges } = unlock( blockEditorPrivateApis );\n\nfunction ChangesSummary( { revision, previousRevision } ) {\n\tconst changes = getGlobalStylesChanges( revision, previousRevision, {\n\t\tmaxResults: 7,\n\t} );\n\tconst changesLength = changes.length;\n\n\tif ( ! changesLength ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<span\n\t\t\tdata-testid=\"global-styles-revision-changes\"\n\t\t\tclassName=\"edit-site-global-styles-screen-revisions__changes\"\n\t\t>\n\t\t\t{ changes.join( ', ' ) }\n\t\t</span>\n\t);\n}\n\n/**\n * Returns a button label for the revision.\n *\n * @param {string|number} id A revision object.\n * @param {string} authorDisplayName Author name.\n * @param {string} formattedModifiedDate Revision modified date formatted.\n * @param {boolean} areStylesEqual Whether the revision matches the current editor styles.\n * @return {string} Translated label.\n */\nfunction getRevisionLabel(\n\tid,\n\tauthorDisplayName,\n\tformattedModifiedDate,\n\tareStylesEqual\n) {\n\tif ( 'parent' === id ) {\n\t\treturn __( 'Reset the styles to the theme defaults' );\n\t}\n\n\tif ( 'unsaved' === id ) {\n\t\treturn sprintf(\n\t\t\t/* translators: %s: author display name */\n\t\t\t__( 'Unsaved changes by %s' ),\n\t\t\tauthorDisplayName\n\t\t);\n\t}\n\n\treturn areStylesEqual\n\t\t? sprintf(\n\t\t\t\t// translators: %1$s: author display name, %2$s: revision creation date.\n\t\t\t\t__(\n\t\t\t\t\t'Changes saved by %1$s on %2$s. This revision matches current editor styles.'\n\t\t\t\t),\n\t\t\t\tauthorDisplayName,\n\t\t\t\tformattedModifiedDate\n\t\t )\n\t\t: sprintf(\n\t\t\t\t// translators: %1$s: author display name, %2$s: revision creation date.\n\t\t\t\t__( 'Changes saved by %1$s on %2$s' ),\n\t\t\t\tauthorDisplayName,\n\t\t\t\tformattedModifiedDate\n\t\t );\n}\n\n/**\n * Returns a rendered list of revisions buttons.\n *\n * @typedef {Object} props\n * @property {Array<Object>} userRevisions A collection of user revisions.\n * @property {number} selectedRevisionId The id of the currently-selected revision.\n * @property {Function} onChange Callback fired when a revision is selected.\n *\n * @param {props} Component props.\n * @return {JSX.Element} The modal component.\n */\nfunction RevisionsButtons( {\n\tuserRevisions,\n\tselectedRevisionId,\n\tonChange,\n\tcanApplyRevision,\n\tonApplyRevision,\n} ) {\n\tconst { currentThemeName, currentUser } = useSelect( ( select ) => {\n\t\tconst { getCurrentTheme, getCurrentUser } = select( coreStore );\n\t\tconst currentTheme = getCurrentTheme();\n\t\treturn {\n\t\t\tcurrentThemeName:\n\t\t\t\tcurrentTheme?.name?.rendered || currentTheme?.stylesheet,\n\t\t\tcurrentUser: getCurrentUser(),\n\t\t};\n\t}, [] );\n\tconst dateNowInMs = getDate().getTime();\n\tconst { datetimeAbbreviated } = getSettings().formats;\n\n\treturn (\n\t\t<ol\n\t\t\tclassName=\"edit-site-global-styles-screen-revisions__revisions-list\"\n\t\t\taria-label={ __( 'Global styles revisions list' ) }\n\t\t\trole=\"group\"\n\t\t>\n\t\t\t{ userRevisions.map( ( revision, index ) => {\n\t\t\t\tconst { id, author, modified } = revision;\n\t\t\t\tconst isUnsaved = 'unsaved' === id;\n\t\t\t\t// Unsaved changes are created by the current user.\n\t\t\t\tconst revisionAuthor = isUnsaved ? currentUser : author;\n\t\t\t\tconst authorDisplayName = revisionAuthor?.name || __( 'User' );\n\t\t\t\tconst authorAvatar = revisionAuthor?.avatar_urls?.[ '48' ];\n\t\t\t\tconst isFirstItem = index === 0;\n\t\t\t\tconst isSelected = selectedRevisionId\n\t\t\t\t\t? selectedRevisionId === id\n\t\t\t\t\t: isFirstItem;\n\t\t\t\tconst areStylesEqual = ! canApplyRevision && isSelected;\n\t\t\t\tconst isReset = 'parent' === id;\n\t\t\t\tconst modifiedDate = getDate( modified );\n\t\t\t\tconst displayDate =\n\t\t\t\t\tmodified &&\n\t\t\t\t\tdateNowInMs - modifiedDate.getTime() > DAY_IN_MILLISECONDS\n\t\t\t\t\t\t? dateI18n( datetimeAbbreviated, modifiedDate )\n\t\t\t\t\t\t: humanTimeDiff( modified );\n\t\t\t\tconst revisionLabel = getRevisionLabel(\n\t\t\t\t\tid,\n\t\t\t\t\tauthorDisplayName,\n\t\t\t\t\tdateI18n( datetimeAbbreviated, modifiedDate ),\n\t\t\t\t\tareStylesEqual\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<li\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'edit-site-global-styles-screen-revisions__revision-item',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'is-selected': isSelected,\n\t\t\t\t\t\t\t\t'is-active': areStylesEqual,\n\t\t\t\t\t\t\t\t'is-reset': isReset,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\taria-current={ isSelected }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__revision-button\"\n\t\t\t\t\t\t\tdisabled={ isSelected }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonChange( revision );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\taria-label={ revisionLabel }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ isReset ? (\n\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__description\">\n\t\t\t\t\t\t\t\t\t{ __( 'Default styles' ) }\n\t\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__meta\">\n\t\t\t\t\t\t\t\t\t\t{ currentThemeName }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__description\">\n\t\t\t\t\t\t\t\t\t{ isUnsaved ? (\n\t\t\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__date\">\n\t\t\t\t\t\t\t\t\t\t\t{ __( '(Unsaved)' ) }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<time\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__date\"\n\t\t\t\t\t\t\t\t\t\t\tdateTime={ modified }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ displayDate }\n\t\t\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__meta\">\n\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\talt={ authorDisplayName }\n\t\t\t\t\t\t\t\t\t\t\tsrc={ authorAvatar }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{ authorDisplayName }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{ isSelected && (\n\t\t\t\t\t\t\t\t\t\t<ChangesSummary\n\t\t\t\t\t\t\t\t\t\t\trevision={ revision }\n\t\t\t\t\t\t\t\t\t\t\tpreviousRevision={\n\t\t\t\t\t\t\t\t\t\t\t\tindex < userRevisions.length\n\t\t\t\t\t\t\t\t\t\t\t\t\t? userRevisions[ index + 1 ]\n\t\t\t\t\t\t\t\t\t\t\t\t\t: {}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t{ isSelected &&\n\t\t\t\t\t\t\t( areStylesEqual ? (\n\t\t\t\t\t\t\t\t<p className=\"edit-site-global-styles-screen-revisions__applied-text\">\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'These styles are already applied to your site.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tdisabled={ areStylesEqual }\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__apply-button\"\n\t\t\t\t\t\t\t\t\tonClick={ onApplyRevision }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ isReset\n\t\t\t\t\t\t\t\t\t\t? __( 'Reset to defaults' )\n\t\t\t\t\t\t\t\t\t\t: __( 'Apply' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\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AAM;MACNC,QAAQ,EAAG9C,cAAgB;MAC3BmD,OAAO,EAAC,SAAS;MACjBzD,SAAS,EAAC,wDAAwD;MAClEqD,OAAO,EAAGvC;IAAiB,GAEzB6B,OAAO,GACN,IAAApC,QAAE,EAAE,mBAAoB,CAAC,GACzB,IAAAA,QAAE,EAAE,OAAQ,CACR,CACR,CACC,CAAC;EAEP,CAAE,CACC,CAAC;AAEP;AAAC,IAAAmD,QAAA,GAEcjD,gBAAgB;AAAAkD,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -23,72 +23,86 @@ const SITE_EDITOR_AUTHORS_QUERY = {
23
23
  context: 'view',
24
24
  capabilities: ['edit_theme_options']
25
25
  };
26
+ const DEFAULT_QUERY = {
27
+ per_page: 100,
28
+ page: 1
29
+ };
26
30
  const EMPTY_ARRAY = [];
27
31
  const {
28
32
  GlobalStylesContext
29
33
  } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
30
- function useGlobalStylesRevisions() {
34
+ function useGlobalStylesRevisions({
35
+ query
36
+ } = {}) {
31
37
  const {
32
38
  user: userConfig
33
39
  } = (0, _element.useContext)(GlobalStylesContext);
40
+ const _query = {
41
+ ...DEFAULT_QUERY,
42
+ ...query
43
+ };
34
44
  const {
35
45
  authors,
36
46
  currentUser,
37
47
  isDirty,
38
48
  revisions,
39
- isLoadingGlobalStylesRevisions
49
+ isLoadingGlobalStylesRevisions,
50
+ revisionsCount
40
51
  } = (0, _data.useSelect)(select => {
52
+ var _globalStyles$_links$;
41
53
  const {
42
54
  __experimentalGetDirtyEntityRecords,
43
55
  getCurrentUser,
44
56
  getUsers,
45
57
  getRevisions,
46
58
  __experimentalGetCurrentGlobalStylesId,
59
+ getEntityRecord,
47
60
  isResolving
48
61
  } = select(_coreData.store);
49
62
  const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
50
63
  const _currentUser = getCurrentUser();
51
64
  const _isDirty = dirtyEntityRecords.length > 0;
52
- const query = {
53
- per_page: 100
54
- };
55
65
  const globalStylesId = __experimentalGetCurrentGlobalStylesId();
56
- const globalStylesRevisions = getRevisions('root', 'globalStyles', globalStylesId, query) || EMPTY_ARRAY;
66
+ const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
67
+ const _revisionsCount = (_globalStyles$_links$ = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : 0;
68
+ const globalStylesRevisions = getRevisions('root', 'globalStyles', globalStylesId, _query) || EMPTY_ARRAY;
57
69
  const _authors = getUsers(SITE_EDITOR_AUTHORS_QUERY) || EMPTY_ARRAY;
58
- const _isResolving = isResolving('getRevisions', ['root', 'globalStyles', globalStylesId, query]);
70
+ const _isResolving = isResolving('getRevisions', ['root', 'globalStyles', globalStylesId, _query]);
59
71
  return {
60
72
  authors: _authors,
61
73
  currentUser: _currentUser,
62
74
  isDirty: _isDirty,
63
75
  revisions: globalStylesRevisions,
64
- isLoadingGlobalStylesRevisions: _isResolving
76
+ isLoadingGlobalStylesRevisions: _isResolving,
77
+ revisionsCount: _revisionsCount
65
78
  };
66
- }, []);
79
+ }, [query]);
67
80
  return (0, _element.useMemo)(() => {
68
- let _modifiedRevisions = [];
69
81
  if (!authors.length || isLoadingGlobalStylesRevisions) {
70
82
  return {
71
- revisions: _modifiedRevisions,
83
+ revisions: EMPTY_ARRAY,
72
84
  hasUnsavedChanges: isDirty,
73
- isLoading: true
85
+ isLoading: true,
86
+ revisionsCount
74
87
  };
75
88
  }
76
89
 
77
90
  // Adds author details to each revision.
78
- _modifiedRevisions = revisions.map(revision => {
91
+ const _modifiedRevisions = revisions.map(revision => {
79
92
  return {
80
93
  ...revision,
81
94
  author: authors.find(author => author.id === revision.author)
82
95
  };
83
96
  });
84
- if (_modifiedRevisions.length) {
97
+ const fetchedRevisionsCount = revisions.length;
98
+ if (fetchedRevisionsCount) {
85
99
  // Flags the most current saved revision.
86
- if (_modifiedRevisions[0].id !== 'unsaved') {
100
+ if (_modifiedRevisions[0].id !== 'unsaved' && _query.page === 1) {
87
101
  _modifiedRevisions[0].isLatest = true;
88
102
  }
89
103
 
90
104
  // Adds an item for unsaved changes.
91
- if (isDirty && userConfig && Object.keys(userConfig).length > 0 && currentUser) {
105
+ if (isDirty && userConfig && Object.keys(userConfig).length > 0 && currentUser && _query.page === 1) {
92
106
  const unsavedRevision = {
93
107
  id: 'unsaved',
94
108
  styles: userConfig?.styles,
@@ -101,16 +115,20 @@ function useGlobalStylesRevisions() {
101
115
  };
102
116
  _modifiedRevisions.unshift(unsavedRevision);
103
117
  }
104
- _modifiedRevisions.push({
105
- id: 'parent',
106
- styles: {},
107
- settings: {}
108
- });
118
+ if (_query.page === Math.ceil(revisionsCount / _query.per_page)) {
119
+ // Adds an item for the default theme styles.
120
+ _modifiedRevisions.push({
121
+ id: 'parent',
122
+ styles: {},
123
+ settings: {}
124
+ });
125
+ }
109
126
  }
110
127
  return {
111
128
  revisions: _modifiedRevisions,
112
129
  hasUnsavedChanges: isDirty,
113
- isLoading: false
130
+ isLoading: false,
131
+ revisionsCount
114
132
  };
115
133
  }, [isDirty, revisions, currentUser, authors, userConfig, isLoadingGlobalStylesRevisions]);
116
134
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_coreData","_element","_blockEditor","_lockUnlock","SITE_EDITOR_AUTHORS_QUERY","per_page","_fields","context","capabilities","EMPTY_ARRAY","GlobalStylesContext","unlock","blockEditorPrivateApis","useGlobalStylesRevisions","user","userConfig","useContext","authors","currentUser","isDirty","revisions","isLoadingGlobalStylesRevisions","useSelect","select","__experimentalGetDirtyEntityRecords","getCurrentUser","getUsers","getRevisions","__experimentalGetCurrentGlobalStylesId","isResolving","coreStore","dirtyEntityRecords","_currentUser","_isDirty","length","query","globalStylesId","globalStylesRevisions","_authors","_isResolving","useMemo","_modifiedRevisions","hasUnsavedChanges","isLoading","map","revision","author","find","id","isLatest","Object","keys","unsavedRevision","styles","settings","name","avatar_urls","modified","Date","unshift","push"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/use-global-styles-revisions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst SITE_EDITOR_AUTHORS_QUERY = {\n\tper_page: -1,\n\t_fields: 'id,name,avatar_urls',\n\tcontext: 'view',\n\tcapabilities: [ 'edit_theme_options' ],\n};\nconst EMPTY_ARRAY = [];\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\nexport default function useGlobalStylesRevisions() {\n\tconst { user: userConfig } = useContext( GlobalStylesContext );\n\tconst {\n\t\tauthors,\n\t\tcurrentUser,\n\t\tisDirty,\n\t\trevisions,\n\t\tisLoadingGlobalStylesRevisions,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tgetCurrentUser,\n\t\t\tgetUsers,\n\t\t\tgetRevisions,\n\t\t\t__experimentalGetCurrentGlobalStylesId,\n\t\t\tisResolving,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst _currentUser = getCurrentUser();\n\t\tconst _isDirty = dirtyEntityRecords.length > 0;\n\t\tconst query = {\n\t\t\tper_page: 100,\n\t\t};\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStylesRevisions =\n\t\t\tgetRevisions( 'root', 'globalStyles', globalStylesId, query ) ||\n\t\t\tEMPTY_ARRAY;\n\t\tconst _authors = getUsers( SITE_EDITOR_AUTHORS_QUERY ) || EMPTY_ARRAY;\n\t\tconst _isResolving = isResolving( 'getRevisions', [\n\t\t\t'root',\n\t\t\t'globalStyles',\n\t\t\tglobalStylesId,\n\t\t\tquery,\n\t\t] );\n\t\treturn {\n\t\t\tauthors: _authors,\n\t\t\tcurrentUser: _currentUser,\n\t\t\tisDirty: _isDirty,\n\t\t\trevisions: globalStylesRevisions,\n\t\t\tisLoadingGlobalStylesRevisions: _isResolving,\n\t\t};\n\t}, [] );\n\treturn useMemo( () => {\n\t\tlet _modifiedRevisions = [];\n\t\tif ( ! authors.length || isLoadingGlobalStylesRevisions ) {\n\t\t\treturn {\n\t\t\t\trevisions: _modifiedRevisions,\n\t\t\t\thasUnsavedChanges: isDirty,\n\t\t\t\tisLoading: true,\n\t\t\t};\n\t\t}\n\n\t\t// Adds author details to each revision.\n\t\t_modifiedRevisions = revisions.map( ( revision ) => {\n\t\t\treturn {\n\t\t\t\t...revision,\n\t\t\t\tauthor: authors.find(\n\t\t\t\t\t( author ) => author.id === revision.author\n\t\t\t\t),\n\t\t\t};\n\t\t} );\n\n\t\tif ( _modifiedRevisions.length ) {\n\t\t\t// Flags the most current saved revision.\n\t\t\tif ( _modifiedRevisions[ 0 ].id !== 'unsaved' ) {\n\t\t\t\t_modifiedRevisions[ 0 ].isLatest = true;\n\t\t\t}\n\n\t\t\t// Adds an item for unsaved changes.\n\t\t\tif (\n\t\t\t\tisDirty &&\n\t\t\t\tuserConfig &&\n\t\t\t\tObject.keys( userConfig ).length > 0 &&\n\t\t\t\tcurrentUser\n\t\t\t) {\n\t\t\t\tconst unsavedRevision = {\n\t\t\t\t\tid: 'unsaved',\n\t\t\t\t\tstyles: userConfig?.styles,\n\t\t\t\t\tsettings: userConfig?.settings,\n\t\t\t\t\tauthor: {\n\t\t\t\t\t\tname: currentUser?.name,\n\t\t\t\t\t\tavatar_urls: currentUser?.avatar_urls,\n\t\t\t\t\t},\n\t\t\t\t\tmodified: new Date(),\n\t\t\t\t};\n\n\t\t\t\t_modifiedRevisions.unshift( unsavedRevision );\n\t\t\t}\n\n\t\t\t_modifiedRevisions.push( {\n\t\t\t\tid: 'parent',\n\t\t\t\tstyles: {},\n\t\t\t\tsettings: {},\n\t\t\t} );\n\t\t}\n\n\t\treturn {\n\t\t\trevisions: _modifiedRevisions,\n\t\t\thasUnsavedChanges: isDirty,\n\t\t\tisLoading: false,\n\t\t};\n\t}, [\n\t\tisDirty,\n\t\trevisions,\n\t\tcurrentUser,\n\t\tauthors,\n\t\tuserConfig,\n\t\tisLoadingGlobalStylesRevisions,\n\t] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA,MAAMK,yBAAyB,GAAG;EACjCC,QAAQ,EAAE,CAAC,CAAC;EACZC,OAAO,EAAE,qBAAqB;EAC9BC,OAAO,EAAE,MAAM;EACfC,YAAY,EAAE,CAAE,oBAAoB;AACrC,CAAC;AACD,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAM;EAAEC;AAAoB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AACjD,SAASC,wBAAwBA,CAAA,EAAG;EAClD,MAAM;IAAEC,IAAI,EAAEC;EAAW,CAAC,GAAG,IAAAC,mBAAU,EAAEN,mBAAoB,CAAC;EAC9D,MAAM;IACLO,OAAO;IACPC,WAAW;IACXC,OAAO;IACPC,SAAS;IACTC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC5B,MAAM;MACLC,mCAAmC;MACnCC,cAAc;MACdC,QAAQ;MACRC,YAAY;MACZC,sCAAsC;MACtCC;IACD,CAAC,GAAGN,MAAM,CAAEO,eAAU,CAAC;IACvB,MAAMC,kBAAkB,GAAGP,mCAAmC,CAAC,CAAC;IAChE,MAAMQ,YAAY,GAAGP,cAAc,CAAC,CAAC;IACrC,MAAMQ,QAAQ,GAAGF,kBAAkB,CAACG,MAAM,GAAG,CAAC;IAC9C,MAAMC,KAAK,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ACA,IACC9B,OAAO,IACPJ,UAAU,IACVmC,MAAM,CAACC,IAAI,CAAEpC,UAAW,CAAC,CAACmB,MAAM,GAAG,CAAC,IACpChB,WAAW,EACV;QACD,MAAMkC,eAAe,GAAG;UACvBJ,EAAE,EAAE,SAAS;UACbK,MAAM,EAAEtC,UAAU,EAAEsC,MAAM;UAC1BC,QAAQ,EAAEvC,UAAU,EAAEuC,QAAQ;UAC9BR,MAAM,EAAE;YACPS,IAAI,EAAErC,WAAW,EAAEqC,IAAI;YACvBC,WAAW,EAAEtC,WAAW,EAAEsC;UAC3B,CAAC;UACDC,QAAQ,EAAE,IAAIC,IAAI,CAAC;QACpB,CAAC;QAEDjB,kBAAkB,CAACkB,OAAO,CAAEP,eAAgB,CAAC;MAC9C;MAEAX,kBAAkB,CAACmB,IAAI,CAAE;QACxBZ,EAAE,EAAE,QAAQ;QACZK,MAAM,EAAE,CAAC,CAAC;QACVC,QAAQ,EAAE,CAAC;MACZ,CAAE,CAAC;IACJ;IAEA,OAAO;MACNlC,SAAS,EAAEqB,kBAAkB;MAC7BC,iBAAiB,EAAEvB,OAAO;MAC1BwB,SAAS,EAAE;IACZ,CAAC;EACF,CAAC,EAAE,CACFxB,OAAO,EACPC,SAAS,EACTF,WAAW,EACXD,OAAO,EACPF,UAAU,EACVM,8BAA8B,CAC7B,CAAC;AACJ"}
1
+ {"version":3,"names":["_data","require","_coreData","_element","_blockEditor","_lockUnlock","SITE_EDITOR_AUTHORS_QUERY","per_page","_fields","context","capabilities","DEFAULT_QUERY","page","EMPTY_ARRAY","GlobalStylesContext","unlock","blockEditorPrivateApis","useGlobalStylesRevisions","query","user","userConfig","useContext","_query","authors","currentUser","isDirty","revisions","isLoadingGlobalStylesRevisions","revisionsCount","useSelect","select","_globalStyles$_links$","__experimentalGetDirtyEntityRecords","getCurrentUser","getUsers","getRevisions","__experimentalGetCurrentGlobalStylesId","getEntityRecord","isResolving","coreStore","dirtyEntityRecords","_currentUser","_isDirty","length","globalStylesId","globalStyles","undefined","_revisionsCount","_links","count","globalStylesRevisions","_authors","_isResolving","useMemo","hasUnsavedChanges","isLoading","_modifiedRevisions","map","revision","author","find","id","fetchedRevisionsCount","isLatest","Object","keys","unsavedRevision","styles","settings","name","avatar_urls","modified","Date","unshift","Math","ceil","push"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/use-global-styles-revisions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst SITE_EDITOR_AUTHORS_QUERY = {\n\tper_page: -1,\n\t_fields: 'id,name,avatar_urls',\n\tcontext: 'view',\n\tcapabilities: [ 'edit_theme_options' ],\n};\nconst DEFAULT_QUERY = { per_page: 100, page: 1 };\nconst EMPTY_ARRAY = [];\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\nexport default function useGlobalStylesRevisions( { query } = {} ) {\n\tconst { user: userConfig } = useContext( GlobalStylesContext );\n\tconst _query = { ...DEFAULT_QUERY, ...query };\n\tconst {\n\t\tauthors,\n\t\tcurrentUser,\n\t\tisDirty,\n\t\trevisions,\n\t\tisLoadingGlobalStylesRevisions,\n\t\trevisionsCount,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tgetCurrentUser,\n\t\t\t\tgetUsers,\n\t\t\t\tgetRevisions,\n\t\t\t\t__experimentalGetCurrentGlobalStylesId,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst _currentUser = getCurrentUser();\n\t\t\tconst _isDirty = dirtyEntityRecords.length > 0;\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\t\t\tconst _revisionsCount =\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0;\n\t\t\tconst globalStylesRevisions =\n\t\t\t\tgetRevisions(\n\t\t\t\t\t'root',\n\t\t\t\t\t'globalStyles',\n\t\t\t\t\tglobalStylesId,\n\t\t\t\t\t_query\n\t\t\t\t) || EMPTY_ARRAY;\n\t\t\tconst _authors =\n\t\t\t\tgetUsers( SITE_EDITOR_AUTHORS_QUERY ) || EMPTY_ARRAY;\n\t\t\tconst _isResolving = isResolving( 'getRevisions', [\n\t\t\t\t'root',\n\t\t\t\t'globalStyles',\n\t\t\t\tglobalStylesId,\n\t\t\t\t_query,\n\t\t\t] );\n\t\t\treturn {\n\t\t\t\tauthors: _authors,\n\t\t\t\tcurrentUser: _currentUser,\n\t\t\t\tisDirty: _isDirty,\n\t\t\t\trevisions: globalStylesRevisions,\n\t\t\t\tisLoadingGlobalStylesRevisions: _isResolving,\n\t\t\t\trevisionsCount: _revisionsCount,\n\t\t\t};\n\t\t},\n\t\t[ query ]\n\t);\n\treturn useMemo( () => {\n\t\tif ( ! authors.length || isLoadingGlobalStylesRevisions ) {\n\t\t\treturn {\n\t\t\t\trevisions: EMPTY_ARRAY,\n\t\t\t\thasUnsavedChanges: isDirty,\n\t\t\t\tisLoading: true,\n\t\t\t\trevisionsCount,\n\t\t\t};\n\t\t}\n\n\t\t// Adds author details to each revision.\n\t\tconst _modifiedRevisions = revisions.map( ( revision ) => {\n\t\t\treturn {\n\t\t\t\t...revision,\n\t\t\t\tauthor: authors.find(\n\t\t\t\t\t( author ) => author.id === revision.author\n\t\t\t\t),\n\t\t\t};\n\t\t} );\n\n\t\tconst fetchedRevisionsCount = revisions.length;\n\n\t\tif ( fetchedRevisionsCount ) {\n\t\t\t// Flags the most current saved revision.\n\t\t\tif (\n\t\t\t\t_modifiedRevisions[ 0 ].id !== 'unsaved' &&\n\t\t\t\t_query.page === 1\n\t\t\t) {\n\t\t\t\t_modifiedRevisions[ 0 ].isLatest = true;\n\t\t\t}\n\n\t\t\t// Adds an item for unsaved changes.\n\t\t\tif (\n\t\t\t\tisDirty &&\n\t\t\t\tuserConfig &&\n\t\t\t\tObject.keys( userConfig ).length > 0 &&\n\t\t\t\tcurrentUser &&\n\t\t\t\t_query.page === 1\n\t\t\t) {\n\t\t\t\tconst unsavedRevision = {\n\t\t\t\t\tid: 'unsaved',\n\t\t\t\t\tstyles: userConfig?.styles,\n\t\t\t\t\tsettings: userConfig?.settings,\n\t\t\t\t\tauthor: {\n\t\t\t\t\t\tname: currentUser?.name,\n\t\t\t\t\t\tavatar_urls: currentUser?.avatar_urls,\n\t\t\t\t\t},\n\t\t\t\t\tmodified: new Date(),\n\t\t\t\t};\n\n\t\t\t\t_modifiedRevisions.unshift( unsavedRevision );\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t_query.page === Math.ceil( revisionsCount / _query.per_page )\n\t\t\t) {\n\t\t\t\t// Adds an item for the default theme styles.\n\t\t\t\t_modifiedRevisions.push( {\n\t\t\t\t\tid: 'parent',\n\t\t\t\t\tstyles: {},\n\t\t\t\t\tsettings: {},\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trevisions: _modifiedRevisions,\n\t\t\thasUnsavedChanges: isDirty,\n\t\t\tisLoading: false,\n\t\t\trevisionsCount,\n\t\t};\n\t}, [\n\t\tisDirty,\n\t\trevisions,\n\t\tcurrentUser,\n\t\tauthors,\n\t\tuserConfig,\n\t\tisLoadingGlobalStylesRevisions,\n\t] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,WA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97
  }, (0, _i18n.__)('Reset styles'))))));
98
98
  }
99
- function GlobalStylesRevisionsMenu() {
100
- const {
101
- setIsListViewOpened
102
- } = (0, _data.useDispatch)(_store.store);
103
- const {
104
- revisionsCount
105
- } = (0, _data.useSelect)(select => {
106
- var _globalStyles$_links$;
107
- const {
108
- getEntityRecord,
109
- __experimentalGetCurrentGlobalStylesId
110
- } = select(_coreData.store);
111
- const globalStylesId = __experimentalGetCurrentGlobalStylesId();
112
- const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
113
- return {
114
- revisionsCount: (_globalStyles$_links$ = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : 0
115
- };
116
- }, []);
117
- const {
118
- goTo
119
- } = (0, _components.__experimentalUseNavigator)();
120
- const {
121
- setEditorCanvasContainerView
122
- } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
123
- const isRevisionsOpened = (0, _data.useSelect)(select => 'global-styles-revisions' === (0, _lockUnlock.unlock)(select(_store.store)).getEditorCanvasContainerView(), []);
124
- const loadRevisions = () => {
125
- setIsListViewOpened(false);
126
- if (!isRevisionsOpened) {
127
- goTo('/revisions');
128
- setEditorCanvasContainerView('global-styles-revisions');
129
- } else {
130
- goTo('/');
131
- setEditorCanvasContainerView(undefined);
132
- }
133
- };
134
- const hasRevisions = revisionsCount > 0;
135
- return (0, _react.createElement)(GlobalStylesMenuFill, null, (0, _react.createElement)(_components.Button, {
136
- label: (0, _i18n.__)('Revisions'),
137
- icon: _icons.backup,
138
- onClick: loadRevisions,
139
- disabled: !hasRevisions,
140
- isPressed: isRevisionsOpened
141
- }));
142
- }
143
99
  function GlobalStylesNavigationScreen({
144
100
  className,
145
101
  ...props
@@ -237,8 +193,7 @@ function GlobalStylesBlockLink() {
237
193
  }
238
194
  function GlobalStylesEditorCanvasContainerLink() {
239
195
  const {
240
- goTo,
241
- location
196
+ goTo
242
197
  } = (0, _components.__experimentalUseNavigator)();
243
198
  const editorCanvasContainerView = (0, _data.useSelect)(select => (0, _lockUnlock.unlock)(select(_store.store)).getEditorCanvasContainerView(), []);
244
199
 
@@ -246,22 +201,18 @@ function GlobalStylesEditorCanvasContainerLink() {
246
201
  // to the appropriate screen. This effectively allows deep linking to the
247
202
  // desired screens from outside the global styles navigation provider.
248
203
  (0, _element.useEffect)(() => {
249
- if (editorCanvasContainerView === 'global-styles-revisions') {
250
- // Switching to the revisions container view should
251
- // redirect to the revisions screen.
252
- goTo('/revisions');
253
- } else if (!!editorCanvasContainerView && location?.path === '/revisions') {
254
- // Switching to any container other than revisions should
255
- // redirect from the revisions screen to the root global styles screen.
256
- goTo('/');
257
- } else if (editorCanvasContainerView === 'global-styles-css') {
258
- goTo('/css');
204
+ switch (editorCanvasContainerView) {
205
+ case 'global-styles-revisions':
206
+ case 'global-styles-revisions:style-book':
207
+ goTo('/revisions');
208
+ break;
209
+ case 'global-styles-css':
210
+ goTo('/css');
211
+ break;
212
+ default:
213
+ goTo('/');
214
+ break;
259
215
  }
260
-
261
- // location?.path is not a dependency because we don't want to track it.
262
- // Doing so will cause an infinite loop. We could abstract logic to avoid
263
- // having to disable the check later.
264
- // eslint-disable-next-line react-hooks/exhaustive-deps
265
216
  }, [editorCanvasContainerView, goTo]);
266
217
  }
267
218
  function GlobalStylesUI() {
@@ -315,7 +266,7 @@ function GlobalStylesUI() {
315
266
  key: 'screens-block-' + block.name,
316
267
  name: block.name,
317
268
  parentMenu: '/blocks/' + encodeURIComponent(block.name)
318
- })), 'style-book' === editorCanvasContainerView && (0, _react.createElement)(GlobalStylesStyleBook, null), (0, _react.createElement)(GlobalStylesRevisionsMenu, null), (0, _react.createElement)(GlobalStylesActionMenu, null), (0, _react.createElement)(GlobalStylesBlockLink, null), (0, _react.createElement)(GlobalStylesEditorCanvasContainerLink, null));
269
+ })), 'style-book' === editorCanvasContainerView && (0, _react.createElement)(GlobalStylesStyleBook, null), (0, _react.createElement)(GlobalStylesActionMenu, null), (0, _react.createElement)(GlobalStylesBlockLink, null), (0, _react.createElement)(GlobalStylesEditorCanvasContainerLink, null));
319
270
  }
320
271
  var _default = GlobalStylesUI;
321
272
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_blocks","_data","_blockEditor","_i18n","_preferences","_icons","_coreData","_element","_screenRoot","_interopRequireDefault","_screenBlockList","_interopRequireWildcard","_screenBlock","_screenTypography","_screenTypographyElement","_screenColors","_screenColorPalette","_screenLayout","_screenStyleVariations","_styleBook","_screenCss","_screenRevisions","_lockUnlock","_store","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","SLOT_FILL_NAME","useGlobalStylesReset","unlock","blockEditorPrivateApis","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","createSlotFill","exports","GlobalStylesActionMenu","canReset","onReset","toggle","useDispatch","preferencesStore","canEditCSS","useSelect","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","setEditorCanvasContainerView","editSiteStore","goTo","useNavigator","loadCustomCSS","_react","createElement","DropdownMenu","icon","moreVertical","label","__","onClose","Fragment","MenuGroup","MenuItem","onClick","disabled","GlobalStylesRevisionsMenu","setIsListViewOpened","revisionsCount","_globalStyles$_links$","count","isRevisionsOpened","getEditorCanvasContainerView","loadRevisions","hasRevisions","Button","backup","isPressed","GlobalStylesNavigationScreen","className","props","__experimentalNavigatorScreen","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","path","name","variation","ContextScreens","blockStyleVariations","getBlockStyles","blocksStore","length","GlobalStylesStyleBook","navigator","location","isSelected","encodeURIComponent","startsWith","onSelect","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","blockEditorStore","clientId","blockHasGlobalStyles","useBlockHasGlobalStyles","useEffect","currentPath","newPath","skipFocus","GlobalStylesEditorCanvasContainerLink","editorCanvasContainerView","GlobalStylesUI","blocks","getBlockTypes","__experimentalNavigatorProvider","initialPath","element","block","_default"],"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\tcreateSlotFill,\n\tButton,\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 { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\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: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { goTo } = useNavigator();\n\tconst loadCustomCSS = () => {\n\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\tgoTo( '/css' );\n\t};\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<>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ canEditCSS && (\n\t\t\t\t\t\t\t\t<MenuItem onClick={ loadCustomCSS }>\n\t\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tonClose();\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{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonReset();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tdisabled={ ! canReset }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Reset styles' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\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 { goTo } = useNavigator();\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst isRevisionsOpened = useSelect(\n\t\t( select ) =>\n\t\t\t'global-styles-revisions' ===\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\tconst loadRevisions = () => {\n\t\tsetIsListViewOpened( false );\n\n\t\tif ( ! isRevisionsOpened ) {\n\t\t\tgoTo( '/revisions' );\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t} else {\n\t\t\tgoTo( '/' );\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t}\n\t};\n\tconst hasRevisions = revisionsCount > 0;\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<Button\n\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\ticon={ backup }\n\t\t\t\tonClick={ loadRevisions }\n\t\t\t\tdisabled={ ! hasRevisions }\n\t\t\t\tisPressed={ isRevisionsOpened }\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 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"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAUA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAIA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAKA,IAAAS,WAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,gBAAA,GAAAC,uBAAA,CAAAZ,OAAA;AAIA,IAAAa,YAAA,GAAAH,sBAAA,CAAAV,OAAA;AACA,IAAAc,iBAAA,GAAAJ,sBAAA,CAAAV,OAAA;AACA,IAAAe,wBAAA,GAAAL,sBAAA,CAAAV,OAAA;AACA,IAAAgB,aAAA,GAAAN,sBAAA,CAAAV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AA,CAAAC,aAAA,EAAC8C,qBAAqB,MAAE,CACxB,EAED,IAAA/C,MAAA,CAAAC,aAAA,EAACY,yBAAyB,MAAE,CAAC,EAC7B,IAAAb,MAAA,CAAAC,aAAA,EAACtB,sBAAsB,MAAE,CAAC,EAC1B,IAAAqB,MAAA,CAAAC,aAAA,EAACqD,qBAAqB,MAAE,CAAC,EACzB,IAAAtD,MAAA,CAAAC,aAAA,EAACkE,qCAAqC,MAAE,CACtB,CAAC;AAEtB;AAAC,IAAAS,QAAA,GAEcP,cAAc;AAAA3F,OAAA,CAAAxB,OAAA,GAAA0H,QAAA"}
1
+ {"version":3,"names":["_components","require","_blocks","_data","_blockEditor","_i18n","_preferences","_icons","_coreData","_element","_screenRoot","_interopRequireDefault","_screenBlockList","_interopRequireWildcard","_screenBlock","_screenTypography","_screenTypographyElement","_screenColors","_screenColorPalette","_screenLayout","_screenStyleVariations","_styleBook","_screenCss","_screenRevisions","_lockUnlock","_store","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","SLOT_FILL_NAME","useGlobalStylesReset","unlock","blockEditorPrivateApis","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","createSlotFill","exports","GlobalStylesActionMenu","canReset","onReset","toggle","useDispatch","preferencesStore","canEditCSS","useSelect","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","setEditorCanvasContainerView","editSiteStore","goTo","useNavigator","loadCustomCSS","_react","createElement","DropdownMenu","icon","moreVertical","label","__","onClose","Fragment","MenuGroup","MenuItem","onClick","disabled","GlobalStylesNavigationScreen","className","props","__experimentalNavigatorScreen","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","path","name","variation","ContextScreens","blockStyleVariations","getBlockStyles","blocksStore","length","GlobalStylesStyleBook","navigator","location","isSelected","encodeURIComponent","startsWith","onSelect","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","blockEditorStore","clientId","blockHasGlobalStyles","useBlockHasGlobalStyles","useEffect","currentPath","newPath","skipFocus","GlobalStylesEditorCanvasContainerLink","editorCanvasContainerView","getEditorCanvasContainerView","GlobalStylesUI","blocks","getBlockTypes","__experimentalNavigatorProvider","initialPath","element","block","_default"],"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"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\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 { 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 { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\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: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { goTo } = useNavigator();\n\tconst loadCustomCSS = () => {\n\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\tgoTo( '/css' );\n\t};\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<>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ canEditCSS && (\n\t\t\t\t\t\t\t\t<MenuItem onClick={ loadCustomCSS }>\n\t\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tonClose();\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{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonReset();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tdisabled={ ! canReset }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Reset styles' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\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 } = 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\tswitch ( editorCanvasContainerView ) {\n\t\t\tcase 'global-styles-revisions':\n\t\t\tcase 'global-styles-revisions:style-book':\n\t\t\t\tgoTo( '/revisions' );\n\t\t\t\tbreak;\n\t\t\tcase 'global-styles-css':\n\t\t\t\tgoTo( '/css' );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tgoTo( '/' );\n\t\t\t\tbreak;\n\t\t}\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<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t\t<GlobalStylesEditorCanvasContainerLink />\n\t\t</NavigatorProvider>\n\t);\n}\nexport { GlobalStylesMenuSlot };\nexport default GlobalStylesUI;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AASA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAIA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAKA,IAAAS,WAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,gBAAA,GAAAC,uBAAA,CAAAZ,OAAA;AAIA,IAAAa,YAAA,GAAAH,sBAAA,CAAAV,OAAA;AACA,IAAAc,iBAAA,GAAAJ,sBAAA,CAAAV,OAAA;AACA,IAAAe,wBAAA,GAAAL,sBAAA,CAAAV,OAAA;AACA,IAA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