@wordpress/edit-site 5.12.0 → 5.12.2

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 (904) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/build/components/add-new-pattern/index.js +99 -0
  3. package/build/components/add-new-pattern/index.js.map +1 -0
  4. package/build/components/add-new-template/add-custom-template-modal-content.js +9 -23
  5. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  6. package/build/components/add-new-template/index.js +2 -10
  7. package/build/components/add-new-template/index.js.map +1 -1
  8. package/build/components/add-new-template/new-template.js +75 -22
  9. package/build/components/add-new-template/new-template.js.map +1 -1
  10. package/build/components/app/index.js +2 -2
  11. package/build/components/app/index.js.map +1 -1
  12. package/build/components/block-editor/back-button.js +5 -3
  13. package/build/components/block-editor/back-button.js.map +1 -1
  14. package/build/components/block-editor/constants.js +9 -0
  15. package/build/components/block-editor/constants.js.map +1 -0
  16. package/build/components/block-editor/editor-canvas.js +8 -8
  17. package/build/components/block-editor/editor-canvas.js.map +1 -1
  18. package/build/components/block-editor/get-block-editor-provider.js +42 -0
  19. package/build/components/block-editor/get-block-editor-provider.js.map +1 -0
  20. package/build/components/block-editor/index.js +6 -132
  21. package/build/components/block-editor/index.js.map +1 -1
  22. package/build/components/block-editor/providers/default-block-editor-provider.js +58 -0
  23. package/build/components/block-editor/providers/default-block-editor-provider.js.map +1 -0
  24. package/build/components/block-editor/providers/navigation-block-editor-provider.js +117 -0
  25. package/build/components/block-editor/providers/navigation-block-editor-provider.js.map +1 -0
  26. package/build/components/block-editor/site-editor-canvas.js +137 -0
  27. package/build/components/block-editor/site-editor-canvas.js.map +1 -0
  28. package/build/components/block-editor/use-site-editor-settings.js +82 -0
  29. package/build/components/block-editor/use-site-editor-settings.js.map +1 -0
  30. package/build/components/canvas-spinner/index.js +18 -1
  31. package/build/components/canvas-spinner/index.js.map +1 -1
  32. package/build/components/create-pattern-modal/index.js +125 -0
  33. package/build/components/create-pattern-modal/index.js.map +1 -0
  34. package/build/components/create-template-part-modal/index.js +50 -6
  35. package/build/components/create-template-part-modal/index.js.map +1 -1
  36. package/build/components/editor/index.js +24 -13
  37. package/build/components/editor/index.js.map +1 -1
  38. package/build/components/editor-canvas-container/index.js +22 -4
  39. package/build/components/editor-canvas-container/index.js.map +1 -1
  40. package/build/components/global-styles/color-indicator-wrapper.js +4 -5
  41. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  42. package/build/components/global-styles/color-palette-panel.js +2 -2
  43. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  44. package/build/components/global-styles/dimensions-panel.js +2 -2
  45. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  46. package/build/components/global-styles/global-styles-provider.js +12 -16
  47. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  48. package/build/components/global-styles/gradients-palette-panel.js +2 -2
  49. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  50. package/build/components/global-styles/hooks.js +3 -3
  51. package/build/components/global-styles/hooks.js.map +1 -1
  52. package/build/components/global-styles/icon-with-current-color.js +4 -5
  53. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  54. package/build/components/global-styles/navigation-button.js +10 -11
  55. package/build/components/global-styles/navigation-button.js.map +1 -1
  56. package/build/components/global-styles/palette.js +3 -3
  57. package/build/components/global-styles/palette.js.map +1 -1
  58. package/build/components/global-styles/preview.js +2 -2
  59. package/build/components/global-styles/preview.js.map +1 -1
  60. package/build/components/global-styles/root-menu.js +2 -2
  61. package/build/components/global-styles/root-menu.js.map +1 -1
  62. package/build/components/global-styles/screen-block-list.js +2 -2
  63. package/build/components/global-styles/screen-block-list.js.map +1 -1
  64. package/build/components/global-styles/screen-block.js +2 -2
  65. package/build/components/global-styles/screen-block.js.map +1 -1
  66. package/build/components/global-styles/screen-colors.js +2 -2
  67. package/build/components/global-styles/screen-colors.js.map +1 -1
  68. package/build/components/global-styles/screen-css.js +2 -2
  69. package/build/components/global-styles/screen-css.js.map +1 -1
  70. package/build/components/global-styles/screen-layout.js +2 -2
  71. package/build/components/global-styles/screen-layout.js.map +1 -1
  72. package/build/components/global-styles/screen-revisions/index.js +4 -4
  73. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  74. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +2 -2
  75. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  76. package/build/components/global-styles/screen-root.js +2 -2
  77. package/build/components/global-styles/screen-root.js.map +1 -1
  78. package/build/components/global-styles/screen-typography.js +2 -2
  79. package/build/components/global-styles/screen-typography.js.map +1 -1
  80. package/build/components/global-styles/style-variations-container.js +11 -3
  81. package/build/components/global-styles/style-variations-container.js.map +1 -1
  82. package/build/components/global-styles/typography-panel.js +2 -2
  83. package/build/components/global-styles/typography-panel.js.map +1 -1
  84. package/build/components/global-styles/typography-preview.js +2 -2
  85. package/build/components/global-styles/typography-preview.js.map +1 -1
  86. package/build/components/global-styles/ui.js +95 -36
  87. package/build/components/global-styles/ui.js.map +1 -1
  88. package/build/components/global-styles-renderer/index.js +2 -2
  89. package/build/components/global-styles-renderer/index.js.map +1 -1
  90. package/build/components/header-edit-mode/document-actions/index.js +55 -22
  91. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  92. package/build/components/header-edit-mode/index.js +41 -16
  93. package/build/components/header-edit-mode/index.js.map +1 -1
  94. package/build/components/header-edit-mode/more-menu/index.js +36 -2
  95. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  96. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +4 -7
  97. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
  98. package/build/components/header-edit-mode/undo-redo/redo.js +2 -6
  99. package/build/components/header-edit-mode/undo-redo/redo.js.map +1 -1
  100. package/build/components/header-edit-mode/undo-redo/undo.js +2 -6
  101. package/build/components/header-edit-mode/undo-redo/undo.js.map +1 -1
  102. package/build/components/keyboard-shortcut-help-modal/index.js +2 -1
  103. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  104. package/build/components/keyboard-shortcuts/edit-mode.js +39 -3
  105. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  106. package/build/components/keyboard-shortcuts/index.js +7 -2
  107. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  108. package/build/components/keyboard-shortcuts/register.js +10 -1
  109. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  110. package/build/components/layout/hooks.js +21 -0
  111. package/build/components/layout/hooks.js.map +1 -1
  112. package/build/components/layout/index.js +126 -34
  113. package/build/components/layout/index.js.map +1 -1
  114. package/build/components/list/index.js +2 -2
  115. package/build/components/list/index.js.map +1 -1
  116. package/build/components/page/header.js +41 -0
  117. package/build/components/page/header.js.map +1 -0
  118. package/build/components/page/index.js +49 -0
  119. package/build/components/page/index.js.map +1 -0
  120. package/build/components/page-content-focus-manager/back-to-page-notification.js +73 -0
  121. package/build/components/page-content-focus-manager/back-to-page-notification.js.map +1 -0
  122. package/build/components/page-content-focus-manager/constants.js +9 -0
  123. package/build/components/page-content-focus-manager/constants.js.map +1 -0
  124. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +60 -0
  125. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -0
  126. package/build/components/page-content-focus-manager/edit-template-notification.js +121 -0
  127. package/build/components/page-content-focus-manager/edit-template-notification.js.map +1 -0
  128. package/build/components/page-content-focus-manager/index.js +37 -0
  129. package/build/components/page-content-focus-manager/index.js.map +1 -0
  130. package/build/components/page-library/grid-item.js +169 -0
  131. package/build/components/page-library/grid-item.js.map +1 -0
  132. package/build/components/page-library/grid.js +49 -0
  133. package/build/components/page-library/grid.js.map +1 -0
  134. package/build/components/page-library/index.js +61 -0
  135. package/build/components/page-library/index.js.map +1 -0
  136. package/build/components/page-library/no-patterns.js +20 -0
  137. package/build/components/page-library/no-patterns.js.map +1 -0
  138. package/build/components/page-library/patterns-list.js +108 -0
  139. package/build/components/page-library/patterns-list.js.map +1 -0
  140. package/build/components/page-library/search-items.js +172 -0
  141. package/build/components/page-library/search-items.js.map +1 -0
  142. package/build/components/page-library/use-library-settings.js +53 -0
  143. package/build/components/page-library/use-library-settings.js.map +1 -0
  144. package/build/components/page-library/use-patterns.js +194 -0
  145. package/build/components/page-library/use-patterns.js.map +1 -0
  146. package/build/components/page-library/utils.js +30 -0
  147. package/build/components/page-library/utils.js.map +1 -0
  148. package/build/components/page-main/index.js +46 -0
  149. package/build/components/page-main/index.js.map +1 -0
  150. package/build/components/page-templates/index.js +101 -0
  151. package/build/components/page-templates/index.js.map +1 -0
  152. package/build/components/preferences-modal/enable-feature.js +9 -8
  153. package/build/components/preferences-modal/enable-feature.js.map +1 -1
  154. package/build/components/preferences-modal/index.js +30 -0
  155. package/build/components/preferences-modal/index.js.map +1 -1
  156. package/build/components/resizable-frame/index.js +6 -4
  157. package/build/components/resizable-frame/index.js.map +1 -1
  158. package/build/components/revisions/index.js +2 -2
  159. package/build/components/revisions/index.js.map +1 -1
  160. package/build/components/routes/link.js +7 -10
  161. package/build/components/routes/link.js.map +1 -1
  162. package/build/components/routes/use-title.js +2 -2
  163. package/build/components/routes/use-title.js.map +1 -1
  164. package/build/components/save-button/index.js +15 -11
  165. package/build/components/save-button/index.js.map +1 -1
  166. package/build/components/save-hub/index.js +2 -2
  167. package/build/components/save-hub/index.js.map +1 -1
  168. package/build/components/save-panel/index.js +5 -7
  169. package/build/components/save-panel/index.js.map +1 -1
  170. package/build/components/secondary-sidebar/inserter-sidebar.js +4 -8
  171. package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  172. package/build/components/secondary-sidebar/list-view-sidebar.js +47 -10
  173. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  174. package/build/components/sidebar/index.js +12 -8
  175. package/build/components/sidebar/index.js.map +1 -1
  176. package/build/components/sidebar-button/index.js +2 -4
  177. package/build/components/sidebar-button/index.js.map +1 -1
  178. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +22 -8
  179. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  180. package/build/components/sidebar-edit-mode/index.js +8 -6
  181. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  182. package/build/components/sidebar-edit-mode/page-panels/edit-template.js +84 -0
  183. package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -0
  184. package/build/components/sidebar-edit-mode/page-panels/index.js +51 -38
  185. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  186. package/build/components/sidebar-edit-mode/page-panels/page-content.js +35 -0
  187. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -0
  188. package/build/components/sidebar-edit-mode/page-panels/page-status.js +192 -0
  189. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -0
  190. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +45 -0
  191. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -0
  192. package/build/components/sidebar-edit-mode/page-panels/publish-date.js +98 -0
  193. package/build/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -0
  194. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -7
  195. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  196. package/build/components/sidebar-edit-mode/settings-header/index.js +19 -6
  197. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  198. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +2 -2
  199. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  200. package/build/components/sidebar-edit-mode/template-panel/index.js +10 -6
  201. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  202. package/build/components/sidebar-navigation-item/index.js +11 -7
  203. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  204. package/build/components/sidebar-navigation-screen/index.js +24 -9
  205. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  206. package/build/components/sidebar-navigation-screen-details-footer/index.js +36 -0
  207. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -0
  208. package/build/components/sidebar-navigation-screen-details-panel/index.js +58 -0
  209. package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -0
  210. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +22 -0
  211. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -0
  212. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +35 -0
  213. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -0
  214. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +22 -0
  215. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -0
  216. package/build/components/sidebar-navigation-screen-global-styles/index.js +28 -16
  217. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  218. package/build/components/sidebar-navigation-screen-library/category-item.js +48 -0
  219. package/build/components/sidebar-navigation-screen-library/category-item.js.map +1 -0
  220. package/build/components/sidebar-navigation-screen-library/index.js +112 -0
  221. package/build/components/sidebar-navigation-screen-library/index.js.map +1 -0
  222. package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +36 -0
  223. package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +1 -0
  224. package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js +76 -0
  225. package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +1 -0
  226. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js +41 -0
  227. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +1 -0
  228. package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js +40 -0
  229. package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +1 -0
  230. package/build/components/sidebar-navigation-screen-main/index.js +12 -13
  231. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  232. package/build/components/sidebar-navigation-screen-navigation-item/index.js +2 -2
  233. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  234. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +42 -0
  235. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -0
  236. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +41 -0
  237. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -0
  238. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +47 -92
  239. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  240. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +84 -0
  241. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -0
  242. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +71 -0
  243. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -0
  244. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +63 -0
  245. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -0
  246. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +49 -0
  247. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -0
  248. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +167 -0
  249. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -0
  250. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  251. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  252. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +58 -8
  253. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  254. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +57 -10
  255. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  256. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +21 -50
  257. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  258. package/build/components/sidebar-navigation-screen-page/index.js +14 -34
  259. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  260. package/build/components/sidebar-navigation-screen-page/page-details.js +29 -27
  261. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  262. package/build/components/sidebar-navigation-screen-page/status-label.js +8 -7
  263. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  264. package/build/components/sidebar-navigation-screen-pages/index.js +9 -8
  265. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  266. package/build/components/sidebar-navigation-screen-pattern/index.js +66 -0
  267. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -0
  268. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +41 -0
  269. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -0
  270. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +33 -0
  271. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -0
  272. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +40 -0
  273. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -0
  274. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +47 -0
  275. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -0
  276. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +82 -0
  277. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -0
  278. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +80 -0
  279. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -0
  280. package/build/components/sidebar-navigation-screen-template/home-template-details.js +212 -0
  281. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -0
  282. package/build/components/sidebar-navigation-screen-template/index.js +21 -7
  283. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  284. package/build/components/sidebar-navigation-screen-templates/index.js +11 -11
  285. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  286. package/build/components/site-hub/index.js +10 -12
  287. package/build/components/site-hub/index.js.map +1 -1
  288. package/build/components/style-book/index.js +10 -11
  289. package/build/components/style-book/index.js.map +1 -1
  290. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +14 -4
  291. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  292. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +4 -4
  293. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  294. package/build/components/sync-state-with-url/use-sync-path-with-url.js +12 -2
  295. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  296. package/build/components/table/index.js +29 -0
  297. package/build/components/table/index.js.map +1 -0
  298. package/build/components/template-part-converter/convert-to-template-part.js +3 -21
  299. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  300. package/build/components/welcome-guide/editor.js +1 -1
  301. package/build/components/welcome-guide/editor.js.map +1 -1
  302. package/build/components/welcome-guide/styles.js +4 -3
  303. package/build/components/welcome-guide/styles.js.map +1 -1
  304. package/build/hooks/commands/use-common-commands.js +212 -0
  305. package/build/hooks/commands/use-common-commands.js.map +1 -0
  306. package/build/hooks/commands/use-edit-mode-commands.js +196 -24
  307. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  308. package/build/hooks/index.js +2 -0
  309. package/build/hooks/index.js.map +1 -1
  310. package/build/hooks/navigation-menu-edit.js +95 -0
  311. package/build/hooks/navigation-menu-edit.js.map +1 -0
  312. package/build/hooks/push-changes-to-global-styles/index.js +5 -3
  313. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  314. package/build/hooks/template-part-edit.js +6 -9
  315. package/build/hooks/template-part-edit.js.map +1 -1
  316. package/build/index.js +1 -0
  317. package/build/index.js.map +1 -1
  318. package/build/{private-apis.js → lock-unlock.js} +1 -1
  319. package/build/lock-unlock.js.map +1 -0
  320. package/build/store/actions.js +45 -9
  321. package/build/store/actions.js.map +1 -1
  322. package/build/store/index.js +3 -3
  323. package/build/store/index.js.map +1 -1
  324. package/build/store/reducer.js +7 -6
  325. package/build/store/reducer.js.map +1 -1
  326. package/build/store/selectors.js +42 -17
  327. package/build/store/selectors.js.map +1 -1
  328. package/build/utils/get-is-list-page.js +12 -5
  329. package/build/utils/get-is-list-page.js.map +1 -1
  330. package/build/utils/is-previewing-theme.js +2 -2
  331. package/build/utils/is-previewing-theme.js.map +1 -1
  332. package/build/utils/use-activate-theme.js +3 -3
  333. package/build/utils/use-activate-theme.js.map +1 -1
  334. package/build/utils/use-debounced-input.js +26 -0
  335. package/build/utils/use-debounced-input.js.map +1 -0
  336. package/build-module/components/add-new-pattern/index.js +82 -0
  337. package/build-module/components/add-new-pattern/index.js.map +1 -0
  338. package/build-module/components/add-new-template/add-custom-template-modal-content.js +7 -20
  339. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  340. package/build-module/components/add-new-template/index.js +2 -8
  341. package/build-module/components/add-new-template/index.js.map +1 -1
  342. package/build-module/components/add-new-template/new-template.js +76 -22
  343. package/build-module/components/add-new-template/new-template.js.map +1 -1
  344. package/build-module/components/app/index.js +1 -1
  345. package/build-module/components/app/index.js.map +1 -1
  346. package/build-module/components/block-editor/back-button.js +4 -2
  347. package/build-module/components/block-editor/back-button.js.map +1 -1
  348. package/build-module/components/block-editor/constants.js +2 -0
  349. package/build-module/components/block-editor/constants.js.map +1 -0
  350. package/build-module/components/block-editor/editor-canvas.js +6 -5
  351. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  352. package/build-module/components/block-editor/get-block-editor-provider.js +31 -0
  353. package/build-module/components/block-editor/get-block-editor-provider.js.map +1 -0
  354. package/build-module/components/block-editor/index.js +9 -127
  355. package/build-module/components/block-editor/index.js.map +1 -1
  356. package/build-module/components/block-editor/providers/default-block-editor-provider.js +42 -0
  357. package/build-module/components/block-editor/providers/default-block-editor-provider.js.map +1 -0
  358. package/build-module/components/block-editor/providers/navigation-block-editor-provider.js +102 -0
  359. package/build-module/components/block-editor/providers/navigation-block-editor-provider.js.map +1 -0
  360. package/build-module/components/block-editor/site-editor-canvas.js +115 -0
  361. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -0
  362. package/build-module/components/block-editor/use-site-editor-settings.js +67 -0
  363. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -0
  364. package/build-module/components/canvas-spinner/index.js +15 -1
  365. package/build-module/components/canvas-spinner/index.js.map +1 -1
  366. package/build-module/components/create-pattern-modal/index.js +113 -0
  367. package/build-module/components/create-pattern-modal/index.js.map +1 -0
  368. package/build-module/components/create-template-part-modal/index.js +47 -7
  369. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  370. package/build-module/components/editor/index.js +24 -13
  371. package/build-module/components/editor/index.js.map +1 -1
  372. package/build-module/components/editor-canvas-container/index.js +19 -2
  373. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  374. package/build-module/components/global-styles/color-indicator-wrapper.js +4 -4
  375. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  376. package/build-module/components/global-styles/color-palette-panel.js +1 -1
  377. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  378. package/build-module/components/global-styles/dimensions-panel.js +1 -1
  379. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  380. package/build-module/components/global-styles/global-styles-provider.js +10 -15
  381. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  382. package/build-module/components/global-styles/gradients-palette-panel.js +1 -1
  383. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  384. package/build-module/components/global-styles/hooks.js +1 -1
  385. package/build-module/components/global-styles/hooks.js.map +1 -1
  386. package/build-module/components/global-styles/icon-with-current-color.js +4 -4
  387. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  388. package/build-module/components/global-styles/navigation-button.js +10 -8
  389. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  390. package/build-module/components/global-styles/palette.js +2 -2
  391. package/build-module/components/global-styles/palette.js.map +1 -1
  392. package/build-module/components/global-styles/preview.js +1 -1
  393. package/build-module/components/global-styles/preview.js.map +1 -1
  394. package/build-module/components/global-styles/root-menu.js +1 -1
  395. package/build-module/components/global-styles/root-menu.js.map +1 -1
  396. package/build-module/components/global-styles/screen-block-list.js +1 -1
  397. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  398. package/build-module/components/global-styles/screen-block.js +1 -1
  399. package/build-module/components/global-styles/screen-block.js.map +1 -1
  400. package/build-module/components/global-styles/screen-colors.js +1 -1
  401. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  402. package/build-module/components/global-styles/screen-css.js +1 -1
  403. package/build-module/components/global-styles/screen-css.js.map +1 -1
  404. package/build-module/components/global-styles/screen-layout.js +1 -1
  405. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  406. package/build-module/components/global-styles/screen-revisions/index.js +1 -1
  407. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  408. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -1
  409. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  410. package/build-module/components/global-styles/screen-root.js +1 -1
  411. package/build-module/components/global-styles/screen-root.js.map +1 -1
  412. package/build-module/components/global-styles/screen-typography.js +1 -1
  413. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  414. package/build-module/components/global-styles/style-variations-container.js +11 -3
  415. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  416. package/build-module/components/global-styles/typography-panel.js +1 -1
  417. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  418. package/build-module/components/global-styles/typography-preview.js +1 -1
  419. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  420. package/build-module/components/global-styles/ui.js +94 -35
  421. package/build-module/components/global-styles/ui.js.map +1 -1
  422. package/build-module/components/global-styles-renderer/index.js +1 -1
  423. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  424. package/build-module/components/header-edit-mode/document-actions/index.js +55 -22
  425. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  426. package/build-module/components/header-edit-mode/index.js +42 -17
  427. package/build-module/components/header-edit-mode/index.js.map +1 -1
  428. package/build-module/components/header-edit-mode/more-menu/index.js +35 -3
  429. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  430. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +4 -4
  431. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
  432. package/build-module/components/header-edit-mode/undo-redo/redo.js +2 -3
  433. package/build-module/components/header-edit-mode/undo-redo/redo.js.map +1 -1
  434. package/build-module/components/header-edit-mode/undo-redo/undo.js +2 -3
  435. package/build-module/components/header-edit-mode/undo-redo/undo.js.map +1 -1
  436. package/build-module/components/keyboard-shortcut-help-modal/index.js +2 -1
  437. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  438. package/build-module/components/keyboard-shortcuts/edit-mode.js +36 -3
  439. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  440. package/build-module/components/keyboard-shortcuts/index.js +7 -2
  441. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  442. package/build-module/components/keyboard-shortcuts/register.js +10 -1
  443. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  444. package/build-module/components/layout/hooks.js +21 -0
  445. package/build-module/components/layout/hooks.js.map +1 -1
  446. package/build-module/components/layout/index.js +119 -28
  447. package/build-module/components/layout/index.js.map +1 -1
  448. package/build-module/components/list/index.js +1 -1
  449. package/build-module/components/list/index.js.map +1 -1
  450. package/build-module/components/page/header.js +33 -0
  451. package/build-module/components/page/header.js.map +1 -0
  452. package/build-module/components/page/index.js +37 -0
  453. package/build-module/components/page/index.js.map +1 -0
  454. package/build-module/components/page-content-focus-manager/back-to-page-notification.js +59 -0
  455. package/build-module/components/page-content-focus-manager/back-to-page-notification.js.map +1 -0
  456. package/build-module/components/page-content-focus-manager/constants.js +2 -0
  457. package/build-module/components/page-content-focus-manager/constants.js.map +1 -0
  458. package/build-module/components/{page-content-lock/use-disable-non-content-blocks.js → page-content-focus-manager/disable-non-page-content-blocks.js} +18 -9
  459. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -0
  460. package/build-module/components/page-content-focus-manager/edit-template-notification.js +110 -0
  461. package/build-module/components/page-content-focus-manager/edit-template-notification.js.map +1 -0
  462. package/build-module/components/page-content-focus-manager/index.js +23 -0
  463. package/build-module/components/page-content-focus-manager/index.js.map +1 -0
  464. package/build-module/components/page-library/grid-item.js +149 -0
  465. package/build-module/components/page-library/grid-item.js.map +1 -0
  466. package/build-module/components/page-library/grid.js +38 -0
  467. package/build-module/components/page-library/grid.js.map +1 -0
  468. package/build-module/components/page-library/index.js +43 -0
  469. package/build-module/components/page-library/index.js.map +1 -0
  470. package/build-module/components/page-library/no-patterns.js +12 -0
  471. package/build-module/components/page-library/no-patterns.js.map +1 -0
  472. package/build-module/components/page-library/patterns-list.js +87 -0
  473. package/build-module/components/page-library/patterns-list.js.map +1 -0
  474. package/build-module/components/page-library/search-items.js +156 -0
  475. package/build-module/components/page-library/search-items.js.map +1 -0
  476. package/build-module/components/page-library/use-library-settings.js +40 -0
  477. package/build-module/components/page-library/use-library-settings.js.map +1 -0
  478. package/build-module/components/page-library/use-patterns.js +176 -0
  479. package/build-module/components/page-library/use-patterns.js.map +1 -0
  480. package/build-module/components/page-library/utils.js +13 -0
  481. package/build-module/components/page-library/utils.js.map +1 -0
  482. package/build-module/components/page-main/index.js +32 -0
  483. package/build-module/components/page-main/index.js.map +1 -0
  484. package/build-module/components/page-templates/index.js +80 -0
  485. package/build-module/components/page-templates/index.js.map +1 -0
  486. package/build-module/components/preferences-modal/enable-feature.js +9 -5
  487. package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
  488. package/build-module/components/preferences-modal/index.js +27 -0
  489. package/build-module/components/preferences-modal/index.js.map +1 -1
  490. package/build-module/components/resizable-frame/index.js +5 -3
  491. package/build-module/components/resizable-frame/index.js.map +1 -1
  492. package/build-module/components/revisions/index.js +1 -1
  493. package/build-module/components/revisions/index.js.map +1 -1
  494. package/build-module/components/routes/link.js +6 -6
  495. package/build-module/components/routes/link.js.map +1 -1
  496. package/build-module/components/routes/use-title.js +1 -1
  497. package/build-module/components/routes/use-title.js.map +1 -1
  498. package/build-module/components/save-button/index.js +15 -11
  499. package/build-module/components/save-button/index.js.map +1 -1
  500. package/build-module/components/save-hub/index.js +1 -1
  501. package/build-module/components/save-hub/index.js.map +1 -1
  502. package/build-module/components/save-panel/index.js +3 -4
  503. package/build-module/components/save-panel/index.js.map +1 -1
  504. package/build-module/components/secondary-sidebar/inserter-sidebar.js +4 -5
  505. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  506. package/build-module/components/secondary-sidebar/list-view-sidebar.js +44 -10
  507. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  508. package/build-module/components/sidebar/index.js +10 -7
  509. package/build-module/components/sidebar/index.js.map +1 -1
  510. package/build-module/components/sidebar-button/index.js +2 -3
  511. package/build-module/components/sidebar-button/index.js.map +1 -1
  512. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +19 -6
  513. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  514. package/build-module/components/sidebar-edit-mode/index.js +8 -6
  515. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  516. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +71 -0
  517. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -0
  518. package/build-module/components/sidebar-edit-mode/page-panels/index.js +51 -40
  519. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  520. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +23 -0
  521. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -0
  522. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +176 -0
  523. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -0
  524. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +33 -0
  525. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -0
  526. package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js +85 -0
  527. package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -0
  528. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -4
  529. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  530. package/build-module/components/sidebar-edit-mode/settings-header/index.js +20 -7
  531. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  532. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -1
  533. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  534. package/build-module/components/sidebar-edit-mode/template-panel/index.js +9 -6
  535. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  536. package/build-module/components/sidebar-navigation-item/index.js +11 -7
  537. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  538. package/build-module/components/sidebar-navigation-screen/index.js +24 -9
  539. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  540. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +27 -0
  541. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -0
  542. package/build-module/components/sidebar-navigation-screen-details-panel/index.js +30 -0
  543. package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -0
  544. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +14 -0
  545. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -0
  546. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +24 -0
  547. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -0
  548. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +14 -0
  549. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -0
  550. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +23 -11
  551. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  552. package/build-module/components/sidebar-navigation-screen-library/category-item.js +37 -0
  553. package/build-module/components/sidebar-navigation-screen-library/category-item.js.map +1 -0
  554. package/build-module/components/sidebar-navigation-screen-library/index.js +87 -0
  555. package/build-module/components/sidebar-navigation-screen-library/index.js.map +1 -0
  556. package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +25 -0
  557. package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +1 -0
  558. package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js +61 -0
  559. package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +1 -0
  560. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js +34 -0
  561. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +1 -0
  562. package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js +27 -0
  563. package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +1 -0
  564. package/build-module/components/sidebar-navigation-screen-main/index.js +13 -13
  565. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  566. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
  567. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  568. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +33 -0
  569. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -0
  570. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +26 -0
  571. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -0
  572. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +45 -90
  573. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  574. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +70 -0
  575. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -0
  576. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +58 -0
  577. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -0
  578. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +56 -0
  579. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -0
  580. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +35 -0
  581. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -0
  582. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +155 -0
  583. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -0
  584. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  585. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  586. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +57 -9
  587. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  588. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +55 -7
  589. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  590. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +22 -50
  591. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  592. package/build-module/components/sidebar-navigation-screen-page/index.js +14 -34
  593. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  594. package/build-module/components/sidebar-navigation-screen-page/page-details.js +28 -28
  595. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  596. package/build-module/components/sidebar-navigation-screen-page/status-label.js +9 -8
  597. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  598. package/build-module/components/sidebar-navigation-screen-pages/index.js +8 -6
  599. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  600. package/build-module/components/sidebar-navigation-screen-pattern/index.js +46 -0
  601. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -0
  602. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +28 -0
  603. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -0
  604. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +22 -0
  605. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -0
  606. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +27 -0
  607. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -0
  608. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +34 -0
  609. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -0
  610. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +71 -0
  611. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -0
  612. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +64 -0
  613. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -0
  614. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +192 -0
  615. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -0
  616. package/build-module/components/sidebar-navigation-screen-template/index.js +18 -6
  617. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  618. package/build-module/components/sidebar-navigation-screen-templates/index.js +11 -10
  619. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  620. package/build-module/components/site-hub/index.js +8 -9
  621. package/build-module/components/site-hub/index.js.map +1 -1
  622. package/build-module/components/style-book/index.js +9 -9
  623. package/build-module/components/style-book/index.js.map +1 -1
  624. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +13 -3
  625. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  626. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
  627. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  628. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +11 -1
  629. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  630. package/build-module/components/table/index.js +21 -0
  631. package/build-module/components/table/index.js.map +1 -0
  632. package/build-module/components/template-part-converter/convert-to-template-part.js +4 -20
  633. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  634. package/build-module/components/welcome-guide/editor.js +1 -1
  635. package/build-module/components/welcome-guide/editor.js.map +1 -1
  636. package/build-module/components/welcome-guide/styles.js +5 -3
  637. package/build-module/components/welcome-guide/styles.js.map +1 -1
  638. package/build-module/hooks/commands/use-common-commands.js +194 -0
  639. package/build-module/hooks/commands/use-common-commands.js.map +1 -0
  640. package/build-module/hooks/commands/use-edit-mode-commands.js +196 -26
  641. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  642. package/build-module/hooks/index.js +1 -0
  643. package/build-module/hooks/index.js.map +1 -1
  644. package/build-module/hooks/navigation-menu-edit.js +77 -0
  645. package/build-module/hooks/navigation-menu-edit.js.map +1 -0
  646. package/build-module/hooks/push-changes-to-global-styles/index.js +4 -2
  647. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  648. package/build-module/hooks/template-part-edit.js +5 -5
  649. package/build-module/hooks/template-part-edit.js.map +1 -1
  650. package/build-module/index.js +1 -0
  651. package/build-module/index.js.map +1 -1
  652. package/build-module/{private-apis.js → lock-unlock.js} +1 -1
  653. package/build-module/lock-unlock.js.map +1 -0
  654. package/build-module/store/actions.js +39 -7
  655. package/build-module/store/actions.js.map +1 -1
  656. package/build-module/store/index.js +1 -1
  657. package/build-module/store/index.js.map +1 -1
  658. package/build-module/store/reducer.js +6 -5
  659. package/build-module/store/reducer.js.map +1 -1
  660. package/build-module/store/selectors.js +37 -15
  661. package/build-module/store/selectors.js.map +1 -1
  662. package/build-module/utils/get-is-list-page.js +12 -5
  663. package/build-module/utils/get-is-list-page.js.map +1 -1
  664. package/build-module/utils/is-previewing-theme.js +2 -2
  665. package/build-module/utils/is-previewing-theme.js.map +1 -1
  666. package/build-module/utils/use-activate-theme.js +2 -2
  667. package/build-module/utils/use-activate-theme.js.map +1 -1
  668. package/build-module/utils/use-debounced-input.js +17 -0
  669. package/build-module/utils/use-debounced-input.js.map +1 -0
  670. package/build-style/style-rtl.css +424 -38
  671. package/build-style/style.css +424 -38
  672. package/package.json +44 -40
  673. package/src/components/add-new-pattern/index.js +92 -0
  674. package/src/components/add-new-template/add-custom-template-modal-content.js +1 -13
  675. package/src/components/add-new-template/index.js +0 -3
  676. package/src/components/add-new-template/new-template.js +121 -26
  677. package/src/components/add-new-template/style.scss +30 -2
  678. package/src/components/app/index.js +1 -1
  679. package/src/components/block-editor/back-button.js +5 -2
  680. package/src/components/block-editor/constants.js +1 -0
  681. package/src/components/block-editor/editor-canvas.js +1 -1
  682. package/src/components/block-editor/get-block-editor-provider.js +29 -0
  683. package/src/components/block-editor/index.js +15 -199
  684. package/src/components/block-editor/providers/default-block-editor-provider.js +44 -0
  685. package/src/components/block-editor/providers/navigation-block-editor-provider.js +114 -0
  686. package/src/components/block-editor/site-editor-canvas.js +155 -0
  687. package/src/components/block-editor/style.scss +6 -0
  688. package/src/components/block-editor/use-site-editor-settings.js +91 -0
  689. package/src/components/canvas-spinner/index.js +11 -1
  690. package/src/components/create-pattern-modal/index.js +134 -0
  691. package/src/components/create-pattern-modal/style.scss +3 -0
  692. package/src/components/create-template-part-modal/index.js +64 -4
  693. package/src/components/editor/index.js +25 -15
  694. package/src/components/editor/style.scss +4 -0
  695. package/src/components/editor-canvas-container/index.js +21 -4
  696. package/src/components/global-styles/color-palette-panel.js +1 -1
  697. package/src/components/global-styles/dimensions-panel.js +1 -1
  698. package/src/components/global-styles/global-styles-provider.js +10 -14
  699. package/src/components/global-styles/gradients-palette-panel.js +1 -1
  700. package/src/components/global-styles/hooks.js +1 -1
  701. package/src/components/global-styles/palette.js +2 -2
  702. package/src/components/global-styles/preview.js +1 -1
  703. package/src/components/global-styles/root-menu.js +1 -1
  704. package/src/components/global-styles/screen-block-list.js +1 -1
  705. package/src/components/global-styles/screen-block.js +1 -1
  706. package/src/components/global-styles/screen-colors.js +1 -1
  707. package/src/components/global-styles/screen-css.js +1 -1
  708. package/src/components/global-styles/screen-layout.js +1 -1
  709. package/src/components/global-styles/screen-revisions/index.js +1 -1
  710. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -1
  711. package/src/components/global-styles/screen-root.js +1 -1
  712. package/src/components/global-styles/screen-typography.js +1 -1
  713. package/src/components/global-styles/stories/index.js +1 -1
  714. package/src/components/global-styles/style-variations-container.js +13 -3
  715. package/src/components/global-styles/style.scss +11 -0
  716. package/src/components/global-styles/typography-panel.js +1 -1
  717. package/src/components/global-styles/typography-preview.js +1 -1
  718. package/src/components/global-styles/ui.js +115 -46
  719. package/src/components/global-styles-renderer/index.js +1 -1
  720. package/src/components/header-edit-mode/document-actions/index.js +51 -26
  721. package/src/components/header-edit-mode/document-actions/style.scss +9 -5
  722. package/src/components/header-edit-mode/index.js +100 -58
  723. package/src/components/header-edit-mode/more-menu/index.js +52 -7
  724. package/src/components/keyboard-shortcuts/edit-mode.js +40 -3
  725. package/src/components/keyboard-shortcuts/index.js +5 -1
  726. package/src/components/keyboard-shortcuts/register.js +11 -1
  727. package/src/components/layout/hooks.js +21 -0
  728. package/src/components/layout/index.js +207 -110
  729. package/src/components/layout/style.scss +65 -1
  730. package/src/components/list/index.js +1 -1
  731. package/src/components/page/header.js +38 -0
  732. package/src/components/page/index.js +38 -0
  733. package/src/components/page/style.scss +38 -0
  734. package/src/components/page-content-focus-manager/back-to-page-notification.js +70 -0
  735. package/src/components/{page-content-lock → page-content-focus-manager}/constants.js +1 -1
  736. package/src/components/{page-content-lock/use-disable-non-content-blocks.js → page-content-focus-manager/disable-non-page-content-blocks.js} +15 -7
  737. package/src/components/page-content-focus-manager/edit-template-notification.js +108 -0
  738. package/src/components/page-content-focus-manager/index.js +26 -0
  739. package/src/components/page-library/grid-item.js +179 -0
  740. package/src/components/page-library/grid.js +39 -0
  741. package/src/components/page-library/index.js +39 -0
  742. package/src/components/page-library/no-patterns.js +12 -0
  743. package/src/components/page-library/patterns-list.js +114 -0
  744. package/src/components/page-library/search-items.js +171 -0
  745. package/src/components/page-library/style.scss +105 -0
  746. package/src/components/page-library/use-library-settings.js +51 -0
  747. package/src/components/page-library/use-patterns.js +238 -0
  748. package/src/components/page-library/utils.js +21 -0
  749. package/src/components/page-main/index.js +27 -0
  750. package/src/components/page-templates/index.js +104 -0
  751. package/src/components/preferences-modal/enable-feature.js +5 -2
  752. package/src/components/preferences-modal/index.js +25 -0
  753. package/src/components/resizable-frame/index.js +3 -1
  754. package/src/components/revisions/index.js +1 -1
  755. package/src/components/routes/link.js +2 -2
  756. package/src/components/routes/use-title.js +1 -1
  757. package/src/components/save-button/index.js +14 -11
  758. package/src/components/save-hub/index.js +1 -1
  759. package/src/components/save-panel/index.js +1 -1
  760. package/src/components/secondary-sidebar/list-view-sidebar.js +53 -6
  761. package/src/components/sidebar/index.js +11 -7
  762. package/src/components/sidebar-button/style.scss +1 -1
  763. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +42 -29
  764. package/src/components/sidebar-edit-mode/index.js +8 -6
  765. package/src/components/sidebar-edit-mode/page-panels/edit-template.js +69 -0
  766. package/src/components/sidebar-edit-mode/page-panels/index.js +53 -53
  767. package/src/components/sidebar-edit-mode/page-panels/page-content.js +27 -0
  768. package/src/components/sidebar-edit-mode/page-panels/page-status.js +233 -0
  769. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +35 -0
  770. package/src/components/sidebar-edit-mode/page-panels/publish-date.js +94 -0
  771. package/src/components/sidebar-edit-mode/page-panels/style.scss +31 -0
  772. package/src/components/sidebar-edit-mode/settings-header/index.js +18 -9
  773. package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -1
  774. package/src/components/sidebar-edit-mode/template-panel/index.js +9 -6
  775. package/src/components/sidebar-navigation-item/index.js +6 -2
  776. package/src/components/sidebar-navigation-item/style.scss +8 -1
  777. package/src/components/sidebar-navigation-screen/index.js +22 -8
  778. package/src/components/sidebar-navigation-screen/style.scss +30 -9
  779. package/src/components/sidebar-navigation-screen-details-footer/index.js +45 -0
  780. package/src/components/sidebar-navigation-screen-details-footer/style.scss +5 -0
  781. package/src/components/sidebar-navigation-screen-details-panel/index.js +40 -0
  782. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +14 -0
  783. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +29 -0
  784. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +14 -0
  785. package/src/components/sidebar-navigation-screen-details-panel/style.scss +25 -0
  786. package/src/components/sidebar-navigation-screen-global-styles/index.js +24 -6
  787. package/src/components/sidebar-navigation-screen-global-styles/style.scss +0 -3
  788. package/src/components/sidebar-navigation-screen-library/category-item.js +43 -0
  789. package/src/components/sidebar-navigation-screen-library/index.js +136 -0
  790. package/src/components/sidebar-navigation-screen-library/style.scss +3 -0
  791. package/src/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +32 -0
  792. package/src/components/sidebar-navigation-screen-library/use-pattern-categories.js +64 -0
  793. package/src/components/sidebar-navigation-screen-library/use-template-part-areas.js +33 -0
  794. package/src/components/sidebar-navigation-screen-library/use-theme-patterns.js +44 -0
  795. package/src/components/sidebar-navigation-screen-main/index.js +11 -14
  796. package/src/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
  797. package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +45 -0
  798. package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +24 -0
  799. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +50 -96
  800. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +89 -0
  801. package/src/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +51 -0
  802. package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +62 -0
  803. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +39 -0
  804. package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +15 -0
  805. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +179 -0
  806. package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  807. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +73 -14
  808. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +61 -2
  809. package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +25 -47
  810. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +4 -0
  811. package/src/components/sidebar-navigation-screen-page/index.js +19 -58
  812. package/src/components/sidebar-navigation-screen-page/page-details.js +42 -39
  813. package/src/components/sidebar-navigation-screen-page/status-label.js +23 -19
  814. package/src/components/sidebar-navigation-screen-page/style.scss +1 -18
  815. package/src/components/sidebar-navigation-screen-pages/index.js +30 -29
  816. package/src/components/sidebar-navigation-screen-pattern/index.js +44 -0
  817. package/src/components/sidebar-navigation-screen-pattern/style.scss +25 -0
  818. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +28 -0
  819. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +21 -0
  820. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +30 -0
  821. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +33 -0
  822. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +71 -0
  823. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +86 -0
  824. package/src/components/sidebar-navigation-screen-template/home-template-details.js +230 -0
  825. package/src/components/sidebar-navigation-screen-template/index.js +19 -5
  826. package/src/components/sidebar-navigation-screen-template/style.scss +37 -14
  827. package/src/components/sidebar-navigation-screen-templates/index.js +18 -25
  828. package/src/components/site-hub/index.js +13 -9
  829. package/src/components/site-hub/style.scss +4 -3
  830. package/src/components/style-book/index.js +1 -1
  831. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +16 -3
  832. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
  833. package/src/components/sync-state-with-url/use-sync-path-with-url.js +11 -1
  834. package/src/components/table/index.js +33 -0
  835. package/src/components/table/style.scss +37 -0
  836. package/src/components/template-part-converter/convert-to-template-part.js +4 -27
  837. package/src/components/welcome-guide/editor.js +1 -1
  838. package/src/components/welcome-guide/styles.js +5 -3
  839. package/src/hooks/commands/use-common-commands.js +186 -0
  840. package/src/hooks/commands/use-edit-mode-commands.js +183 -28
  841. package/src/hooks/index.js +1 -0
  842. package/src/hooks/navigation-menu-edit.js +95 -0
  843. package/src/hooks/push-changes-to-global-styles/index.js +1 -1
  844. package/src/hooks/template-part-edit.js +1 -1
  845. package/src/index.js +1 -0
  846. package/src/store/actions.js +40 -8
  847. package/src/store/index.js +1 -1
  848. package/src/store/reducer.js +6 -5
  849. package/src/store/selectors.js +39 -9
  850. package/src/store/test/actions.js +8 -8
  851. package/src/store/test/reducer.js +11 -11
  852. package/src/store/test/selectors.js +10 -8
  853. package/src/style.scss +13 -2
  854. package/src/utils/get-is-list-page.js +16 -4
  855. package/src/utils/is-previewing-theme.js +4 -2
  856. package/src/utils/use-activate-theme.js +3 -2
  857. package/src/utils/use-debounced-input.js +17 -0
  858. package/build/components/add-new-template/new-template-part.js +0 -113
  859. package/build/components/add-new-template/new-template-part.js.map +0 -1
  860. package/build/components/page-content-lock/constants.js +0 -9
  861. package/build/components/page-content-lock/constants.js.map +0 -1
  862. package/build/components/page-content-lock/index.js +0 -29
  863. package/build/components/page-content-lock/index.js.map +0 -1
  864. package/build/components/page-content-lock/use-disable-non-content-blocks.js +0 -49
  865. package/build/components/page-content-lock/use-disable-non-content-blocks.js.map +0 -1
  866. package/build/components/page-content-lock/use-page-content-lock-notifications.js +0 -112
  867. package/build/components/page-content-lock/use-page-content-lock-notifications.js.map +0 -1
  868. package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js +0 -79
  869. package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +0 -1
  870. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -52
  871. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +0 -1
  872. package/build/components/sidebar-navigation-screen-template-part/index.js +0 -105
  873. package/build/components/sidebar-navigation-screen-template-part/index.js.map +0 -1
  874. package/build/components/sidebar-navigation-subtitle/index.js +0 -17
  875. package/build/components/sidebar-navigation-subtitle/index.js.map +0 -1
  876. package/build/private-apis.js.map +0 -1
  877. package/build-module/components/add-new-template/new-template-part.js +0 -93
  878. package/build-module/components/add-new-template/new-template-part.js.map +0 -1
  879. package/build-module/components/page-content-lock/constants.js +0 -2
  880. package/build-module/components/page-content-lock/constants.js.map +0 -1
  881. package/build-module/components/page-content-lock/index.js +0 -14
  882. package/build-module/components/page-content-lock/index.js.map +0 -1
  883. package/build-module/components/page-content-lock/use-disable-non-content-blocks.js.map +0 -1
  884. package/build-module/components/page-content-lock/use-page-content-lock-notifications.js +0 -98
  885. package/build-module/components/page-content-lock/use-page-content-lock-notifications.js.map +0 -1
  886. package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js +0 -67
  887. package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +0 -1
  888. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -39
  889. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +0 -1
  890. package/build-module/components/sidebar-navigation-screen-template-part/index.js +0 -86
  891. package/build-module/components/sidebar-navigation-screen-template-part/index.js.map +0 -1
  892. package/build-module/components/sidebar-navigation-subtitle/index.js +0 -9
  893. package/build-module/components/sidebar-navigation-subtitle/index.js.map +0 -1
  894. package/build-module/private-apis.js.map +0 -1
  895. package/src/components/add-new-template/new-template-part.js +0 -109
  896. package/src/components/page-content-lock/index.js +0 -14
  897. package/src/components/page-content-lock/use-page-content-lock-notifications.js +0 -128
  898. package/src/components/sidebar-edit-mode/page-panels/content-blocks-list.js +0 -77
  899. package/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -47
  900. package/src/components/sidebar-navigation-screen-template-part/index.js +0 -103
  901. package/src/components/sidebar-navigation-screen-templates/style.scss +0 -4
  902. package/src/components/sidebar-navigation-subtitle/index.js +0 -5
  903. package/src/components/sidebar-navigation-subtitle/style.scss +0 -7
  904. /package/src/{private-apis.js → lock-unlock.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/revisions/index.js"],"names":["Disabled","__","BlockList","privateApis","blockEditorPrivateApis","store","blockEditorStore","__unstableEditorStyles","EditorStyles","__unstableIframe","Iframe","useSelect","useMemo","coreStore","unlock","mergeBaseAndUserConfigs","EditorCanvasContainer","ExperimentalBlockEditorProvider","useGlobalStylesOutputWithConfig","isObjectEmpty","object","Object","keys","length","Revisions","onClose","userConfig","blocks","baseConfig","select","__experimentalGetCurrentThemeBaseGlobalStyles","mergedConfig","renderedBlocksArray","Array","isArray","originalSettings","getSettings","settings","__unstableIsPreviewMode","globalStyles","editorStyles","styles"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,uBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SACCC,SADD,EAECC,WAAW,IAAIC,sBAFhB,EAGCC,KAAK,IAAIC,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AF,CAFkC,CAAnC;AAKA,QAAMQ,gBAAgB,GAAGxB,SAAS,CAC/BkB,MAAF,IAAcA,MAAM,CAAEvB,gBAAF,CAAN,CAA2B8B,WAA3B,EADmB,EAEjC,EAFiC,CAAlC;AAIA,QAAMC,QAAQ,GAAGzB,OAAO,CACvB,OAAQ,EAAE,GAAGuB,gBAAL;AAAuBG,IAAAA,uBAAuB,EAAE;AAAhD,GAAR,CADuB,EAEvB,CAAEH,gBAAF,CAFuB,CAAxB;AAKA,QAAM,CAAEI,YAAF,IAAmBrB,+BAA+B,CAAEa,YAAF,CAAxD;AAEA,QAAMS,YAAY,GACjB,CAAErB,aAAa,CAAEoB,YAAF,CAAf,IAAmC,CAAEpB,aAAa,CAAEO,UAAF,CAAlD,GACGa,YADH,GAEGF,QAAQ,CAACI,MAHb;AAKA,SACC,cAAC,qBAAD;AACC,IAAA,KAAK,EAAGxC,EAAE,CAAE,WAAF,CADX;AAEC,IAAA,OAAO,EAAGwB,OAFX;AAGC,IAAA,gBAAgB,EAAGxB,EAAE,CAAE,iBAAF,CAHtB;AAIC,IAAA,cAAc,EAAG;AAJlB,KAMC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,6BADX;AAEC,IAAA,IAAI,EAAC,WAFN;AAGC,IAAA,QAAQ,EAAG;AAHZ,KAKC,cAAC,YAAD;AAAc,IAAA,MAAM,EAAGuC;AAAvB,IALD,EAMC,6BAEE;AACA;AACC,0FAJH,CAND,EAaC,cAAC,QAAD;AAAU,IAAA,SAAS,EAAC;AAApB,KACC,cAAC,+BAAD;AACC,IAAA,KAAK,EAAGR,mBADT;AAEC,IAAA,QAAQ,EAAGK;AAFZ,KAIC,cAAC,SAAD;AAAW,IAAA,cAAc,EAAG;AAA5B,IAJD,CADD,CAbD,CAND,CADD;AA+BA;;AAED,eAAeb,SAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Disabled } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\n\nimport { unlock } from '../../private-apis';\nimport { mergeBaseAndUserConfigs } from '../global-styles/global-styles-provider';\nimport EditorCanvasContainer from '../editor-canvas-container';\n\nconst { ExperimentalBlockEditorProvider, useGlobalStylesOutputWithConfig } =\n\tunlock( blockEditorPrivateApis );\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\nfunction Revisions( { onClose, userConfig, blocks } ) {\n\tconst { baseConfig } = useSelect(\n\t\t( select ) => ( {\n\t\t\tbaseConfig:\n\t\t\t\tselect(\n\t\t\t\t\tcoreStore\n\t\t\t\t).__experimentalGetCurrentThemeBaseGlobalStyles(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\tconst renderedBlocksArray = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),\n\t\t[ originalSettings ]\n\t);\n\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst editorStyles =\n\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )\n\t\t\t? globalStyles\n\t\t\t: settings.styles;\n\n\treturn (\n\t\t<EditorCanvasContainer\n\t\t\ttitle={ __( 'Revisions' ) }\n\t\t\tonClose={ onClose }\n\t\t\tcloseButtonLabel={ __( 'Close revisions' ) }\n\t\t\tenableResizing={ true }\n\t\t>\n\t\t\t<Iframe\n\t\t\t\tclassName=\"edit-site-revisions__iframe\"\n\t\t\t\tname=\"revisions\"\n\t\t\t\ttabIndex={ 0 }\n\t\t\t>\n\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t<style>\n\t\t\t\t\t{\n\t\t\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\t\t\t`.is-root-container { display: flow-root; } body { position: relative; padding: 32px; }`\n\t\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t\t<Disabled className=\"edit-site-revisions__example-preview__content\">\n\t\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\t\tvalue={ renderedBlocksArray }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList renderAppender={ false } />\n\t\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t\t</Disabled>\n\t\t\t</Iframe>\n\t\t</EditorCanvasContainer>\n\t);\n}\n\nexport default Revisions;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/revisions/index.js"],"names":["Disabled","__","BlockList","privateApis","blockEditorPrivateApis","store","blockEditorStore","__unstableEditorStyles","EditorStyles","__unstableIframe","Iframe","useSelect","useMemo","coreStore","unlock","mergeBaseAndUserConfigs","EditorCanvasContainer","ExperimentalBlockEditorProvider","useGlobalStylesOutputWithConfig","isObjectEmpty","object","Object","keys","length","Revisions","onClose","userConfig","blocks","baseConfig","select","__experimentalGetCurrentThemeBaseGlobalStyles","mergedConfig","renderedBlocksArray","Array","isArray","originalSettings","getSettings","settings","__unstableIsPreviewMode","globalStyles","editorStyles","styles"],"mappings":";;AAAA;AACA;AACA;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D;AA+BA;;AAED,eAAeb,SAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Disabled } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\n\nimport { unlock } from '../../lock-unlock';\nimport { mergeBaseAndUserConfigs } from '../global-styles/global-styles-provider';\nimport EditorCanvasContainer from '../editor-canvas-container';\n\nconst { ExperimentalBlockEditorProvider, useGlobalStylesOutputWithConfig } =\n\tunlock( blockEditorPrivateApis );\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\nfunction Revisions( { onClose, userConfig, blocks } ) {\n\tconst { baseConfig } = useSelect(\n\t\t( select ) => ( {\n\t\t\tbaseConfig:\n\t\t\t\tselect(\n\t\t\t\t\tcoreStore\n\t\t\t\t).__experimentalGetCurrentThemeBaseGlobalStyles(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\tconst renderedBlocksArray = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),\n\t\t[ originalSettings ]\n\t);\n\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst editorStyles =\n\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )\n\t\t\t? globalStyles\n\t\t\t: settings.styles;\n\n\treturn (\n\t\t<EditorCanvasContainer\n\t\t\ttitle={ __( 'Revisions' ) }\n\t\t\tonClose={ onClose }\n\t\t\tcloseButtonLabel={ __( 'Close revisions' ) }\n\t\t\tenableResizing={ true }\n\t\t>\n\t\t\t<Iframe\n\t\t\t\tclassName=\"edit-site-revisions__iframe\"\n\t\t\t\tname=\"revisions\"\n\t\t\t\ttabIndex={ 0 }\n\t\t\t>\n\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t<style>\n\t\t\t\t\t{\n\t\t\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\t\t\t`.is-root-container { display: flow-root; } body { position: relative; padding: 32px; }`\n\t\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t\t<Disabled className=\"edit-site-revisions__example-preview__content\">\n\t\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\t\tvalue={ renderedBlocksArray }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList renderAppender={ false } />\n\t\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t\t</Disabled>\n\t\t\t</Iframe>\n\t\t</EditorCanvasContainer>\n\t);\n}\n\nexport default Revisions;\n"]}
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement } from "@wordpress/element";
3
2
 
4
3
  /**
@@ -10,7 +9,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
10
9
  * Internal dependencies
11
10
  */
12
11
 
13
- import { unlock } from '../../private-apis';
12
+ import { unlock } from '../../lock-unlock';
14
13
  import { isPreviewingTheme, currentlyPreviewingTheme } from '../../utils/is-previewing-theme';
15
14
  const {
16
15
  useHistory
@@ -33,7 +32,7 @@ export function useLink(params = {}, state, shouldReplace = false) {
33
32
 
34
33
  if (isPreviewingTheme()) {
35
34
  params = { ...params,
36
- theme_preview: currentlyPreviewingTheme()
35
+ wp_theme_preview: currentlyPreviewingTheme()
37
36
  };
38
37
  }
39
38
 
@@ -54,9 +53,10 @@ export default function Link({
54
53
  href,
55
54
  onClick
56
55
  } = useLink(params, state, shouldReplace);
57
- return createElement("a", _extends({
56
+ return createElement("a", {
58
57
  href: href,
59
- onClick: onClick
60
- }, props), children);
58
+ onClick: onClick,
59
+ ...props
60
+ }, children);
61
61
  }
62
62
  //# sourceMappingURL=link.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/routes/link.js"],"names":["addQueryArgs","getQueryArgs","removeQueryArgs","privateApis","routerPrivateApis","unlock","isPreviewingTheme","currentlyPreviewingTheme","useHistory","useLink","params","state","shouldReplace","history","onClick","event","preventDefault","replace","push","currentArgs","window","location","href","currentUrlWithoutArgs","Object","keys","theme_preview","newUrl","Link","children","props"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,YAAT,EAAuBC,YAAvB,EAAqCC,eAArC,QAA4D,gBAA5D;AACA,SAASC,WAAW,IAAIC,iBAAxB,QAAiD,mBAAjD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,SACCC,iBADD,EAECC,wBAFD,QAGO,iCAHP;AAKA,MAAM;AAAEC,EAAAA;AAAF,IAAiBH,MAAM,CAAED,iBAAF,CAA7B;AAEA,OAAO,SAASK,OAAT,CAAkBC,MAAM,GAAG,EAA3B,EAA+BC,KAA/B,EAAsCC,aAAa,GAAG,KAAtD,EAA8D;AACpE,QAAMC,OAAO,GAAGL,UAAU,EAA1B;;AAEA,WAASM,OAAT,CAAkBC,KAAlB,EAA0B;AACzBA,IAAAA,KAAK,CAACC,cAAN;;AAEA,QAAKJ,aAAL,EAAqB;AACpBC,MAAAA,OAAO,CAACI,OAAR,CAAiBP,MAAjB,EAAyBC,KAAzB;AACA,KAFD,MAEO;AACNE,MAAAA,OAAO,CAACK,IAAR,CAAcR,MAAd,EAAsBC,KAAtB;AACA;AACD;;AAED,QAAMQ,WAAW,GAAGlB,YAAY,CAAEmB,MAAM,CAACC,QAAP,CAAgBC,IAAlB,CAAhC;AACA,QAAMC,qBAAqB,GAAGrB,eAAe,CAC5CkB,MAAM,CAACC,QAAP,CAAgBC,IAD4B,EAE5C,GAAGE,MAAM,CAACC,IAAP,CAAaN,WAAb,CAFyC,CAA7C;;AAKA,MAAKb,iBAAiB,EAAtB,EAA2B;AAC1BI,IAAAA,MAAM,GAAG,EACR,GAAGA,MADK;AAERgB,MAAAA,aAAa,EAAEnB,wBAAwB;AAF/B,KAAT;AAIA;;AAED,QAAMoB,MAAM,GAAG3B,YAAY,CAAEuB,qBAAF,EAAyBb,MAAzB,CAA3B;AAEA,SAAO;AACNY,IAAAA,IAAI,EAAEK,MADA;AAENb,IAAAA;AAFM,GAAP;AAIA;AAED,eAAe,SAASc,IAAT,CAAe;AAC7BlB,EAAAA,MAAM,GAAG,EADoB;AAE7BC,EAAAA,KAF6B;AAG7BM,EAAAA,OAAO,EAAEL,aAAa,GAAG,KAHI;AAI7BiB,EAAAA,QAJ6B;AAK7B,KAAGC;AAL0B,CAAf,EAMX;AACH,QAAM;AAAER,IAAAA,IAAF;AAAQR,IAAAA;AAAR,MAAoBL,OAAO,CAAEC,MAAF,EAAUC,KAAV,EAAiBC,aAAjB,CAAjC;AAEA,SACC;AAAG,IAAA,IAAI,EAAGU,IAAV;AAAiB,IAAA,OAAO,EAAGR;AAA3B,KAA0CgB,KAA1C,GACGD,QADH,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs, getQueryArgs, removeQueryArgs } from '@wordpress/url';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport function useLink( params = {}, state, shouldReplace = false ) {\n\tconst history = useHistory();\n\n\tfunction onClick( event ) {\n\t\tevent.preventDefault();\n\n\t\tif ( shouldReplace ) {\n\t\t\thistory.replace( params, state );\n\t\t} else {\n\t\t\thistory.push( params, state );\n\t\t}\n\t}\n\n\tconst currentArgs = getQueryArgs( window.location.href );\n\tconst currentUrlWithoutArgs = removeQueryArgs(\n\t\twindow.location.href,\n\t\t...Object.keys( currentArgs )\n\t);\n\n\tif ( isPreviewingTheme() ) {\n\t\tparams = {\n\t\t\t...params,\n\t\t\ttheme_preview: currentlyPreviewingTheme(),\n\t\t};\n\t}\n\n\tconst newUrl = addQueryArgs( currentUrlWithoutArgs, params );\n\n\treturn {\n\t\thref: newUrl,\n\t\tonClick,\n\t};\n}\n\nexport default function Link( {\n\tparams = {},\n\tstate,\n\treplace: shouldReplace = false,\n\tchildren,\n\t...props\n} ) {\n\tconst { href, onClick } = useLink( params, state, shouldReplace );\n\n\treturn (\n\t\t<a href={ href } onClick={ onClick } { ...props }>\n\t\t\t{ children }\n\t\t</a>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/routes/link.js"],"names":["addQueryArgs","getQueryArgs","removeQueryArgs","privateApis","routerPrivateApis","unlock","isPreviewingTheme","currentlyPreviewingTheme","useHistory","useLink","params","state","shouldReplace","history","onClick","event","preventDefault","replace","push","currentArgs","window","location","href","currentUrlWithoutArgs","Object","keys","wp_theme_preview","newUrl","Link","children","props"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,YAAT,EAAuBC,YAAvB,EAAqCC,eAArC,QAA4D,gBAA5D;AACA,SAASC,WAAW,IAAIC,iBAAxB,QAAiD,mBAAjD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,mBAAvB;AACA,SACCC,iBADD,EAECC,wBAFD,QAGO,iCAHP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,CAAEC,MAAF,EAAUC,KAAV,EAAiBC,aAAjB,CAAjC;AAEA,SACC;AAAG,IAAA,IAAI,EAAGU,IAAV;AAAiB,IAAA,OAAO,EAAGR,OAA3B;AAAA,OAA0CgB;AAA1C,KACGD,QADH,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs, getQueryArgs, removeQueryArgs } from '@wordpress/url';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport function useLink( params = {}, state, shouldReplace = false ) {\n\tconst history = useHistory();\n\n\tfunction onClick( event ) {\n\t\tevent.preventDefault();\n\n\t\tif ( shouldReplace ) {\n\t\t\thistory.replace( params, state );\n\t\t} else {\n\t\t\thistory.push( params, state );\n\t\t}\n\t}\n\n\tconst currentArgs = getQueryArgs( window.location.href );\n\tconst currentUrlWithoutArgs = removeQueryArgs(\n\t\twindow.location.href,\n\t\t...Object.keys( currentArgs )\n\t);\n\n\tif ( isPreviewingTheme() ) {\n\t\tparams = {\n\t\t\t...params,\n\t\t\twp_theme_preview: currentlyPreviewingTheme(),\n\t\t};\n\t}\n\n\tconst newUrl = addQueryArgs( currentUrlWithoutArgs, params );\n\n\treturn {\n\t\thref: newUrl,\n\t\tonClick,\n\t};\n}\n\nexport default function Link( {\n\tparams = {},\n\tstate,\n\treplace: shouldReplace = false,\n\tchildren,\n\t...props\n} ) {\n\tconst { href, onClick } = useLink( params, state, shouldReplace );\n\n\treturn (\n\t\t<a href={ href } onClick={ onClick } { ...props }>\n\t\t\t{ children }\n\t\t</a>\n\t);\n}\n"]}
@@ -12,7 +12,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
12
12
  * Internal dependencies
13
13
  */
14
14
 
15
- import { unlock } from '../../private-apis';
15
+ import { unlock } from '../../lock-unlock';
16
16
  const {
17
17
  useLocation
18
18
  } = unlock(routerPrivateApis);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/routes/use-title.js"],"names":["useEffect","useRef","useSelect","store","coreStore","__","sprintf","speak","decodeEntities","privateApis","routerPrivateApis","unlock","useLocation","useTitle","title","location","siteTitle","select","getEntityRecord","isInitialLocationRef","current","formattedTitle","document"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,MAApB,QAAkC,oBAAlC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,KAAT,QAAsB,iBAAtB;AACA,SAASC,cAAT,QAA+B,0BAA/B;AACA,SAASC,WAAW,IAAIC,iBAAxB,QAAiD,mBAAjD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAkBD,MAAM,CAAED,iBAAF,CAA9B;AAEA,eAAe,SAASG,QAAT,CAAmBC,KAAnB,EAA2B;AACzC,QAAMC,QAAQ,GAAGH,WAAW,EAA5B;AACA,QAAMI,SAAS,GAAGd,SAAS,CACxBe,MAAF,IACCA,MAAM,CAAEb,SAAF,CAAN,CAAoBc,eAApB,CAAqC,MAArC,EAA6C,MAA7C,GAAuDJ,KAF9B,EAG1B,EAH0B,CAA3B;AAKA,QAAMK,oBAAoB,GAAGlB,MAAM,CAAE,IAAF,CAAnC;AAEAD,EAAAA,SAAS,CAAE,MAAM;AAChBmB,IAAAA,oBAAoB,CAACC,OAArB,GAA+B,KAA/B;AACA,GAFQ,EAEN,CAAEL,QAAF,CAFM,CAAT;AAIAf,EAAAA,SAAS,CAAE,MAAM;AAChB;AACA,QAAKmB,oBAAoB,CAACC,OAA1B,EAAoC;AACnC;AACA;;AAED,QAAKN,KAAK,IAAIE,SAAd,EAA0B;AACzB;AACA,YAAMK,cAAc,GAAGf,OAAO;AAC7B;AACAD,MAAAA,EAAE,CAAE,yBAAF,CAF2B,EAG7BG,cAAc,CAAEM,KAAF,CAHe,EAI7BN,cAAc,CAAEQ,SAAF,CAJe,CAA9B;AAOAM,MAAAA,QAAQ,CAACR,KAAT,GAAiBO,cAAjB,CATyB,CAWzB;;AACAd,MAAAA,KAAK,CACJD,OAAO;AACN;AACAD,MAAAA,EAAE,CAAE,oBAAF,CAFI,EAGNiB,QAAQ,CAACR,KAHH,CADH,EAMJ,WANI,CAAL;AAQA;AACD,GA3BQ,EA2BN,CAAEA,KAAF,EAASE,SAAT,EAAoBD,QAApB,CA3BM,CAAT;AA4BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function useTitle( title ) {\n\tconst location = useLocation();\n\tconst siteTitle = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord( 'root', 'site' )?.title,\n\t\t[]\n\t);\n\tconst isInitialLocationRef = useRef( true );\n\n\tuseEffect( () => {\n\t\tisInitialLocationRef.current = false;\n\t}, [ location ] );\n\n\tuseEffect( () => {\n\t\t// Don't update or announce the title for initial page load.\n\t\tif ( isInitialLocationRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( title && siteTitle ) {\n\t\t\t// @see https://github.com/WordPress/wordpress-develop/blob/94849898192d271d533e09756007e176feb80697/src/wp-admin/admin-header.php#L67-L68\n\t\t\tconst formattedTitle = sprintf(\n\t\t\t\t/* translators: Admin screen title. 1: Admin screen name, 2: Network or site name. */\n\t\t\t\t__( '%1$s ‹ %2$s — WordPress' ),\n\t\t\t\tdecodeEntities( title ),\n\t\t\t\tdecodeEntities( siteTitle )\n\t\t\t);\n\n\t\t\tdocument.title = formattedTitle;\n\n\t\t\t// Announce title on route change for screen readers.\n\t\t\tspeak(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: The page title that is currently displaying. */\n\t\t\t\t\t__( 'Now displaying: %s' ),\n\t\t\t\t\tdocument.title\n\t\t\t\t),\n\t\t\t\t'assertive'\n\t\t\t);\n\t\t}\n\t}, [ title, siteTitle, location ] );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/routes/use-title.js"],"names":["useEffect","useRef","useSelect","store","coreStore","__","sprintf","speak","decodeEntities","privateApis","routerPrivateApis","unlock","useLocation","useTitle","title","location","siteTitle","select","getEntityRecord","isInitialLocationRef","current","formattedTitle","document"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,MAApB,QAAkC,oBAAlC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,KAAT,QAAsB,iBAAtB;AACA,SAASC,cAAT,QAA+B,0BAA/B;AACA,SAASC,WAAW,IAAIC,iBAAxB,QAAiD,mBAAjD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,mBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAkBD,MAAM,CAAED,iBAAF,CAA9B;AAEA,eAAe,SAASG,QAAT,CAAmBC,KAAnB,EAA2B;AACzC,QAAMC,QAAQ,GAAGH,WAAW,EAA5B;AACA,QAAMI,SAAS,GAAGd,SAAS,CACxBe,MAAF,IACCA,MAAM,CAAEb,SAAF,CAAN,CAAoBc,eAApB,CAAqC,MAArC,EAA6C,MAA7C,GAAuDJ,KAF9B,EAG1B,EAH0B,CAA3B;AAKA,QAAMK,oBAAoB,GAAGlB,MAAM,CAAE,IAAF,CAAnC;AAEAD,EAAAA,SAAS,CAAE,MAAM;AAChBmB,IAAAA,oBAAoB,CAACC,OAArB,GAA+B,KAA/B;AACA,GAFQ,EAEN,CAAEL,QAAF,CAFM,CAAT;AAIAf,EAAAA,SAAS,CAAE,MAAM;AAChB;AACA,QAAKmB,oBAAoB,CAACC,OAA1B,EAAoC;AACnC;AACA;;AAED,QAAKN,KAAK,IAAIE,SAAd,EAA0B;AACzB;AACA,YAAMK,cAAc,GAAGf,OAAO;AAC7B;AACAD,MAAAA,EAAE,CAAE,yBAAF,CAF2B,EAG7BG,cAAc,CAAEM,KAAF,CAHe,EAI7BN,cAAc,CAAEQ,SAAF,CAJe,CAA9B;AAOAM,MAAAA,QAAQ,CAACR,KAAT,GAAiBO,cAAjB,CATyB,CAWzB;;AACAd,MAAAA,KAAK,CACJD,OAAO;AACN;AACAD,MAAAA,EAAE,CAAE,oBAAF,CAFI,EAGNiB,QAAQ,CAACR,KAHH,CADH,EAMJ,WANI,CAAL;AAQA;AACD,GA3BQ,EA2BN,CAAEA,KAAF,EAASE,SAAT,EAAoBD,QAApB,CA3BM,CAAT;AA4BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function useTitle( title ) {\n\tconst location = useLocation();\n\tconst siteTitle = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord( 'root', 'site' )?.title,\n\t\t[]\n\t);\n\tconst isInitialLocationRef = useRef( true );\n\n\tuseEffect( () => {\n\t\tisInitialLocationRef.current = false;\n\t}, [ location ] );\n\n\tuseEffect( () => {\n\t\t// Don't update or announce the title for initial page load.\n\t\tif ( isInitialLocationRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( title && siteTitle ) {\n\t\t\t// @see https://github.com/WordPress/wordpress-develop/blob/94849898192d271d533e09756007e176feb80697/src/wp-admin/admin-header.php#L67-L68\n\t\t\tconst formattedTitle = sprintf(\n\t\t\t\t/* translators: Admin screen title. 1: Admin screen name, 2: Network or site name. */\n\t\t\t\t__( '%1$s ‹ %2$s — WordPress' ),\n\t\t\t\tdecodeEntities( title ),\n\t\t\t\tdecodeEntities( siteTitle )\n\t\t\t);\n\n\t\t\tdocument.title = formattedTitle;\n\n\t\t\t// Announce title on route change for screen readers.\n\t\t\tspeak(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: The page title that is currently displaying. */\n\t\t\t\t\t__( 'Now displaying: %s' ),\n\t\t\t\t\tdocument.title\n\t\t\t\t),\n\t\t\t\t'assertive'\n\t\t\t);\n\t\t}\n\t}, [ title, siteTitle, location ] );\n}\n"]}
@@ -49,20 +49,24 @@ export default function SaveButton({
49
49
  const disabled = isSaving || !activateSaveEnabled;
50
50
 
51
51
  const getLabel = () => {
52
- if (isSaving) {
53
- return __('Saving');
54
- }
52
+ if (isPreviewingTheme()) {
53
+ if (isSaving) {
54
+ return __('Activating');
55
+ } else if (disabled) {
56
+ return __('Saved');
57
+ } else if (isDirty) {
58
+ return __('Activate & Save');
59
+ }
55
60
 
56
- if (disabled) {
57
- return __('Saved');
61
+ return __('Activate');
58
62
  }
59
63
 
60
- if (defaultLabel) return defaultLabel;
61
-
62
- if (isPreviewingTheme() && isDirty) {
63
- return __('Activate & Save');
64
- } else if (isPreviewingTheme()) {
65
- return __('Activate');
64
+ if (isSaving) {
65
+ return __('Saving');
66
+ } else if (disabled) {
67
+ return __('Saved');
68
+ } else if (defaultLabel) {
69
+ return defaultLabel;
66
70
  }
67
71
 
68
72
  return __('Save');
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"names":["useSelect","useDispatch","Button","__","store","coreStore","displayShortcut","editSiteStore","isPreviewingTheme","SaveButton","className","variant","showTooltip","defaultLabel","icon","isDirty","isSaving","isSaveViewOpen","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","dirtyEntityRecords","isSaveViewOpened","length","some","record","kind","name","key","setIsSaveViewOpened","activateSaveEnabled","disabled","getLabel","label","undefined","primary"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,eAAT,QAAgC,qBAAhC;AAEA;AACA;AACA;;AACA,SAASF,KAAK,IAAIG,aAAlB,QAAuC,aAAvC;AACA,SAASC,iBAAT,QAAkC,iCAAlC;AAEA,eAAe,SAASC,UAAT,CAAqB;AACnCC,EAAAA,SAAS,GAAG,+BADuB;AAEnCC,EAAAA,OAAO,GAAG,SAFyB;AAGnCC,EAAAA,WAAW,GAAG,IAHqB;AAInCC,EAAAA,YAJmC;AAKnCC,EAAAA;AALmC,CAArB,EAMX;AACH,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA,QAAX;AAAqBC,IAAAA;AAArB,MAAwCjB,SAAS,CAAIkB,MAAF,IAAc;AACtE,UAAM;AAAEC,MAAAA,mCAAF;AAAuCC,MAAAA;AAAvC,QACLF,MAAM,CAAEb,SAAF,CADP;;AAEA,UAAMgB,kBAAkB,GAAGF,mCAAmC,EAA9D;;AACA,UAAM;AAAEG,MAAAA;AAAF,QAAuBJ,MAAM,CAAEX,aAAF,CAAnC;AACA,WAAO;AACNQ,MAAAA,OAAO,EAAEM,kBAAkB,CAACE,MAAnB,GAA4B,CAD/B;AAENP,MAAAA,QAAQ,EAAEK,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Ae5B,eAAe,CAAC6B,OAAhB,CAAyB,GAAzB;AAClC;AACH;AACA;AACA;AACA;AACA;AAlBE;AAmBC,IAAA,WAAW,EAAGvB,WAnBf;AAoBC,IAAA,IAAI,EAAGE;AApBR,KAsBGmB,KAtBH,CADD;AA0BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nexport default function SaveButton( {\n\tclassName = 'edit-site-save-button__button',\n\tvariant = 'primary',\n\tshowTooltip = true,\n\tdefaultLabel,\n\ticon,\n} ) {\n\tconst { isDirty, isSaving, isSaveViewOpen } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\treturn {\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving: dirtyEntityRecords.some( ( record ) =>\n\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t),\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\n\tconst getLabel = () => {\n\t\tif ( isSaving ) {\n\t\t\treturn __( 'Saving' );\n\t\t}\n\t\tif ( disabled ) {\n\t\t\treturn __( 'Saved' );\n\t\t}\n\n\t\tif ( defaultLabel ) return defaultLabel;\n\n\t\tif ( isPreviewingTheme() && isDirty ) {\n\t\t\treturn __( 'Activate & Save' );\n\t\t} else if ( isPreviewingTheme() ) {\n\t\t\treturn __( 'Activate' );\n\t\t}\n\n\t\treturn __( 'Save' );\n\t};\n\tconst label = getLabel();\n\n\treturn (\n\t\t<Button\n\t\t\tvariant={ variant }\n\t\t\tclassName={ className }\n\t\t\taria-disabled={ disabled }\n\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\tisBusy={ isSaving }\n\t\t\tonClick={ disabled ? undefined : () => setIsSaveViewOpened( true ) }\n\t\t\tlabel={ label }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ disabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\t/*\n\t\t\t * Displaying the keyboard shortcut conditionally makes the tooltip\n\t\t\t * itself show conditionally. This would trigger a full-rerendering\n\t\t\t * of the button that we want to avoid. By setting `showTooltip`,\n\t\t\t & the tooltip is always rendered even when there's no keyboard shortcut.\n\t\t\t */\n\t\t\tshowTooltip={ showTooltip }\n\t\t\ticon={ icon }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"names":["useSelect","useDispatch","Button","__","store","coreStore","displayShortcut","editSiteStore","isPreviewingTheme","SaveButton","className","variant","showTooltip","defaultLabel","icon","isDirty","isSaving","isSaveViewOpen","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","dirtyEntityRecords","isSaveViewOpened","length","some","record","kind","name","key","setIsSaveViewOpened","activateSaveEnabled","disabled","getLabel","label","undefined","primary"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,eAAT,QAAgC,qBAAhC;AAEA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AAT;AACA,OAFD,MAEO,IAAK4B,QAAL,EAAgB;AACtB,eAAO5B,EAAE,CAAE,OAAF,CAAT;AACA,OAFM,MAEA,IAAKY,OAAL,EAAe;AACrB,eAAOZ,EAAE,CAAE,iBAAF,CAAT;AACA;;AACD,aAAOA,EAAE,CAAE,UAAF,CAAT;AACA;;AAED,QAAKa,QAAL,EAAgB;AACf,aAAOb,EAAE,CAAE,QAAF,CAAT;AACA,KAFD,MAEO,IAAK4B,QAAL,EAAgB;AACtB,aAAO5B,EAAE,CAAE,OAAF,CAAT;AACA,KAFM,MAEA,IAAKU,YAAL,EAAoB;AAC1B,aAAOA,YAAP;AACA;;AACD,WAAOV,EAAE,CAAE,MAAF,CAAT;AACA,GApBD;;AAqBA,QAAM8B,KAAK,GAAGD,QAAQ,EAAtB;AAEA,SACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAGrB,OADX;AAEC,IAAA,SAAS,EAAGD,SAFb;AAGC,qBAAgBqB,QAHjB;AAIC,qBAAgBd,cAJjB;AAKC,IAAA,MAAM,EAAGD,QALV;AAMC,IAAA,OAAO,EAAGe,QAAQ,GAAGG,SAAH,GAAe,MAAML,mBAAmB,CAAE,IAAF,CAN3D;AAOC,IAAA,KAAK,EAAGI;AACR;AACH;AACA;AACA;AAXE;AAYC,IAAA,QAAQ,EAAGF,QAAQ,GAAGG,SAAH,GAAe5B,eAAe,CAAC6B,OAAhB,CAAyB,GAAzB;AAClC;AACH;AACA;AACA;AACA;AACA;AAlBE;AAmBC,IAAA,WAAW,EAAGvB,WAnBf;AAoBC,IAAA,IAAI,EAAGE;AApBR,KAsBGmB,KAtBH,CADD;AA0BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nexport default function SaveButton( {\n\tclassName = 'edit-site-save-button__button',\n\tvariant = 'primary',\n\tshowTooltip = true,\n\tdefaultLabel,\n\ticon,\n} ) {\n\tconst { isDirty, isSaving, isSaveViewOpen } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\treturn {\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving: dirtyEntityRecords.some( ( record ) =>\n\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t),\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\n\tconst getLabel = () => {\n\t\tif ( isPreviewingTheme() ) {\n\t\t\tif ( isSaving ) {\n\t\t\t\treturn __( 'Activating' );\n\t\t\t} else if ( disabled ) {\n\t\t\t\treturn __( 'Saved' );\n\t\t\t} else if ( isDirty ) {\n\t\t\t\treturn __( 'Activate & Save' );\n\t\t\t}\n\t\t\treturn __( 'Activate' );\n\t\t}\n\n\t\tif ( isSaving ) {\n\t\t\treturn __( 'Saving' );\n\t\t} else if ( disabled ) {\n\t\t\treturn __( 'Saved' );\n\t\t} else if ( defaultLabel ) {\n\t\t\treturn defaultLabel;\n\t\t}\n\t\treturn __( 'Save' );\n\t};\n\tconst label = getLabel();\n\n\treturn (\n\t\t<Button\n\t\t\tvariant={ variant }\n\t\t\tclassName={ className }\n\t\t\taria-disabled={ disabled }\n\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\tisBusy={ isSaving }\n\t\t\tonClick={ disabled ? undefined : () => setIsSaveViewOpened( true ) }\n\t\t\tlabel={ label }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ disabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\t/*\n\t\t\t * Displaying the keyboard shortcut conditionally makes the tooltip\n\t\t\t * itself show conditionally. This would trigger a full-rerendering\n\t\t\t * of the button that we want to avoid. By setting `showTooltip`,\n\t\t\t & the tooltip is always rendered even when there's no keyboard shortcut.\n\t\t\t */\n\t\t\tshowTooltip={ showTooltip }\n\t\t\ticon={ icon }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"]}
@@ -17,7 +17,7 @@ import { store as noticesStore } from '@wordpress/notices';
17
17
 
18
18
  import SaveButton from '../save-button';
19
19
  import { isPreviewingTheme } from '../../utils/is-previewing-theme';
20
- import { unlock } from '../../private-apis';
20
+ import { unlock } from '../../lock-unlock';
21
21
  const {
22
22
  useLocation
23
23
  } = unlock(routerPrivateApis);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/save-hub/index.js"],"names":["useSelect","useDispatch","Button","__experimentalHStack","HStack","__","sprintf","_n","store","coreStore","blockEditorStore","check","privateApis","routerPrivateApis","noticesStore","SaveButton","isPreviewingTheme","unlock","useLocation","PUBLISH_ON_SAVE_ENTITIES","kind","name","SaveHub","params","__unstableMarkLastChangeAsPersistent","createSuccessNotice","createErrorNotice","dirtyCurrentEntity","countUnsavedChanges","isDirty","isSaving","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","dirtyEntityRecords","calcDirtyCurrentEntity","length","path","includes","find","record","postId","postType","String","key","some","editEntityRecord","saveEditedEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","disabled","label","saveCurrentEntity","property","undefined","typeToPublish","status","type","error"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC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,IAAA,SAAS,EAAC,oBAAlB;AAAuC,IAAA,SAAS,EAAC,OAAjD;AAAyD,IAAA,OAAO,EAAG;AAAnE,KACG/B,kBAAkB,GACnB,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,OAAO,EAAGyB,iBAFX;AAGC,IAAA,MAAM,EAAGtB,QAHV;AAIC,IAAA,QAAQ,EAAGA,QAJZ;AAKC,qBAAgBA,QALjB;AAMC,IAAA,SAAS,EAAC;AANX,KAQGqB,KARH,CADmB,GAYnB,cAAC,UAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,OAAO,EAAGD,QAAQ,GAAG,IAAH,GAAU,SAF7B;AAGC,IAAA,WAAW,EAAG,KAHf;AAIC,IAAA,IAAI,EAAGA,QAAQ,IAAI,CAAEpB,QAAd,GAAyBnB,KAAzB,GAAiC,IAJzC;AAKC,IAAA,YAAY,EAAGwC;AALhB,IAbF,CADD;AAwBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, __experimentalHStack as HStack } from '@wordpress/components';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { check } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport SaveButton from '../save-button';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\nimport { unlock } from '../../private-apis';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst PUBLISH_ON_SAVE_ENTITIES = [\n\t{\n\t\tkind: 'postType',\n\t\tname: 'wp_navigation',\n\t},\n];\n\nexport default function SaveHub() {\n\tconst { params } = useLocation();\n\n\tconst { __unstableMarkLastChangeAsPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst { dirtyCurrentEntity, countUnsavedChanges, isDirty, isSaving } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\t\tisSavingEntityRecord,\n\t\t\t\t} = select( coreStore );\n\t\t\t\tconst dirtyEntityRecords =\n\t\t\t\t\t__experimentalGetDirtyEntityRecords();\n\t\t\t\tlet calcDirtyCurrentEntity = null;\n\n\t\t\t\tif ( dirtyEntityRecords.length === 1 ) {\n\t\t\t\t\t// if we are on global styles\n\t\t\t\t\tif ( params.path?.includes( 'wp_global_styles' ) ) {\n\t\t\t\t\t\tcalcDirtyCurrentEntity = dirtyEntityRecords.find(\n\t\t\t\t\t\t\t( record ) => record.name === 'globalStyles'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// if we are on pages\n\t\t\t\t\telse if ( params.postId ) {\n\t\t\t\t\t\tcalcDirtyCurrentEntity = dirtyEntityRecords.find(\n\t\t\t\t\t\t\t( record ) =>\n\t\t\t\t\t\t\t\trecord.name === params.postType &&\n\t\t\t\t\t\t\t\tString( record.key ) === params.postId\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tdirtyCurrentEntity: calcDirtyCurrentEntity,\n\t\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\t\tisSaving: dirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\tcountUnsavedChanges: dirtyEntityRecords.length,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ params.path, params.postType, params.postId ]\n\t\t);\n\n\tconst {\n\t\teditEntityRecord,\n\t\tsaveEditedEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst disabled = isSaving || ( ! isDirty && ! isPreviewingTheme() );\n\n\t// if we have only one unsaved change and it matches current context, we can show a more specific label\n\tlet label = dirtyCurrentEntity\n\t\t? __( 'Save' )\n\t\t: sprintf(\n\t\t\t\t// translators: %d: number of unsaved changes (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Review %d change…',\n\t\t\t\t\t'Review %d changes…',\n\t\t\t\t\tcountUnsavedChanges\n\t\t\t\t),\n\t\t\t\tcountUnsavedChanges\n\t\t );\n\n\tif ( isSaving ) {\n\t\tlabel = __( 'Saving' );\n\t}\n\n\tconst saveCurrentEntity = async () => {\n\t\tif ( ! dirtyCurrentEntity ) return;\n\n\t\tconst { kind, name, key, property } = dirtyCurrentEntity;\n\n\t\ttry {\n\t\t\tif ( 'root' === dirtyCurrentEntity.kind && 'site' === name ) {\n\t\t\t\tawait saveSpecifiedEntityEdits( 'root', 'site', undefined, [\n\t\t\t\t\tproperty,\n\t\t\t\t] );\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tPUBLISH_ON_SAVE_ENTITIES.some(\n\t\t\t\t\t\t( typeToPublish ) =>\n\t\t\t\t\t\t\ttypeToPublish.kind === kind &&\n\t\t\t\t\t\t\ttypeToPublish.name === name\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\teditEntityRecord( kind, name, key, { status: 'publish' } );\n\t\t\t\t}\n\n\t\t\t\tawait saveEditedEntityRecord( kind, name, key );\n\t\t\t}\n\n\t\t\t__unstableMarkLastChangeAsPersistent();\n\n\t\t\tcreateSuccessNotice( __( 'Site updated.' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice( `${ __( 'Saving failed.' ) } ${ error }` );\n\t\t}\n\t};\n\n\treturn (\n\t\t<HStack className=\"edit-site-save-hub\" alignment=\"right\" spacing={ 4 }>\n\t\t\t{ dirtyCurrentEntity ? (\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tonClick={ saveCurrentEntity }\n\t\t\t\t\tisBusy={ isSaving }\n\t\t\t\t\tdisabled={ isSaving }\n\t\t\t\t\taria-disabled={ isSaving }\n\t\t\t\t\tclassName=\"edit-site-save-hub__button\"\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</Button>\n\t\t\t) : (\n\t\t\t\t<SaveButton\n\t\t\t\t\tclassName=\"edit-site-save-hub__button\"\n\t\t\t\t\tvariant={ disabled ? null : 'primary' }\n\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t\ticon={ disabled && ! isSaving ? check : null }\n\t\t\t\t\tdefaultLabel={ label }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</HStack>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/save-hub/index.js"],"names":["useSelect","useDispatch","Button","__experimentalHStack","HStack","__","sprintf","_n","store","coreStore","blockEditorStore","check","privateApis","routerPrivateApis","noticesStore","SaveButton","isPreviewingTheme","unlock","useLocation","PUBLISH_ON_SAVE_ENTITIES","kind","name","SaveHub","params","__unstableMarkLastChangeAsPersistent","createSuccessNotice","createErrorNotice","dirtyCurrentEntity","countUnsavedChanges","isDirty","isSaving","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","dirtyEntityRecords","calcDirtyCurrentEntity","length","path","includes","find","record","postId","postType","String","key","some","editEntityRecord","saveEditedEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","disabled","label","saveCurrentEntity","property","undefined","typeToPublish","status","type","error"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,MAAT,EAAiBC,oBAAoB,IAAIC,MAAzC,QAAuD,uBAAvD;AACA,SAASC,EAAT,EAAaC,OAAb,EAAsBC,EAAtB,QAAgC,iBAAhC;AACA,SAASC,K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AAO,EAAC,SADT;AAEC,IAAA,OAAO,EAAGyB,iBAFX;AAGC,IAAA,MAAM,EAAGtB,QAHV;AAIC,IAAA,QAAQ,EAAGA,QAJZ;AAKC,qBAAgBA,QALjB;AAMC,IAAA,SAAS,EAAC;AANX,KAQGqB,KARH,CADmB,GAYnB,cAAC,UAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,OAAO,EAAGD,QAAQ,GAAG,IAAH,GAAU,SAF7B;AAGC,IAAA,WAAW,EAAG,KAHf;AAIC,IAAA,IAAI,EAAGA,QAAQ,IAAI,CAAEpB,QAAd,GAAyBnB,KAAzB,GAAiC,IAJzC;AAKC,IAAA,YAAY,EAAGwC;AALhB,IAbF,CADD;AAwBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, __experimentalHStack as HStack } from '@wordpress/components';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { check } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport SaveButton from '../save-button';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst PUBLISH_ON_SAVE_ENTITIES = [\n\t{\n\t\tkind: 'postType',\n\t\tname: 'wp_navigation',\n\t},\n];\n\nexport default function SaveHub() {\n\tconst { params } = useLocation();\n\n\tconst { __unstableMarkLastChangeAsPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst { dirtyCurrentEntity, countUnsavedChanges, isDirty, isSaving } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\t\tisSavingEntityRecord,\n\t\t\t\t} = select( coreStore );\n\t\t\t\tconst dirtyEntityRecords =\n\t\t\t\t\t__experimentalGetDirtyEntityRecords();\n\t\t\t\tlet calcDirtyCurrentEntity = null;\n\n\t\t\t\tif ( dirtyEntityRecords.length === 1 ) {\n\t\t\t\t\t// if we are on global styles\n\t\t\t\t\tif ( params.path?.includes( 'wp_global_styles' ) ) {\n\t\t\t\t\t\tcalcDirtyCurrentEntity = dirtyEntityRecords.find(\n\t\t\t\t\t\t\t( record ) => record.name === 'globalStyles'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// if we are on pages\n\t\t\t\t\telse if ( params.postId ) {\n\t\t\t\t\t\tcalcDirtyCurrentEntity = dirtyEntityRecords.find(\n\t\t\t\t\t\t\t( record ) =>\n\t\t\t\t\t\t\t\trecord.name === params.postType &&\n\t\t\t\t\t\t\t\tString( record.key ) === params.postId\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tdirtyCurrentEntity: calcDirtyCurrentEntity,\n\t\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\t\tisSaving: dirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\tcountUnsavedChanges: dirtyEntityRecords.length,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ params.path, params.postType, params.postId ]\n\t\t);\n\n\tconst {\n\t\teditEntityRecord,\n\t\tsaveEditedEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst disabled = isSaving || ( ! isDirty && ! isPreviewingTheme() );\n\n\t// if we have only one unsaved change and it matches current context, we can show a more specific label\n\tlet label = dirtyCurrentEntity\n\t\t? __( 'Save' )\n\t\t: sprintf(\n\t\t\t\t// translators: %d: number of unsaved changes (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Review %d change…',\n\t\t\t\t\t'Review %d changes…',\n\t\t\t\t\tcountUnsavedChanges\n\t\t\t\t),\n\t\t\t\tcountUnsavedChanges\n\t\t );\n\n\tif ( isSaving ) {\n\t\tlabel = __( 'Saving' );\n\t}\n\n\tconst saveCurrentEntity = async () => {\n\t\tif ( ! dirtyCurrentEntity ) return;\n\n\t\tconst { kind, name, key, property } = dirtyCurrentEntity;\n\n\t\ttry {\n\t\t\tif ( 'root' === dirtyCurrentEntity.kind && 'site' === name ) {\n\t\t\t\tawait saveSpecifiedEntityEdits( 'root', 'site', undefined, [\n\t\t\t\t\tproperty,\n\t\t\t\t] );\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tPUBLISH_ON_SAVE_ENTITIES.some(\n\t\t\t\t\t\t( typeToPublish ) =>\n\t\t\t\t\t\t\ttypeToPublish.kind === kind &&\n\t\t\t\t\t\t\ttypeToPublish.name === name\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\teditEntityRecord( kind, name, key, { status: 'publish' } );\n\t\t\t\t}\n\n\t\t\t\tawait saveEditedEntityRecord( kind, name, key );\n\t\t\t}\n\n\t\t\t__unstableMarkLastChangeAsPersistent();\n\n\t\t\tcreateSuccessNotice( __( 'Site updated.' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice( `${ __( 'Saving failed.' ) } ${ error }` );\n\t\t}\n\t};\n\n\treturn (\n\t\t<HStack className=\"edit-site-save-hub\" alignment=\"right\" spacing={ 4 }>\n\t\t\t{ dirtyCurrentEntity ? (\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tonClick={ saveCurrentEntity }\n\t\t\t\t\tisBusy={ isSaving }\n\t\t\t\t\tdisabled={ isSaving }\n\t\t\t\t\taria-disabled={ isSaving }\n\t\t\t\t\tclassName=\"edit-site-save-hub__button\"\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</Button>\n\t\t\t) : (\n\t\t\t\t<SaveButton\n\t\t\t\t\tclassName=\"edit-site-save-hub__button\"\n\t\t\t\t\tvariant={ disabled ? null : 'primary' }\n\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t\ticon={ disabled && ! isSaving ? check : null }\n\t\t\t\t\tdefaultLabel={ label }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</HStack>\n\t);\n}\n"]}
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement } from "@wordpress/element";
3
2
 
4
3
  /**
@@ -20,7 +19,7 @@ import { store as coreStore } from '@wordpress/core-data';
20
19
  */
21
20
 
22
21
  import { store as editSiteStore } from '../../store';
23
- import { unlock } from '../../private-apis';
22
+ import { unlock } from '../../lock-unlock';
24
23
  import { useActivateTheme } from '../../utils/use-activate-theme';
25
24
  import { currentlyPreviewingTheme, isPreviewingTheme } from '../../utils/is-previewing-theme';
26
25
  const {
@@ -51,13 +50,13 @@ const EntitiesSavedStatesForPreview = ({
51
50
  return values;
52
51
  };
53
52
 
54
- return createElement(EntitiesSavedStatesExtensible, _extends({}, isDirtyProps, {
53
+ return createElement(EntitiesSavedStatesExtensible, { ...isDirtyProps,
55
54
  additionalPrompt,
56
55
  close: onClose,
57
56
  onSave,
58
57
  saveEnabled: true,
59
58
  saveLabel: activateSaveLabel
60
- }));
59
+ });
61
60
  };
62
61
 
63
62
  const _EntitiesSavedStates = ({
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["classnames","Button","Modal","EntitiesSavedStates","useEntitiesSavedStatesIsDirty","privateApis","useDispatch","useSelect","__","sprintf","NavigableRegion","store","coreStore","editSiteStore","unlock","useActivateTheme","currentlyPreviewingTheme","isPreviewingTheme","EntitiesSavedStatesExtensible","EntitiesSavedStatesForPreview","onClose","isDirtyProps","activateSaveLabel","isDirty","getTheme","theme","additionalPrompt","name","rendered","activateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","SavePanel","isSaveViewOpen","canvasMode","select","isSaveViewOpened","getCanvasMode","setIsSaveViewOpened"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,EAAiBC,KAAjB,QAA8B,uBAA9B;AACA,SACCC,mBADD,EAECC,6BAFD,EAGCC,WAHD,QAIO,mBAJP;AAKA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,eAAT,QAAgC,sBAAhC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,SAASC,gBAAT,QAAiC,gCAAjC;AACA,SACCC,wBADD,EAECC,iBAFD,QAGO,iCAHP;AAKA,MAAM;AAAEC,EAAAA;AAAF,IAAoCJ,MAAM,CAAET,WAAF,CAAhD;;AAEA,MAAMc,6BAA6B,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF,KAAmB;AACxD,QAAMC,YAAY,GAAGjB,6BAA6B,EAAlD;AACA,MAAIkB,iBAAJ;;AACA,MAAKD,YAAY,CAACE,OAAlB,EAA4B;AAC3BD,IAAAA,iBAAiB,GAAGd,EAAE,CAAE,iBAAF,CAAtB;AACA,GAFD,MAEO;AACNc,IAAAA,iBAAiB,GAAGd,EAAE,CAAE,UAAF,CAAtB;AACA;;AAED,QAAM;AAAEgB,IAAAA;AAAF,MAAejB,SAAS,CAAEK,SAAF,CAA9B;AACA,QAAMa,KAAK,GAAGD,QAAQ,CAAER,wBAAwB,EA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;;AAEA,MAAKJ,UAAU,KAAK,MAApB,EAA6B;AAC5B,WAAOD,cAAc,GACpB,cAAC,KAAD;AACC,MAAA,SAAS,EAAC,6BADX;AAEC,MAAA,cAAc,EAAGjB,OAFlB;AAGC,MAAA,wBAAwB,MAHzB;AAIC,MAAA,YAAY,EAAGZ,EAAE,CAChB,0CADgB;AAJlB,OAQC,cAAC,oBAAD;AAAsB,MAAA,OAAO,EAAGY;AAAhC,MARD,CADoB,GAWjB,IAXJ;AAYA;;AAED,SACC,cAAC,eAAD;AACC,IAAA,SAAS,EAAGpB,UAAU,CAAE,2BAAF,EAA+B;AACpD,kCAA4BqC;AADwB,KAA/B,CADvB;AAIC,IAAA,SAAS,EAAG7B,EAAE,CAAE,YAAF;AAJf,KAMG6B,cAAc,GACf,cAAC,oBAAD;AAAsB,IAAA,OAAO,EAAGjB;AAAhC,IADe,GAGf;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,SAAS,EAAC,4CAFX;AAGC,IAAA,OAAO,EAAG,MAAMsB,mBAAmB,CAAE,IAAF,CAHpC;AAIC,qBAAgB;AAJjB,KAMGlC,EAAE,CAAE,iBAAF,CANL,CADD,CATF,CADD;AAuBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { NavigableRegion } from '@wordpress/interface';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible } = unlock( privateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose } ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t}\n\n\tconst { getTheme } = useSelect( coreStore );\n\tconst theme = getTheme( currentlyPreviewingTheme() );\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t'Saving your changes will change your active theme to %1$s.',\n\t\t\t\ttheme?.name?.rendered\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn <EntitiesSavedStatesForPreview onClose={ onClose } />;\n\t}\n\treturn <EntitiesSavedStates close={ onClose } />;\n};\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode } = useSelect( ( select ) => {\n\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\n\tif ( canvasMode === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ classnames( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t{ isSaveViewOpen ? (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t) : (\n\t\t\t\t<div className=\"edit-site-editor__toggle-save-panel\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["classnames","Button","Modal","EntitiesSavedStates","useEntitiesSavedStatesIsDirty","privateApis","useDispatch","useSelect","__","sprintf","NavigableRegion","store","coreStore","editSiteStore","unlock","useActivateTheme","currentlyPreviewingTheme","isPreviewingTheme","EntitiesSavedStatesExtensible","EntitiesSavedStatesForPreview","onClose","isDirtyProps","activateSaveLabel","isDirty","getTheme","theme","additionalPrompt","name","rendered","activateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","SavePanel","isSaveViewOpen","canvasMode","select","isSaveViewOpened","getCanvasMode","setIsSaveViewOpened"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,EAAiBC,KAAjB,QAA8B,uBAA9B;AACA,SACCC,mBADD,EAECC,6BAFD,EAGCC,WAHD,QAIO,mBAJP;AAKA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,eAAT,QAAgC,sBAAhC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,mBAAvB;AACA,SAASC,gBAAT,QAAiC,gCAAjC;AACA,SACCC,wBADD,EAECC,iBAFD,QAGO,iCAHP;AAKA,MAAM;AAAEC,EAAAA;AAAF,IAAoCJ,MAAM,CAAET,WAAF,CAAhD;;AAEA,MAAMc,6BAA6B,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF,KAAmB;AACxD,QAAMC,YAAY,GAAGjB,6BAA6B,EAAlD;AACA,MAAIkB,iBAAJ;;AACA,MAAKD,YAAY,CAACE,OAAlB,EAA4B;AAC3BD,IAAAA,iBAAiB,GAAGd,EAAE,CAAE,iBAAF,CAAtB;AACA,GAFD,MAEO;AACNc,IAAAA,iBAAiB,GAAGd,EAAE,CAAE,UAAF,CAAtB;AACA;;AAED,QAAM;AAAEgB,IAAAA;AAAF,MAAejB,SAAS,CAAEK,SAAF,CAA9B;AACA,QAAMa,KAAK,GAAGD,QAAQ,CAAER,wBAAwB,EAA1B,CAAtB;AACA,QAAMU,gBAAgB,GACrB,yBACGjB,OAAO,CACR,6DADQ,EAERgB,KAAK,EAAEE,IAAP,EAAaC,QAFL,CADV,CADD;AASA,QAAMC,aAAa,GAAGd,gBA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AFlB;AAGC,MAAA,wBAAwB,MAHzB;AAIC,MAAA,YAAY,EAAGZ,EAAE,CAChB,0CADgB;AAJlB,OAQC,cAAC,oBAAD;AAAsB,MAAA,OAAO,EAAGY;AAAhC,MARD,CADoB,GAWjB,IAXJ;AAYA;;AAED,SACC,cAAC,eAAD;AACC,IAAA,SAAS,EAAGpB,UAAU,CAAE,2BAAF,EAA+B;AACpD,kCAA4BqC;AADwB,KAA/B,CADvB;AAIC,IAAA,SAAS,EAAG7B,EAAE,CAAE,YAAF;AAJf,KAMG6B,cAAc,GACf,cAAC,oBAAD;AAAsB,IAAA,OAAO,EAAGjB;AAAhC,IADe,GAGf;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,SAAS,EAAC,4CAFX;AAGC,IAAA,OAAO,EAAG,MAAMsB,mBAAmB,CAAE,IAAF,CAHpC;AAIC,qBAAgB;AAJjB,KAMGlC,EAAE,CAAE,iBAAF,CANL,CADD,CATF,CADD;AAuBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { NavigableRegion } from '@wordpress/interface';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible } = unlock( privateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose } ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t}\n\n\tconst { getTheme } = useSelect( coreStore );\n\tconst theme = getTheme( currentlyPreviewingTheme() );\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t'Saving your changes will change your active theme to %1$s.',\n\t\t\t\ttheme?.name?.rendered\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn <EntitiesSavedStatesForPreview onClose={ onClose } />;\n\t}\n\treturn <EntitiesSavedStates close={ onClose } />;\n};\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode } = useSelect( ( select ) => {\n\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\n\tif ( canvasMode === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ classnames( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t{ isSaveViewOpen ? (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t) : (\n\t\t\t\t<div className=\"edit-site-editor__toggle-save-panel\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"]}
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement } from "@wordpress/element";
3
2
 
4
3
  /**
@@ -31,11 +30,11 @@ export default function InserterSidebar() {
31
30
  useEffect(() => {
32
31
  libraryRef.current.focusSearch();
33
32
  }, []);
34
- return createElement("div", _extends({
35
- ref: inserterDialogRef
36
- }, inserterDialogProps, {
33
+ return createElement("div", {
34
+ ref: inserterDialogRef,
35
+ ...inserterDialogProps,
37
36
  className: "edit-site-editor__inserter-panel"
38
- }), createElement(TagName, {
37
+ }, createElement(TagName, {
39
38
  className: "edit-site-editor__inserter-panel-header"
40
39
  }, createElement(Button, {
41
40
  icon: close,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/secondary-sidebar/inserter-sidebar.js"],"names":["useSelect","useDispatch","Button","VisuallyHidden","__experimentalLibrary","Library","close","useViewportMatch","__experimentalUseDialog","useDialog","__","useEffect","useRef","store","editSiteStore","InserterSidebar","setIsInserterOpened","insertionPoint","select","__experimentalGetInsertionPoint","isMobile","TagName","inserterDialogRef","inserterDialogProps","onClose","focusOnMount","libraryRef","current","focusSearch","rootClientId","insertionIndex","filterValue"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,MAAT,EAAiBC,cAAjB,QAAuC,uBAAvC;AACA,SAASC,qBAAqB,IAAIC,OAAlC,QAAiD,yBAAjD;AACA,SAASC,KAAT,QAAsB,kBAAtB;AACA,SACCC,gBADD,EAECC,uBAAuB,IAAIC,SAF5B,QAGO,oBAHP;AAIA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,EAAoBC,MAApB,QAAkC,oBAAlC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AAEA,eAAe,SAASC,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0Bf,WAAW,CAAEa,aAAF,CAA3C;AACA,QAAMG,cAAc,GAAGjB,SAAS,CAC7BkB,MAAF,IAAcA,MAAM,CAAEJ,aAAF,CAAN,CAAwBK,+BAAxB,EADiB,EAE/B,EAF+B,CAAhC;AAKA,QAAMC,QAAQ,GAAGb,gBAAgB,CAAE,QAAF,EAAY,GAAZ,CAAjC;AACA,QAAMc,OAAO,GAAG,CAAED,QAAF,GAAajB,cAAb,GAA8B,KAA9C;AACA,QAAM,CAAEmB,iBAAF,EAAqBC,mBAArB,IAA6Cd,SAAS,CAAE;AAC7De,IAAAA,OAAO,EAAE,MAAMR,mBAAmB,CAAE,KAAF,CAD2B;AAE7DS,IAAAA,YAAY,EAAE;AAF+C,GAAF,CAA5D;AAKA,QAAMC,UAAU,GAAGd,MAAM,EAAzB;AACAD,EAAAA,SAAS,CAAE,MAAM;AAChBe,IAAAA,UAAU,CAACC,OAAX,CAAmBC,WAAnB;AACA,GAFQ,EAEN,EAFM,CAAT;AAIA,SACC;AACC,IAAA,GAAG,EAAGN;AADP,KAEMC,mBAFN;AAGC,IAAA,SAAS,EAAC;AAHX,MAKC,cAAC,OAAD;AAAS,IAAA,SAAS,EAAC;AAAnB,KACC,cAAC,MAAD;AACC,IAAA,IAAI,EAAGjB,KADR;AAEC,IAAA,KAAK,EAAGI,EAAE,CAAE,sBAAF,CAFX;AAGC,IAAA,OAAO,EAAG,MAAMM,mBAAmB,CAAE,KAAF;AAHpC,IADD,CALD,EAYC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,OAAD;AACC,IAAA,qBAAqB,MADtB;AAEC,IAAA,gBAAgB,EAAGI,QAFpB;AAGC,IAAA,YAAY,EAAGH,cAAc,CAACY,YAH/B;AAIC,IAAA,4BAA4B,EAC3BZ,cAAc,CAACa,cALjB;AAOC,IAAA,yBAAyB,EAAGb,cAAc,CAACc,WAP5C;AAQC,IAAA,GAAG,EAAGL;AARP,IADD,CAZD,CADD;AA2BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, VisuallyHidden } from '@wordpress/components';\nimport { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport { close } from '@wordpress/icons';\nimport {\n\tuseViewportMatch,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function InserterSidebar() {\n\tconst { setIsInserterOpened } = useDispatch( editSiteStore );\n\tconst insertionPoint = useSelect(\n\t\t( select ) => select( editSiteStore ).__experimentalGetInsertionPoint(),\n\t\t[]\n\t);\n\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\tconst TagName = ! isMobile ? VisuallyHidden : 'div';\n\tconst [ inserterDialogRef, inserterDialogProps ] = useDialog( {\n\t\tonClose: () => setIsInserterOpened( false ),\n\t\tfocusOnMount: null,\n\t} );\n\n\tconst libraryRef = useRef();\n\tuseEffect( () => {\n\t\tlibraryRef.current.focusSearch();\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tref={ inserterDialogRef }\n\t\t\t{ ...inserterDialogProps }\n\t\t\tclassName=\"edit-site-editor__inserter-panel\"\n\t\t>\n\t\t\t<TagName className=\"edit-site-editor__inserter-panel-header\">\n\t\t\t\t<Button\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tlabel={ __( 'Close block inserter' ) }\n\t\t\t\t\tonClick={ () => setIsInserterOpened( false ) }\n\t\t\t\t/>\n\t\t\t</TagName>\n\t\t\t<div className=\"edit-site-editor__inserter-panel-content\">\n\t\t\t\t<Library\n\t\t\t\t\tshowInserterHelpPanel\n\t\t\t\t\tshouldFocusBlock={ isMobile }\n\t\t\t\t\trootClientId={ insertionPoint.rootClientId }\n\t\t\t\t\t__experimentalInsertionIndex={\n\t\t\t\t\t\tinsertionPoint.insertionIndex\n\t\t\t\t\t}\n\t\t\t\t\t__experimentalFilterValue={ insertionPoint.filterValue }\n\t\t\t\t\tref={ libraryRef }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/secondary-sidebar/inserter-sidebar.js"],"names":["useSelect","useDispatch","Button","VisuallyHidden","__experimentalLibrary","Library","close","useViewportMatch","__experimentalUseDialog","useDialog","__","useEffect","useRef","store","editSiteStore","InserterSidebar","setIsInserterOpened","insertionPoint","select","__experimentalGetInsertionPoint","isMobile","TagName","inserterDialogRef","inserterDialogProps","onClose","focusOnMount","libraryRef","current","focusSearch","rootClientId","insertionIndex","filterValue"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC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AF,CAFX;AAGC,IAAA,OAAO,EAAG,MAAMM,mBAAmB,CAAE,KAAF;AAHpC,IADD,CALD,EAYC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,OAAD;AACC,IAAA,qBAAqB,MADtB;AAEC,IAAA,gBAAgB,EAAGI,QAFpB;AAGC,IAAA,YAAY,EAAGH,cAAc,CAACY,YAH/B;AAIC,IAAA,4BAA4B,EAC3BZ,cAAc,CAACa,cALjB;AAOC,IAAA,yBAAyB,EAAGb,cAAc,CAACc,WAP5C;AAQC,IAAA,GAAG,EAAGL;AARP,IADD,CAZD,CADD;AA2BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, VisuallyHidden } from '@wordpress/components';\nimport { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport { close } from '@wordpress/icons';\nimport {\n\tuseViewportMatch,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function InserterSidebar() {\n\tconst { setIsInserterOpened } = useDispatch( editSiteStore );\n\tconst insertionPoint = useSelect(\n\t\t( select ) => select( editSiteStore ).__experimentalGetInsertionPoint(),\n\t\t[]\n\t);\n\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\tconst TagName = ! isMobile ? VisuallyHidden : 'div';\n\tconst [ inserterDialogRef, inserterDialogProps ] = useDialog( {\n\t\tonClose: () => setIsInserterOpened( false ),\n\t\tfocusOnMount: null,\n\t} );\n\n\tconst libraryRef = useRef();\n\tuseEffect( () => {\n\t\tlibraryRef.current.focusSearch();\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tref={ inserterDialogRef }\n\t\t\t{ ...inserterDialogProps }\n\t\t\tclassName=\"edit-site-editor__inserter-panel\"\n\t\t>\n\t\t\t<TagName className=\"edit-site-editor__inserter-panel-header\">\n\t\t\t\t<Button\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tlabel={ __( 'Close block inserter' ) }\n\t\t\t\t\tonClick={ () => setIsInserterOpened( false ) }\n\t\t\t\t/>\n\t\t\t</TagName>\n\t\t\t<div className=\"edit-site-editor__inserter-panel-content\">\n\t\t\t\t<Library\n\t\t\t\t\tshowInserterHelpPanel\n\t\t\t\t\tshouldFocusBlock={ isMobile }\n\t\t\t\t\trootClientId={ insertionPoint.rootClientId }\n\t\t\t\t\t__experimentalInsertionIndex={\n\t\t\t\t\t\tinsertionPoint.insertionIndex\n\t\t\t\t\t}\n\t\t\t\t\t__experimentalFilterValue={ insertionPoint.filterValue }\n\t\t\t\t\tref={ libraryRef }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
@@ -7,27 +7,28 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
7
7
  import { Button } from '@wordpress/components';
8
8
  import { useFocusOnMount, useFocusReturn, useMergeRefs } from '@wordpress/compose';
9
9
  import { useDispatch } from '@wordpress/data';
10
- import { useState } from '@wordpress/element';
10
+ import { useRef, useState } from '@wordpress/element';
11
11
  import { __ } from '@wordpress/i18n';
12
12
  import { closeSmall } from '@wordpress/icons';
13
13
  import { ESCAPE } from '@wordpress/keycodes';
14
+ import { focus } from '@wordpress/dom';
15
+ import { useShortcut } from '@wordpress/keyboard-shortcuts';
14
16
  /**
15
17
  * Internal dependencies
16
18
  */
17
19
 
18
20
  import { store as editSiteStore } from '../../store';
19
- import { unlock } from '../../private-apis';
21
+ import { unlock } from '../../lock-unlock';
20
22
  const {
21
23
  PrivateListView
22
24
  } = unlock(blockEditorPrivateApis);
23
25
  export default function ListViewSidebar() {
24
26
  const {
25
27
  setIsListViewOpened
26
- } = useDispatch(editSiteStore); // Use internal state instead of a ref to make sure that the component
27
- // re-renders when the dropZoneElement updates.
28
+ } = useDispatch(editSiteStore); // This hook handles focus when the sidebar first renders.
29
+
30
+ const focusOnMountRef = useFocusOnMount('firstElement'); // The next 2 hooks handle focus for when the sidebar closes and returning focus to the element that had focus before sidebar opened.
28
31
 
29
- const [dropZoneElement, setDropZoneElement] = useState(null);
30
- const focusOnMountRef = useFocusOnMount('firstElement');
31
32
  const headerFocusReturnRef = useFocusReturn();
32
33
  const contentFocusReturnRef = useFocusReturn();
33
34
 
@@ -35,22 +36,55 @@ export default function ListViewSidebar() {
35
36
  if (event.keyCode === ESCAPE && !event.defaultPrevented) {
36
37
  setIsListViewOpened(false);
37
38
  }
38
- }
39
+ } // Use internal state instead of a ref to make sure that the component
40
+ // re-renders when the dropZoneElement updates.
41
+
42
+
43
+ const [dropZoneElement, setDropZoneElement] = useState(null); // This ref refers to the sidebar as a whole.
44
+
45
+ const sidebarRef = useRef(); // This ref refers to the close button.
39
46
 
47
+ const sidebarCloseButtonRef = useRef(); // This ref refers to the list view application area.
48
+
49
+ const listViewRef = useRef();
50
+ /*
51
+ * Callback function to handle list view or close button focus.
52
+ *
53
+ * @return void
54
+ */
55
+
56
+ function handleSidebarFocus() {
57
+ // Either focus the list view or the sidebar close button. Must have a fallback because the list view does not render when there are no blocks.
58
+ const listViewApplicationFocus = focus.tabbable.find(listViewRef.current)[0];
59
+ const listViewFocusArea = sidebarRef.current.contains(listViewApplicationFocus) ? listViewApplicationFocus : sidebarCloseButtonRef.current;
60
+ listViewFocusArea.focus();
61
+ } // This only fires when the sidebar is open because of the conditional rendering. It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.
62
+
63
+
64
+ useShortcut('core/edit-site/toggle-list-view', () => {
65
+ // If the sidebar has focus, it is safe to close.
66
+ if (sidebarRef.current.contains(sidebarRef.current.ownerDocument.activeElement)) {
67
+ setIsListViewOpened(false); // If the list view or close button does not have focus, focus should be moved to it.
68
+ } else {
69
+ handleSidebarFocus();
70
+ }
71
+ });
40
72
  return (// eslint-disable-next-line jsx-a11y/no-static-element-interactions
41
73
  createElement("div", {
42
74
  className: "edit-site-editor__list-view-panel",
43
- onKeyDown: closeOnEscape
75
+ onKeyDown: closeOnEscape,
76
+ ref: sidebarRef
44
77
  }, createElement("div", {
45
78
  className: "edit-site-editor__list-view-panel-header",
46
79
  ref: headerFocusReturnRef
47
80
  }, createElement("strong", null, __('List View')), createElement(Button, {
48
81
  icon: closeSmall,
49
82
  label: __('Close'),
50
- onClick: () => setIsListViewOpened(false)
83
+ onClick: () => setIsListViewOpened(false),
84
+ ref: sidebarCloseButtonRef
51
85
  })), createElement("div", {
52
86
  className: "edit-site-editor__list-view-panel-content",
53
- ref: useMergeRefs([contentFocusReturnRef, focusOnMountRef, setDropZoneElement])
87
+ ref: useMergeRefs([contentFocusReturnRef, focusOnMountRef, setDropZoneElement, listViewRef])
54
88
  }, createElement(PrivateListView, {
55
89
  dropZoneElement: dropZoneElement
56
90
  })))
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/secondary-sidebar/list-view-sidebar.js"],"names":["privateApis","blockEditorPrivateApis","Button","useFocusOnMount","useFocusReturn","useMergeRefs","useDispatch","useState","__","closeSmall","ESCAPE","store","editSiteStore","unlock","PrivateListView","ListViewSidebar","setIsListViewOpened","dropZoneElement","setDropZoneElement","focusOnMountRef","headerFocusReturnRef","contentFocusReturnRef","closeOnEscape","event","keyCode","defaultPrevented"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SACCC,eADD,EAECC,cAFD,EAGCC,YAHD,QAIO,oBAJP;AAKA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,QAA2B,kBAA3B;AACA,SAASC,MAAT,QAAuB,qBAAvB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAsBD,MAAM,CAAEZ,sBAAF,CAAlC;AAEA,eAAe,SAASc,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0BV,WAAW,CAAEM,aAAF,CAA3C,CADyC,CAGzC;AACA;;AACA,QAAM,CAAEK,eAAF,EAAmBC,kBAAnB,IAA0CX,QAAQ,CAAE,IAAF,CAAxD;AAEA,QAAMY,eAAe,GAAGhB,eAAe,CAAE,cAAF,CAAvC;AACA,QAAMiB,oBAAoB,GAAGhB,cAAc,EAA3C;AACA,QAAMiB,qBAAqB,GAAGjB,cAAc,EAA5C;;AAEA,WAASkB,aAAT,CAAwBC,KAAxB,EAAgC;AAC/B,QAAKA,KAAK,CAACC,OAAN,KAAkBd,MAAlB,IAA4B,CAAEa,KAAK,CAACE,gBAAzC,EAA4D;AAC3DT,MAAAA,mBAAmB,CAAE,KAAF,CAAnB;AACA;AACD;;AAED,SACC;AACA;AACC,MAAA,SAAS,EAAC,mCADX;AAEC,MAAA,SAAS,EAAGM;AAFb,OAIC;AACC,MAAA,SAAS,EAAC,0CADX;AAEC,MAAA,GAAG,EAAGF;AAFP,OAIC,8BAAUZ,EAAE,CAAE,WAAF,CAAZ,CAJD,EAKC,cAAC,MAAD;AACC,MAAA,IAAI,EAAGC,UADR;AAEC,MAAA,KAAK,EAAGD,EAAE,CAAE,OAAF,CAFX;AAGC,MAAA,OAAO,EAAG,MAAMQ,mBAAmB,CAAE,KAAF;AAHpC,MALD,CAJD,EAeC;AACC,MAAA,SAAS,EAAC,2CADX;AAEC,MAAA,GAAG,EAAGX,YAAY,CAAE,CACnBgB,qBADmB,EAEnBF,eAFmB,EAGnBD,kBAHmB,CAAF;AAFnB,OAQC,cAAC,eAAD;AAAiB,MAAA,eAAe,EAAGD;AAAnC,MARD,CAfD;AAFD;AA6BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport {\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\n\nconst { PrivateListView } = unlock( blockEditorPrivateApis );\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editSiteStore );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\tconst headerFocusReturnRef = useFocusReturn();\n\tconst contentFocusReturnRef = useFocusReturn();\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-site-editor__list-view-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-site-editor__list-view-panel-header\"\n\t\t\t\tref={ headerFocusReturnRef }\n\t\t\t>\n\t\t\t\t<strong>{ __( 'List View' ) }</strong>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ () => setIsListViewOpened( false ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-site-editor__list-view-panel-content\"\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\tcontentFocusReturnRef,\n\t\t\t\t\tfocusOnMountRef,\n\t\t\t\t\tsetDropZoneElement,\n\t\t\t\t] ) }\n\t\t\t>\n\t\t\t\t<PrivateListView dropZoneElement={ dropZoneElement } />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/secondary-sidebar/list-view-sidebar.js"],"names":["privateApis","blockEditorPrivateApis","Button","useFocusOnMount","useFocusReturn","useMergeRefs","useDispatch","useRef","useState","__","closeSmall","ESCAPE","focus","useShortcut","store","editSiteStore","unlock","PrivateListView","ListViewSidebar","setIsListViewOpened","focusOnMountRef","headerFocusReturnRef","contentFocusReturnRef","closeOnEscape","event","keyCode","defaultPrevented","dropZoneElement","setDropZoneElement","sidebarRef","sidebarCloseButtonRef","listViewRef","handleSidebarFocus","listViewApplicationFocus","tabbable","find","current","listViewFocusArea","contains","ownerDocument","activeElement"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SACCC,eADD,EAECC,cAFD,EAGCC,YAHD,QAIO,oBAJP;AAKA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,MAAT,EAAiBC,QAAjB,QAAiC,oBAAjC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,QAA2B,kBAA3B;AACA,SAASC,MAAT,QAAuB,qBAAvB;AACA,SAASC,KAAT,QAAsB,gBAAtB;AACA,SAASC,WAAT,QAA4B,+BAA5B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,mBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAsBD,MAAM,CAAEf,sBAAF,CAAlC;AAEA,eAAe,SAASiB,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0Bb,WAAW,CAAES,aAAF,CAA3C,CADyC,CAGzC;;AACA,QAAMK,eAAe,GAAGjB,eAAe,CA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A,SAAS,EAAC,mCADX;AAEC,MAAA,SAAS,EAAGT,aAFb;AAGC,MAAA,GAAG,EAAGM;AAHP,OAKC;AACC,MAAA,SAAS,EAAC,0CADX;AAEC,MAAA,GAAG,EAAGR;AAFP,OAIC,8BAAUZ,EAAE,CAAE,WAAF,CAAZ,CAJD,EAKC,cAAC,MAAD;AACC,MAAA,IAAI,EAAGC,UADR;AAEC,MAAA,KAAK,EAAGD,EAAE,CAAE,OAAF,CAFX;AAGC,MAAA,OAAO,EAAG,MAAMU,mBAAmB,CAAE,KAAF,CAHpC;AAIC,MAAA,GAAG,EAAGW;AAJP,MALD,CALD,EAiBC;AACC,MAAA,SAAS,EAAC,2CADX;AAEC,MAAA,GAAG,EAAGzB,YAAY,CAAE,CACnBiB,qBADmB,EAEnBF,eAFmB,EAGnBQ,kBAHmB,EAInBG,WAJmB,CAAF;AAFnB,OASC,cAAC,eAAD;AAAiB,MAAA,eAAe,EAAGJ;AAAnC,MATD,CAjBD;AAFD;AAgCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport {\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { useRef, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { ESCAPE } from '@wordpress/keycodes';\nimport { focus } from '@wordpress/dom';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { PrivateListView } = unlock( blockEditorPrivateApis );\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editSiteStore );\n\n\t// This hook handles focus when the sidebar first renders.\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\t// The next 2 hooks handle focus for when the sidebar closes and returning focus to the element that had focus before sidebar opened.\n\tconst headerFocusReturnRef = useFocusReturn();\n\tconst contentFocusReturnRef = useFocusReturn();\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\n\t// This ref refers to the sidebar as a whole.\n\tconst sidebarRef = useRef();\n\t// This ref refers to the close button.\n\tconst sidebarCloseButtonRef = useRef();\n\t// This ref refers to the list view application area.\n\tconst listViewRef = useRef();\n\n\t/*\n\t * Callback function to handle list view or close button focus.\n\t *\n\t * @return void\n\t */\n\tfunction handleSidebarFocus() {\n\t\t// Either focus the list view or the sidebar close button. Must have a fallback because the list view does not render when there are no blocks.\n\t\tconst listViewApplicationFocus = focus.tabbable.find(\n\t\t\tlistViewRef.current\n\t\t)[ 0 ];\n\t\tconst listViewFocusArea = sidebarRef.current.contains(\n\t\t\tlistViewApplicationFocus\n\t\t)\n\t\t\t? listViewApplicationFocus\n\t\t\t: sidebarCloseButtonRef.current;\n\t\tlistViewFocusArea.focus();\n\t}\n\n\t// This only fires when the sidebar is open because of the conditional rendering. It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.\n\tuseShortcut( 'core/edit-site/toggle-list-view', () => {\n\t\t// If the sidebar has focus, it is safe to close.\n\t\tif (\n\t\t\tsidebarRef.current.contains(\n\t\t\t\tsidebarRef.current.ownerDocument.activeElement\n\t\t\t)\n\t\t) {\n\t\t\tsetIsListViewOpened( false );\n\t\t\t// If the list view or close button does not have focus, focus should be moved to it.\n\t\t} else {\n\t\t\thandleSidebarFocus();\n\t\t}\n\t} );\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-site-editor__list-view-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t\tref={ sidebarRef }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-site-editor__list-view-panel-header\"\n\t\t\t\tref={ headerFocusReturnRef }\n\t\t\t>\n\t\t\t\t<strong>{ __( 'List View' ) }</strong>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ () => setIsListViewOpened( false ) }\n\t\t\t\t\tref={ sidebarCloseButtonRef }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-site-editor__list-view-panel-content\"\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\tcontentFocusReturnRef,\n\t\t\t\t\tfocusOnMountRef,\n\t\t\t\t\tsetDropZoneElement,\n\t\t\t\t\tlistViewRef,\n\t\t\t\t] ) }\n\t\t\t>\n\t\t\t\t<PrivateListView dropZoneElement={ dropZoneElement } />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
@@ -11,16 +11,17 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
11
11
  */
12
12
 
13
13
  import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
14
+ import SidebarNavigationScreenLibrary from '../sidebar-navigation-screen-library';
14
15
  import SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';
15
16
  import SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';
16
- import SidebarNavigationScreenTemplatePart from '../sidebar-navigation-screen-template-part';
17
+ import SidebarNavigationScreenPattern from '../sidebar-navigation-screen-pattern';
17
18
  import useSyncPathWithURL, { getPathFromURL } from '../sync-state-with-url/use-sync-path-with-url';
18
19
  import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
19
20
  import SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';
20
21
  import SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';
21
22
  import SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';
22
23
  import SaveHub from '../save-hub';
23
- import { unlock } from '../../private-apis';
24
+ import { unlock } from '../../lock-unlock';
24
25
  import SidebarNavigationScreenPages from '../sidebar-navigation-screen-pages';
25
26
  import SidebarNavigationScreenPage from '../sidebar-navigation-screen-page';
26
27
  const {
@@ -42,14 +43,16 @@ function SidebarScreens() {
42
43
  }, createElement(SidebarNavigationScreenPages, null)), createElement(NavigatorScreen, {
43
44
  path: "/page/:postId"
44
45
  }, createElement(SidebarNavigationScreenPage, null)), createElement(NavigatorScreen, {
45
- path: "/:postType(wp_template|wp_template_part)"
46
+ path: "/:postType(wp_template)"
46
47
  }, createElement(SidebarNavigationScreenTemplates, null)), createElement(NavigatorScreen, {
47
- path: "/:postType(wp_template|wp_template_part)/all"
48
+ path: "/library"
49
+ }, createElement(SidebarNavigationScreenLibrary, null)), createElement(NavigatorScreen, {
50
+ path: "/:postType(wp_template_part|wp_block)/:postId"
51
+ }, createElement(SidebarNavigationScreenPattern, null)), createElement(NavigatorScreen, {
52
+ path: "/:postType(wp_template)/all"
48
53
  }, createElement(SidebarNavigationScreenTemplatesBrowse, null)), createElement(NavigatorScreen, {
49
54
  path: "/:postType(wp_template)/:postId"
50
- }, createElement(SidebarNavigationScreenTemplate, null)), createElement(NavigatorScreen, {
51
- path: "/:postType(wp_template_part)/:postId"
52
- }, createElement(SidebarNavigationScreenTemplatePart, null)));
55
+ }, createElement(SidebarNavigationScreenTemplate, null)));
53
56
  }
54
57
 
55
58
  function Sidebar() {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["memo","useRef","__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","privateApis","routerPrivateApis","SidebarNavigationScreenMain","SidebarNavigationScreenTemplates","SidebarNavigationScreenTemplate","SidebarNavigationScreenTemplatePart","useSyncPathWithURL","getPathFromURL","SidebarNavigationScreenNavigationMenus","SidebarNavigationScreenNavigationMenu","SidebarNavigationScreenGlobalStyles","SidebarNavigationScreenTemplatesBrowse","SaveHub","unlock","SidebarNavigationScreenPages","SidebarNavigationScreenPage","useLocation","SidebarScreens","Sidebar","params","urlParams","initialPath","current"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,MAAf,QAA6B,oBAA7B;AACA,SACCC,+BAA+B,IAAIC,iBADpC,EAECC,6BAA6B,IAAIC,eAFlC,QAGO,uBAHP;AAIA,SAASC,WAAW,IAAIC,iBAAxB,QAAiD,mBAAjD;AAEA;AACA;AACA;;AACA,OAAOC,2BAAP,MAAwC,mCAAxC;AACA,OAAOC,gCAAP,MAA6C,wCAA7C;AACA,OAAOC,+BAAP,MAA4C,uCAA5C;AACA,OAAOC,mCAAP,MAAgD,4CAAhD;AACA,OAAOC,kBAAP,IACCC,cADD,QAEO,+CAFP;AAGA,OAAOC,sCAAP,MAAmD,+CAAnD;AACA,OAAOC,qCAAP,MAAkD,8CAAlD;AACA,OAAOC,mCAAP,MAAgD,4CAAhD;AACA,OAAOC,sCAAP,MAAmD,+CAAnD;AACA,OAAOC,OAAP,MAAoB,aAApB;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,OAAOC,4BAAP,MAAyC,oCAAzC;AACA,OAAOC,2BAAP,MAAwC,mCAAxC;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAkBH,MAAM,CAAEZ,iBAAF,CAA9B;;AAEA,SAASgB,cAAT,GAA0B;AACzBX,EAAAA,kBAAkB;AAElB,SACC,8BACC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,2BAAD,OADD,CADD,EAIC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,sCAAD,OADD,CAJD,EAOC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,qCAAD,OADD,CAPD,EAUC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,mCAAD,OADD,CAVD,EAaC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,4BAAD,OADD,CAbD,EAgBC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,2BAAD,OADD,CAhBD,EAmBC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,gCAAD,OADD,CAnBD,EAsBC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,sCAAD,OADD,CAtBD,EAyBC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,+BAAD,OADD,CAzBD,EA4BC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,mCAAD,OADD,CA5BD,CADD;AAkCA;;AAED,SAASY,OAAT,GAAmB;AAClB,QAAM;AAAEC,IAAAA,MAAM,EAAEC;AAAV,MAAwBJ,WAAW,EAAzC;AACA,QAAMK,WAAW,GAAG1B,MAAM,CAAEY,cAAc,CAAEa,SAAF,CAAhB,CAA1B;AAEA,SACC,8BACC,cAAC,iBAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,WAAW,EAAGC,WAAW,CAACC;AAF3B,KAIC,cAAC,cAAD,OAJD,CADD,EAOC,cAAC,OAAD,OAPD,CADD;AAWA;;AAED,eAAe5B,IAAI,CAAEwB,OAAF,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo, useRef } from '@wordpress/element';\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';\nimport SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';\nimport SidebarNavigationScreenTemplatePart from '../sidebar-navigation-screen-template-part';\nimport useSyncPathWithURL, {\n\tgetPathFromURL,\n} from '../sync-state-with-url/use-sync-path-with-url';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\nimport SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\nimport SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';\nimport SaveHub from '../save-hub';\nimport { unlock } from '../../private-apis';\nimport SidebarNavigationScreenPages from '../sidebar-navigation-screen-pages';\nimport SidebarNavigationScreenPage from '../sidebar-navigation-screen-page';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction SidebarScreens() {\n\tuseSyncPathWithURL();\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorScreen path=\"/\">\n\t\t\t\t<SidebarNavigationScreenMain />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/navigation\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenus />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/navigation/:postType/:postId\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenu />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/wp_global_styles\">\n\t\t\t\t<SidebarNavigationScreenGlobalStyles />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/page\">\n\t\t\t\t<SidebarNavigationScreenPages />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/page/:postId\">\n\t\t\t\t<SidebarNavigationScreenPage />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template|wp_template_part)\">\n\t\t\t\t<SidebarNavigationScreenTemplates />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template|wp_template_part)/all\">\n\t\t\t\t<SidebarNavigationScreenTemplatesBrowse />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template)/:postId\">\n\t\t\t\t<SidebarNavigationScreenTemplate />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template_part)/:postId\">\n\t\t\t\t<SidebarNavigationScreenTemplatePart />\n\t\t\t</NavigatorScreen>\n\t\t</>\n\t);\n}\n\nfunction Sidebar() {\n\tconst { params: urlParams } = useLocation();\n\tconst initialPath = useRef( getPathFromURL( urlParams ) );\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorProvider\n\t\t\t\tclassName=\"edit-site-sidebar__content\"\n\t\t\t\tinitialPath={ initialPath.current }\n\t\t\t>\n\t\t\t\t<SidebarScreens />\n\t\t\t</NavigatorProvider>\n\t\t\t<SaveHub />\n\t\t</>\n\t);\n}\n\nexport default memo( Sidebar );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["memo","useRef","__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","privateApis","routerPrivateApis","SidebarNavigationScreenMain","SidebarNavigationScreenLibrary","SidebarNavigationScreenTemplates","SidebarNavigationScreenTemplate","SidebarNavigationScreenPattern","useSyncPathWithURL","getPathFromURL","SidebarNavigationScreenNavigationMenus","SidebarNavigationScreenNavigationMenu","SidebarNavigationScreenGlobalStyles","SidebarNavigationScreenTemplatesBrowse","SaveHub","unlock","SidebarNavigationScreenPages","SidebarNavigationScreenPage","useLocation","SidebarScreens","Sidebar","params","urlParams","initialPath","current"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,MAAf,QAA6B,oBAA7B;AACA,SACCC,+BAA+B,IAAIC,iBADpC,EAECC,6BAA6B,IAAIC,eAFlC,QAGO,uBAHP;AAIA,SAASC,WAAW,IAAIC,iBAAxB,QAAiD,mBAAjD;AAE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,EAAC;AAAtB,KACC,cAAC,8BAAD,OADD,CAtBD,EAyBC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,8BAAD,OADD,CAzBD,EA4BC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,sCAAD,OADD,CA5BD,EA+BC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,+BAAD,OADD,CA/BD,CADD;AAqCA;;AAED,SAASY,OAAT,GAAmB;AAClB,QAAM;AAAEC,IAAAA,MAAM,EAAEC;AAAV,MAAwBJ,WAAW,EAAzC;AACA,QAAMK,WAAW,GAAG3B,MAAM,CAAEa,cAAc,CAAEa,SAAF,CAAhB,CAA1B;AAEA,SACC,8BACC,cAAC,iBAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,WAAW,EAAGC,WAAW,CAACC;AAF3B,KAIC,cAAC,cAAD,OAJD,CADD,EAOC,cAAC,OAAD,OAPD,CADD;AAWA;;AAED,eAAe7B,IAAI,CAAEyB,OAAF,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo, useRef } from '@wordpress/element';\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport SidebarNavigationScreenLibrary from '../sidebar-navigation-screen-library';\nimport SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';\nimport SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';\nimport SidebarNavigationScreenPattern from '../sidebar-navigation-screen-pattern';\nimport useSyncPathWithURL, {\n\tgetPathFromURL,\n} from '../sync-state-with-url/use-sync-path-with-url';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\nimport SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\nimport SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';\nimport SaveHub from '../save-hub';\nimport { unlock } from '../../lock-unlock';\nimport SidebarNavigationScreenPages from '../sidebar-navigation-screen-pages';\nimport SidebarNavigationScreenPage from '../sidebar-navigation-screen-page';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction SidebarScreens() {\n\tuseSyncPathWithURL();\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorScreen path=\"/\">\n\t\t\t\t<SidebarNavigationScreenMain />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/navigation\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenus />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/navigation/:postType/:postId\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenu />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/wp_global_styles\">\n\t\t\t\t<SidebarNavigationScreenGlobalStyles />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/page\">\n\t\t\t\t<SidebarNavigationScreenPages />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/page/:postId\">\n\t\t\t\t<SidebarNavigationScreenPage />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template)\">\n\t\t\t\t<SidebarNavigationScreenTemplates />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/library\">\n\t\t\t\t<SidebarNavigationScreenLibrary />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template_part|wp_block)/:postId\">\n\t\t\t\t<SidebarNavigationScreenPattern />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template)/all\">\n\t\t\t\t<SidebarNavigationScreenTemplatesBrowse />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template)/:postId\">\n\t\t\t\t<SidebarNavigationScreenTemplate />\n\t\t\t</NavigatorScreen>\n\t\t</>\n\t);\n}\n\nfunction Sidebar() {\n\tconst { params: urlParams } = useLocation();\n\tconst initialPath = useRef( getPathFromURL( urlParams ) );\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorProvider\n\t\t\t\tclassName=\"edit-site-sidebar__content\"\n\t\t\t\tinitialPath={ initialPath.current }\n\t\t\t>\n\t\t\t\t<SidebarScreens />\n\t\t\t</NavigatorProvider>\n\t\t\t<SaveHub />\n\t\t</>\n\t);\n}\n\nexport default memo( Sidebar );\n"]}
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement } from "@wordpress/element";
3
2
 
4
3
  /**
@@ -11,8 +10,8 @@ import classnames from 'classnames';
11
10
 
12
11
  import { Button } from '@wordpress/components';
13
12
  export default function SidebarButton(props) {
14
- return createElement(Button, _extends({}, props, {
13
+ return createElement(Button, { ...props,
15
14
  className: classnames('edit-site-sidebar-button', props.className)
16
- }));
15
+ });
17
16
  }
18
17
  //# sourceMappingURL=index.js.map