@wordpress/edit-site 5.31.0 → 5.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (906) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-page/index.js.map +1 -1
  3. package/build/components/add-new-pattern/index.js.map +1 -1
  4. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  5. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  6. package/build/components/add-new-template/index.js +282 -13
  7. package/build/components/add-new-template/index.js.map +1 -1
  8. package/build/components/add-new-template/utils.js +22 -11
  9. package/build/components/add-new-template/utils.js.map +1 -1
  10. package/build/components/app/index.js.map +1 -1
  11. package/build/components/async/index.js +51 -0
  12. package/build/components/async/index.js.map +1 -0
  13. package/build/components/block-editor/block-inspector-button.js +10 -9
  14. package/build/components/block-editor/block-inspector-button.js.map +1 -1
  15. package/build/components/block-editor/editor-canvas.js +23 -7
  16. package/build/components/block-editor/editor-canvas.js.map +1 -1
  17. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  18. package/build/components/block-editor/resizable-editor.js.map +1 -1
  19. package/build/components/block-editor/resize-handle.js.map +1 -1
  20. package/build/components/block-editor/site-editor-canvas.js +20 -5
  21. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  22. package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  23. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  24. package/build/components/canvas-loader/index.js.map +1 -1
  25. package/build/components/code-editor/index.js.map +1 -1
  26. package/build/components/create-template-part-modal/index.js.map +1 -1
  27. package/build/components/editor/index.js +47 -11
  28. package/build/components/editor/index.js.map +1 -1
  29. package/build/components/editor-canvas-container/index.js +1 -2
  30. package/build/components/editor-canvas-container/index.js.map +1 -1
  31. package/build/components/error-boundary/index.js.map +1 -1
  32. package/build/components/error-boundary/warning.js.map +1 -1
  33. package/build/components/global-styles/background-panel.js +50 -0
  34. package/build/components/global-styles/background-panel.js.map +1 -0
  35. package/build/components/global-styles/block-preview-panel.js +6 -1
  36. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  37. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  38. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  39. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  40. package/build/components/global-styles/font-families.js +2 -2
  41. package/build/components/global-styles/font-families.js.map +1 -1
  42. package/build/components/global-styles/font-family-item.js.map +1 -1
  43. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  44. package/build/components/global-styles/font-library-modal/context.js +88 -31
  45. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  46. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
  47. package/build/components/global-styles/font-library-modal/font-collection.js +11 -4
  48. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  49. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  50. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  51. package/build/components/global-styles/font-library-modal/index.js +1 -1
  52. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  53. package/build/components/global-styles/font-library-modal/installed-fonts.js +10 -9
  54. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  55. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  56. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  57. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  58. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  59. package/build/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
  60. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  61. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  62. package/build/components/global-styles/font-library-modal/utils/index.js +20 -2
  63. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  64. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  65. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  66. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  67. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
  68. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  69. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  70. package/build/components/global-styles/header.js.map +1 -1
  71. package/build/components/global-styles/highlighted-colors.js +1 -1
  72. package/build/components/global-styles/highlighted-colors.js.map +1 -1
  73. package/build/components/global-styles/hooks.js +11 -3
  74. package/build/components/global-styles/hooks.js.map +1 -1
  75. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  76. package/build/components/global-styles/index.js.map +1 -1
  77. package/build/components/global-styles/navigation-button.js.map +1 -1
  78. package/build/components/global-styles/palette.js +3 -1
  79. package/build/components/global-styles/palette.js.map +1 -1
  80. package/build/components/global-styles/preview-colors.js +2 -2
  81. package/build/components/global-styles/preview-colors.js.map +1 -1
  82. package/build/components/global-styles/preview-iframe.js.map +1 -1
  83. package/build/components/global-styles/preview-styles.js.map +1 -1
  84. package/build/components/global-styles/root-menu.js +8 -2
  85. package/build/components/global-styles/root-menu.js.map +1 -1
  86. package/build/components/global-styles/screen-background.js +34 -0
  87. package/build/components/global-styles/screen-background.js.map +1 -0
  88. package/build/components/global-styles/screen-block-list.js.map +1 -1
  89. package/build/components/global-styles/screen-block.js.map +1 -1
  90. package/build/components/global-styles/screen-color-palette.js +2 -2
  91. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  92. package/build/components/global-styles/screen-colors.js +6 -4
  93. package/build/components/global-styles/screen-colors.js.map +1 -1
  94. package/build/components/global-styles/screen-css.js.map +1 -1
  95. package/build/components/global-styles/screen-layout.js.map +1 -1
  96. package/build/components/global-styles/screen-revisions/index.js +1 -1
  97. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  98. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  99. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  100. package/build/components/global-styles/screen-root.js.map +1 -1
  101. package/build/components/global-styles/screen-style-variations.js +3 -37
  102. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  103. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  104. package/build/components/global-styles/screen-typography.js +6 -6
  105. package/build/components/global-styles/screen-typography.js.map +1 -1
  106. package/build/components/global-styles/style-variations-container.js +5 -2
  107. package/build/components/global-styles/style-variations-container.js.map +1 -1
  108. package/build/components/global-styles/subtitle.js.map +1 -1
  109. package/build/components/global-styles/typography-elements.js.map +1 -1
  110. package/build/components/global-styles/typography-example.js.map +1 -1
  111. package/build/components/global-styles/typography-panel.js.map +1 -1
  112. package/build/components/global-styles/typography-preview.js.map +1 -1
  113. package/build/components/global-styles/ui.js +5 -2
  114. package/build/components/global-styles/ui.js.map +1 -1
  115. package/build/components/global-styles/utils.js.map +1 -1
  116. package/build/components/global-styles/variations/variation.js.map +1 -1
  117. package/build/components/global-styles/variations/variations-color.js +10 -3
  118. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  119. package/build/components/global-styles/variations/variations-panel.js.map +1 -1
  120. package/build/components/global-styles/variations/variations-typography.js +9 -2
  121. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  122. package/build/components/global-styles-renderer/index.js.map +1 -1
  123. package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
  124. package/build/components/header-edit-mode/index.js +4 -4
  125. package/build/components/header-edit-mode/index.js.map +1 -1
  126. package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +1 -1
  127. package/build/components/header-edit-mode/more-menu/index.js +10 -12
  128. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  129. package/build/components/header-edit-mode/more-menu/site-export.js.map +1 -1
  130. package/build/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
  131. package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  132. package/build/components/keyboard-shortcuts/edit-mode.js +0 -23
  133. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  134. package/build/components/keyboard-shortcuts/global.js.map +1 -1
  135. package/build/components/keyboard-shortcuts/register.js +0 -18
  136. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  137. package/build/components/layout/animation.js +130 -0
  138. package/build/components/layout/animation.js.map +1 -0
  139. package/build/components/layout/hooks.js.map +1 -1
  140. package/build/components/layout/index.js +21 -64
  141. package/build/components/layout/index.js.map +1 -1
  142. package/build/components/layout/router.js +92 -23
  143. package/build/components/layout/router.js.map +1 -1
  144. package/build/components/media/index.js.map +1 -1
  145. package/build/components/page/header.js.map +1 -1
  146. package/build/components/page/index.js +5 -2
  147. package/build/components/page/index.js.map +1 -1
  148. package/build/components/page-pages/index.js +33 -33
  149. package/build/components/page-pages/index.js.map +1 -1
  150. package/build/components/page-patterns/dataviews-pattern-actions.js +5 -4
  151. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  152. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  153. package/build/components/page-patterns/header.js +2 -2
  154. package/build/components/page-patterns/header.js.map +1 -1
  155. package/build/components/page-patterns/index.js +136 -39
  156. package/build/components/page-patterns/index.js.map +1 -1
  157. package/build/components/page-patterns/rename-category-menu-item.js.map +1 -1
  158. package/build/components/page-patterns/search-items.js +18 -59
  159. package/build/components/page-patterns/search-items.js.map +1 -1
  160. package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
  161. package/build/components/page-patterns/use-patterns.js +5 -10
  162. package/build/components/page-patterns/use-patterns.js.map +1 -1
  163. package/build/components/page-patterns/utils.js.map +1 -1
  164. package/build/components/page-templates-template-parts/add-new-template-part.js +2 -1
  165. package/build/components/page-templates-template-parts/add-new-template-part.js.map +1 -1
  166. package/build/components/page-templates-template-parts/hooks.js.map +1 -1
  167. package/build/components/page-templates-template-parts/index.js +35 -80
  168. package/build/components/page-templates-template-parts/index.js.map +1 -1
  169. package/build/components/pagination/index.js.map +1 -1
  170. package/build/components/pattern-modal/duplicate.js +6 -3
  171. package/build/components/pattern-modal/duplicate.js.map +1 -1
  172. package/build/components/pattern-modal/index.js.map +1 -1
  173. package/build/components/pattern-modal/rename.js +6 -3
  174. package/build/components/pattern-modal/rename.js.map +1 -1
  175. package/build/components/plugin-template-setting-panel/index.js +12 -1
  176. package/build/components/plugin-template-setting-panel/index.js.map +1 -1
  177. package/build/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +18 -16
  178. package/build/components/rename-post-menu-item/index.js.map +1 -0
  179. package/build/components/resizable-frame/index.js +1 -5
  180. package/build/components/resizable-frame/index.js.map +1 -1
  181. package/build/components/revisions/index.js.map +1 -1
  182. package/build/components/routes/link.js.map +1 -1
  183. package/build/components/routes/use-title.js.map +1 -1
  184. package/build/components/save-button/index.js +45 -16
  185. package/build/components/save-button/index.js.map +1 -1
  186. package/build/components/save-hub/index.js +8 -112
  187. package/build/components/save-hub/index.js.map +1 -1
  188. package/build/components/save-panel/index.js +3 -3
  189. package/build/components/save-panel/index.js.map +1 -1
  190. package/build/components/sidebar/index.js +41 -79
  191. package/build/components/sidebar/index.js.map +1 -1
  192. package/build/components/sidebar-button/index.js.map +1 -1
  193. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  194. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  195. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  196. package/build/components/sidebar-dataviews/default-views.js +2 -2
  197. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  198. package/build/components/sidebar-dataviews/index.js +2 -2
  199. package/build/components/sidebar-dataviews/index.js.map +1 -1
  200. package/build/components/sidebar-edit-mode/default-sidebar.js +18 -7
  201. package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  202. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +5 -3
  203. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  204. package/build/components/sidebar-edit-mode/index.js +30 -56
  205. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  206. package/build/components/sidebar-edit-mode/page-panels/index.js +26 -15
  207. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  208. package/build/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
  209. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  210. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  211. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +2 -2
  212. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  213. package/build/components/sidebar-edit-mode/settings-header/index.js +4 -5
  214. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  215. package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
  216. package/build/components/sidebar-edit-mode/template-panel/index.js +11 -17
  217. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  218. package/build/components/sidebar-navigation-item/index.js +31 -0
  219. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  220. package/build/components/sidebar-navigation-screen/index.js +36 -9
  221. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  222. package/build/components/sidebar-navigation-screen-details-footer/index.js +5 -1
  223. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  224. package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  225. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
  226. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  227. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
  228. package/build/components/sidebar-navigation-screen-global-styles/index.js +11 -7
  229. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  230. package/build/components/sidebar-navigation-screen-main/index.js +6 -15
  231. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  232. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
  233. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  234. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +7 -2
  235. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  236. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  237. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  238. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  239. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  240. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  241. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -15
  242. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  243. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  244. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  245. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  246. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  247. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -5
  248. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  249. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  250. package/build/components/sidebar-navigation-screen-page/index.js +22 -12
  251. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  252. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  253. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  254. package/build/components/sidebar-navigation-screen-pattern/index.js +14 -5
  255. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  256. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  257. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
  258. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  259. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  260. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  261. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -1
  262. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  263. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  264. package/build/components/sidebar-navigation-screen-patterns/index.js +34 -32
  265. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  266. package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
  267. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  268. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  269. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  270. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  271. package/build/components/sidebar-navigation-screen-template/index.js +10 -7
  272. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  273. package/build/components/sidebar-navigation-screen-template/template-areas.js.map +1 -1
  274. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  275. package/build/components/sidebar-navigation-screen-templates-browse/index.js +6 -8
  276. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  277. package/build/components/site-hub/index.js +22 -21
  278. package/build/components/site-hub/index.js.map +1 -1
  279. package/build/components/site-icon/index.js.map +1 -1
  280. package/build/components/start-template-options/index.js.map +1 -1
  281. package/build/components/style-book/index.js +1 -1
  282. package/build/components/style-book/index.js.map +1 -1
  283. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +16 -7
  284. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  285. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  286. package/build/components/table/index.js.map +1 -1
  287. package/build/components/template-actions/index.js +7 -8
  288. package/build/components/template-actions/index.js.map +1 -1
  289. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  290. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  291. package/build/components/template-part-converter/index.js.map +1 -1
  292. package/build/components/use-edited-entity-record/index.js.map +1 -1
  293. package/build/components/welcome-guide/editor.js.map +1 -1
  294. package/build/components/welcome-guide/image.js.map +1 -1
  295. package/build/components/welcome-guide/index.js.map +1 -1
  296. package/build/components/welcome-guide/page.js.map +1 -1
  297. package/build/components/welcome-guide/styles.js +6 -3
  298. package/build/components/welcome-guide/styles.js.map +1 -1
  299. package/build/components/welcome-guide/template.js.map +1 -1
  300. package/build/hooks/commands/use-common-commands.js.map +1 -1
  301. package/build/hooks/commands/use-edit-mode-commands.js +10 -28
  302. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  303. package/build/hooks/components.js.map +1 -1
  304. package/build/hooks/index.js +0 -1
  305. package/build/hooks/index.js.map +1 -1
  306. package/build/hooks/push-changes-to-global-styles/index.js +3 -40
  307. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  308. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +1 -1
  309. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  310. package/build/index.js +3 -8
  311. package/build/index.js.map +1 -1
  312. package/build/lock-unlock.js.map +1 -1
  313. package/build/store/actions.js +21 -96
  314. package/build/store/actions.js.map +1 -1
  315. package/build/store/constants.js.map +1 -1
  316. package/build/store/index.js +1 -1
  317. package/build/store/index.js.map +1 -1
  318. package/build/store/private-actions.js +1 -85
  319. package/build/store/private-actions.js.map +1 -1
  320. package/build/store/private-selectors.js.map +1 -1
  321. package/build/store/reducer.js.map +1 -1
  322. package/build/store/selectors.js +1 -9
  323. package/build/store/selectors.js.map +1 -1
  324. package/build/utils/clone-deep.js.map +1 -1
  325. package/build/utils/constants.js +2 -1
  326. package/build/utils/constants.js.map +1 -1
  327. package/build/utils/get-is-list-page.js.map +1 -1
  328. package/build/utils/is-previewing-theme.js.map +1 -1
  329. package/build/utils/is-template-removable.js.map +1 -1
  330. package/build/utils/is-template-revertable.js.map +1 -1
  331. package/build/utils/math.js.map +1 -1
  332. package/build/utils/set-nested-value.js +44 -0
  333. package/build/utils/set-nested-value.js.map +1 -0
  334. package/build/utils/template-part-create.js.map +1 -1
  335. package/build/utils/use-activate-theme.js.map +1 -1
  336. package/build/utils/use-actual-current-theme.js.map +1 -1
  337. package/build-module/components/add-new-page/index.js.map +1 -1
  338. package/build-module/components/add-new-pattern/index.js.map +1 -1
  339. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  340. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  341. package/build-module/components/add-new-template/index.js +283 -14
  342. package/build-module/components/add-new-template/index.js.map +1 -1
  343. package/build-module/components/add-new-template/utils.js +21 -11
  344. package/build-module/components/add-new-template/utils.js.map +1 -1
  345. package/build-module/components/app/index.js.map +1 -1
  346. package/build-module/components/async/index.js +44 -0
  347. package/build-module/components/async/index.js.map +1 -0
  348. package/build-module/components/block-editor/block-inspector-button.js +9 -8
  349. package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
  350. package/build-module/components/block-editor/editor-canvas.js +24 -8
  351. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  352. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
  353. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  354. package/build-module/components/block-editor/resize-handle.js.map +1 -1
  355. package/build-module/components/block-editor/site-editor-canvas.js +20 -5
  356. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  357. package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  358. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  359. package/build-module/components/canvas-loader/index.js.map +1 -1
  360. package/build-module/components/code-editor/index.js.map +1 -1
  361. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  362. package/build-module/components/editor/index.js +48 -12
  363. package/build-module/components/editor/index.js.map +1 -1
  364. package/build-module/components/editor-canvas-container/index.js +1 -2
  365. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  366. package/build-module/components/error-boundary/index.js.map +1 -1
  367. package/build-module/components/error-boundary/warning.js.map +1 -1
  368. package/build-module/components/global-styles/background-panel.js +44 -0
  369. package/build-module/components/global-styles/background-panel.js.map +1 -0
  370. package/build-module/components/global-styles/block-preview-panel.js +6 -1
  371. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  372. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  373. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  374. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  375. package/build-module/components/global-styles/font-families.js +1 -1
  376. package/build-module/components/global-styles/font-families.js.map +1 -1
  377. package/build-module/components/global-styles/font-family-item.js.map +1 -1
  378. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  379. package/build-module/components/global-styles/font-library-modal/context.js +87 -31
  380. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  381. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
  382. package/build-module/components/global-styles/font-library-modal/font-collection.js +12 -5
  383. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  384. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  385. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  386. package/build-module/components/global-styles/font-library-modal/index.js +2 -2
  387. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  388. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +11 -10
  389. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  390. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  391. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  392. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  393. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  394. package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
  395. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  396. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  397. package/build-module/components/global-styles/font-library-modal/utils/index.js +20 -2
  398. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  399. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  400. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  401. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  402. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
  403. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  404. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  405. package/build-module/components/global-styles/header.js.map +1 -1
  406. package/build-module/components/global-styles/highlighted-colors.js +1 -1
  407. package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
  408. package/build-module/components/global-styles/hooks.js +11 -3
  409. package/build-module/components/global-styles/hooks.js.map +1 -1
  410. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  411. package/build-module/components/global-styles/index.js.map +1 -1
  412. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  413. package/build-module/components/global-styles/palette.js +3 -1
  414. package/build-module/components/global-styles/palette.js.map +1 -1
  415. package/build-module/components/global-styles/preview-colors.js +2 -2
  416. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  417. package/build-module/components/global-styles/preview-iframe.js.map +1 -1
  418. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  419. package/build-module/components/global-styles/root-menu.js +9 -3
  420. package/build-module/components/global-styles/root-menu.js.map +1 -1
  421. package/build-module/components/global-styles/screen-background.js +26 -0
  422. package/build-module/components/global-styles/screen-background.js.map +1 -0
  423. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  424. package/build-module/components/global-styles/screen-block.js.map +1 -1
  425. package/build-module/components/global-styles/screen-color-palette.js +2 -2
  426. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  427. package/build-module/components/global-styles/screen-colors.js +6 -4
  428. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  429. package/build-module/components/global-styles/screen-css.js.map +1 -1
  430. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  431. package/build-module/components/global-styles/screen-revisions/index.js +1 -1
  432. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  433. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  434. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  435. package/build-module/components/global-styles/screen-root.js.map +1 -1
  436. package/build-module/components/global-styles/screen-style-variations.js +4 -38
  437. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  438. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  439. package/build-module/components/global-styles/screen-typography.js +6 -6
  440. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  441. package/build-module/components/global-styles/style-variations-container.js +5 -2
  442. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  443. package/build-module/components/global-styles/subtitle.js.map +1 -1
  444. package/build-module/components/global-styles/typography-elements.js.map +1 -1
  445. package/build-module/components/global-styles/typography-example.js.map +1 -1
  446. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  447. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  448. package/build-module/components/global-styles/ui.js +4 -1
  449. package/build-module/components/global-styles/ui.js.map +1 -1
  450. package/build-module/components/global-styles/utils.js.map +1 -1
  451. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  452. package/build-module/components/global-styles/variations/variations-color.js +10 -3
  453. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  454. package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
  455. package/build-module/components/global-styles/variations/variations-typography.js +9 -2
  456. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  457. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  458. package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
  459. package/build-module/components/header-edit-mode/index.js +3 -3
  460. package/build-module/components/header-edit-mode/index.js.map +1 -1
  461. package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +1 -1
  462. package/build-module/components/header-edit-mode/more-menu/index.js +8 -8
  463. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  464. package/build-module/components/header-edit-mode/more-menu/site-export.js.map +1 -1
  465. package/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
  466. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  467. package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -23
  468. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  469. package/build-module/components/keyboard-shortcuts/global.js.map +1 -1
  470. package/build-module/components/keyboard-shortcuts/register.js +0 -18
  471. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  472. package/build-module/components/layout/animation.js +123 -0
  473. package/build-module/components/layout/animation.js.map +1 -0
  474. package/build-module/components/layout/hooks.js.map +1 -1
  475. package/build-module/components/layout/index.js +21 -64
  476. package/build-module/components/layout/index.js.map +1 -1
  477. package/build-module/components/layout/router.js +92 -23
  478. package/build-module/components/layout/router.js.map +1 -1
  479. package/build-module/components/media/index.js.map +1 -1
  480. package/build-module/components/page/header.js.map +1 -1
  481. package/build-module/components/page/index.js +5 -2
  482. package/build-module/components/page/index.js.map +1 -1
  483. package/build-module/components/page-pages/index.js +32 -32
  484. package/build-module/components/page-pages/index.js.map +1 -1
  485. package/build-module/components/page-patterns/dataviews-pattern-actions.js +5 -4
  486. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  487. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  488. package/build-module/components/page-patterns/header.js +2 -2
  489. package/build-module/components/page-patterns/header.js.map +1 -1
  490. package/build-module/components/page-patterns/index.js +139 -42
  491. package/build-module/components/page-patterns/index.js.map +1 -1
  492. package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
  493. package/build-module/components/page-patterns/search-items.js +17 -57
  494. package/build-module/components/page-patterns/search-items.js.map +1 -1
  495. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
  496. package/build-module/components/page-patterns/use-patterns.js +2 -6
  497. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  498. package/build-module/components/page-patterns/utils.js.map +1 -1
  499. package/build-module/components/page-templates-template-parts/add-new-template-part.js +3 -2
  500. package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +1 -1
  501. package/build-module/components/page-templates-template-parts/hooks.js.map +1 -1
  502. package/build-module/components/page-templates-template-parts/index.js +36 -81
  503. package/build-module/components/page-templates-template-parts/index.js.map +1 -1
  504. package/build-module/components/pagination/index.js.map +1 -1
  505. package/build-module/components/pattern-modal/duplicate.js +4 -1
  506. package/build-module/components/pattern-modal/duplicate.js.map +1 -1
  507. package/build-module/components/pattern-modal/index.js.map +1 -1
  508. package/build-module/components/pattern-modal/rename.js +4 -1
  509. package/build-module/components/pattern-modal/rename.js.map +1 -1
  510. package/build-module/components/plugin-template-setting-panel/index.js +12 -1
  511. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
  512. package/build-module/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +17 -15
  513. package/build-module/components/rename-post-menu-item/index.js.map +1 -0
  514. package/build-module/components/resizable-frame/index.js +1 -5
  515. package/build-module/components/resizable-frame/index.js.map +1 -1
  516. package/build-module/components/revisions/index.js.map +1 -1
  517. package/build-module/components/routes/link.js.map +1 -1
  518. package/build-module/components/routes/use-title.js.map +1 -1
  519. package/build-module/components/save-button/index.js +46 -17
  520. package/build-module/components/save-button/index.js.map +1 -1
  521. package/build-module/components/save-hub/index.js +10 -114
  522. package/build-module/components/save-hub/index.js.map +1 -1
  523. package/build-module/components/save-panel/index.js +2 -2
  524. package/build-module/components/save-panel/index.js.map +1 -1
  525. package/build-module/components/sidebar/index.js +42 -79
  526. package/build-module/components/sidebar/index.js.map +1 -1
  527. package/build-module/components/sidebar-button/index.js.map +1 -1
  528. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  529. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  530. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  531. package/build-module/components/sidebar-dataviews/default-views.js +2 -2
  532. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  533. package/build-module/components/sidebar-dataviews/index.js +2 -2
  534. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  535. package/build-module/components/sidebar-edit-mode/default-sidebar.js +16 -5
  536. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  537. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +5 -3
  538. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  539. package/build-module/components/sidebar-edit-mode/index.js +29 -55
  540. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  541. package/build-module/components/sidebar-edit-mode/page-panels/index.js +29 -18
  542. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  543. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
  544. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  545. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  546. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +4 -4
  547. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  548. package/build-module/components/sidebar-edit-mode/settings-header/index.js +4 -5
  549. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  550. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
  551. package/build-module/components/sidebar-edit-mode/template-panel/index.js +12 -18
  552. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  553. package/build-module/components/sidebar-navigation-item/index.js +31 -0
  554. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  555. package/build-module/components/sidebar-navigation-screen/index.js +37 -10
  556. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  557. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +5 -1
  558. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  559. package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  560. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
  561. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  562. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
  563. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +12 -8
  564. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  565. package/build-module/components/sidebar-navigation-screen-main/index.js +7 -16
  566. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  567. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
  568. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  569. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +8 -3
  570. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  571. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  572. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  573. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  574. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  575. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  576. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -15
  577. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  578. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  579. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  580. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  581. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  582. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -5
  583. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  584. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  585. package/build-module/components/sidebar-navigation-screen-page/index.js +24 -14
  586. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  587. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  588. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  589. package/build-module/components/sidebar-navigation-screen-pattern/index.js +14 -5
  590. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  591. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  592. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
  593. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  594. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  595. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  596. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -1
  597. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  598. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  599. package/build-module/components/sidebar-navigation-screen-patterns/index.js +35 -33
  600. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  601. package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
  602. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  603. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  604. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  605. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  606. package/build-module/components/sidebar-navigation-screen-template/index.js +12 -8
  607. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  608. package/build-module/components/sidebar-navigation-screen-template/template-areas.js.map +1 -1
  609. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  610. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +6 -8
  611. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  612. package/build-module/components/site-hub/index.js +22 -21
  613. package/build-module/components/site-hub/index.js.map +1 -1
  614. package/build-module/components/site-icon/index.js.map +1 -1
  615. package/build-module/components/start-template-options/index.js.map +1 -1
  616. package/build-module/components/style-book/index.js +1 -1
  617. package/build-module/components/style-book/index.js.map +1 -1
  618. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +16 -7
  619. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  620. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  621. package/build-module/components/table/index.js.map +1 -1
  622. package/build-module/components/template-actions/index.js +7 -8
  623. package/build-module/components/template-actions/index.js.map +1 -1
  624. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  625. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  626. package/build-module/components/template-part-converter/index.js.map +1 -1
  627. package/build-module/components/use-edited-entity-record/index.js.map +1 -1
  628. package/build-module/components/welcome-guide/editor.js.map +1 -1
  629. package/build-module/components/welcome-guide/image.js.map +1 -1
  630. package/build-module/components/welcome-guide/index.js.map +1 -1
  631. package/build-module/components/welcome-guide/page.js.map +1 -1
  632. package/build-module/components/welcome-guide/styles.js +6 -3
  633. package/build-module/components/welcome-guide/styles.js.map +1 -1
  634. package/build-module/components/welcome-guide/template.js.map +1 -1
  635. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  636. package/build-module/hooks/commands/use-edit-mode-commands.js +11 -29
  637. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  638. package/build-module/hooks/components.js.map +1 -1
  639. package/build-module/hooks/index.js +0 -1
  640. package/build-module/hooks/index.js.map +1 -1
  641. package/build-module/hooks/push-changes-to-global-styles/index.js +1 -38
  642. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  643. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +1 -1
  644. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  645. package/build-module/index.js +4 -6
  646. package/build-module/index.js.map +1 -1
  647. package/build-module/lock-unlock.js.map +1 -1
  648. package/build-module/store/actions.js +16 -92
  649. package/build-module/store/actions.js.map +1 -1
  650. package/build-module/store/constants.js.map +1 -1
  651. package/build-module/store/index.js.map +1 -1
  652. package/build-module/store/private-actions.js +0 -83
  653. package/build-module/store/private-actions.js.map +1 -1
  654. package/build-module/store/private-selectors.js.map +1 -1
  655. package/build-module/store/reducer.js.map +1 -1
  656. package/build-module/store/selectors.js +1 -9
  657. package/build-module/store/selectors.js.map +1 -1
  658. package/build-module/utils/clone-deep.js.map +1 -1
  659. package/build-module/utils/constants.js +1 -0
  660. package/build-module/utils/constants.js.map +1 -1
  661. package/build-module/utils/get-is-list-page.js.map +1 -1
  662. package/build-module/utils/is-previewing-theme.js.map +1 -1
  663. package/build-module/utils/is-template-removable.js.map +1 -1
  664. package/build-module/utils/is-template-revertable.js.map +1 -1
  665. package/build-module/utils/math.js.map +1 -1
  666. package/build-module/utils/set-nested-value.js +38 -0
  667. package/build-module/utils/set-nested-value.js.map +1 -0
  668. package/build-module/utils/template-part-create.js.map +1 -1
  669. package/build-module/utils/use-activate-theme.js.map +1 -1
  670. package/build-module/utils/use-actual-current-theme.js.map +1 -1
  671. package/build-style/style-rtl.css +287 -688
  672. package/build-style/style.css +287 -688
  673. package/package.json +44 -45
  674. package/src/components/add-new-template/index.js +412 -12
  675. package/src/components/add-new-template/style.scss +0 -22
  676. package/src/components/add-new-template/utils.js +44 -24
  677. package/src/components/async/index.js +43 -0
  678. package/src/components/block-editor/block-inspector-button.js +9 -11
  679. package/src/components/block-editor/editor-canvas.js +59 -23
  680. package/src/components/block-editor/site-editor-canvas.js +16 -8
  681. package/src/components/editor/index.js +61 -17
  682. package/src/components/editor-canvas-container/index.js +0 -1
  683. package/src/components/global-styles/background-panel.js +50 -0
  684. package/src/components/global-styles/block-preview-panel.js +6 -1
  685. package/src/components/global-styles/font-families.js +1 -1
  686. package/src/components/global-styles/font-library-modal/context.js +104 -50
  687. package/src/components/global-styles/font-library-modal/font-collection.js +247 -223
  688. package/src/components/global-styles/font-library-modal/index.js +2 -2
  689. package/src/components/global-styles/font-library-modal/installed-fonts.js +156 -147
  690. package/src/components/global-styles/font-library-modal/style.scss +32 -14
  691. package/src/components/global-styles/font-library-modal/utils/index.js +17 -4
  692. package/src/components/global-styles/highlighted-colors.js +1 -1
  693. package/src/components/global-styles/hooks.js +20 -3
  694. package/src/components/global-styles/palette.js +3 -1
  695. package/src/components/global-styles/preview-colors.js +2 -2
  696. package/src/components/global-styles/root-menu.js +12 -1
  697. package/src/components/global-styles/screen-background.js +29 -0
  698. package/src/components/global-styles/screen-color-palette.js +2 -2
  699. package/src/components/global-styles/screen-colors.js +4 -4
  700. package/src/components/global-styles/screen-revisions/index.js +1 -1
  701. package/src/components/global-styles/screen-style-variations.js +4 -36
  702. package/src/components/global-styles/screen-typography.js +6 -9
  703. package/src/components/global-styles/style-variations-container.js +2 -1
  704. package/src/components/global-styles/style.scss +14 -12
  705. package/src/components/global-styles/ui.js +5 -0
  706. package/src/components/global-styles/variations/style.scss +32 -17
  707. package/src/components/global-styles/variations/variations-color.js +4 -2
  708. package/src/components/global-styles/variations/variations-typography.js +4 -1
  709. package/src/components/header-edit-mode/index.js +3 -5
  710. package/src/components/header-edit-mode/more-menu/index.js +6 -17
  711. package/src/components/header-edit-mode/style.scss +29 -18
  712. package/src/components/keyboard-shortcuts/edit-mode.js +0 -29
  713. package/src/components/keyboard-shortcuts/register.js +0 -20
  714. package/src/components/layout/animation.js +125 -0
  715. package/src/components/layout/index.js +21 -74
  716. package/src/components/layout/router.js +99 -30
  717. package/src/components/layout/style.scss +17 -37
  718. package/src/components/page/index.js +7 -2
  719. package/src/components/page-pages/index.js +59 -65
  720. package/src/components/page-pages/style.scss +29 -22
  721. package/src/components/page-patterns/dataviews-pattern-actions.js +5 -6
  722. package/src/components/page-patterns/header.js +4 -2
  723. package/src/components/page-patterns/index.js +182 -78
  724. package/src/components/page-patterns/search-items.js +16 -58
  725. package/src/components/page-patterns/style.scss +7 -6
  726. package/src/components/page-patterns/use-patterns.js +2 -6
  727. package/src/components/page-templates-template-parts/add-new-template-part.js +4 -2
  728. package/src/components/page-templates-template-parts/index.js +44 -103
  729. package/src/components/page-templates-template-parts/style.scss +5 -0
  730. package/src/components/pattern-modal/duplicate.js +2 -1
  731. package/src/components/pattern-modal/rename.js +2 -1
  732. package/src/components/plugin-template-setting-panel/index.js +14 -1
  733. package/src/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +20 -24
  734. package/src/components/resizable-frame/index.js +2 -6
  735. package/src/components/save-button/index.js +55 -26
  736. package/src/components/save-hub/index.js +20 -164
  737. package/src/components/save-panel/index.js +2 -2
  738. package/src/components/sidebar/index.js +52 -105
  739. package/src/components/sidebar/style.scss +41 -6
  740. package/src/components/sidebar-dataviews/default-views.js +2 -2
  741. package/src/components/sidebar-dataviews/index.js +2 -2
  742. package/src/components/sidebar-edit-mode/default-sidebar.js +13 -6
  743. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +7 -3
  744. package/src/components/sidebar-edit-mode/index.js +39 -77
  745. package/src/components/sidebar-edit-mode/page-panels/index.js +52 -60
  746. package/src/components/sidebar-edit-mode/page-panels/page-content.js +10 -10
  747. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +20 -12
  748. package/src/components/sidebar-edit-mode/page-panels/style.scss +0 -6
  749. package/src/components/sidebar-edit-mode/settings-header/index.js +4 -5
  750. package/src/components/sidebar-edit-mode/style.scss +1 -1
  751. package/src/components/sidebar-edit-mode/template-panel/index.js +24 -34
  752. package/src/components/sidebar-edit-mode/template-panel/style.scss +1 -29
  753. package/src/components/sidebar-navigation-item/index.js +29 -0
  754. package/src/components/sidebar-navigation-screen/index.js +29 -12
  755. package/src/components/sidebar-navigation-screen/style.scss +13 -30
  756. package/src/components/sidebar-navigation-screen-details-footer/index.js +6 -2
  757. package/src/components/sidebar-navigation-screen-global-styles/index.js +9 -24
  758. package/src/components/sidebar-navigation-screen-main/index.js +11 -23
  759. package/src/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
  760. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +7 -6
  761. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  762. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +14 -14
  763. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  764. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +4 -5
  765. package/src/components/sidebar-navigation-screen-page/index.js +23 -13
  766. package/src/components/sidebar-navigation-screen-page/style.scss +8 -2
  767. package/src/components/sidebar-navigation-screen-pattern/index.js +9 -6
  768. package/src/components/sidebar-navigation-screen-patterns/index.js +70 -67
  769. package/src/components/sidebar-navigation-screen-patterns/style.scss +5 -0
  770. package/src/components/sidebar-navigation-screen-template/index.js +8 -12
  771. package/src/components/sidebar-navigation-screen-templates-browse/index.js +2 -7
  772. package/src/components/site-hub/index.js +80 -90
  773. package/src/components/site-hub/style.scss +14 -34
  774. package/src/components/style-book/index.js +1 -3
  775. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +52 -37
  776. package/src/components/template-actions/index.js +8 -11
  777. package/src/components/welcome-guide/style.scss +1 -1
  778. package/src/components/welcome-guide/styles.js +6 -5
  779. package/src/hooks/commands/use-edit-mode-commands.js +12 -33
  780. package/src/hooks/index.js +0 -1
  781. package/src/hooks/push-changes-to-global-styles/index.js +1 -40
  782. package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +4 -0
  783. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +5 -1
  784. package/src/index.js +9 -10
  785. package/src/store/actions.js +25 -141
  786. package/src/store/private-actions.js +0 -133
  787. package/src/store/selectors.js +3 -15
  788. package/src/store/test/actions.js +7 -2
  789. package/src/style.scss +0 -3
  790. package/src/utils/constants.js +1 -0
  791. package/src/utils/set-nested-value.js +39 -0
  792. package/build/components/actions/index.js +0 -319
  793. package/build/components/actions/index.js.map +0 -1
  794. package/build/components/add-new-template/new-template.js +0 -298
  795. package/build/components/add-new-template/new-template.js.map +0 -1
  796. package/build/components/add-new-template/template-actions-loading-screen.js +0 -27
  797. package/build/components/add-new-template/template-actions-loading-screen.js.map +0 -1
  798. package/build/components/header-edit-mode/plugin-more-menu-item/index.js +0 -78
  799. package/build/components/header-edit-mode/plugin-more-menu-item/index.js.map +0 -1
  800. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -71
  801. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +0 -1
  802. package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
  803. package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  804. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -48
  805. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  806. package/build/components/keyboard-shortcut-help-modal/index.js +0 -116
  807. package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  808. package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -54
  809. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  810. package/build/components/page-actions/index.js +0 -35
  811. package/build/components/page-actions/index.js.map +0 -1
  812. package/build/components/page-actions/trash-page-menu-item.js +0 -54
  813. package/build/components/page-actions/trash-page-menu-item.js.map +0 -1
  814. package/build/components/page-templates-template-parts/actions.js +0 -194
  815. package/build/components/page-templates-template-parts/actions.js.map +0 -1
  816. package/build/components/preferences-modal/index.js +0 -38
  817. package/build/components/preferences-modal/index.js.map +0 -1
  818. package/build/components/sidebar-edit-mode/constants.js +0 -9
  819. package/build/components/sidebar-edit-mode/constants.js.map +0 -1
  820. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -89
  821. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +0 -1
  822. package/build/components/sidebar-edit-mode/sidebar-card/index.js +0 -48
  823. package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
  824. package/build/components/sidebar-edit-mode/template-panel/template-areas.js +0 -70
  825. package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +0 -1
  826. package/build/components/sidebar-navigation-screen-navigation-item/index.js +0 -54
  827. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +0 -1
  828. package/build/components/sidebar-navigation-screen-pages/index.js +0 -175
  829. package/build/components/sidebar-navigation-screen-pages/index.js.map +0 -1
  830. package/build/components/sync-state-with-url/use-sync-path-with-url.js +0 -132
  831. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +0 -1
  832. package/build/components/template-actions/rename-menu-item.js.map +0 -1
  833. package/build/hooks/template-part-edit.js +0 -82
  834. package/build/hooks/template-part-edit.js.map +0 -1
  835. package/build/store/utils.js +0 -71
  836. package/build/store/utils.js.map +0 -1
  837. package/build-module/components/actions/index.js +0 -308
  838. package/build-module/components/actions/index.js.map +0 -1
  839. package/build-module/components/add-new-template/new-template.js +0 -290
  840. package/build-module/components/add-new-template/new-template.js.map +0 -1
  841. package/build-module/components/add-new-template/template-actions-loading-screen.js +0 -20
  842. package/build-module/components/add-new-template/template-actions-loading-screen.js.map +0 -1
  843. package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js +0 -73
  844. package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js.map +0 -1
  845. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -65
  846. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +0 -1
  847. package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
  848. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  849. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -40
  850. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  851. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -107
  852. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  853. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -47
  854. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  855. package/build-module/components/page-actions/index.js +0 -27
  856. package/build-module/components/page-actions/index.js.map +0 -1
  857. package/build-module/components/page-actions/trash-page-menu-item.js +0 -47
  858. package/build-module/components/page-actions/trash-page-menu-item.js.map +0 -1
  859. package/build-module/components/page-templates-template-parts/actions.js +0 -185
  860. package/build-module/components/page-templates-template-parts/actions.js.map +0 -1
  861. package/build-module/components/preferences-modal/index.js +0 -30
  862. package/build-module/components/preferences-modal/index.js.map +0 -1
  863. package/build-module/components/sidebar-edit-mode/constants.js +0 -3
  864. package/build-module/components/sidebar-edit-mode/constants.js.map +0 -1
  865. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -83
  866. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +0 -1
  867. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +0 -40
  868. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
  869. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js +0 -63
  870. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +0 -1
  871. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +0 -46
  872. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +0 -1
  873. package/build-module/components/sidebar-navigation-screen-pages/index.js +0 -167
  874. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +0 -1
  875. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +0 -124
  876. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +0 -1
  877. package/build-module/components/template-actions/rename-menu-item.js.map +0 -1
  878. package/build-module/hooks/template-part-edit.js +0 -75
  879. package/build-module/hooks/template-part-edit.js.map +0 -1
  880. package/build-module/store/utils.js +0 -64
  881. package/build-module/store/utils.js.map +0 -1
  882. package/src/components/actions/index.js +0 -409
  883. package/src/components/add-new-template/new-template.js +0 -429
  884. package/src/components/add-new-template/template-actions-loading-screen.js +0 -23
  885. package/src/components/header-edit-mode/plugin-more-menu-item/index.js +0 -73
  886. package/src/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -64
  887. package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
  888. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
  889. package/src/components/keyboard-shortcut-help-modal/index.js +0 -147
  890. package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -70
  891. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
  892. package/src/components/page-actions/index.js +0 -30
  893. package/src/components/page-actions/trash-page-menu-item.js +0 -63
  894. package/src/components/page-templates-template-parts/actions.js +0 -262
  895. package/src/components/preferences-modal/index.js +0 -29
  896. package/src/components/sidebar-edit-mode/constants.js +0 -2
  897. package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -80
  898. package/src/components/sidebar-edit-mode/sidebar-card/index.js +0 -53
  899. package/src/components/sidebar-edit-mode/sidebar-card/style.scss +0 -36
  900. package/src/components/sidebar-edit-mode/template-panel/template-areas.js +0 -86
  901. package/src/components/sidebar-navigation-screen-navigation-item/index.js +0 -59
  902. package/src/components/sidebar-navigation-screen-pages/index.js +0 -238
  903. package/src/components/sync-state-with-url/use-sync-path-with-url.js +0 -147
  904. package/src/hooks/template-part-edit.js +0 -89
  905. package/src/store/test/utils.js +0 -191
  906. package/src/store/utils.js +0 -69
@@ -2,46 +2,19 @@ import { createElement } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
5
- import { useSelect, useDispatch } from '@wordpress/data';
6
- import { Button, __experimentalHStack as HStack } from '@wordpress/components';
7
- import { __, sprintf, _n } from '@wordpress/i18n';
5
+ import { useSelect } from '@wordpress/data';
6
+ import { __experimentalHStack as HStack } from '@wordpress/components';
8
7
  import { store as coreStore } from '@wordpress/core-data';
9
- import { store as blockEditorStore } from '@wordpress/block-editor';
10
8
  import { check } from '@wordpress/icons';
11
- import { privateApis as routerPrivateApis } from '@wordpress/router';
12
- import { store as noticesStore } from '@wordpress/notices';
13
9
 
14
10
  /**
15
11
  * Internal dependencies
16
12
  */
17
13
  import SaveButton from '../save-button';
18
14
  import { isPreviewingTheme } from '../../utils/is-previewing-theme';
19
- import { unlock } from '../../lock-unlock';
20
- import { NAVIGATION_POST_TYPE } from '../../utils/constants';
21
- const {
22
- useLocation
23
- } = unlock(routerPrivateApis);
24
- const PUBLISH_ON_SAVE_ENTITIES = [{
25
- kind: 'postType',
26
- name: NAVIGATION_POST_TYPE
27
- }];
28
15
  export default function SaveHub() {
29
- const saveNoticeId = 'site-edit-save-notice';
30
16
  const {
31
- params
32
- } = useLocation();
33
- const {
34
- __unstableMarkLastChangeAsPersistent
35
- } = useDispatch(blockEditorStore);
36
- const {
37
- createSuccessNotice,
38
- createErrorNotice,
39
- removeNotice
40
- } = useDispatch(noticesStore);
41
- const {
42
- dirtyCurrentEntity,
43
- countUnsavedChanges,
44
- isDirty,
17
+ isDisabled,
45
18
  isSaving
46
19
  } = useSelect(select => {
47
20
  const {
@@ -49,99 +22,22 @@ export default function SaveHub() {
49
22
  isSavingEntityRecord
50
23
  } = select(coreStore);
51
24
  const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
52
- let calcDirtyCurrentEntity = null;
53
- if (dirtyEntityRecords.length === 1) {
54
- // if we are on global styles
55
- if (params.path?.includes('wp_global_styles')) {
56
- calcDirtyCurrentEntity = dirtyEntityRecords.find(record => record.name === 'globalStyles');
57
- }
58
- // if we are on pages
59
- else if (params.postId) {
60
- calcDirtyCurrentEntity = dirtyEntityRecords.find(record => record.name === params.postType && String(record.key) === params.postId);
61
- }
62
- }
63
- return {
64
- dirtyCurrentEntity: calcDirtyCurrentEntity,
65
- isDirty: dirtyEntityRecords.length > 0,
66
- isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)),
67
- countUnsavedChanges: dirtyEntityRecords.length
68
- };
69
- }, [params.path, params.postType, params.postId]);
70
- const {
71
- editEntityRecord,
72
- saveEditedEntityRecord,
73
- __experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits
74
- } = useDispatch(coreStore);
75
- const disabled = isSaving || !isDirty && !isPreviewingTheme();
76
-
77
- // if we have only one unsaved change and it matches current context, we can show a more specific label
78
- let label = dirtyCurrentEntity ? __('Save') : sprintf(
79
- // translators: %d: number of unsaved changes (number).
80
- _n('Review %d change…', 'Review %d changes…', countUnsavedChanges), countUnsavedChanges);
81
- if (isSaving) {
82
- label = __('Saving');
83
- }
84
- const {
85
- homeUrl
86
- } = useSelect(select => {
87
- const {
88
- getUnstableBase // Site index.
89
- } = select(coreStore);
25
+ const _isSaving = dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key));
90
26
  return {
91
- homeUrl: getUnstableBase()?.home
27
+ isSaving: _isSaving,
28
+ isDisabled: _isSaving || !dirtyEntityRecords.length && !isPreviewingTheme()
92
29
  };
93
30
  }, []);
94
- const saveCurrentEntity = async () => {
95
- if (!dirtyCurrentEntity) return;
96
- removeNotice(saveNoticeId);
97
- const {
98
- kind,
99
- name,
100
- key,
101
- property
102
- } = dirtyCurrentEntity;
103
- try {
104
- if ('root' === dirtyCurrentEntity.kind && 'site' === name) {
105
- await saveSpecifiedEntityEdits('root', 'site', undefined, [property]);
106
- } else {
107
- if (PUBLISH_ON_SAVE_ENTITIES.some(typeToPublish => typeToPublish.kind === kind && typeToPublish.name === name)) {
108
- editEntityRecord(kind, name, key, {
109
- status: 'publish'
110
- });
111
- }
112
- await saveEditedEntityRecord(kind, name, key);
113
- }
114
- __unstableMarkLastChangeAsPersistent();
115
- createSuccessNotice(__('Site updated.'), {
116
- type: 'snackbar',
117
- actions: [{
118
- label: __('View site'),
119
- url: homeUrl
120
- }],
121
- id: saveNoticeId
122
- });
123
- } catch (error) {
124
- createErrorNotice(`${__('Saving failed.')} ${error}`);
125
- }
126
- };
127
31
  return createElement(HStack, {
128
32
  className: "edit-site-save-hub",
129
33
  alignment: "right",
130
34
  spacing: 4
131
- }, dirtyCurrentEntity ? createElement(Button, {
132
- variant: "primary",
133
- onClick: saveCurrentEntity,
134
- isBusy: isSaving,
135
- disabled: isSaving,
136
- "aria-disabled": isSaving,
137
- className: "edit-site-save-hub__button",
138
- __next40pxDefaultSize: true
139
- }, label) : createElement(SaveButton, {
35
+ }, createElement(SaveButton, {
140
36
  className: "edit-site-save-hub__button",
141
- variant: disabled ? null : 'primary',
37
+ variant: isDisabled ? null : 'primary',
142
38
  showTooltip: false,
143
- icon: disabled && !isSaving ? check : null,
144
- defaultLabel: label,
39
+ icon: isDisabled && !isSaving ? check : null,
40
+ showReviewMessage: true,
145
41
  __next40pxDefaultSize: true
146
42
  }));
147
43
  }
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useDispatch","Button","__experimentalHStack","HStack","__","sprintf","_n","store","coreStore","blockEditorStore","check","privateApis","routerPrivateApis","noticesStore","SaveButton","isPreviewingTheme","unlock","NAVIGATION_POST_TYPE","useLocation","PUBLISH_ON_SAVE_ENTITIES","kind","name","SaveHub","saveNoticeId","params","__unstableMarkLastChangeAsPersistent","createSuccessNotice","createErrorNotice","removeNotice","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","homeUrl","getUnstableBase","home","saveCurrentEntity","property","undefined","typeToPublish","status","type","actions","url","id","error","createElement","className","alignment","spacing","variant","onClick","isBusy","__next40pxDefaultSize","showTooltip","icon","defaultLabel"],"sources":["@wordpress/edit-site/src/components/save-hub/index.js"],"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';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst PUBLISH_ON_SAVE_ENTITIES = [\n\t{\n\t\tkind: 'postType',\n\t\tname: NAVIGATION_POST_TYPE,\n\t},\n];\n\nexport default function SaveHub() {\n\tconst saveNoticeId = 'site-edit-save-notice';\n\tconst { params } = useLocation();\n\n\tconst { __unstableMarkLastChangeAsPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst { createSuccessNotice, createErrorNotice, removeNotice } =\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 { homeUrl } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetUnstableBase, // Site index.\n\t\t} = select( coreStore );\n\t\treturn {\n\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t};\n\t}, [] );\n\n\tconst saveCurrentEntity = async () => {\n\t\tif ( ! dirtyCurrentEntity ) return;\n\n\t\tremoveNotice( saveNoticeId );\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\tactions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'View site' ),\n\t\t\t\t\t\turl: homeUrl,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tid: saveNoticeId,\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\t__next40pxDefaultSize\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\t__next40pxDefaultSize\n\t\t\t\t/>\n\t\t\t) }\n\t\t</HStack>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,MAAM,EAAEC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AAC9E,SAASC,EAAE,EAAEC,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AACjD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK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C,iBAAiB,CAAG,GAAGvB,EAAE,CAAE,gBAAiB,CAAG,IAAI8D,KAAO,EAAE,CAAC;IAC9D;EACD,CAAC;EAED,OACCC,aAAA,CAAChE,MAAM;IAACiE,SAAS,EAAC,oBAAoB;IAACC,SAAS,EAAC,OAAO;IAACC,OAAO,EAAG;EAAG,GACnEzC,kBAAkB,GACnBsC,aAAA,CAAClE,MAAM;IACNsE,OAAO,EAAC,SAAS;IACjBC,OAAO,EAAGf,iBAAmB;IAC7BgB,MAAM,EAAGzC,QAAU;IACnBoB,QAAQ,EAAGpB,QAAU;IACrB,iBAAgBA,QAAU;IAC1BoC,SAAS,EAAC,4BAA4B;IACtCM,qBAAqB;EAAA,GAEnBrB,KACK,CAAC,GAETc,aAAA,CAACrD,UAAU;IACVsD,SAAS,EAAC,4BAA4B;IACtCG,OAAO,EAAGnB,QAAQ,GAAG,IAAI,GAAG,SAAW;IACvCuB,WAAW,EAAG,KAAO;IACrBC,IAAI,EAAGxB,QAAQ,IAAI,CAAEpB,QAAQ,GAAGtB,KAAK,GAAG,IAAM;IAC9CmE,YAAY,EAAGxB,KAAO;IACtBqB,qBAAqB;EAAA,CACrB,CAEK,CAAC;AAEX"}
1
+ {"version":3,"names":["useSelect","__experimentalHStack","HStack","store","coreStore","check","SaveButton","isPreviewingTheme","SaveHub","isDisabled","isSaving","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","dirtyEntityRecords","_isSaving","some","record","kind","name","key","length","createElement","className","alignment","spacing","variant","showTooltip","icon","showReviewMessage","__next40pxDefaultSize"],"sources":["@wordpress/edit-site/src/components/save-hub/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SaveButton from '../save-button';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nexport default function SaveHub() {\n\tconst { isDisabled, isSaving } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst _isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\t\treturn {\n\t\t\tisSaving: _isSaving,\n\t\t\tisDisabled:\n\t\t\t\t_isSaving ||\n\t\t\t\t( ! dirtyEntityRecords.length && ! isPreviewingTheme() ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<HStack className=\"edit-site-save-hub\" alignment=\"right\" spacing={ 4 }>\n\t\t\t<SaveButton\n\t\t\t\tclassName=\"edit-site-save-hub__button\"\n\t\t\t\tvariant={ isDisabled ? null : 'primary' }\n\t\t\t\tshowTooltip={ false }\n\t\t\t\ticon={ isDisabled && ! isSaving ? check : null }\n\t\t\t\tshowReviewMessage\n\t\t\t\t__next40pxDefaultSize\n\t\t\t/>\n\t\t</HStack>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AACtE,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,KAAK,QAAQ,kBAAkB;;AAExC;AACA;AACA;AACA,OAAOC,UAAU,MAAM,gBAAgB;AACvC,SAASC,iBAAiB,QAAQ,iCAAiC;AAEnE,eAAe,SAASC,OAAOA,CAAA,EAAG;EACjC,MAAM;IAAEC,UAAU;IAAEC;EAAS,CAAC,GAAGV,SAAS,CAAIW,MAAM,IAAM;IACzD,MAAM;MAAEC,mCAAmC;MAAEC;IAAqB,CAAC,GAClEF,MAAM,CAAEP,SAAU,CAAC;IACpB,MAAMU,kBAAkB,GAAGF,mCAAmC,CAAC,CAAC;IAChE,MAAMG,SAAS,GAAGD,kBAAkB,CAACE,IAAI,CAAIC,MAAM,IAClDJ,oBAAoB,CAAEI,MAAM,CAACC,IAAI,EAAED,MAAM,CAACE,IAAI,EAAEF,MAAM,CAACG,GAAI,CAC5D,CAAC;IACD,OAAO;MACNV,QAAQ,EAAEK,SAAS;MACnBN,UAAU,EACTM,SAAS,IACP,CAAED,kBAAkB,CAACO,MAAM,IAAI,CAAEd,iBAAiB,CAAC;IACvD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,OACCe,aAAA,CAACpB,MAAM;IAACqB,SAAS,EAAC,oBAAoB;IAACC,SAAS,EAAC,OAAO;IAACC,OAAO,EAAG;EAAG,GACrEH,aAAA,CAAChB,UAAU;IACViB,SAAS,EAAC,4BAA4B;IACtCG,OAAO,EAAGjB,UAAU,GAAG,IAAI,GAAG,SAAW;IACzCkB,WAAW,EAAG,KAAO;IACrBC,IAAI,EAAGnB,UAAU,IAAI,CAAEC,QAAQ,GAAGL,KAAK,GAAG,IAAM;IAChDwB,iBAAiB;IACjBC,qBAAqB;EAAA,CACrB,CACM,CAAC;AAEX","ignoreList":[]}
@@ -11,7 +11,6 @@ import { Button, Modal } from '@wordpress/components';
11
11
  import { EntitiesSavedStates, useEntitiesSavedStatesIsDirty, privateApis } from '@wordpress/editor';
12
12
  import { useDispatch, useSelect } from '@wordpress/data';
13
13
  import { __, sprintf } from '@wordpress/i18n';
14
- import { NavigableRegion } from '@wordpress/interface';
15
14
  import { store as coreStore } from '@wordpress/core-data';
16
15
 
17
16
  /**
@@ -23,7 +22,8 @@ import { useActivateTheme } from '../../utils/use-activate-theme';
23
22
  import { useActualCurrentTheme } from '../../utils/use-actual-current-theme';
24
23
  import { isPreviewingTheme } from '../../utils/is-previewing-theme';
25
24
  const {
26
- EntitiesSavedStatesExtensible
25
+ EntitiesSavedStatesExtensible,
26
+ NavigableRegion
27
27
  } = unlock(privateApis);
28
28
  const EntitiesSavedStatesForPreview = ({
29
29
  onClose
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","Button","Modal","EntitiesSavedStates","useEntitiesSavedStatesIsDirty","privateApis","useDispatch","useSelect","__","sprintf","NavigableRegion","store","coreStore","editSiteStore","unlock","useActivateTheme","useActualCurrentTheme","isPreviewingTheme","EntitiesSavedStatesExtensible","EntitiesSavedStatesForPreview","onClose","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","activateSaveLabel","isDirty","currentTheme","previewingTheme","select","getCurrentTheme","additionalPrompt","createElement","name","rendered","activateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","renderDialog","undefined","SavePanel","isSaveViewOpen","canvasMode","isSaving","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isActivatingTheme","isSaveViewOpened","getCanvasMode","length","some","record","kind","key","setIsSaveViewOpened","className","onRequestClose","__experimentalHideHeader","contentLabel","activateSaveEnabled","disabled","ariaLabel","variant","onClick","__experimentalIsFocusable"],"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"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 { useActualCurrentTheme } from '../../utils/use-actual-current-theme';\nimport { isPreviewingTheme } 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 currentTheme = useActualCurrentTheme();\n\n\tconst previewingTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */\n\t\t\t\t__(\n\t\t\t\t\t'Saving your changes will change your active theme from %1$s to %2$s.'\n\t\t\t\t),\n\t\t\t\tcurrentTheme?.name?.rendered ?? '...',\n\t\t\t\tpreviewingTheme?.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, renderDialog = undefined } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn <EntitiesSavedStatesForPreview onClose={ onClose } />;\n\t}\n\treturn (\n\t\t<EntitiesSavedStates close={ onClose } renderDialog={ renderDialog } />\n\t);\n};\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode, isDirty, isSaving } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tisSavingEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\n\t\t\t// The currently selected entity to display.\n\t\t\t// Typically template or template part in the site editor.\n\t\t\treturn {\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.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) || isActivatingTheme,\n\t\t\t};\n\t\t},\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\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\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<div\n\t\t\t\tclassName={ classnames( 'edit-site-editor__toggle-save-panel', {\n\t\t\t\t\t'screen-reader-text': isSaveViewOpen,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'edit-site-editor__toggle-save-panel-button'\n\t\t\t\t\t) }\n\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\taria-haspopup={ 'dialog' }\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t{ isSaveViewOpen && (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } renderDialog />\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,KAAK,QAAQ,uBAAuB;AACrD,SACCC,mBAAmB,EACnBC,6BAA6B,EAC7BC,WAAW,QACL,mBAAmB;AAC1B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,SAASC,qBAAqB,QAAQ,sCAAsC;AAC5E,SAASC,iBAAiB,QAAQ,iCAAiC;AAEnE,MAAM;EAAEC;AAA8B,CAAC,GAAGJ,MAAM,CAAET,WAAY,CAAC;AAE/D,MAAMc,6BAA6B,GAAGA,CAAE;EAAEC;AAAQ,CAAC,KAAM;EAAA,IAAAC,qBAAA,EAAAC,qBAAA;EACxD,MAAMC,YAAY,GAAGnB,6BAA6B,CAAC,CAAC;EACpD,IAAIoB,iBAAiB;EACrB,I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;IAAS,CAAE,CACrC,CAAC,GACL,IAAI;EACT;EACA,MAAM4C,mBAAmB,GAAG/C,iBAAiB,CAAC,CAAC,IAAIQ,OAAO;EAC1D,MAAMwC,QAAQ,GAAGnB,QAAQ,IAAI,CAAEkB,mBAAmB;EAClD,OACCjC,aAAA,CAACrB,eAAe;IACfkD,SAAS,EAAG5D,UAAU,CAAE,2BAA2B,EAAE;MACpD,0BAA0B,EAAE4C;IAC7B,CAAE,CAAG;IACLsB,SAAS,EAAG1D,EAAE,CAAE,YAAa;EAAG,GAEhCuB,aAAA;IACC6B,SAAS,EAAG5D,UAAU,CAAE,qCAAqC,EAAE;MAC9D,oBAAoB,EAAE4C;IACvB,CAAE;EAAG,GAELb,aAAA,CAAC9B,MAAM;IACNkE,OAAO,EAAC,WAAW;IACnBP,SAAS,EAAG5D,UAAU,CACrB,4CACD,CAAG;IACHoE,OAAO,EAAGA,CAAA,KAAMT,mBAAmB,CAAE,IAAK,CAAG;IAC7C,iBAAgB,QAAU;IAC1BM,QAAQ,EAAGA,QAAU;IACrBI,yBAAyB;EAAA,GAEvB7D,EAAE,CAAE,iBAAkB,CACjB,CACJ,CAAC,EACJoC,cAAc,IACfb,aAAA,CAACS,oBAAoB;IAACpB,OAAO,EAAGA,OAAS;IAACqB,YAAY;EAAA,CAAE,CAEzC,CAAC;AAEpB"}
1
+ {"version":3,"names":["classnames","Button","Modal","EntitiesSavedStates","useEntitiesSavedStatesIsDirty","privateApis","useDispatch","useSelect","__","sprintf","store","coreStore","editSiteStore","unlock","useActivateTheme","useActualCurrentTheme","isPreviewingTheme","EntitiesSavedStatesExtensible","NavigableRegion","EntitiesSavedStatesForPreview","onClose","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","activateSaveLabel","isDirty","currentTheme","previewingTheme","select","getCurrentTheme","additionalPrompt","createElement","name","rendered","activateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","renderDialog","undefined","SavePanel","isSaveViewOpen","canvasMode","isSaving","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isActivatingTheme","isSaveViewOpened","getCanvasMode","length","some","record","kind","key","setIsSaveViewOpened","className","onRequestClose","__experimentalHideHeader","contentLabel","activateSaveEnabled","disabled","ariaLabel","variant","onClick","__experimentalIsFocusable"],"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"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 { 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 { useActualCurrentTheme } from '../../utils/use-actual-current-theme';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible, NavigableRegion } =\n\tunlock( 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 currentTheme = useActualCurrentTheme();\n\n\tconst previewingTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */\n\t\t\t\t__(\n\t\t\t\t\t'Saving your changes will change your active theme from %1$s to %2$s.'\n\t\t\t\t),\n\t\t\t\tcurrentTheme?.name?.rendered ?? '...',\n\t\t\t\tpreviewingTheme?.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, renderDialog = undefined } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn <EntitiesSavedStatesForPreview onClose={ onClose } />;\n\t}\n\treturn (\n\t\t<EntitiesSavedStates close={ onClose } renderDialog={ renderDialog } />\n\t);\n};\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode, isDirty, isSaving } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tisSavingEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\n\t\t\t// The currently selected entity to display.\n\t\t\t// Typically template or template part in the site editor.\n\t\t\treturn {\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.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) || isActivatingTheme,\n\t\t\t};\n\t\t},\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\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\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<div\n\t\t\t\tclassName={ classnames( 'edit-site-editor__toggle-save-panel', {\n\t\t\t\t\t'screen-reader-text': isSaveViewOpen,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'edit-site-editor__toggle-save-panel-button'\n\t\t\t\t\t) }\n\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\taria-haspopup={ 'dialog' }\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t{ isSaveViewOpen && (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } renderDialog />\n\t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oBAAoB,EAAE4C;IACvB,CAAE;EAAG,GAELb,aAAA,CAAC9B,MAAM;IACNkE,OAAO,EAAC,WAAW;IACnBP,SAAS,EAAG5D,UAAU,CACrB,4CACD,CAAG;IACHoE,OAAO,EAAGA,CAAA,KAAMT,mBAAmB,CAAE,IAAK,CAAG;IAC7C,iBAAgB,QAAU;IAC1BM,QAAQ,EAAGA,QAAU;IACrBI,yBAAyB;EAAA,GAEvB7D,EAAE,CAAE,iBAAkB,CACjB,CACJ,CAAC,EACJoC,cAAc,IACfb,aAAA,CAACS,oBAAoB;IAACpB,OAAO,EAAGA,OAAS;IAACqB,YAAY;EAAA,CAAE,CAEzC,CAAC;AAEpB","ignoreList":[]}
@@ -1,90 +1,53 @@
1
- import { createElement, Fragment } from "react";
1
+ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classNames from 'classnames';
5
+ import classnames from 'classnames';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
9
9
  */
10
- import { memo, useRef } from '@wordpress/element';
11
- import { __experimentalNavigatorProvider as NavigatorProvider, __experimentalNavigatorScreen as NavigatorScreen } from '@wordpress/components';
12
- import { privateApis as routerPrivateApis } from '@wordpress/router';
13
- import { useViewportMatch } from '@wordpress/compose';
14
- import { __ } from '@wordpress/i18n';
15
-
16
- /**
17
- * Internal dependencies
18
- */
19
- import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
20
- import SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';
21
- import SidebarNavigationScreenPatterns from '../sidebar-navigation-screen-patterns';
22
- import SidebarNavigationScreenPattern from '../sidebar-navigation-screen-pattern';
23
- import useSyncPathWithURL, { getPathFromURL } from '../sync-state-with-url/use-sync-path-with-url';
24
- import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
25
- import SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';
26
- import SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';
27
- import SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';
28
- import SaveHub from '../save-hub';
29
- import { unlock } from '../../lock-unlock';
30
- import SidebarNavigationScreenPages from '../sidebar-navigation-screen-pages';
31
- import SidebarNavigationScreen from '../sidebar-navigation-screen';
32
- import DataViewsSidebarContent from '../sidebar-dataviews';
33
- import SidebarNavigationScreenPage from '../sidebar-navigation-screen-page';
34
- const {
35
- useLocation
36
- } = unlock(routerPrivateApis);
37
- function SidebarScreenWrapper({
38
- className,
39
- ...props
10
+ import { useCallback, createContext, useState, useRef, useEffect } from '@wordpress/element';
11
+ import { focus } from '@wordpress/dom';
12
+ export const SidebarNavigationContext = createContext(() => {});
13
+ export default function SidebarContent({
14
+ routeKey,
15
+ children
40
16
  }) {
41
- return createElement(NavigatorScreen, {
42
- className: classNames('edit-site-sidebar__screen-wrapper', className),
43
- ...props
17
+ const [navState, setNavState] = useState({
18
+ direction: null,
19
+ focusSelector: null
44
20
  });
21
+ const navigate = useCallback((direction, focusSelector = null) => {
22
+ setNavState(prevState => ({
23
+ direction,
24
+ focusSelector: direction === 'forward' && focusSelector ? focusSelector : prevState.focusSelector
25
+ }));
26
+ }, []);
27
+ const wrapperRef = useRef();
28
+ useEffect(() => {
29
+ let elementToFocus;
30
+ if (navState.direction === 'back' && navState.focusSelector) {
31
+ elementToFocus = wrapperRef.current.querySelector(navState.focusSelector);
32
+ }
33
+ if (navState.direction !== null && !elementToFocus) {
34
+ const [firstTabbable] = focus.tabbable.find(wrapperRef.current);
35
+ elementToFocus = firstTabbable !== null && firstTabbable !== void 0 ? firstTabbable : wrapperRef.current;
36
+ }
37
+ elementToFocus?.focus();
38
+ }, [navState]);
39
+ const wrapperCls = classnames('edit-site-sidebar__screen-wrapper', {
40
+ 'slide-from-left': navState.direction === 'back',
41
+ 'slide-from-right': navState.direction === 'forward'
42
+ });
43
+ return createElement(SidebarNavigationContext.Provider, {
44
+ value: navigate
45
+ }, createElement("div", {
46
+ className: "edit-site-sidebar__content"
47
+ }, createElement("div", {
48
+ ref: wrapperRef,
49
+ key: routeKey,
50
+ className: wrapperCls
51
+ }, children)));
45
52
  }
46
- function SidebarScreens() {
47
- useSyncPathWithURL();
48
- const isMobileViewport = useViewportMatch('medium', '<');
49
- return createElement(Fragment, null, createElement(SidebarScreenWrapper, {
50
- path: "/"
51
- }, createElement(SidebarNavigationScreenMain, null)), createElement(SidebarScreenWrapper, {
52
- path: "/navigation"
53
- }, createElement(SidebarNavigationScreenNavigationMenus, null)), createElement(SidebarScreenWrapper, {
54
- path: "/navigation/:postType/:postId"
55
- }, createElement(SidebarNavigationScreenNavigationMenu, null)), createElement(SidebarScreenWrapper, {
56
- path: "/wp_global_styles"
57
- }, createElement(SidebarNavigationScreenGlobalStyles, null)), createElement(SidebarScreenWrapper, {
58
- path: "/page"
59
- }, createElement(SidebarNavigationScreenPages, null)), createElement(SidebarScreenWrapper, {
60
- path: "/pages"
61
- }, createElement(SidebarNavigationScreen, {
62
- title: __('Manage pages'),
63
- content: createElement(DataViewsSidebarContent, null),
64
- backPath: "/page"
65
- })), createElement(SidebarScreenWrapper, {
66
- path: "/page/:postId"
67
- }, createElement(SidebarNavigationScreenPage, null)), createElement(SidebarScreenWrapper, {
68
- path: "/:postType(wp_template)"
69
- }, createElement(SidebarNavigationScreenTemplatesBrowse, null)), !isMobileViewport && createElement(SidebarScreenWrapper, {
70
- path: "/patterns"
71
- }, createElement(SidebarNavigationScreenPatterns, null)), createElement(SidebarScreenWrapper, {
72
- path: "/:postType(wp_template_part)/all"
73
- }, createElement(SidebarNavigationScreenTemplatesBrowse, null)), createElement(SidebarScreenWrapper, {
74
- path: "/:postType(wp_template_part|wp_block)/:postId"
75
- }, createElement(SidebarNavigationScreenPattern, null)), createElement(SidebarScreenWrapper, {
76
- path: "/:postType(wp_template)/:postId"
77
- }, createElement(SidebarNavigationScreenTemplate, null)));
78
- }
79
- function Sidebar() {
80
- const {
81
- params: urlParams
82
- } = useLocation();
83
- const initialPath = useRef(getPathFromURL(urlParams));
84
- return createElement(Fragment, null, createElement(NavigatorProvider, {
85
- className: "edit-site-sidebar__content",
86
- initialPath: initialPath.current
87
- }, createElement(SidebarScreens, null)), createElement(SaveHub, null));
88
- }
89
- export default memo(Sidebar);
90
53
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["classNames","memo","useRef","__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","privateApis","routerPrivateApis","useViewportMatch","__","SidebarNavigationScreenMain","SidebarNavigationScreenTemplate","SidebarNavigationScreenPatterns","SidebarNavigationScreenPattern","useSyncPathWithURL","getPathFromURL","SidebarNavigationScreenNavigationMenus","SidebarNavigationScreenNavigationMenu","SidebarNavigationScreenGlobalStyles","SidebarNavigationScreenTemplatesBrowse","SaveHub","unlock","SidebarNavigationScreenPages","SidebarNavigationScreen","DataViewsSidebarContent","SidebarNavigationScreenPage","useLocation","SidebarScreenWrapper","className","props","createElement","SidebarScreens","isMobileViewport","Fragment","path","title","content","backPath","Sidebar","params","urlParams","initialPath","current"],"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\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';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';\nimport SidebarNavigationScreenPatterns from '../sidebar-navigation-screen-patterns';\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 SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport DataViewsSidebarContent from '../sidebar-dataviews';\nimport SidebarNavigationScreenPage from '../sidebar-navigation-screen-page';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction SidebarScreenWrapper( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ classNames(\n\t\t\t\t'edit-site-sidebar__screen-wrapper',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction SidebarScreens() {\n\tuseSyncPathWithURL();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarScreenWrapper path=\"/\">\n\t\t\t\t<SidebarNavigationScreenMain />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/navigation\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenus />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/navigation/:postType/:postId\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenu />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/wp_global_styles\">\n\t\t\t\t<SidebarNavigationScreenGlobalStyles />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/page\">\n\t\t\t\t<SidebarNavigationScreenPages />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/pages\">\n\t\t\t\t<SidebarNavigationScreen\n\t\t\t\t\ttitle={ __( 'Manage pages' ) }\n\t\t\t\t\tcontent={ <DataViewsSidebarContent /> }\n\t\t\t\t\tbackPath=\"/page\"\n\t\t\t\t/>\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/page/:postId\">\n\t\t\t\t<SidebarNavigationScreenPage />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template)\">\n\t\t\t\t<SidebarNavigationScreenTemplatesBrowse />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t{ ! isMobileViewport && (\n\t\t\t\t<SidebarScreenWrapper path=\"/patterns\">\n\t\t\t\t\t<SidebarNavigationScreenPatterns />\n\t\t\t\t</SidebarScreenWrapper>\n\t\t\t) }\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template_part)/all\">\n\t\t\t\t<SidebarNavigationScreenTemplatesBrowse />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template_part|wp_block)/:postId\">\n\t\t\t\t<SidebarNavigationScreenPattern />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template)/:postId\">\n\t\t\t\t<SidebarNavigationScreenTemplate />\n\t\t\t</SidebarScreenWrapper>\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"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEn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zEJ,aAAA,CAACjB,8BAA8B,MAAE,CACZ,CAAC,EACvBiB,aAAA,CAACH,oBAAoB;IAACO,IAAI,EAAC;EAAiC,GAC3DJ,aAAA,CAACnB,+BAA+B,MAAE,CACb,CACrB,CAAC;AAEL;AAEA,SAAS2B,OAAOA,CAAA,EAAG;EAClB,MAAM;IAAEC,MAAM,EAAEC;EAAU,CAAC,GAAGd,WAAW,CAAC,CAAC;EAC3C,MAAMe,WAAW,GAAGxC,MAAM,CAAEc,cAAc,CAAEyB,SAAU,CAAE,CAAC;EAEzD,OACCV,aAAA,CAAAG,QAAA,QACCH,aAAA,CAAC3B,iBAAiB;IACjByB,SAAS,EAAC,4BAA4B;IACtCa,WAAW,EAAGA,WAAW,CAACC;EAAS,GAEnCZ,aAAA,CAACC,cAAc,MAAE,CACC,CAAC,EACpBD,aAAA,CAACV,OAAO,MAAE,CACT,CAAC;AAEL;AAEA,eAAepB,IAAI,CAAEsC,OAAQ,CAAC"}
1
+ {"version":3,"names":["classnames","useCallback","createContext","useState","useRef","useEffect","focus","SidebarNavigationContext","SidebarContent","routeKey","children","navState","setNavState","direction","focusSelector","navigate","prevState","wrapperRef","elementToFocus","current","querySelector","firstTabbable","tabbable","find","wrapperCls","createElement","Provider","value","className","ref","key"],"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseCallback,\n\tcreateContext,\n\tuseState,\n\tuseRef,\n\tuseEffect,\n} from '@wordpress/element';\nimport { focus } from '@wordpress/dom';\n\nexport const SidebarNavigationContext = createContext( () => {} );\n\nexport default function SidebarContent( { routeKey, children } ) {\n\tconst [ navState, setNavState ] = useState( {\n\t\tdirection: null,\n\t\tfocusSelector: null,\n\t} );\n\n\tconst navigate = useCallback( ( direction, focusSelector = null ) => {\n\t\tsetNavState( ( prevState ) => ( {\n\t\t\tdirection,\n\t\t\tfocusSelector:\n\t\t\t\tdirection === 'forward' && focusSelector\n\t\t\t\t\t? focusSelector\n\t\t\t\t\t: prevState.focusSelector,\n\t\t} ) );\n\t}, [] );\n\n\tconst wrapperRef = useRef();\n\tuseEffect( () => {\n\t\tlet elementToFocus;\n\t\tif ( navState.direction === 'back' && navState.focusSelector ) {\n\t\t\telementToFocus = wrapperRef.current.querySelector(\n\t\t\t\tnavState.focusSelector\n\t\t\t);\n\t\t}\n\t\tif ( navState.direction !== null && ! elementToFocus ) {\n\t\t\tconst [ firstTabbable ] = focus.tabbable.find( wrapperRef.current );\n\t\t\telementToFocus = firstTabbable ?? wrapperRef.current;\n\t\t}\n\t\telementToFocus?.focus();\n\t}, [ navState ] );\n\n\tconst wrapperCls = classnames( 'edit-site-sidebar__screen-wrapper', {\n\t\t'slide-from-left': navState.direction === 'back',\n\t\t'slide-from-right': navState.direction === 'forward',\n\t} );\n\n\treturn (\n\t\t<SidebarNavigationContext.Provider value={ navigate }>\n\t\t\t<div className=\"edit-site-sidebar__content\">\n\t\t\t\t<div\n\t\t\t\t\tref={ wrapperRef }\n\t\t\t\t\tkey={ routeKey }\n\t\t\t\t\tclassName={ wrapperCls }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</SidebarNavigationContext.Provider>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,WAAW,EACXC,aAAa,EACbC,QAAQ,EACRC,MAAM,EACNC,SAAS,QACH,oBAAoB;AAC3B,SAASC,KAAK,QAAQ,gBAAgB;AAEtC,OAAO,MAAMC,wBAAwB,GAAGL,aAAa,CAAE,MAAM,CAAC,CAAE,CAAC;AAEjE,eAAe,SAASM,cAAcA,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,EAAG;EAChE,MAAM,CAAEC,QAAQ,EAAEC,WAAW,CAAE,GAAGT,QAAQ,CAAE;IAC3CU,SAAS,EAAE,IA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a,GAAG,EAAGrB,QAAU;IAChBmB,SAAS,EAAGJ;EAAY,GAEtBd,QACE,CACD,CAC6B,CAAC;AAEtC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","Button","SidebarButton","props","createElement","className"],"sources":["@wordpress/edit-site/src/components/sidebar-button/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\n\nexport default function SidebarButton( props ) {\n\treturn (\n\t\t<Button\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-button',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,MAAM,QAAQ,uBAAuB;AAE9C,eAAe,SAASC,aAAaA,CAAEC,KAAK,EAAG;EAC9C,OACCC,aAAA,CAACH,MAAM;IAAA,GACDE,KAAK;IACVE,SAAS,EAAGL,UAAU,CACrB,0BAA0B,EAC1BG,KAAK,CAACE,SACP;EAAG,CACH,CAAC;AAEJ"}
1
+ {"version":3,"names":["classnames","Button","SidebarButton","props","createElement","className"],"sources":["@wordpress/edit-site/src/components/sidebar-button/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\n\nexport default function SidebarButton( props ) {\n\treturn (\n\t\t<Button\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-button',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,MAAM,QAAQ,uBAAuB;AAE9C,eAAe,SAASC,aAAaA,CAAEC,KAAK,EAAG;EAC9C,OACCC,aAAA,CAACH,MAAM;IAAA,GACDE,KAAK;IACVE,SAAS,EAAGL,UAAU,CACrB,0BAA0B,EAC1BG,KAAK,CAACE,SACP;EAAG,CACH,CAAC;AAEJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Modal","TextControl","__experimentalHStack","HStack","__experimentalVStack","VStack","Button","__","useDispatch","resolveSelect","store","coreStore","useState","plus","privateApis","routerPrivateApis","SidebarNavigationItem","DEFAULT_VIEWS","unlock","useHistory","useLocation","AddNewItemModalContent","type","setIsAdding","params","path","history","saveEntityRecord","title","setTitle","isSaving","setIsSaving","createElement","onSubmit","event","preventDefault","getEntityRecords","dataViewTaxonomyId","dataViewTypeRecords","slug","length","id","record","name","savedRecord","status","wp_dataviews_type","content","JSON","stringify","view","push","activeView","isCustom","spacing","__nextHasNoMarginBottom","label","value","onChange","placeholder","className","justify","variant","onClick","isBusy","AddNewItem","isAdding","Fragment","icon","onRequestClose"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/add-new-view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tModal,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, resolveSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState } from '@wordpress/element';\nimport { plus } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { DEFAULT_VIEWS } from './default-views';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nfunction AddNewItemModalContent( { type, setIsAdding } ) {\n\tconst {\n\t\tparams: { path },\n\t} = useLocation();\n\tconst history = useHistory();\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst [ title, setTitle ] = useState( '' );\n\tconst [ isSaving, setIsSaving ] = useState( false );\n\treturn (\n\t\t<form\n\t\t\tonSubmit={ async ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsetIsSaving( true );\n\t\t\t\tconst { getEntityRecords } = resolveSelect( coreStore );\n\t\t\t\tlet dataViewTaxonomyId;\n\t\t\t\tconst dataViewTypeRecords = await getEntityRecords(\n\t\t\t\t\t'taxonomy',\n\t\t\t\t\t'wp_dataviews_type',\n\t\t\t\t\t{ slug: type }\n\t\t\t\t);\n\t\t\t\tif ( dataViewTypeRecords && dataViewTypeRecords.length > 0 ) {\n\t\t\t\t\tdataViewTaxonomyId = dataViewTypeRecords[ 0 ].id;\n\t\t\t\t} else {\n\t\t\t\t\tconst record = await saveEntityRecord(\n\t\t\t\t\t\t'taxonomy',\n\t\t\t\t\t\t'wp_dataviews_type',\n\t\t\t\t\t\t{ name: type }\n\t\t\t\t\t);\n\t\t\t\t\tif ( record && record.id ) {\n\t\t\t\t\t\tdataViewTaxonomyId = record.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle,\n\t\t\t\t\t\tstatus: 'publish',\n\t\t\t\t\t\twp_dataviews_type: dataViewTaxonomyId,\n\t\t\t\t\t\tcontent: JSON.stringify(\n\t\t\t\t\t\t\tDEFAULT_VIEWS[ type ][ 0 ].view\n\t\t\t\t\t\t),\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath,\n\t\t\t\t\tactiveView: savedRecord.id,\n\t\t\t\t\tisCustom: 'true',\n\t\t\t\t} );\n\t\t\t\tsetIsSaving( false );\n\t\t\t\tsetIsAdding( false );\n\t\t\t} }\n\t\t>\n\t\t\t<VStack spacing=\"5\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\tplaceholder={ __( 'My view' ) }\n\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t/>\n\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetIsAdding( false );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\taria-disabled={ ! title || isSaving }\n\t\t\t\t\t\tisBusy={ isSaving }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</form>\n\t);\n}\n\nexport default function AddNewItem( { type } ) {\n\tconst [ isAdding, setIsAdding ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ plus }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsAdding( true );\n\t\t\t\t} }\n\t\t\t\tclassName=\"dataviews__siderbar-content-add-new-item\"\n\t\t\t>\n\t\t\t\t{ __( 'New view' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ isAdding && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Add new view' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsAdding( false );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<AddNewItemModalContent\n\t\t\t\t\t\ttype={ type }\n\t\t\t\t\t\tsetIsAdding={ setIsAdding }\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mapp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AC7B,MAAM;IAAC0D,OAAO,EAAC;EAAO,GACtB7B,aAAA,CAAC1B,MAAM;IACNwD,OAAO,EAAC,UAAU;IAClBC,OAAO,EAAGA,CAAA,KAAM;MACfxC,WAAW,CAAE,KAAM,CAAC;IACrB;EAAG,GAEDhB,EAAE,CAAE,QAAS,CACR,CAAC,EAETyB,aAAA,CAAC1B,MAAM;IACNwD,OAAO,EAAC,SAAS;IACjBxC,IAAI,EAAC,QAAQ;IACb,iBAAgB,CAAEM,KAAK,IAAIE,QAAU;IACrCkC,MAAM,EAAGlC;EAAU,GAEjBvB,EAAE,CAAE,QAAS,CACR,CACD,CACD,CACH,CAAC;AAET;AAEA,eAAe,SAAS0D,UAAUA,CAAE;EAAE3C;AAAK,CAAC,EAAG;EAC9C,MAAM,CAAE4C,QAAQ,EAAE3C,WAAW,CAAE,GAAGX,QAAQ,CAAE,KAAM,CAAC;EACnD,OACCoB,aAAA,CAAAmC,QAAA,QACCnC,aAAA,CAAChB,qBAAqB;IACrBoD,IAAI,EAAGvD,IAAM;IACbkD,OAAO,EAAGA,CAAA,KAAM;MACfxC,WAAW,CAAE,IAAK,CAAC;IACpB,CAAG;IACHqC,SAAS,EAAC;EAA0C,GAElDrD,EAAE,CAAE,UAAW,CACK,CAAC,EACtB2D,QAAQ,IACTlC,aAAA,CAAChC,KAAK;IACL4B,KAAK,EAAGrB,EAAE,CAAE,cAAe,CAAG;IAC9B8D,cAAc,EAAGA,CAAA,KAAM;MACtB9C,WAAW,CAAE,KAAM,CAAC;IACrB;EAAG,GAEHS,aAAA,CAACX,sBAAsB;IACtBC,IAAI,EAAGA,IAAM;IACbC,WAAW,EAAGA;EAAa,CAC3B,CACK,CAEP,CAAC;AAEL"}
1
+ {"version":3,"names":["Modal","TextControl","__experimentalHStack","HStack","__experimentalVStack","VStack","Button","__","useDispatch","resolveSelect","store","coreStore","useState","plus","privateApis","routerPrivateApis","SidebarNavigationItem","DEFAULT_VIEWS","unlock","useHistory","useLocation","AddNewItemModalContent","type","setIsAdding","params","path","history","saveEntityRecord","title","setTitle","isSaving","setIsSaving","createElement","onSubmit","event","preventDefault","getEntityRecords","dataViewTaxonomyId","dataViewTypeRecords","slug","length","id","record","name","savedRecord","status","wp_dataviews_type","content","JSON","stringify","view","push","activeView","isCustom","spacing","__nextHasNoMarginBottom","label","value","onChange","placeholder","className","justify","variant","onClick","isBusy","AddNewItem","isAdding","Fragment","icon","onRequestClose"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/add-new-view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tModal,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, resolveSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState } from '@wordpress/element';\nimport { plus } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { DEFAULT_VIEWS } from './default-views';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nfunction AddNewItemModalContent( { type, setIsAdding } ) {\n\tconst {\n\t\tparams: { path },\n\t} = useLocation();\n\tconst history = useHistory();\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst [ title, setTitle ] = useState( '' );\n\tconst [ isSaving, setIsSaving ] = useState( false );\n\treturn (\n\t\t<form\n\t\t\tonSubmit={ async ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsetIsSaving( true );\n\t\t\t\tconst { getEntityRecords } = resolveSelect( coreStore );\n\t\t\t\tlet dataViewTaxonomyId;\n\t\t\t\tconst dataViewTypeRecords = await getEntityRecords(\n\t\t\t\t\t'taxonomy',\n\t\t\t\t\t'wp_dataviews_type',\n\t\t\t\t\t{ slug: type }\n\t\t\t\t);\n\t\t\t\tif ( dataViewTypeRecords && dataViewTypeRecords.length > 0 ) {\n\t\t\t\t\tdataViewTaxonomyId = dataViewTypeRecords[ 0 ].id;\n\t\t\t\t} else {\n\t\t\t\t\tconst record = await saveEntityRecord(\n\t\t\t\t\t\t'taxonomy',\n\t\t\t\t\t\t'wp_dataviews_type',\n\t\t\t\t\t\t{ name: type }\n\t\t\t\t\t);\n\t\t\t\t\tif ( record && record.id ) {\n\t\t\t\t\t\tdataViewTaxonomyId = record.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle,\n\t\t\t\t\t\tstatus: 'publish',\n\t\t\t\t\t\twp_dataviews_type: dataViewTaxonomyId,\n\t\t\t\t\t\tcontent: JSON.stringify(\n\t\t\t\t\t\t\tDEFAULT_VIEWS[ type ][ 0 ].view\n\t\t\t\t\t\t),\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath,\n\t\t\t\t\tactiveView: savedRecord.id,\n\t\t\t\t\tisCustom: 'true',\n\t\t\t\t} );\n\t\t\t\tsetIsSaving( false );\n\t\t\t\tsetIsAdding( false );\n\t\t\t} }\n\t\t>\n\t\t\t<VStack spacing=\"5\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\tplaceholder={ __( 'My view' ) }\n\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t/>\n\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetIsAdding( false );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\taria-disabled={ ! title || isSaving }\n\t\t\t\t\t\tisBusy={ isSaving }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</form>\n\t);\n}\n\nexport default function AddNewItem( { type } ) {\n\tconst [ isAdding, setIsAdding ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ plus }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsAdding( true );\n\t\t\t\t} }\n\t\t\t\tclassName=\"dataviews__siderbar-content-add-new-item\"\n\t\t\t>\n\t\t\t\t{ __( 'New view' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ isAdding && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Add new view' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsAdding( false );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<AddNewItemModalContent\n\t\t\t\t\t\ttype={ type }\n\t\t\t\t\t\tsetIsAdding={ setIsAdding }\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,KAAK,EACLC,WAAW,EACXC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,QACA,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,EAAEC,aAAa,QAAQ,iBAAiB;AAC5D,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,IAAI,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E,QAAU;IACrCkC,MAAM,EAAGlC;EAAU,GAEjBvB,EAAE,CAAE,QAAS,CACR,CACD,CACD,CACH,CAAC;AAET;AAEA,eAAe,SAAS0D,UAAUA,CAAE;EAAE3C;AAAK,CAAC,EAAG;EAC9C,MAAM,CAAE4C,QAAQ,EAAE3C,WAAW,CAAE,GAAGX,QAAQ,CAAE,KAAM,CAAC;EACnD,OACCoB,aAAA,CAAAmC,QAAA,QACCnC,aAAA,CAAChB,qBAAqB;IACrBoD,IAAI,EAAGvD,IAAM;IACbkD,OAAO,EAAGA,CAAA,KAAM;MACfxC,WAAW,CAAE,IAAK,CAAC;IACpB,CAAG;IACHqC,SAAS,EAAC;EAA0C,GAElDrD,EAAE,CAAE,UAAW,CACK,CAAC,EACtB2D,QAAQ,IACTlC,aAAA,CAAChC,KAAK;IACL4B,KAAK,EAAGrB,EAAE,CAAE,cAAe,CAAG;IAC9B8D,cAAc,EAAGA,CAAA,KAAM;MACtB9C,WAAW,CAAE,KAAM,CAAC;IACrB;EAAG,GAEHS,aAAA,CAACX,sBAAsB;IACtBC,IAAI,EAAGA,IAAM;IACbC,WAAW,EAAGA;EAAa,CAC3B,CACK,CAEP,CAAC;AAEL","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useDispatch","store","coreStore","__experimentalItemGroup","ItemGroup","__experimentalHeading","Heading","DropdownMenu","MenuGroup","MenuItem","TextControl","__experimentalHStack","HStack","__experimentalVStack","VStack","Button","Modal","useMemo","useState","moreVertical","__","privateApis","routerPrivateApis","DataViewItem","AddNewItem","unlock","useHistory","useLocation","EMPTY_ARRAY","RenameItemModalContent","dataviewId","currentTitle","setIsRenaming","editEntityRecord","title","setTitle","createElement","onSubmit","event","preventDefault","spacing","__nextHasNoMarginBottom","label","value","onChange","placeholder","className","justify","variant","onClick","type","CustomDataViewItem","isActive","params","path","history","dataview","select","getEditedEntityRecord","deleteEntityRecord","viewContent","JSON","parse","content","isRenaming","Fragment","isCustom","customViewId","suffix","icon","toggleProps","style","color","size","onClose","id","force","replace","isDestructive","onRequestClose","useCustomDataViews","customDataViews","getEntityRecords","dataViewTypeRecords","slug","length","dataViews","wp_dataviews_type","orderby","order","CustomDataViewsList","activeView","level","map","customViewRecord","key","Number"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/custom-dataviews-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHeading as Heading,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\tModal,\n} from '@wordpress/components';\nimport { useMemo, useState } from '@wordpress/element';\nimport { moreVertical } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport DataViewItem from './dataview-item';\nimport AddNewItem from './add-new-view';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nfunction RenameItemModalContent( { dataviewId, currentTitle, setIsRenaming } ) {\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst [ title, setTitle ] = useState( currentTitle );\n\treturn (\n\t\t<form\n\t\t\tonSubmit={ async ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tawait editEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\tdataviewId,\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tsetIsRenaming( false );\n\t\t\t} }\n\t\t>\n\t\t\t<VStack spacing=\"5\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\tplaceholder={ __( 'My view' ) }\n\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t/>\n\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetIsRenaming( false );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\taria-disabled={ ! title }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</form>\n\t);\n}\n\nfunction CustomDataViewItem( { dataviewId, isActive } ) {\n\tconst {\n\t\tparams: { path },\n\t} = useLocation();\n\tconst history = useHistory();\n\tconst { dataview } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\treturn {\n\t\t\t\tdataview: getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\tdataviewId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ dataviewId ]\n\t);\n\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\tconst type = useMemo( () => {\n\t\tconst viewContent = JSON.parse( dataview.content );\n\t\treturn viewContent.type;\n\t}, [ dataview.content ] );\n\tconst [ isRenaming, setIsRenaming ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<DataViewItem\n\t\t\t\ttitle={ dataview.title }\n\t\t\t\ttype={ type }\n\t\t\t\tisActive={ isActive }\n\t\t\t\tisCustom\n\t\t\t\tcustomViewId={ dataviewId }\n\t\t\t\tsuffix={\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-dataviews-dataview-item__dropdown-menu\"\n\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\tcolor: 'inherit',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetIsRenaming( true );\n\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ async () => {\n\t\t\t\t\t\t\t\t\t\tawait deleteEntityRecord(\n\t\t\t\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\t\t\t\t\t\t\tdataview.id,\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tforce: true,\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tif ( isActive ) {\n\t\t\t\t\t\t\t\t\t\t\thistory.replace( {\n\t\t\t\t\t\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tisDestructive\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ isRenaming && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Rename view' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsRenaming( false );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<RenameItemModalContent\n\t\t\t\t\t\tdataviewId={ dataviewId }\n\t\t\t\t\t\tsetIsRenaming={ setIsRenaming }\n\t\t\t\t\t\tcurrentTitle={ dataview.title }\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport function useCustomDataViews( type ) {\n\tconst customDataViews = useSelect( ( select ) => {\n\t\tconst { getEntityRecords } = select( coreStore );\n\t\tconst dataViewTypeRecords = getEntityRecords(\n\t\t\t'taxonomy',\n\t\t\t'wp_dataviews_type',\n\t\t\t{ slug: type }\n\t\t);\n\t\tif ( ! dataViewTypeRecords || dataViewTypeRecords.length === 0 ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\tconst dataViews = getEntityRecords( 'postType', 'wp_dataviews', {\n\t\t\twp_dataviews_type: dataViewTypeRecords[ 0 ].id,\n\t\t\torderby: 'date',\n\t\t\torder: 'asc',\n\t\t} );\n\t\tif ( ! dataViews ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\treturn dataViews;\n\t} );\n\treturn customDataViews;\n}\n\nexport default function CustomDataViewsList( { type, activeView, isCustom } ) {\n\tconst customDataViews = useCustomDataViews( type );\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-site-sidebar-navigation-screen-dataviews__group-header\">\n\t\t\t\t<Heading level={ 2 }>{ __( 'Custom Views' ) }</Heading>\n\t\t\t</div>\n\t\t\t<ItemGroup>\n\t\t\t\t{ customDataViews.map( ( customViewRecord ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CustomDataViewItem\n\t\t\t\t\t\t\tkey={ customViewRecord.id }\n\t\t\t\t\t\t\tdataviewId={ customViewRecord.id }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\tisCustom &&\n\t\t\t\t\t\t\t\tNumber( activeView ) === customViewRecord.id\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t\t<AddNewItem type={ type } />\n\t\t\t</ItemGroup>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SACCC,uBAAuB,IAAIC,SAAS,EACpCC,qBAAqB,IAAIC,OAAO,EAChCC,YAAY,EACZC,SAAS,EACTC,QAAQ,EACRC,WAAW,EACXC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,EACNC,KAAK,QACC,uBAAuB;AAC9B,SAASC,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;AACtD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,UAAU,MAAM,gBAAgB;AACvC,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC,UAAU;EAAEC;AAAY,CAAC,GAAGF,MAAM,CAAEH,iBAAkB,CAAC;AAE/D,MAAMM,WAAW,GAAG,EAAE;AAEtB,SAASC,sBAAsBA,CAAE;EAAEC,UAAU;EAAEC,YAAY;EAAEC;AAAc,CAAC,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mBAAmB,CAAE,CAAC,CAAE,CAACR,EAAE;MAC9Ca,OAAO,EAAE,MAAM;MACfC,KAAK,EAAE;IACR,CAAE,CAAC;IACH,IAAK,CAAEH,SAAS,EAAG;MAClB,OAAO1D,WAAW;IACnB;IACA,OAAO0D,SAAS;EACjB,CAAE,CAAC;EACH,OAAOL,eAAe;AACvB;AAEA,eAAe,SAASS,mBAAmBA,CAAE;EAAExC,IAAI;EAAEyC,UAAU;EAAEzB;AAAS,CAAC,EAAG;EAC7E,MAAMe,eAAe,GAAGD,kBAAkB,CAAE9B,IAAK,CAAC;EAClD,OACCd,aAAA,CAAA6B,QAAA,QACC7B,aAAA;IAAKU,SAAS,EAAC;EAA6D,GAC3EV,aAAA,CAAC9B,OAAO;IAACsF,KAAK,EAAG;EAAG,GAAGxE,EAAE,CAAE,cAAe,CAAY,CAClD,CAAC,EACNgB,aAAA,CAAChC,SAAS,QACP6E,eAAe,CAACY,GAAG,CAAIC,gBAAgB,IAAM;IAC9C,OACC1D,aAAA,CAACe,kBAAkB;MAClB4C,GAAG,EAAGD,gBAAgB,CAACnB,EAAI;MAC3B7C,UAAU,EAAGgE,gBAAgB,CAACnB,EAAI;MAClCvB,QAAQ,EACPc,QAAQ,IACR8B,MAAM,CAAEL,UAAW,CAAC,KAAKG,gBAAgB,CAACnB;IAC1C,CACD,CAAC;EAEJ,CAAE,CAAC,EACHvC,aAAA,CAACZ,UAAU;IAAC0B,IAAI,EAAGA;EAAM,CAAE,CACjB,CACV,CAAC;AAEL"}
1
+ {"version":3,"names":["useSelect","useDispatch","store","coreStore","__experimentalItemGroup","ItemGroup","__experimentalHeading","Heading","DropdownMenu","MenuGroup","MenuItem","TextControl","__experimentalHStack","HStack","__experimentalVStack","VStack","Button","Modal","useMemo","useState","moreVertical","__","privateApis","routerPrivateApis","DataViewItem","AddNewItem","unlock","useHistory","useLocation","EMPTY_ARRAY","RenameItemModalContent","dataviewId","currentTitle","setIsRenaming","editEntityRecord","title","setTitle","createElement","onSubmit","event","preventDefault","spacing","__nextHasNoMarginBottom","label","value","onChange","placeholder","className","justify","variant","onClick","type","CustomDataViewItem","isActive","params","path","history","dataview","select","getEditedEntityRecord","deleteEntityRecord","viewContent","JSON","parse","content","isRenaming","Fragment","isCustom","customViewId","suffix","icon","toggleProps","style","color","size","onClose","id","force","replace","isDestructive","onRequestClose","useCustomDataViews","customDataViews","getEntityRecords","dataViewTypeRecords","slug","length","dataViews","wp_dataviews_type","orderby","order","CustomDataViewsList","activeView","level","map","customViewRecord","key","Number"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/custom-dataviews-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHeading as Heading,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\tModal,\n} from '@wordpress/components';\nimport { useMemo, useState } from '@wordpress/element';\nimport { moreVertical } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport DataViewItem from './dataview-item';\nimport AddNewItem from './add-new-view';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nfunction RenameItemModalContent( { dataviewId, currentTitle, setIsRenaming } ) {\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst [ title, setTitle ] = useState( currentTitle );\n\treturn (\n\t\t<form\n\t\t\tonSubmit={ async ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tawait editEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\tdataviewId,\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tsetIsRenaming( false );\n\t\t\t} }\n\t\t>\n\t\t\t<VStack spacing=\"5\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\tplaceholder={ __( 'My view' ) }\n\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t/>\n\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetIsRenaming( false );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\taria-disabled={ ! title }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</form>\n\t);\n}\n\nfunction CustomDataViewItem( { dataviewId, isActive } ) {\n\tconst {\n\t\tparams: { path },\n\t} = useLocation();\n\tconst history = useHistory();\n\tconst { dataview } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\treturn {\n\t\t\t\tdataview: getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\tdataviewId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ dataviewId ]\n\t);\n\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\tconst type = useMemo( () => {\n\t\tconst viewContent = JSON.parse( dataview.content );\n\t\treturn viewContent.type;\n\t}, [ dataview.content ] );\n\tconst [ isRenaming, setIsRenaming ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<DataViewItem\n\t\t\t\ttitle={ dataview.title }\n\t\t\t\ttype={ type }\n\t\t\t\tisActive={ isActive }\n\t\t\t\tisCustom\n\t\t\t\tcustomViewId={ dataviewId }\n\t\t\t\tsuffix={\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-dataviews-dataview-item__dropdown-menu\"\n\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\tcolor: 'inherit',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetIsRenaming( true );\n\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ async () => {\n\t\t\t\t\t\t\t\t\t\tawait deleteEntityRecord(\n\t\t\t\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\t\t\t\t\t\t\tdataview.id,\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tforce: true,\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tif ( isActive ) {\n\t\t\t\t\t\t\t\t\t\t\thistory.replace( {\n\t\t\t\t\t\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tisDestructive\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ isRenaming && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Rename view' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsRenaming( false );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<RenameItemModalContent\n\t\t\t\t\t\tdataviewId={ dataviewId }\n\t\t\t\t\t\tsetIsRenaming={ setIsRenaming }\n\t\t\t\t\t\tcurrentTitle={ dataview.title }\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport function useCustomDataViews( type ) {\n\tconst customDataViews = useSelect( ( select ) => {\n\t\tconst { getEntityRecords } = select( coreStore );\n\t\tconst dataViewTypeRecords = getEntityRecords(\n\t\t\t'taxonomy',\n\t\t\t'wp_dataviews_type',\n\t\t\t{ slug: type }\n\t\t);\n\t\tif ( ! dataViewTypeRecords || dataViewTypeRecords.length === 0 ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\tconst dataViews = getEntityRecords( 'postType', 'wp_dataviews', {\n\t\t\twp_dataviews_type: dataViewTypeRecords[ 0 ].id,\n\t\t\torderby: 'date',\n\t\t\torder: 'asc',\n\t\t} );\n\t\tif ( ! dataViews ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\treturn dataViews;\n\t} );\n\treturn customDataViews;\n}\n\nexport default function CustomDataViewsList( { type, activeView, isCustom } ) {\n\tconst customDataViews = useCustomDataViews( type );\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-site-sidebar-navigation-screen-dataviews__group-header\">\n\t\t\t\t<Heading level={ 2 }>{ __( 'Custom Views' ) }</Heading>\n\t\t\t</div>\n\t\t\t<ItemGroup>\n\t\t\t\t{ customDataViews.map( ( customViewRecord ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CustomDataViewItem\n\t\t\t\t\t\t\tkey={ customViewRecord.id }\n\t\t\t\t\t\t\tdataviewId={ customViewRecord.id }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\tisCustom &&\n\t\t\t\t\t\t\t\tNumber( activeView ) === customViewRecord.id\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t\t<AddNewItem type={ type } />\n\t\t\t</ItemGroup>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SACCC,uBAAuB,IAAIC,SAAS,EACpCC,qBAAqB,IAAIC,OAAO,EAChCC,YAAY,EACZC,SAAS,EACTC,QAAQ,EACRC,WAAW,EACXC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,EACNC,KAAK,QACC,uBAAuB;AAC9B,SAASC,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;AACtD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,UAAU,MAAM,gBAAgB;AACvC,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC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AmB,IAAIA,mBAAmB,CAACE,MAAM,KAAK,CAAC,EAAG;MAChE,OAAOzD,WAAW;IACnB;IACA,MAAM0D,SAAS,GAAGJ,gBAAgB,CAAE,UAAU,EAAE,cAAc,EAAE;MAC/DK,iBAAiB,EAAEJ,mBAAmB,CAAE,CAAC,CAAE,CAACR,EAAE;MAC9Ca,OAAO,EAAE,MAAM;MACfC,KAAK,EAAE;IACR,CAAE,CAAC;IACH,IAAK,CAAEH,SAAS,EAAG;MAClB,OAAO1D,WAAW;IACnB;IACA,OAAO0D,SAAS;EACjB,CAAE,CAAC;EACH,OAAOL,eAAe;AACvB;AAEA,eAAe,SAASS,mBAAmBA,CAAE;EAAExC,IAAI;EAAEyC,UAAU;EAAEzB;AAAS,CAAC,EAAG;EAC7E,MAAMe,eAAe,GAAGD,kBAAkB,CAAE9B,IAAK,CAAC;EAClD,OACCd,aAAA,CAAA6B,QAAA,QACC7B,aAAA;IAAKU,SAAS,EAAC;EAA6D,GAC3EV,aAAA,CAAC9B,OAAO;IAACsF,KAAK,EAAG;EAAG,GAAGxE,EAAE,CAAE,cAAe,CAAY,CAClD,CAAC,EACNgB,aAAA,CAAChC,SAAS,QACP6E,eAAe,CAACY,GAAG,CAAIC,gBAAgB,IAAM;IAC9C,OACC1D,aAAA,CAACe,kBAAkB;MAClB4C,GAAG,EAAGD,gBAAgB,CAACnB,EAAI;MAC3B7C,UAAU,EAAGgE,gBAAgB,CAACnB,EAAI;MAClCvB,QAAQ,EACPc,QAAQ,IACR8B,MAAM,CAAEL,UAAW,CAAC,KAAKG,gBAAgB,CAACnB;IAC1C,CACD,CAAC;EAEJ,CAAE,CAAC,EACHvC,aAAA,CAACZ,UAAU;IAAC0B,IAAI,EAAGA;EAAM,CAAE,CACjB,CACV,CAAC;AAEL","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","privateApis","routerPrivateApis","__experimentalHStack","HStack","VIEW_LAYOUTS","useLink","SidebarNavigationItem","unlock","useLocation","DataViewItem","title","slug","customViewId","type","icon","isActive","isCustom","suffix","params","path","layout","iconToUse","find","v","linkInfo","activeView","createElement","justify","className","undefined"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/dataview-item.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { VIEW_LAYOUTS } from '@wordpress/dataviews';\n\n/**\n * Internal dependencies\n */\nimport { useLink } from '../routes/link';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { unlock } from '../../lock-unlock';\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewItem( {\n\ttitle,\n\tslug,\n\tcustomViewId,\n\ttype,\n\ticon,\n\tisActive,\n\tisCustom,\n\tsuffix,\n} ) {\n\tconst {\n\t\tparams: { path, layout },\n\t} = useLocation();\n\n\tconst iconToUse =\n\t\ticon || VIEW_LAYOUTS.find( ( v ) => v.type === type ).icon;\n\n\tconst linkInfo = useLink( {\n\t\tpath,\n\t\tlayout,\n\t\tactiveView: isCustom ? customViewId : slug,\n\t\tisCustom: isCustom ? 'true' : 'false',\n\t} );\n\treturn (\n\t\t<HStack\n\t\t\tjustify=\"flex-start\"\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-dataviews-dataview-item',\n\t\t\t\t{\n\t\t\t\t\t'is-selected': isActive,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ iconToUse }\n\t\t\t\t{ ...linkInfo }\n\t\t\t\taria-current={ isActive ? 'true' : undefined }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ suffix }\n\t\t</HStack>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,WAAW,IA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TS","useLink","SidebarNavigationItem","unlock","useLocation","DataViewItem","title","slug","customViewId","type","icon","isActive","isCustom","suffix","params","path","layout","iconToUse","find","v","linkInfo","activeView","createElement","justify","className","undefined"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/dataview-item.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { VIEW_LAYOUTS } from '@wordpress/dataviews';\n\n/**\n * Internal dependencies\n */\nimport { useLink } from '../routes/link';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { unlock } from '../../lock-unlock';\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewItem( {\n\ttitle,\n\tslug,\n\tcustomViewId,\n\ttype,\n\ticon,\n\tisActive,\n\tisCustom,\n\tsuffix,\n} ) {\n\tconst {\n\t\tparams: { path, layout },\n\t} = useLocation();\n\n\tconst iconToUse =\n\t\ticon || VIEW_LAYOUTS.find( ( v ) => v.type === type ).icon;\n\n\tconst linkInfo = useLink( {\n\t\tpath,\n\t\tlayout,\n\t\tactiveView: isCustom ? customViewId : slug,\n\t\tisCustom: isCustom ? 'true' : 'false',\n\t} );\n\treturn (\n\t\t<HStack\n\t\t\tjustify=\"flex-start\"\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-dataviews-dataview-item',\n\t\t\t\t{\n\t\t\t\t\t'is-selected': isActive,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ iconToUse }\n\t\t\t\t{ ...linkInfo }\n\t\t\t\taria-current={ isActive ? 'true' : undefined }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ suffix }\n\t\t</HStack>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;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const DEFAULT_CONFIG_PER_VIEW_TYPE = {
22
22
  }
23
23
  };
24
24
  const DEFAULT_PAGE_BASE = {
25
- type: LAYOUT_TABLE,
25
+ type: LAYOUT_LIST,
26
26
  search: '',
27
27
  filters: [],
28
28
  page: 1,
@@ -35,7 +35,7 @@ const DEFAULT_PAGE_BASE = {
35
35
  // better to keep track of the hidden ones.
36
36
  hiddenFields: ['date', 'featured-image'],
37
37
  layout: {
38
- ...DEFAULT_CONFIG_PER_VIEW_TYPE[LAYOUT_TABLE]
38
+ ...DEFAULT_CONFIG_PER_VIEW_TYPE[LAYOUT_LIST]
39
39
  }
40
40
  };
41
41
  export const DEFAULT_VIEWS = {