@wordpress/edit-site 6.9.0 → 6.11.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 (675) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-post/index.js +1 -1
  3. package/build/components/add-new-post/index.js.map +1 -1
  4. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  5. package/build/components/add-new-template/index.js +1 -1
  6. package/build/components/add-new-template/index.js.map +1 -1
  7. package/build/components/add-new-template/utils.js +8 -8
  8. package/build/components/add-new-template/utils.js.map +1 -1
  9. package/build/components/app/index.js +3 -1
  10. package/build/components/app/index.js.map +1 -1
  11. package/build/components/block-editor/use-editor-iframe-props.js +29 -20
  12. package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
  13. package/build/components/block-editor/use-site-editor-settings.js +10 -8
  14. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  15. package/build/components/editor/index.js +23 -11
  16. package/build/components/editor/index.js.map +1 -1
  17. package/build/components/editor/use-adapt-editor-to-canvas.js +49 -0
  18. package/build/components/editor/use-adapt-editor-to-canvas.js.map +1 -0
  19. package/build/components/editor/use-editor-title.js +2 -2
  20. package/build/components/editor/use-editor-title.js.map +1 -1
  21. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  22. package/build/components/global-styles/font-families.js +41 -25
  23. package/build/components/global-styles/font-families.js.map +1 -1
  24. package/build/components/global-styles/font-family-item.js +1 -1
  25. package/build/components/global-styles/font-family-item.js.map +1 -1
  26. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  27. package/build/components/global-styles/font-library-modal/context.js +1 -0
  28. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  29. package/build/components/global-styles/font-library-modal/font-card.js +1 -1
  30. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
  31. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  32. package/build/components/global-styles/font-library-modal/installed-fonts.js +4 -3
  33. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  34. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  35. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  36. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  37. package/build/components/global-styles/font-library-modal/upload-fonts.js +1 -0
  38. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  39. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  40. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  41. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  42. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +1 -1
  43. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +1 -1
  44. package/build/components/global-styles/font-sizes/font-size.js +14 -15
  45. package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
  46. package/build/components/global-styles/font-sizes/font-sizes-count.js +1 -2
  47. package/build/components/global-styles/font-sizes/font-sizes-count.js.map +1 -1
  48. package/build/components/global-styles/font-sizes/font-sizes.js +4 -4
  49. package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -1
  50. package/build/components/global-styles/highlighted-colors.js.map +1 -1
  51. package/build/components/global-styles/palette.js +16 -13
  52. package/build/components/global-styles/palette.js.map +1 -1
  53. package/build/components/global-styles/preset-colors.js.map +1 -1
  54. package/build/components/global-styles/root-menu.js +0 -4
  55. package/build/components/global-styles/root-menu.js.map +1 -1
  56. package/build/components/global-styles/screen-block-list.js +2 -6
  57. package/build/components/global-styles/screen-block-list.js.map +1 -1
  58. package/build/components/global-styles/screen-css.js +1 -1
  59. package/build/components/global-styles/screen-css.js.map +1 -1
  60. package/build/components/global-styles/screen-revisions/index.js +3 -8
  61. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  62. package/build/components/global-styles/screen-revisions/revisions-buttons.js +3 -3
  63. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  64. package/build/components/global-styles/screen-root.js +0 -3
  65. package/build/components/global-styles/screen-root.js.map +1 -1
  66. package/build/components/global-styles/screen-style-variations.js +14 -3
  67. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  68. package/build/components/global-styles/shadow-utils.js.map +1 -1
  69. package/build/components/global-styles/shadows-edit-panel.js +26 -15
  70. package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
  71. package/build/components/global-styles/shadows-panel.js +1 -4
  72. package/build/components/global-styles/shadows-panel.js.map +1 -1
  73. package/build/components/global-styles/style-variations-container.js +1 -5
  74. package/build/components/global-styles/style-variations-container.js.map +1 -1
  75. package/build/components/global-styles/typography-elements.js +1 -4
  76. package/build/components/global-styles/typography-elements.js.map +1 -1
  77. package/build/components/global-styles/typography-preview.js.map +1 -1
  78. package/build/components/global-styles/ui.js +27 -14
  79. package/build/components/global-styles/ui.js.map +1 -1
  80. package/build/components/global-styles/utils.js.map +1 -1
  81. package/build/components/global-styles/variations/variation.js +2 -2
  82. package/build/components/global-styles/variations/variation.js.map +1 -1
  83. package/build/components/global-styles/variations/variations-panel.js +0 -1
  84. package/build/components/global-styles/variations/variations-panel.js.map +1 -1
  85. package/build/components/global-styles-sidebar/default-sidebar.js +0 -1
  86. package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -1
  87. package/build/components/global-styles-sidebar/index.js +43 -36
  88. package/build/components/global-styles-sidebar/index.js.map +1 -1
  89. package/build/components/layout/animation.js +1 -3
  90. package/build/components/layout/animation.js.map +1 -1
  91. package/build/components/layout/index.js +23 -47
  92. package/build/components/layout/index.js.map +1 -1
  93. package/build/components/layout/router.js +17 -140
  94. package/build/components/layout/router.js.map +1 -1
  95. package/build/components/page-patterns/delete-category-menu-item.js +3 -3
  96. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  97. package/build/components/page-patterns/fields.js.map +1 -1
  98. package/build/components/page-patterns/header.js +1 -1
  99. package/build/components/page-patterns/header.js.map +1 -1
  100. package/build/components/page-patterns/index.js +4 -2
  101. package/build/components/page-patterns/index.js.map +1 -1
  102. package/build/components/page-patterns/use-pattern-settings.js +1 -1
  103. package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
  104. package/build/components/page-templates/index.js +2 -2
  105. package/build/components/page-templates/index.js.map +1 -1
  106. package/build/components/pagination/index.js +1 -1
  107. package/build/components/pagination/index.js.map +1 -1
  108. package/build/components/post-edit/index.js +8 -4
  109. package/build/components/post-edit/index.js.map +1 -1
  110. package/build/components/post-fields/index.js +8 -54
  111. package/build/components/post-fields/index.js.map +1 -1
  112. package/build/components/post-list/index.js +1 -1
  113. package/build/components/post-list/index.js.map +1 -1
  114. package/build/components/posts-app/index.js.map +1 -1
  115. package/build/components/posts-app/router.js +4 -4
  116. package/build/components/posts-app/router.js.map +1 -1
  117. package/build/components/resizable-frame/index.js +21 -9
  118. package/build/components/resizable-frame/index.js.map +1 -1
  119. package/build/components/revisions/index.js +1 -1
  120. package/build/components/revisions/index.js.map +1 -1
  121. package/build/components/routes/use-title.js +1 -1
  122. package/build/components/routes/use-title.js.map +1 -1
  123. package/build/components/save-button/index.js +3 -3
  124. package/build/components/save-button/index.js.map +1 -1
  125. package/build/components/save-keyboard-shortcut/index.js +78 -0
  126. package/build/components/save-keyboard-shortcut/index.js.map +1 -0
  127. package/build/components/save-panel/index.js +17 -6
  128. package/build/components/save-panel/index.js.map +1 -1
  129. package/build/components/sidebar-button/index.js +1 -1
  130. package/build/components/sidebar-button/index.js.map +1 -1
  131. package/build/components/sidebar-dataviews/default-views.js +2 -5
  132. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  133. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  134. package/build/components/sidebar-navigation-screen/index.js +2 -1
  135. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  136. package/build/components/sidebar-navigation-screen-details-footer/index.js +1 -1
  137. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  138. package/build/components/sidebar-navigation-screen-global-styles/index.js +30 -10
  139. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  140. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  141. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +5 -5
  142. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  143. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +3 -3
  144. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  145. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +7 -12
  146. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  147. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +2 -2
  148. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  149. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  150. package/build/components/site-editor-routes/home-edit.js +26 -0
  151. package/build/components/site-editor-routes/home-edit.js.map +1 -0
  152. package/build/components/site-editor-routes/home-view.js +25 -0
  153. package/build/components/site-editor-routes/home-view.js.map +1 -0
  154. package/build/components/site-editor-routes/index.js +49 -0
  155. package/build/components/site-editor-routes/index.js.map +1 -0
  156. package/build/components/site-editor-routes/navigation-edit.js +29 -0
  157. package/build/components/site-editor-routes/navigation-edit.js.map +1 -0
  158. package/build/components/site-editor-routes/navigation-item-edit.js +31 -0
  159. package/build/components/site-editor-routes/navigation-item-edit.js.map +1 -0
  160. package/build/components/site-editor-routes/navigation-item-view.js +30 -0
  161. package/build/components/site-editor-routes/navigation-item-view.js.map +1 -0
  162. package/build/components/site-editor-routes/navigation-view.js +28 -0
  163. package/build/components/site-editor-routes/navigation-view.js.map +1 -0
  164. package/build/components/site-editor-routes/pages-edit.js +43 -0
  165. package/build/components/site-editor-routes/pages-edit.js.map +1 -0
  166. package/build/components/site-editor-routes/pages-list-view-quick-edit.js +64 -0
  167. package/build/components/site-editor-routes/pages-list-view-quick-edit.js.map +1 -0
  168. package/build/components/site-editor-routes/pages-list-view.js +47 -0
  169. package/build/components/site-editor-routes/pages-list-view.js.map +1 -0
  170. package/build/components/site-editor-routes/pages-view-quick-edit.js +61 -0
  171. package/build/components/site-editor-routes/pages-view-quick-edit.js.map +1 -0
  172. package/build/components/site-editor-routes/pages-view.js +42 -0
  173. package/build/components/site-editor-routes/pages-view.js.map +1 -0
  174. package/build/components/site-editor-routes/patterns-edit.js +31 -0
  175. package/build/components/site-editor-routes/patterns-edit.js.map +1 -0
  176. package/build/components/site-editor-routes/patterns-view.js +29 -0
  177. package/build/components/site-editor-routes/patterns-view.js.map +1 -0
  178. package/build/components/site-editor-routes/styles-edit.js +28 -0
  179. package/build/components/site-editor-routes/styles-edit.js.map +1 -0
  180. package/build/components/site-editor-routes/styles-view.js +27 -0
  181. package/build/components/site-editor-routes/styles-view.js.map +1 -0
  182. package/build/components/site-editor-routes/templates-edit.js +31 -0
  183. package/build/components/site-editor-routes/templates-edit.js.map +1 -0
  184. package/build/components/site-editor-routes/templates-list-view.js +34 -0
  185. package/build/components/site-editor-routes/templates-list-view.js.map +1 -0
  186. package/build/components/site-editor-routes/templates-view.js +29 -0
  187. package/build/components/site-editor-routes/templates-view.js.map +1 -0
  188. package/build/components/site-hub/index.js +3 -2
  189. package/build/components/site-hub/index.js.map +1 -1
  190. package/build/components/style-book/color-examples.js +46 -0
  191. package/build/components/style-book/color-examples.js.map +1 -0
  192. package/build/components/style-book/constants.js +75 -10
  193. package/build/components/style-book/constants.js.map +1 -1
  194. package/build/components/style-book/duotone-examples.js +55 -0
  195. package/build/components/style-book/duotone-examples.js.map +1 -0
  196. package/build/components/style-book/examples.js +46 -3
  197. package/build/components/style-book/examples.js.map +1 -1
  198. package/build/components/style-book/index.js +92 -36
  199. package/build/components/style-book/index.js.map +1 -1
  200. package/build/components/style-book/types.js.map +1 -1
  201. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +6 -1
  202. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  203. package/build/deprecated.js.map +1 -1
  204. package/build/hooks/commands/use-common-commands.js +46 -30
  205. package/build/hooks/commands/use-common-commands.js.map +1 -1
  206. package/build/hooks/commands/use-edit-mode-commands.js +15 -11
  207. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  208. package/build/hooks/commands/use-set-command-context.js +12 -15
  209. package/build/hooks/commands/use-set-command-context.js.map +1 -1
  210. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  211. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
  212. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  213. package/build/index.js +2 -4
  214. package/build/index.js.map +1 -1
  215. package/build/posts.js +1 -1
  216. package/build/posts.js.map +1 -1
  217. package/build/store/actions.js.map +1 -1
  218. package/build/store/private-actions.js +8 -61
  219. package/build/store/private-actions.js.map +1 -1
  220. package/build/store/private-selectors.js +4 -12
  221. package/build/store/private-selectors.js.map +1 -1
  222. package/build/store/reducer.js +9 -18
  223. package/build/store/reducer.js.map +1 -1
  224. package/build/store/selectors.js.map +1 -1
  225. package/build/utils/get-filtered-template-parts.js.map +1 -1
  226. package/build-module/components/add-new-pattern/index.js +1 -3
  227. package/build-module/components/add-new-pattern/index.js.map +1 -1
  228. package/build-module/components/add-new-post/index.js +2 -3
  229. package/build-module/components/add-new-post/index.js.map +1 -1
  230. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +1 -2
  231. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  232. package/build-module/components/add-new-template/add-custom-template-modal-content.js +1 -3
  233. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  234. package/build-module/components/add-new-template/index.js +2 -4
  235. package/build-module/components/add-new-template/index.js.map +1 -1
  236. package/build-module/components/add-new-template/utils.js +9 -9
  237. package/build-module/components/add-new-template/utils.js.map +1 -1
  238. package/build-module/components/app/index.js +6 -5
  239. package/build-module/components/app/index.js.map +1 -1
  240. package/build-module/components/block-editor/use-editor-iframe-props.js +30 -21
  241. package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
  242. package/build-module/components/block-editor/use-site-editor-settings.js +10 -8
  243. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  244. package/build-module/components/editor/index.js +24 -14
  245. package/build-module/components/editor/index.js.map +1 -1
  246. package/build-module/components/editor/use-adapt-editor-to-canvas.js +42 -0
  247. package/build-module/components/editor/use-adapt-editor-to-canvas.js.map +1 -0
  248. package/build-module/components/editor/use-editor-title.js +3 -3
  249. package/build-module/components/editor/use-editor-title.js.map +1 -1
  250. package/build-module/components/editor-canvas-container/index.js +1 -2
  251. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  252. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  253. package/build-module/components/global-styles/color-palette-panel.js +1 -2
  254. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  255. package/build-module/components/global-styles/font-families.js +45 -31
  256. package/build-module/components/global-styles/font-families.js.map +1 -1
  257. package/build-module/components/global-styles/font-family-item.js +2 -3
  258. package/build-module/components/global-styles/font-family-item.js.map +1 -1
  259. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +1 -2
  260. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  261. package/build-module/components/global-styles/font-library-modal/context.js +1 -0
  262. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  263. package/build-module/components/global-styles/font-library-modal/font-card.js +2 -3
  264. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
  265. package/build-module/components/global-styles/font-library-modal/font-collection.js +1 -3
  266. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  267. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +1 -2
  268. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  269. package/build-module/components/global-styles/font-library-modal/index.js +1 -2
  270. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  271. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +5 -6
  272. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  273. package/build-module/components/global-styles/font-library-modal/library-font-details.js +1 -3
  274. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  275. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +1 -2
  276. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  277. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  278. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +2 -2
  279. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  280. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  281. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  282. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  283. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +1 -1
  284. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +1 -1
  285. package/build-module/components/global-styles/font-sizes/font-size.js +15 -18
  286. package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -1
  287. package/build-module/components/global-styles/font-sizes/font-sizes-count.js +2 -4
  288. package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +1 -1
  289. package/build-module/components/global-styles/font-sizes/font-sizes.js +5 -7
  290. package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
  291. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js +1 -2
  292. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js.map +1 -1
  293. package/build-module/components/global-styles/gradients-palette-panel.js +1 -2
  294. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  295. package/build-module/components/global-styles/header.js +1 -2
  296. package/build-module/components/global-styles/header.js.map +1 -1
  297. package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
  298. package/build-module/components/global-styles/navigation-button.js +1 -2
  299. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  300. package/build-module/components/global-styles/palette.js +17 -15
  301. package/build-module/components/global-styles/palette.js.map +1 -1
  302. package/build-module/components/global-styles/preset-colors.js.map +1 -1
  303. package/build-module/components/global-styles/preview-iframe.js +1 -3
  304. package/build-module/components/global-styles/preview-iframe.js.map +1 -1
  305. package/build-module/components/global-styles/preview-styles.js +1 -2
  306. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  307. package/build-module/components/global-styles/root-menu.js +1 -7
  308. package/build-module/components/global-styles/root-menu.js.map +1 -1
  309. package/build-module/components/global-styles/screen-background.js +1 -3
  310. package/build-module/components/global-styles/screen-background.js.map +1 -1
  311. package/build-module/components/global-styles/screen-block-list.js +3 -9
  312. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  313. package/build-module/components/global-styles/screen-block.js +1 -3
  314. package/build-module/components/global-styles/screen-block.js.map +1 -1
  315. package/build-module/components/global-styles/screen-color-palette.js +1 -3
  316. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  317. package/build-module/components/global-styles/screen-colors.js +1 -3
  318. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  319. package/build-module/components/global-styles/screen-css.js +2 -4
  320. package/build-module/components/global-styles/screen-css.js.map +1 -1
  321. package/build-module/components/global-styles/screen-layout.js +1 -3
  322. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  323. package/build-module/components/global-styles/screen-revisions/index.js +5 -12
  324. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  325. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +4 -5
  326. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  327. package/build-module/components/global-styles/screen-root.js +1 -6
  328. package/build-module/components/global-styles/screen-root.js.map +1 -1
  329. package/build-module/components/global-styles/screen-style-variations.js +15 -6
  330. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  331. package/build-module/components/global-styles/screen-typography-element.js +1 -3
  332. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  333. package/build-module/components/global-styles/screen-typography.js +1 -3
  334. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  335. package/build-module/components/global-styles/shadow-utils.js.map +1 -1
  336. package/build-module/components/global-styles/shadows-edit-panel.js +28 -19
  337. package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
  338. package/build-module/components/global-styles/shadows-panel.js +2 -7
  339. package/build-module/components/global-styles/shadows-panel.js.map +1 -1
  340. package/build-module/components/global-styles/size-control/index.js +1 -2
  341. package/build-module/components/global-styles/size-control/index.js.map +1 -1
  342. package/build-module/components/global-styles/style-variations-container.js +2 -6
  343. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  344. package/build-module/components/global-styles/typeset.js +3 -5
  345. package/build-module/components/global-styles/typeset.js.map +1 -1
  346. package/build-module/components/global-styles/typography-elements.js +3 -7
  347. package/build-module/components/global-styles/typography-elements.js.map +1 -1
  348. package/build-module/components/global-styles/typography-example.js +1 -2
  349. package/build-module/components/global-styles/typography-example.js.map +1 -1
  350. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  351. package/build-module/components/global-styles/ui.js +28 -17
  352. package/build-module/components/global-styles/ui.js.map +1 -1
  353. package/build-module/components/global-styles/utils.js.map +1 -1
  354. package/build-module/components/global-styles/variations/variation.js +3 -3
  355. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  356. package/build-module/components/global-styles/variations/variations-color.js +1 -2
  357. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  358. package/build-module/components/global-styles/variations/variations-panel.js +0 -1
  359. package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
  360. package/build-module/components/global-styles/variations/variations-typography.js +1 -2
  361. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  362. package/build-module/components/global-styles-sidebar/default-sidebar.js +1 -4
  363. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -1
  364. package/build-module/components/global-styles-sidebar/index.js +45 -39
  365. package/build-module/components/global-styles-sidebar/index.js.map +1 -1
  366. package/build-module/components/layout/animation.js +1 -3
  367. package/build-module/components/layout/animation.js.map +1 -1
  368. package/build-module/components/layout/index.js +24 -50
  369. package/build-module/components/layout/index.js.map +1 -1
  370. package/build-module/components/layout/router.js +17 -139
  371. package/build-module/components/layout/router.js.map +1 -1
  372. package/build-module/components/more-menu/index.js +1 -3
  373. package/build-module/components/more-menu/index.js.map +1 -1
  374. package/build-module/components/page/header.js +1 -2
  375. package/build-module/components/page/header.js.map +1 -1
  376. package/build-module/components/page/index.js +1 -2
  377. package/build-module/components/page/index.js.map +1 -1
  378. package/build-module/components/page-patterns/delete-category-menu-item.js +5 -7
  379. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  380. package/build-module/components/page-patterns/fields.js +1 -2
  381. package/build-module/components/page-patterns/fields.js.map +1 -1
  382. package/build-module/components/page-patterns/header.js +2 -3
  383. package/build-module/components/page-patterns/header.js.map +1 -1
  384. package/build-module/components/page-patterns/index.js +5 -4
  385. package/build-module/components/page-patterns/index.js.map +1 -1
  386. package/build-module/components/page-patterns/rename-category-menu-item.js +1 -3
  387. package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
  388. package/build-module/components/page-patterns/use-pattern-settings.js +1 -1
  389. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
  390. package/build-module/components/page-templates/fields.js +1 -2
  391. package/build-module/components/page-templates/fields.js.map +1 -1
  392. package/build-module/components/page-templates/index.js +2 -2
  393. package/build-module/components/page-templates/index.js.map +1 -1
  394. package/build-module/components/pagination/index.js +2 -3
  395. package/build-module/components/pagination/index.js.map +1 -1
  396. package/build-module/components/post-edit/index.js +9 -6
  397. package/build-module/components/post-edit/index.js.map +1 -1
  398. package/build-module/components/post-fields/index.js +10 -55
  399. package/build-module/components/post-fields/index.js.map +1 -1
  400. package/build-module/components/post-list/index.js +2 -4
  401. package/build-module/components/post-list/index.js.map +1 -1
  402. package/build-module/components/posts-app/index.js +3 -4
  403. package/build-module/components/posts-app/index.js.map +1 -1
  404. package/build-module/components/posts-app/router.js +3 -3
  405. package/build-module/components/posts-app/router.js.map +1 -1
  406. package/build-module/components/resizable-frame/index.js +21 -12
  407. package/build-module/components/resizable-frame/index.js.map +1 -1
  408. package/build-module/components/revisions/index.js +2 -3
  409. package/build-module/components/revisions/index.js.map +1 -1
  410. package/build-module/components/routes/use-title.js +1 -1
  411. package/build-module/components/routes/use-title.js.map +1 -1
  412. package/build-module/components/save-button/index.js +3 -3
  413. package/build-module/components/save-button/index.js.map +1 -1
  414. package/build-module/components/save-keyboard-shortcut/index.js +71 -0
  415. package/build-module/components/save-keyboard-shortcut/index.js.map +1 -0
  416. package/build-module/components/save-panel/index.js +18 -8
  417. package/build-module/components/save-panel/index.js.map +1 -1
  418. package/build-module/components/sidebar-button/index.js +1 -1
  419. package/build-module/components/sidebar-button/index.js.map +1 -1
  420. package/build-module/components/sidebar-dataviews/add-new-view.js +1 -3
  421. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  422. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +1 -3
  423. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  424. package/build-module/components/sidebar-dataviews/dataview-item.js +1 -2
  425. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  426. package/build-module/components/sidebar-dataviews/default-views.js +2 -5
  427. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  428. package/build-module/components/sidebar-dataviews/index.js +1 -3
  429. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  430. package/build-module/components/sidebar-navigation-item/index.js +1 -2
  431. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  432. package/build-module/components/sidebar-navigation-screen/index.js +3 -4
  433. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  434. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +2 -3
  435. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  436. package/build-module/components/sidebar-navigation-screen-details-panel/index.js +1 -2
  437. package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  438. package/build-module/components/sidebar-navigation-screen-global-styles/content.js +1 -2
  439. package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
  440. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +31 -13
  441. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  442. package/build-module/components/sidebar-navigation-screen-main/index.js +1 -3
  443. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  444. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  445. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -3
  446. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  447. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -2
  448. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  449. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -2
  450. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  451. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +6 -6
  452. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  453. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +4 -4
  454. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  455. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +8 -13
  456. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  457. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +3 -5
  458. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  459. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +1 -3
  460. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  461. package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -3
  462. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  463. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +1 -2
  464. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  465. package/build-module/components/site-editor-routes/home-edit.js +18 -0
  466. package/build-module/components/site-editor-routes/home-edit.js.map +1 -0
  467. package/build-module/components/site-editor-routes/home-view.js +17 -0
  468. package/build-module/components/site-editor-routes/home-view.js.map +1 -0
  469. package/build-module/components/site-editor-routes/index.js +42 -0
  470. package/build-module/components/site-editor-routes/index.js.map +1 -0
  471. package/build-module/components/site-editor-routes/navigation-edit.js +21 -0
  472. package/build-module/components/site-editor-routes/navigation-edit.js.map +1 -0
  473. package/build-module/components/site-editor-routes/navigation-item-edit.js +23 -0
  474. package/build-module/components/site-editor-routes/navigation-item-edit.js.map +1 -0
  475. package/build-module/components/site-editor-routes/navigation-item-view.js +22 -0
  476. package/build-module/components/site-editor-routes/navigation-item-view.js.map +1 -0
  477. package/build-module/components/site-editor-routes/navigation-view.js +20 -0
  478. package/build-module/components/site-editor-routes/navigation-view.js.map +1 -0
  479. package/build-module/components/site-editor-routes/pages-edit.js +35 -0
  480. package/build-module/components/site-editor-routes/pages-edit.js.map +1 -0
  481. package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js +56 -0
  482. package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js.map +1 -0
  483. package/build-module/components/site-editor-routes/pages-list-view.js +39 -0
  484. package/build-module/components/site-editor-routes/pages-list-view.js.map +1 -0
  485. package/build-module/components/site-editor-routes/pages-view-quick-edit.js +53 -0
  486. package/build-module/components/site-editor-routes/pages-view-quick-edit.js.map +1 -0
  487. package/build-module/components/site-editor-routes/pages-view.js +34 -0
  488. package/build-module/components/site-editor-routes/pages-view.js.map +1 -0
  489. package/build-module/components/site-editor-routes/patterns-edit.js +23 -0
  490. package/build-module/components/site-editor-routes/patterns-edit.js.map +1 -0
  491. package/build-module/components/site-editor-routes/patterns-view.js +21 -0
  492. package/build-module/components/site-editor-routes/patterns-view.js.map +1 -0
  493. package/build-module/components/site-editor-routes/styles-edit.js +20 -0
  494. package/build-module/components/site-editor-routes/styles-edit.js.map +1 -0
  495. package/build-module/components/site-editor-routes/styles-view.js +19 -0
  496. package/build-module/components/site-editor-routes/styles-view.js.map +1 -0
  497. package/build-module/components/site-editor-routes/templates-edit.js +23 -0
  498. package/build-module/components/site-editor-routes/templates-edit.js.map +1 -0
  499. package/build-module/components/site-editor-routes/templates-list-view.js +26 -0
  500. package/build-module/components/site-editor-routes/templates-list-view.js.map +1 -0
  501. package/build-module/components/site-editor-routes/templates-view.js +21 -0
  502. package/build-module/components/site-editor-routes/templates-view.js.map +1 -0
  503. package/build-module/components/site-hub/index.js +4 -4
  504. package/build-module/components/site-hub/index.js.map +1 -1
  505. package/build-module/components/style-book/color-examples.js +38 -0
  506. package/build-module/components/style-book/color-examples.js.map +1 -0
  507. package/build-module/components/style-book/constants.js +74 -9
  508. package/build-module/components/style-book/constants.js.map +1 -1
  509. package/build-module/components/style-book/duotone-examples.js +48 -0
  510. package/build-module/components/style-book/duotone-examples.js.map +1 -0
  511. package/build-module/components/style-book/examples.js +47 -3
  512. package/build-module/components/style-book/examples.js.map +1 -1
  513. package/build-module/components/style-book/index.js +95 -40
  514. package/build-module/components/style-book/index.js.map +1 -1
  515. package/build-module/components/style-book/types.js.map +1 -1
  516. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +6 -1
  517. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  518. package/build-module/components/welcome-guide/editor.js +1 -3
  519. package/build-module/components/welcome-guide/editor.js.map +1 -1
  520. package/build-module/components/welcome-guide/image.js +1 -2
  521. package/build-module/components/welcome-guide/image.js.map +1 -1
  522. package/build-module/components/welcome-guide/index.js +1 -3
  523. package/build-module/components/welcome-guide/index.js.map +1 -1
  524. package/build-module/components/welcome-guide/page.js +1 -3
  525. package/build-module/components/welcome-guide/page.js.map +1 -1
  526. package/build-module/components/welcome-guide/styles.js +1 -3
  527. package/build-module/components/welcome-guide/styles.js.map +1 -1
  528. package/build-module/components/welcome-guide/template.js +1 -3
  529. package/build-module/components/welcome-guide/template.js.map +1 -1
  530. package/build-module/deprecated.js.map +1 -1
  531. package/build-module/hooks/commands/use-common-commands.js +46 -30
  532. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  533. package/build-module/hooks/commands/use-edit-mode-commands.js +15 -11
  534. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  535. package/build-module/hooks/commands/use-set-command-context.js +12 -15
  536. package/build-module/hooks/commands/use-set-command-context.js.map +1 -1
  537. package/build-module/hooks/push-changes-to-global-styles/index.js +1 -3
  538. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  539. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
  540. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  541. package/build-module/index.js +2 -4
  542. package/build-module/index.js.map +1 -1
  543. package/build-module/posts.js +1 -1
  544. package/build-module/posts.js.map +1 -1
  545. package/build-module/store/actions.js.map +1 -1
  546. package/build-module/store/private-actions.js +6 -59
  547. package/build-module/store/private-actions.js.map +1 -1
  548. package/build-module/store/private-selectors.js +3 -11
  549. package/build-module/store/private-selectors.js.map +1 -1
  550. package/build-module/store/reducer.js +9 -18
  551. package/build-module/store/reducer.js.map +1 -1
  552. package/build-module/store/selectors.js.map +1 -1
  553. package/build-module/utils/get-filtered-template-parts.js.map +1 -1
  554. package/build-style/posts-rtl.css +39 -45
  555. package/build-style/posts.css +39 -45
  556. package/build-style/style-rtl.css +160 -60
  557. package/build-style/style.css +160 -60
  558. package/package.json +44 -42
  559. package/src/components/add-new-post/index.js +1 -1
  560. package/src/components/add-new-template/index.js +1 -1
  561. package/src/components/add-new-template/utils.js +12 -9
  562. package/src/components/app/index.js +4 -2
  563. package/src/components/block-editor/use-editor-iframe-props.js +22 -18
  564. package/src/components/block-editor/use-site-editor-settings.js +12 -10
  565. package/src/components/editor/index.js +34 -14
  566. package/src/components/editor/use-adapt-editor-to-canvas.js +53 -0
  567. package/src/components/editor/use-editor-title.js +3 -3
  568. package/src/components/global-styles/font-families.js +51 -35
  569. package/src/components/global-styles/font-sizes/font-size.js +20 -21
  570. package/src/components/global-styles/font-sizes/font-sizes-count.js +1 -4
  571. package/src/components/global-styles/font-sizes/font-sizes.js +7 -9
  572. package/src/components/global-styles/palette.js +21 -18
  573. package/src/components/global-styles/root-menu.js +3 -16
  574. package/src/components/global-styles/screen-block-list.js +1 -8
  575. package/src/components/global-styles/screen-css.js +1 -0
  576. package/src/components/global-styles/screen-revisions/index.js +2 -11
  577. package/src/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  578. package/src/components/global-styles/screen-root.js +3 -12
  579. package/src/components/global-styles/screen-style-variations.js +11 -3
  580. package/src/components/global-styles/shadows-edit-panel.js +33 -18
  581. package/src/components/global-styles/shadows-panel.js +0 -4
  582. package/src/components/global-styles/style-variations-container.js +2 -7
  583. package/src/components/global-styles/typography-elements.js +3 -11
  584. package/src/components/global-styles/ui.js +29 -12
  585. package/src/components/global-styles/variations/variation.js +3 -3
  586. package/src/components/global-styles/variations/variations-panel.js +0 -1
  587. package/src/components/global-styles-sidebar/default-sidebar.js +0 -1
  588. package/src/components/global-styles-sidebar/index.js +86 -75
  589. package/src/components/global-styles-sidebar/style.scss +6 -0
  590. package/src/components/layout/animation.js +0 -1
  591. package/src/components/layout/index.js +17 -51
  592. package/src/components/layout/router.js +18 -133
  593. package/src/components/layout/style.scss +2 -2
  594. package/src/components/page-patterns/delete-category-menu-item.js +4 -4
  595. package/src/components/page-patterns/index.js +3 -2
  596. package/src/components/page-patterns/use-pattern-settings.js +1 -1
  597. package/src/components/page-templates/index.js +0 -1
  598. package/src/components/pagination/index.js +1 -1
  599. package/src/components/post-edit/index.js +35 -4
  600. package/src/components/post-fields/index.js +7 -54
  601. package/src/components/post-fields/style.scss +3 -0
  602. package/src/components/post-list/index.js +1 -1
  603. package/src/components/post-list/style.scss +1 -1
  604. package/src/components/posts-app/index.js +2 -2
  605. package/src/components/posts-app/router.js +3 -3
  606. package/src/components/resizable-frame/index.js +19 -10
  607. package/src/components/revisions/index.js +4 -1
  608. package/src/components/save-keyboard-shortcut/index.js +69 -0
  609. package/src/components/save-panel/index.js +30 -32
  610. package/src/components/sidebar-button/index.js +1 -1
  611. package/src/components/sidebar-button/style.scss +2 -2
  612. package/src/components/sidebar-dataviews/default-views.js +2 -5
  613. package/src/components/sidebar-navigation-screen/index.js +2 -1
  614. package/src/components/sidebar-navigation-screen/style.scss +5 -1
  615. package/src/components/sidebar-navigation-screen-global-styles/index.js +47 -29
  616. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
  617. package/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +4 -4
  618. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +11 -13
  619. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +1 -1
  620. package/src/components/site-editor-routes/README.md +20 -0
  621. package/src/components/site-editor-routes/home-edit.js +17 -0
  622. package/src/components/site-editor-routes/home-view.js +16 -0
  623. package/src/components/site-editor-routes/index.js +60 -0
  624. package/src/components/site-editor-routes/navigation-edit.js +22 -0
  625. package/src/components/site-editor-routes/navigation-item-edit.js +26 -0
  626. package/src/components/site-editor-routes/navigation-item-view.js +25 -0
  627. package/src/components/site-editor-routes/navigation-view.js +21 -0
  628. package/src/components/site-editor-routes/pages-edit.js +35 -0
  629. package/src/components/site-editor-routes/pages-list-view-quick-edit.js +56 -0
  630. package/src/components/site-editor-routes/pages-list-view.js +44 -0
  631. package/src/components/site-editor-routes/pages-view-quick-edit.js +53 -0
  632. package/src/components/site-editor-routes/pages-view.js +39 -0
  633. package/src/components/site-editor-routes/patterns-edit.js +24 -0
  634. package/src/components/site-editor-routes/patterns-view.js +22 -0
  635. package/src/components/site-editor-routes/styles-edit.js +17 -0
  636. package/src/components/site-editor-routes/styles-view.js +16 -0
  637. package/src/components/site-editor-routes/templates-edit.js +22 -0
  638. package/src/components/site-editor-routes/templates-list-view.js +28 -0
  639. package/src/components/site-editor-routes/templates-view.js +22 -0
  640. package/src/components/site-hub/index.js +2 -2
  641. package/src/components/site-hub/style.scss +4 -0
  642. package/src/components/style-book/color-examples.tsx +44 -0
  643. package/src/components/style-book/constants.ts +83 -10
  644. package/src/components/style-book/duotone-examples.tsx +53 -0
  645. package/src/components/style-book/examples.tsx +113 -0
  646. package/src/components/style-book/index.js +149 -52
  647. package/src/components/style-book/style.scss +12 -14
  648. package/src/components/style-book/test/categories.js +0 -5
  649. package/src/components/style-book/types.ts +34 -1
  650. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +11 -1
  651. package/src/hooks/commands/use-common-commands.js +60 -40
  652. package/src/hooks/commands/use-edit-mode-commands.js +14 -18
  653. package/src/hooks/commands/use-set-command-context.js +7 -9
  654. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
  655. package/src/index.js +1 -5
  656. package/src/store/private-actions.js +7 -82
  657. package/src/store/private-selectors.js +4 -11
  658. package/src/store/reducer.js +10 -18
  659. package/src/style.scss +3 -0
  660. package/build/components/keyboard-shortcuts/global.js +0 -53
  661. package/build/components/keyboard-shortcuts/global.js.map +0 -1
  662. package/build/components/keyboard-shortcuts/register.js +0 -34
  663. package/build/components/keyboard-shortcuts/register.js.map +0 -1
  664. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -69
  665. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +0 -1
  666. package/build-module/components/keyboard-shortcuts/global.js +0 -46
  667. package/build-module/components/keyboard-shortcuts/global.js.map +0 -1
  668. package/build-module/components/keyboard-shortcuts/register.js +0 -27
  669. package/build-module/components/keyboard-shortcuts/register.js.map +0 -1
  670. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -62
  671. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +0 -1
  672. package/src/components/keyboard-shortcuts/global.js +0 -47
  673. package/src/components/keyboard-shortcuts/register.js +0 -27
  674. package/src/components/style-book/examples.ts +0 -63
  675. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -73
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_data","_coreData","_i18n","_a11y","_htmlEntities","_router","_lockUnlock","useLocation","unlock","routerPrivateApis","useTitle","title","location","siteTitle","useSelect","select","coreStore","getEntityRecord","isInitialLocationRef","useRef","useEffect","current","formattedTitle","sprintf","__","decodeEntities","document","speak"],"sources":["@wordpress/edit-site/src/components/routes/use-title.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function useTitle( title ) {\n\tconst location = useLocation();\n\tconst siteTitle = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord( 'root', 'site' )?.title,\n\t\t[]\n\t);\n\tconst isInitialLocationRef = useRef( true );\n\n\tuseEffect( () => {\n\t\tisInitialLocationRef.current = false;\n\t}, [ location ] );\n\n\tuseEffect( () => {\n\t\t// Don't update or announce the title for initial page load.\n\t\tif ( isInitialLocationRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( title && siteTitle ) {\n\t\t\t// @see https://github.com/WordPress/wordpress-develop/blob/94849898192d271d533e09756007e176feb80697/src/wp-admin/admin-header.php#L67-L68\n\t\t\tconst formattedTitle = sprintf(\n\t\t\t\t/* translators: Admin document title. 1: Admin screen name, 2: Network or site name. */\n\t\t\t\t__( '%1$s ‹ %2$s ‹ Editor — WordPress' ),\n\t\t\t\tdecodeEntities( title ),\n\t\t\t\tdecodeEntities( siteTitle )\n\t\t\t);\n\n\t\t\tdocument.title = formattedTitle;\n\n\t\t\t// Announce title on route change for screen readers.\n\t\t\tspeak( title, 'assertive' );\n\t\t}\n\t}, [ title, siteTitle, location ] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AAdA;AACA;AACA;;AASA;AACA;AACA;;AAGA,MAAM;EAAEQ;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEpC,SAASC,QAAQA,CAAEC,KAAK,EAAG;EACzC,MAAMC,QAAQ,GAAGL,WAAW,CAAC,CAAC;EAC9B,MAAMM,SAAS,GAAG,IAAAC,eAAS,EACxBC,MAAM,IACPA,MAAM,CAAEC,eAAU,CAAC,CAACC,eAAe,CAAE,MAAM,EAAE,MAAO,CAAC,EAAEN,KAAK,EAC7D,EACD,CAAC;EACD,MAAMO,oBAAoB,GAAG,IAAAC,eAAM,EAAE,IAAK,CAAC;EAE3C,IAAAC,kBAAS,EAAE,MAAM;IAChBF,oBAAoB,CAACG,OAAO,GAAG,KAAK;EACrC,CAAC,EAAE,CAAET,QAAQ,CAAG,CAAC;EAEjB,IAAAQ,kBAAS,EAAE,MAAM;IAChB;IACA,IAAKF,oBAAoB,CAACG,OAAO,EAAG;MACnC;IACD;IAEA,IAAKV,KAAK,IAAIE,SAAS,EAAG;MACzB;MACA,MAAMS,cAAc,GAAG,IAAAC,aAAO,GAC7B;MACA,IAAAC,QAAE,EAAE,kCAAmC,CAAC,EACxC,IAAAC,4BAAc,EAAEd,KAAM,CAAC,EACvB,IAAAc,4BAAc,EAAEZ,SAAU,CAC3B,CAAC;MAEDa,QAAQ,CAACf,KAAK,GAAGW,cAAc;;MAE/B;MACA,IAAAK,WAAK,EAAEhB,KAAK,EAAE,WAAY,CAAC;IAC5B;EACD,CAAC,EAAE,CAAEA,KAAK,EAAEE,SAAS,EAAED,QAAQ,CAAG,CAAC;AACpC","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_data","_coreData","_i18n","_a11y","_htmlEntities","_router","_lockUnlock","useLocation","unlock","routerPrivateApis","useTitle","title","location","siteTitle","useSelect","select","coreStore","getEntityRecord","isInitialLocationRef","useRef","useEffect","current","formattedTitle","sprintf","__","decodeEntities","document","speak"],"sources":["@wordpress/edit-site/src/components/routes/use-title.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function useTitle( title ) {\n\tconst location = useLocation();\n\tconst siteTitle = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord( 'root', 'site' )?.title,\n\t\t[]\n\t);\n\tconst isInitialLocationRef = useRef( true );\n\n\tuseEffect( () => {\n\t\tisInitialLocationRef.current = false;\n\t}, [ location ] );\n\n\tuseEffect( () => {\n\t\t// Don't update or announce the title for initial page load.\n\t\tif ( isInitialLocationRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( title && siteTitle ) {\n\t\t\t// @see https://github.com/WordPress/wordpress-develop/blob/94849898192d271d533e09756007e176feb80697/src/wp-admin/admin-header.php#L67-L68\n\t\t\tconst formattedTitle = sprintf(\n\t\t\t\t/* translators: Admin document title. 1: Admin screen name, 2: Network or site name. */\n\t\t\t\t__( '%1$s ‹ %2$s ‹ Editor — WordPress' ),\n\t\t\t\tdecodeEntities( title ),\n\t\t\t\tdecodeEntities( siteTitle )\n\t\t\t);\n\n\t\t\tdocument.title = formattedTitle;\n\n\t\t\t// Announce title on route change for screen readers.\n\t\t\tspeak( title, 'assertive' );\n\t\t}\n\t}, [ title, siteTitle, location ] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AAdA;AACA;AACA;;AASA;AACA;AACA;;AAGA,MAAM;EAAEQ;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEpC,SAASC,QAAQA,CAAEC,KAAK,EAAG;EACzC,MAAMC,QAAQ,GAAGL,WAAW,CAAC,CAAC;EAC9B,MAAMM,SAAS,GAAG,IAAAC,eAAS,EACxBC,MAAM,IACPA,MAAM,CAAEC,eAAU,CAAC,CAACC,eAAe,CAAE,MAAM,EAAE,MAAO,CAAC,EAAEN,KAAK,EAC7D,EACD,CAAC;EACD,MAAMO,oBAAoB,GAAG,IAAAC,eAAM,EAAE,IAAK,CAAC;EAE3C,IAAAC,kBAAS,EAAE,MAAM;IAChBF,oBAAoB,CAACG,OAAO,GAAG,KAAK;EACrC,CAAC,EAAE,CAAET,QAAQ,CAAG,CAAC;EAEjB,IAAAQ,kBAAS,EAAE,MAAM;IAChB;IACA,IAAKF,oBAAoB,CAACG,OAAO,EAAG;MACnC;IACD;IAEA,IAAKV,KAAK,IAAIE,SAAS,EAAG;MACzB;MACA,MAAMS,cAAc,GAAG,IAAAC,aAAO,EAC7B;MACA,IAAAC,QAAE,EAAE,kCAAmC,CAAC,EACxC,IAAAC,4BAAc,EAAEd,KAAM,CAAC,EACvB,IAAAc,4BAAc,EAAEZ,SAAU,CAC3B,CAAC;MAEDa,QAAQ,CAACf,KAAK,GAAGW,cAAc;;MAE/B;MACA,IAAAK,WAAK,EAAEhB,KAAK,EAAE,WAAY,CAAC;IAC5B;EACD,CAAC,EAAE,CAAEA,KAAK,EAAEE,SAAS,EAAED,QAAQ,CAAG,CAAC;AACpC","ignoreList":[]}
@@ -85,15 +85,15 @@ function SaveButton({
85
85
  const getLabel = () => {
86
86
  if ((0, _isPreviewingTheme.isPreviewingTheme)()) {
87
87
  if (isSaving) {
88
- return (0, _i18n.sprintf)( /* translators: %s: The name of theme to be activated. */
88
+ return (0, _i18n.sprintf)(/* translators: %s: The name of theme to be activated. */
89
89
  (0, _i18n.__)('Activating %s'), previewingThemeName);
90
90
  } else if (disabled) {
91
91
  return (0, _i18n.__)('Saved');
92
92
  } else if (hasDirtyEntities) {
93
- return (0, _i18n.sprintf)( /* translators: %s: The name of theme to be activated. */
93
+ return (0, _i18n.sprintf)(/* translators: %s: The name of theme to be activated. */
94
94
  (0, _i18n.__)('Activate %s & Save'), previewingThemeName);
95
95
  }
96
- return (0, _i18n.sprintf)( /* translators: %s: The name of theme to be activated. */
96
+ return (0, _i18n.sprintf)(/* translators: %s: The name of theme to be activated. */
97
97
  (0, _i18n.__)('Activate %s'), previewingThemeName);
98
98
  }
99
99
  if (isSaving) {
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_components","_i18n","_coreData","_keycodes","_router","_editor","_store","_isPreviewingTheme","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","SaveButton","className","variant","showTooltip","showReviewMessage","icon","size","__next40pxDefaultSize","params","setIsSaveViewOpened","useDispatch","editSiteStore","saveDirtyEntities","editorStore","dirtyEntityRecords","useEntitiesSavedStatesIsDirty","isSaving","isSaveViewOpen","previewingThemeName","useSelect","select","isSavingEntityRecord","isResolving","coreStore","isSaveViewOpened","isActivatingTheme","currentlyPreviewingThemeId","currentlyPreviewingTheme","some","record","kind","name","key","getTheme","rendered","undefined","hasDirtyEntities","length","isOnlyCurrentEntityDirty","postId","postType","path","includes","disabled","isPreviewingTheme","getLabel","sprintf","__","_n","label","onClick","jsx","Button","isBusy","shortcut","displayShortcut","primary","children"],"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport {\n\tuseEntitiesSavedStatesIsDirty,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function SaveButton( {\n\tclassName = 'edit-site-save-button__button',\n\tvariant = 'primary',\n\tshowTooltip = true,\n\tshowReviewMessage,\n\ticon,\n\tsize,\n\t__next40pxDefaultSize = false,\n} ) {\n\tconst { params } = useLocation();\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst { saveDirtyEntities } = unlock( useDispatch( editorStore ) );\n\tconst { dirtyEntityRecords } = useEntitiesSavedStatesIsDirty();\n\tconst { isSaving, isSaveViewOpen, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isSavingEntityRecord, isResolving } = select( coreStore );\n\t\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\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\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[ dirtyEntityRecords ]\n\t);\n\tconst hasDirtyEntities = !! dirtyEntityRecords.length;\n\tlet isOnlyCurrentEntityDirty;\n\t// Check if the current entity is the only entity with changes.\n\t// We have some extra logic for `wp_global_styles` for now, that\n\t// is used in navigation sidebar.\n\tif ( dirtyEntityRecords.length === 1 ) {\n\t\tif ( params.postId ) {\n\t\t\tisOnlyCurrentEntityDirty =\n\t\t\t\t`${ dirtyEntityRecords[ 0 ].key }` === params.postId &&\n\t\t\t\tdirtyEntityRecords[ 0 ].name === params.postType;\n\t\t} else if ( params.path?.includes( 'wp_global_styles' ) ) {\n\t\t\tisOnlyCurrentEntityDirty =\n\t\t\t\tdirtyEntityRecords[ 0 ].name === 'globalStyles';\n\t\t}\n\t}\n\tconst disabled =\n\t\tisSaving || ( ! hasDirtyEntities && ! isPreviewingTheme() );\n\tconst getLabel = () => {\n\t\tif ( isPreviewingTheme() ) {\n\t\t\tif ( isSaving ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activating %s' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t} else if ( disabled ) {\n\t\t\t\treturn __( 'Saved' );\n\t\t\t} else if ( hasDirtyEntities ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activate %s & Save' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t__( 'Activate %s' ),\n\t\t\t\tpreviewingThemeName\n\t\t\t);\n\t\t}\n\t\tif ( isSaving ) {\n\t\t\treturn __( 'Saving' );\n\t\t}\n\t\tif ( disabled ) {\n\t\t\treturn __( 'Saved' );\n\t\t}\n\t\tif ( ! isOnlyCurrentEntityDirty && showReviewMessage ) {\n\t\t\treturn 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\tdirtyEntityRecords.length\n\t\t\t\t),\n\t\t\t\tdirtyEntityRecords.length\n\t\t\t);\n\t\t}\n\t\treturn __( 'Save' );\n\t};\n\tconst label = getLabel();\n\tconst onClick = isOnlyCurrentEntityDirty\n\t\t? () => saveDirtyEntities( { dirtyEntityRecords } )\n\t\t: () => setIsSaveViewOpened( true );\n\treturn (\n\t\t<Button\n\t\t\tvariant={ variant }\n\t\t\tclassName={ className }\n\t\t\taria-disabled={ disabled }\n\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\tisBusy={ isSaving }\n\t\t\tonClick={ disabled ? undefined : onClick }\n\t\t\tlabel={ label }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ disabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\t/*\n\t\t\t * Displaying the keyboard shortcut conditionally makes the tooltip\n\t\t\t * itself show conditionally. This would trigger a full-rerendering\n\t\t\t * of the button that we want to avoid. By setting `showTooltip`,\n\t\t\t * the tooltip is always rendered even when there's no keyboard shortcut.\n\t\t\t */\n\t\t\tshowTooltip={ showTooltip }\n\t\t\ticon={ icon }\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\tsize={ size }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAQA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AAIA,IAAAS,WAAA,GAAAT,OAAA;AAA2C,IAAAU,WAAA,GAAAV,OAAA;AAtB3C;AACA;AACA;;AAYA;AACA;AACA;;AAQA,MAAM;EAAEW;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEpC,SAASC,UAAUA,CAAE;EACnCC,SAAS,GAAG,+BAA+B;EAC3CC,OAAO,GAAG,SAAS;EACnBC,WAAW,GAAG,IAAI;EAClBC,iBAAiB;EACjBC,IAAI;EACJC,IAAI;EACJC,qBAAqB,GAAG;AACzB,CAAC,EAAG;EACH,MAAM;IAAEC;EAAO,CAAC,GAAGX,WAAW,CAAC,CAAC;EAChC,MAAM;IAAEY;EAAoB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAc,CAAC;EAC5D,MAAM;IAAEC;EAAkB,CAAC,GAAG,IAAAd,kBAAM,EAAE,IAAAY,iBAAW,EAAEG,aAAY,CAAE,CAAC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AAMK,OAAO,GAAGZ,wBAAwB,GACrC,MAAM1B,iBAAiB,CAAE;IAAEE;EAAmB,CAAE,CAAC,GACjD,MAAML,mBAAmB,CAAE,IAAK,CAAC;EACpC,oBACC,IAAAb,WAAA,CAAAuD,GAAA,EAAChE,WAAA,CAAAiE,MAAM;IACNlD,OAAO,EAAGA,OAAS;IACnBD,SAAS,EAAGA,SAAW;IACvB,iBAAgB0C,QAAU;IAC1B,iBAAgB1B,cAAgB;IAChCoC,MAAM,EAAGrC,QAAU;IACnBkC,OAAO,EAAGP,QAAQ,GAAGR,SAAS,GAAGe,OAAS;IAC1CD,KAAK,EAAGA;IACR;AACH;AACA;AACA,OAHG;IAIAK,QAAQ,EAAGX,QAAQ,GAAGR,SAAS,GAAGoB,yBAAe,CAACC,OAAO,CAAE,GAAI;IAC/D;AACH;AACA;AACA;AACA;AACA,OALG;IAMArD,WAAW,EAAGA,WAAa;IAC3BE,IAAI,EAAGA,IAAM;IACbE,qBAAqB,EAAGA,qBAAuB;IAC/CD,IAAI,EAAGA,IAAM;IAAAmD,QAAA,EAEXR;EAAK,CACA,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_components","_i18n","_coreData","_keycodes","_router","_editor","_store","_isPreviewingTheme","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","SaveButton","className","variant","showTooltip","showReviewMessage","icon","size","__next40pxDefaultSize","params","setIsSaveViewOpened","useDispatch","editSiteStore","saveDirtyEntities","editorStore","dirtyEntityRecords","useEntitiesSavedStatesIsDirty","isSaving","isSaveViewOpen","previewingThemeName","useSelect","select","isSavingEntityRecord","isResolving","coreStore","isSaveViewOpened","isActivatingTheme","currentlyPreviewingThemeId","currentlyPreviewingTheme","some","record","kind","name","key","getTheme","rendered","undefined","hasDirtyEntities","length","isOnlyCurrentEntityDirty","postId","postType","path","includes","disabled","isPreviewingTheme","getLabel","sprintf","__","_n","label","onClick","jsx","Button","isBusy","shortcut","displayShortcut","primary","children"],"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport {\n\tuseEntitiesSavedStatesIsDirty,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function SaveButton( {\n\tclassName = 'edit-site-save-button__button',\n\tvariant = 'primary',\n\tshowTooltip = true,\n\tshowReviewMessage,\n\ticon,\n\tsize,\n\t__next40pxDefaultSize = false,\n} ) {\n\tconst { params } = useLocation();\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst { saveDirtyEntities } = unlock( useDispatch( editorStore ) );\n\tconst { dirtyEntityRecords } = useEntitiesSavedStatesIsDirty();\n\tconst { isSaving, isSaveViewOpen, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isSavingEntityRecord, isResolving } = select( coreStore );\n\t\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\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\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[ dirtyEntityRecords ]\n\t);\n\tconst hasDirtyEntities = !! dirtyEntityRecords.length;\n\tlet isOnlyCurrentEntityDirty;\n\t// Check if the current entity is the only entity with changes.\n\t// We have some extra logic for `wp_global_styles` for now, that\n\t// is used in navigation sidebar.\n\tif ( dirtyEntityRecords.length === 1 ) {\n\t\tif ( params.postId ) {\n\t\t\tisOnlyCurrentEntityDirty =\n\t\t\t\t`${ dirtyEntityRecords[ 0 ].key }` === params.postId &&\n\t\t\t\tdirtyEntityRecords[ 0 ].name === params.postType;\n\t\t} else if ( params.path?.includes( 'wp_global_styles' ) ) {\n\t\t\tisOnlyCurrentEntityDirty =\n\t\t\t\tdirtyEntityRecords[ 0 ].name === 'globalStyles';\n\t\t}\n\t}\n\tconst disabled =\n\t\tisSaving || ( ! hasDirtyEntities && ! isPreviewingTheme() );\n\tconst getLabel = () => {\n\t\tif ( isPreviewingTheme() ) {\n\t\t\tif ( isSaving ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activating %s' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t} else if ( disabled ) {\n\t\t\t\treturn __( 'Saved' );\n\t\t\t} else if ( hasDirtyEntities ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activate %s & Save' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t__( 'Activate %s' ),\n\t\t\t\tpreviewingThemeName\n\t\t\t);\n\t\t}\n\t\tif ( isSaving ) {\n\t\t\treturn __( 'Saving' );\n\t\t}\n\t\tif ( disabled ) {\n\t\t\treturn __( 'Saved' );\n\t\t}\n\t\tif ( ! isOnlyCurrentEntityDirty && showReviewMessage ) {\n\t\t\treturn 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\tdirtyEntityRecords.length\n\t\t\t\t),\n\t\t\t\tdirtyEntityRecords.length\n\t\t\t);\n\t\t}\n\t\treturn __( 'Save' );\n\t};\n\tconst label = getLabel();\n\tconst onClick = isOnlyCurrentEntityDirty\n\t\t? () => saveDirtyEntities( { dirtyEntityRecords } )\n\t\t: () => setIsSaveViewOpened( true );\n\treturn (\n\t\t<Button\n\t\t\tvariant={ variant }\n\t\t\tclassName={ className }\n\t\t\taria-disabled={ disabled }\n\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\tisBusy={ isSaving }\n\t\t\tonClick={ disabled ? undefined : onClick }\n\t\t\tlabel={ label }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ disabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\t/*\n\t\t\t * Displaying the keyboard shortcut conditionally makes the tooltip\n\t\t\t * itself show conditionally. This would trigger a full-rerendering\n\t\t\t * of the button that we want to avoid. By setting `showTooltip`,\n\t\t\t * the tooltip is always rendered even when there's no keyboard shortcut.\n\t\t\t */\n\t\t\tshowTooltip={ showTooltip }\n\t\t\ticon={ icon }\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\tsize={ size }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GA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;AACA,OAHG;IAIAK,QAAQ,EAAGX,QAAQ,GAAGR,SAAS,GAAGoB,yBAAe,CAACC,OAAO,CAAE,GAAI;IAC/D;AACH;AACA;AACA;AACA;AACA,OALG;IAMArD,WAAW,EAAGA,WAAa;IAC3BE,IAAI,EAAGA,IAAM;IACbE,qBAAqB,EAAGA,qBAAuB;IAC/CD,IAAI,EAAGA,IAAM;IAAAmD,QAAA,EAEXR;EAAK,CACA,CAAC;AAEX","ignoreList":[]}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = SaveKeyboardShortcut;
7
+ var _element = require("@wordpress/element");
8
+ var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
9
+ var _i18n = require("@wordpress/i18n");
10
+ var _data = require("@wordpress/data");
11
+ var _coreData = require("@wordpress/core-data");
12
+ var _editor = require("@wordpress/editor");
13
+ var _store = require("../../store");
14
+ /**
15
+ * WordPress dependencies
16
+ */
17
+
18
+ /**
19
+ * Internal dependencies
20
+ */
21
+
22
+ const shortcutName = 'core/edit-site/save';
23
+
24
+ /**
25
+ * Register the save keyboard shortcut in view mode.
26
+ *
27
+ * @return {null} Returns null.
28
+ */
29
+ function SaveKeyboardShortcut() {
30
+ const {
31
+ __experimentalGetDirtyEntityRecords,
32
+ isSavingEntityRecord
33
+ } = (0, _data.useSelect)(_coreData.store);
34
+ const {
35
+ hasNonPostEntityChanges,
36
+ isPostSavingLocked
37
+ } = (0, _data.useSelect)(_editor.store);
38
+ const {
39
+ savePost
40
+ } = (0, _data.useDispatch)(_editor.store);
41
+ const {
42
+ setIsSaveViewOpened
43
+ } = (0, _data.useDispatch)(_store.store);
44
+ const {
45
+ registerShortcut,
46
+ unregisterShortcut
47
+ } = (0, _data.useDispatch)(_keyboardShortcuts.store);
48
+ (0, _element.useEffect)(() => {
49
+ registerShortcut({
50
+ name: shortcutName,
51
+ category: 'global',
52
+ description: (0, _i18n.__)('Save your changes.'),
53
+ keyCombination: {
54
+ modifier: 'primary',
55
+ character: 's'
56
+ }
57
+ });
58
+ return () => {
59
+ unregisterShortcut(shortcutName);
60
+ };
61
+ }, [registerShortcut, unregisterShortcut]);
62
+ (0, _keyboardShortcuts.useShortcut)('core/edit-site/save', event => {
63
+ event.preventDefault();
64
+ const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
65
+ const hasDirtyEntities = !!dirtyEntityRecords.length;
66
+ const isSaving = dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key));
67
+ if (!hasDirtyEntities || isSaving) {
68
+ return;
69
+ }
70
+ if (hasNonPostEntityChanges()) {
71
+ setIsSaveViewOpened(true);
72
+ } else if (!isPostSavingLocked()) {
73
+ savePost();
74
+ }
75
+ });
76
+ return null;
77
+ }
78
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_element","require","_keyboardShortcuts","_i18n","_data","_coreData","_editor","_store","shortcutName","SaveKeyboardShortcut","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","useSelect","coreStore","hasNonPostEntityChanges","isPostSavingLocked","editorStore","savePost","useDispatch","setIsSaveViewOpened","editSiteStore","registerShortcut","unregisterShortcut","keyboardShortcutsStore","useEffect","name","category","description","__","keyCombination","modifier","character","useShortcut","event","preventDefault","dirtyEntityRecords","hasDirtyEntities","length","isSaving","some","record","kind","key"],"sources":["@wordpress/edit-site/src/components/save-keyboard-shortcut/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nconst shortcutName = 'core/edit-site/save';\n\n/**\n * Register the save keyboard shortcut in view mode.\n *\n * @return {null} Returns null.\n */\nexport default function SaveKeyboardShortcut() {\n\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\tuseSelect( coreStore );\n\tconst { hasNonPostEntityChanges, isPostSavingLocked } =\n\t\tuseSelect( editorStore );\n\tconst { savePost } = useDispatch( editorStore );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst { registerShortcut, unregisterShortcut } = useDispatch(\n\t\tkeyboardShortcutsStore\n\t);\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: shortcutName,\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\t\treturn () => {\n\t\t\tunregisterShortcut( shortcutName );\n\t\t};\n\t}, [ registerShortcut, unregisterShortcut ] );\n\n\tuseShortcut( 'core/edit-site/save', ( event ) => {\n\t\tevent.preventDefault();\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst hasDirtyEntities = !! dirtyEntityRecords.length;\n\t\tconst isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\t\tif ( ! hasDirtyEntities || isSaving ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( hasNonPostEntityChanges() ) {\n\t\t\tsetIsSaveViewOpened( true );\n\t\t} else if ( ! isPostSavingLocked() ) {\n\t\t\tsavePost();\n\t\t}\n\t} );\n\n\treturn null;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAIA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM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C,IAAI,EAAED,MAAM,CAACf,IAAI,EAAEe,MAAM,CAACE,GAAI,CAC5D,CAAC;IACD,IAAK,CAAEN,gBAAgB,IAAIE,QAAQ,EAAG;MACrC;IACD;IACA,IAAKxB,uBAAuB,CAAC,CAAC,EAAG;MAChCK,mBAAmB,CAAE,IAAK,CAAC;IAC5B,CAAC,MAAM,IAAK,CAAEJ,kBAAkB,CAAC,CAAC,EAAG;MACpCE,QAAQ,CAAC,CAAC;IACX;EACD,CAAE,CAAC;EAEH,OAAO,IAAI;AACZ","ignoreList":[]}
@@ -11,6 +11,8 @@ var _editor = require("@wordpress/editor");
11
11
  var _data = require("@wordpress/data");
12
12
  var _i18n = require("@wordpress/i18n");
13
13
  var _coreData = require("@wordpress/core-data");
14
+ var _router = require("@wordpress/router");
15
+ var _element = require("@wordpress/element");
14
16
  var _store = require("../../store");
15
17
  var _lockUnlock = require("../../lock-unlock");
16
18
  var _useActivateTheme = require("../../utils/use-activate-theme");
@@ -33,6 +35,9 @@ const {
33
35
  EntitiesSavedStatesExtensible,
34
36
  NavigableRegion
35
37
  } = (0, _lockUnlock.unlock)(_editor.privateApis);
38
+ const {
39
+ useLocation
40
+ } = (0, _lockUnlock.unlock)(_router.privateApis);
36
41
  const EntitiesSavedStatesForPreview = ({
37
42
  onClose
38
43
  }) => {
@@ -47,7 +52,7 @@ const EntitiesSavedStatesForPreview = ({
47
52
  const currentTheme = (0, _useActualCurrentTheme.useActualCurrentTheme)();
48
53
  const previewingTheme = (0, _data.useSelect)(select => select(_coreData.store).getCurrentTheme(), []);
49
54
  const additionalPrompt = /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
50
- children: (0, _i18n.sprintf)( /* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */
55
+ children: (0, _i18n.sprintf)(/* translators: 1: The name of active theme, 2: The name of theme to be activated. */
51
56
  (0, _i18n.__)('Saving your changes will change your active theme from %1$s to %2$s.'), (_currentTheme$name$re = currentTheme?.name?.rendered) !== null && _currentTheme$name$re !== void 0 ? _currentTheme$name$re : '...', (_previewingTheme$name = previewingTheme?.name?.rendered) !== null && _previewingTheme$name !== void 0 ? _previewingTheme$name : '...')
52
57
  });
53
58
  const activateTheme = (0, _useActivateTheme.useActivateTheme)();
@@ -79,9 +84,14 @@ const _EntitiesSavedStates = ({
79
84
  });
80
85
  };
81
86
  function SavePanel() {
87
+ const {
88
+ params
89
+ } = useLocation();
90
+ const {
91
+ canvas = 'view'
92
+ } = params;
82
93
  const {
83
94
  isSaveViewOpen,
84
- canvasMode,
85
95
  isDirty,
86
96
  isSaving
87
97
  } = (0, _data.useSelect)(select => {
@@ -93,15 +103,13 @@ function SavePanel() {
93
103
  const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
94
104
  const isActivatingTheme = isResolving('activateTheme');
95
105
  const {
96
- isSaveViewOpened,
97
- getCanvasMode
106
+ isSaveViewOpened
98
107
  } = (0, _lockUnlock.unlock)(select(_store.store));
99
108
 
100
109
  // The currently selected entity to display.
101
110
  // Typically template or template part in the site editor.
102
111
  return {
103
112
  isSaveViewOpen: isSaveViewOpened(),
104
- canvasMode: getCanvasMode(),
105
113
  isDirty: dirtyEntityRecords.length > 0,
106
114
  isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)) || isActivatingTheme
107
115
  };
@@ -110,7 +118,10 @@ function SavePanel() {
110
118
  setIsSaveViewOpened
111
119
  } = (0, _data.useDispatch)(_store.store);
112
120
  const onClose = () => setIsSaveViewOpened(false);
113
- if (canvasMode === 'view') {
121
+ (0, _element.useEffect)(() => {
122
+ setIsSaveViewOpened(false);
123
+ }, [canvas, setIsSaveViewOpened]);
124
+ if (canvas === 'view') {
114
125
  return isSaveViewOpen ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Modal, {
115
126
  className: "edit-site-save-panel__modal",
116
127
  onRequestClose: onClose,
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_editor","_data","_i18n","_coreData","_store","_lockUnlock","_useActivateTheme","_useActualCurrentTheme","_isPreviewingTheme","_jsxRuntime","EntitiesSavedStatesExtensible","NavigableRegion","unlock","privateApis","EntitiesSavedStatesForPreview","onClose","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","useEntitiesSavedStatesIsDirty","activateSaveLabel","isDirty","__","currentTheme","useActualCurrentTheme","previewingTheme","useSelect","select","coreStore","getCurrentTheme","additionalPrompt","jsx","children","sprintf","name","rendered","activateTheme","useActivateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","renderDialog","undefined","isPreviewingTheme","EntitiesSavedStates","SavePanel","isSaveViewOpen","canvasMode","isSaving","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isActivatingTheme","isSaveViewOpened","getCanvasMode","editSiteStore","length","some","record","kind","key","setIsSaveViewOpened","useDispatch","Modal","className","onRequestClose","__experimentalHideHeader","contentLabel","activateSaveEnabled","disabled","jsxs","clsx","ariaLabel","Button","__next40pxDefaultSize","variant","onClick","accessibleWhenDisabled"],"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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={ clsx( '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={ clsx( '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\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\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\taccessibleWhenDisabled\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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAR,OAAA;AACA,IAAAS,sBAAA,GAAAT,OAAA;AACA,IAAAU,kBAAA,GAAAV,OAAA;AAAoE,IAAAW,WAAA,GAAAX,OAAA;AAzBpE;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAOA,MAAM;EAAEY,6BAA6B;EAAEC;AAAgB,CAAC,GACvD,IAAAC,kBAAM,EAAEC,mBAAY,CAAC;AAEtB,MAAMC,6BAA6B,GAAGA,CAAE;EAAEC;AAAQ,CAAC,KAAM;EAAA,IAAAC,qBAAA,EAAAC,qBAAA;EACxD,MAAMC,YAAY,GAAG,IAAAC,qCAA6B,EAAC,CAAC;EACpD,IAAIC,iBAAiB;EACr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AY;IAAA,CAAE,CACxD;EAAA,CACe,CAAC;AAEpB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_editor","_data","_i18n","_coreData","_router","_element","_store","_lockUnlock","_useActivateTheme","_useActualCurrentTheme","_isPreviewingTheme","_jsxRuntime","EntitiesSavedStatesExtensible","NavigableRegion","unlock","privateApis","useLocation","routerPrivateApis","EntitiesSavedStatesForPreview","onClose","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","useEntitiesSavedStatesIsDirty","activateSaveLabel","isDirty","__","currentTheme","useActualCurrentTheme","previewingTheme","useSelect","select","coreStore","getCurrentTheme","additionalPrompt","jsx","children","sprintf","name","rendered","activateTheme","useActivateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","renderDialog","undefined","isPreviewingTheme","EntitiesSavedStates","SavePanel","params","canvas","isSaveViewOpen","isSaving","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isActivatingTheme","isSaveViewOpened","editSiteStore","length","some","record","kind","key","setIsSaveViewOpened","useDispatch","useEffect","Modal","className","onRequestClose","__experimentalHideHeader","contentLabel","activateSaveEnabled","disabled","jsxs","clsx","ariaLabel","Button","__next40pxDefaultSize","variant","onClick","accessibleWhenDisabled"],"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useEffect } from '@wordpress/element';\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 );\nconst { useLocation } = unlock( routerPrivateApis );\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: The name of active theme, 2: 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 { params } = useLocation();\n\tconst { canvas = 'view' } = params;\n\tconst { isSaveViewOpen, isDirty, isSaving } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tisSavingEntityRecord,\n\t\t\tisResolving,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\tconst { isSaveViewOpened } = unlock( select( editSiteStore ) );\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving:\n\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t\t) || isActivatingTheme,\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\tuseEffect( () => {\n\t\tsetIsSaveViewOpened( false );\n\t}, [ canvas, setIsSaveViewOpened ] );\n\n\tif ( canvas === '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={ clsx( '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={ clsx( '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\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\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\taccessibleWhenDisabled\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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,iBAAA,GAAAV,OAAA;AACA,IAAAW,sBAAA,GAAAX,OAAA;AACA,IAAAY,kBAAA,GAAAZ,OAAA;AAAoE,IAAAa,WAAA,GAAAb,OAAA;AA3BpE;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;;AAOA,MAAM;EAAEc,6BAA6B;EAAEC;AAAgB,CAAC,GACvD,IAAAC,kBAAM,EAAEC,mBAAY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AAA,eAEL,IAAAzB,WAAA,CAAAwB,GAAA,EAACpC,WAAA,CAAAmF,MAAM;QACNC,qBAAqB;QACrBC,OAAO,EAAC,WAAW;QACnBX,SAAS,EAAC,4CAA4C;QACtDY,OAAO,EAAGA,CAAA,KAAMhB,mBAAmB,CAAE,IAAK,CAAG;QAC7C,iBAAc,QAAQ;QACtBS,QAAQ,EAAGA,QAAU;QACrBQ,sBAAsB;QAAAlD,QAAA,EAEpB,IAAAV,QAAE,EAAE,iBAAkB;MAAC,CAClB;IAAC,CACL,CAAC,EACJ6B,cAAc,iBACf,IAAA5C,WAAA,CAAAwB,GAAA,EAACY,oBAAoB;MAAC5B,OAAO,EAAGA,OAAS;MAAC6B,YAAY;IAAA,CAAE,CACxD;EAAA,CACe,CAAC;AAEpB","ignoreList":[]}
@@ -18,7 +18,7 @@ var _jsxRuntime = require("react/jsx-runtime");
18
18
 
19
19
  function SidebarButton(props) {
20
20
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
21
- __next40pxDefaultSize: true,
21
+ size: "compact",
22
22
  ...props,
23
23
  className: (0, _clsx.default)('edit-site-sidebar-button', props.className)
24
24
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_jsxRuntime","SidebarButton","props","jsx","Button","__next40pxDefaultSize","className","clsx"],"sources":["@wordpress/edit-site/src/components/sidebar-button/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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__next40pxDefaultSize\n\t\t\t{ ...props }\n\t\t\tclassName={ clsx( 'edit-site-sidebar-button', props.className ) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAA+C,IAAAE,WAAA,GAAAF,OAAA;AAR/C;AACA;AACA;;AAGA;AACA;AACA;;AAGe,SAASG,aAAaA,CAAEC,KAAK,EAAG;EAC9C,oBACC,IAAAF,WAAA,CAAAG,GAAA,EAACJ,WAAA,CAAAK,MAAM;IACNC,qBAAqB;IAAA,GAChBH,KAAK;IACVI,SAAS,EAAG,IAAAC,aAAI,EAAE,0BAA0B,EAAEL,KAAK,CAACI,SAAU;EAAG,CACjE,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_jsxRuntime","SidebarButton","props","jsx","Button","size","className","clsx"],"sources":["@wordpress/edit-site/src/components/sidebar-button/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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\tsize=\"compact\"\n\t\t\t{ ...props }\n\t\t\tclassName={ clsx( 'edit-site-sidebar-button', props.className ) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAA+C,IAAAE,WAAA,GAAAF,OAAA;AAR/C;AACA;AACA;;AAGA;AACA;AACA;;AAGe,SAASG,aAAaA,CAAEC,KAAK,EAAG;EAC9C,oBACC,IAAAF,WAAA,CAAAG,GAAA,EAACJ,WAAA,CAAAK,MAAM;IACNC,IAAI,EAAC,SAAS;IAAA,GACTH,KAAK;IACVI,SAAS,EAAG,IAAAC,aAAI,EAAE,0BAA0B,EAAEL,KAAK,CAACI,SAAU;EAAG,CACjE,CAAC;AAEJ","ignoreList":[]}
@@ -24,9 +24,6 @@ const defaultLayouts = exports.defaultLayouts = {
24
24
  layout: {
25
25
  primaryField: 'title',
26
26
  styles: {
27
- 'featured-image': {
28
- width: '1%'
29
- },
30
27
  title: {
31
28
  maxWidth: 300
32
29
  }
@@ -35,14 +32,14 @@ const defaultLayouts = exports.defaultLayouts = {
35
32
  },
36
33
  [_constants.LAYOUT_GRID]: {
37
34
  layout: {
38
- mediaField: 'featured-image',
35
+ mediaField: 'featured_media',
39
36
  primaryField: 'title'
40
37
  }
41
38
  },
42
39
  [_constants.LAYOUT_LIST]: {
43
40
  layout: {
44
41
  primaryField: 'title',
45
- mediaField: 'featured-image'
42
+ mediaField: 'featured_media'
46
43
  }
47
44
  }
48
45
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_icons","_data","_coreData","_element","_constants","defaultLayouts","exports","LAYOUT_TABLE","layout","primaryField","styles","width","title","maxWidth","LAYOUT_GRID","mediaField","LAYOUT_LIST","DEFAULT_POST_BASE","type","search","filters","page","perPage","sort","field","direction","fields","useDefaultViews","postType","labels","useSelect","select","getPostType","coreStore","useMemo","all_items","__","slug","icon","pages","view","published","operator","OPERATOR_IS_ANY","value","scheduled","drafts","pending","notAllowed","trash"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/default-views.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nimport {\n\ttrash,\n\tpages,\n\tdrafts,\n\tpublished,\n\tscheduled,\n\tpending,\n\tnotAllowed,\n} from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tLAYOUT_LIST,\n\tLAYOUT_TABLE,\n\tLAYOUT_GRID,\n\tOPERATOR_IS_ANY,\n} from '../../utils/constants';\n\nexport const defaultLayouts = {\n\t[ LAYOUT_TABLE ]: {\n\t\tlayout: {\n\t\t\tprimaryField: 'title',\n\t\t\tstyles: {\n\t\t\t\t'featured-image': {\n\t\t\t\t\twidth: '1%',\n\t\t\t\t},\n\t\t\t\ttitle: {\n\t\t\t\t\tmaxWidth: 300,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t[ LAYOUT_GRID ]: {\n\t\tlayout: {\n\t\t\tmediaField: 'featured-image',\n\t\t\tprimaryField: 'title',\n\t\t},\n\t},\n\t[ LAYOUT_LIST ]: {\n\t\tlayout: {\n\t\t\tprimaryField: 'title',\n\t\t\tmediaField: 'featured-image',\n\t\t},\n\t},\n};\n\nconst DEFAULT_POST_BASE = {\n\ttype: LAYOUT_LIST,\n\tsearch: '',\n\tfilters: [],\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'date',\n\t\tdirection: 'desc',\n\t},\n\tfields: [ 'title', 'author', 'status' ],\n\tlayout: defaultLayouts[ LAYOUT_LIST ].layout,\n};\n\nexport function useDefaultViews( { postType } ) {\n\tconst labels = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPostType } = select( coreStore );\n\t\t\treturn getPostType( postType )?.labels;\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: labels?.all_items || __( 'All items' ),\n\t\t\t\tslug: 'all',\n\t\t\t\ticon: pages,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Published' ),\n\t\t\t\tslug: 'published',\n\t\t\t\ticon: published,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'publish',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Scheduled' ),\n\t\t\t\tslug: 'future',\n\t\t\t\ticon: scheduled,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'future',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Drafts' ),\n\t\t\t\tslug: 'drafts',\n\t\t\t\ticon: drafts,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'draft',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Pending' ),\n\t\t\t\tslug: 'pending',\n\t\t\t\ticon: pending,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'pending',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Private' ),\n\t\t\t\tslug: 'private',\n\t\t\t\ticon: notAllowed,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'private',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Trash' ),\n\t\t\t\tslug: 'trash',\n\t\t\t\ticon: trash,\n\t\t\t\tview: {\n\t\t\t\t\t...DEFAULT_POST_BASE,\n\t\t\t\t\ttype: LAYOUT_TABLE,\n\t\t\t\t\tlayout: defaultLayouts[ LAYOUT_TABLE ].layout,\n\t\t\t\t},\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'trash',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\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,EAAEvB,iBAAiB;MACvBG,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfkB,QAAQ,EAAEC,0BAAe;QACzBC,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,EACD;MACChC,KAAK,EAAE,IAAAwB,QAAE,EAAE,SAAU,CAAC;MACtBC,IAAI,EAAE,SAAS;MACfC,IAAI,EAAEU,iBAAU;MAChBR,IAAI,EAAEvB,iBAAiB;MACvBG,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfkB,QAAQ,EAAEC,0BAAe;QACzBC,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,EACD;MACChC,KAAK,EAAE,IAAAwB,QAAE,EAAE,OAAQ,CAAC;MACpBC,IAAI,EAAE,OAAO;MACbC,IAAI,EAAEW,YAAK;MACXT,IAAI,EAAE;QACL,GAAGvB,iBAAiB;QACpBC,IAAI,EAAEX,uBAAY;QAClBC,MAAM,EAAEH,cAAc,CAAEE,uBAAY,CAAE,CAACC;MACxC,CAAC;MACDY,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfkB,QAAQ,EAAEC,0BAAe;QACzBC,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,CACD;EACF,CAAC,EAAE,CAAEf,MAAM,CAAG,CAAC;AAChB","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_icons","_data","_coreData","_element","_constants","defaultLayouts","exports","LAYOUT_TABLE","layout","primaryField","styles","title","maxWidth","LAYOUT_GRID","mediaField","LAYOUT_LIST","DEFAULT_POST_BASE","type","search","filters","page","perPage","sort","field","direction","fields","useDefaultViews","postType","labels","useSelect","select","getPostType","coreStore","useMemo","all_items","__","slug","icon","pages","view","published","operator","OPERATOR_IS_ANY","value","scheduled","drafts","pending","notAllowed","trash"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/default-views.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nimport {\n\ttrash,\n\tpages,\n\tdrafts,\n\tpublished,\n\tscheduled,\n\tpending,\n\tnotAllowed,\n} from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tLAYOUT_LIST,\n\tLAYOUT_TABLE,\n\tLAYOUT_GRID,\n\tOPERATOR_IS_ANY,\n} from '../../utils/constants';\n\nexport const defaultLayouts = {\n\t[ LAYOUT_TABLE ]: {\n\t\tlayout: {\n\t\t\tprimaryField: 'title',\n\t\t\tstyles: {\n\t\t\t\ttitle: {\n\t\t\t\t\tmaxWidth: 300,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t[ LAYOUT_GRID ]: {\n\t\tlayout: {\n\t\t\tmediaField: 'featured_media',\n\t\t\tprimaryField: 'title',\n\t\t},\n\t},\n\t[ LAYOUT_LIST ]: {\n\t\tlayout: {\n\t\t\tprimaryField: 'title',\n\t\t\tmediaField: 'featured_media',\n\t\t},\n\t},\n};\n\nconst DEFAULT_POST_BASE = {\n\ttype: LAYOUT_LIST,\n\tsearch: '',\n\tfilters: [],\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'date',\n\t\tdirection: 'desc',\n\t},\n\tfields: [ 'title', 'author', 'status' ],\n\tlayout: defaultLayouts[ LAYOUT_LIST ].layout,\n};\n\nexport function useDefaultViews( { postType } ) {\n\tconst labels = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPostType } = select( coreStore );\n\t\t\treturn getPostType( postType )?.labels;\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: labels?.all_items || __( 'All items' ),\n\t\t\t\tslug: 'all',\n\t\t\t\ticon: pages,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Published' ),\n\t\t\t\tslug: 'published',\n\t\t\t\ticon: published,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'publish',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Scheduled' ),\n\t\t\t\tslug: 'future',\n\t\t\t\ticon: scheduled,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'future',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Drafts' ),\n\t\t\t\tslug: 'drafts',\n\t\t\t\ticon: drafts,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'draft',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Pending' ),\n\t\t\t\tslug: 'pending',\n\t\t\t\ticon: pending,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'pending',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Private' ),\n\t\t\t\tslug: 'private',\n\t\t\t\ticon: notAllowed,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'private',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Trash' ),\n\t\t\t\tslug: 'trash',\n\t\t\t\ticon: trash,\n\t\t\t\tview: {\n\t\t\t\t\t...DEFAULT_POST_BASE,\n\t\t\t\t\ttype: LAYOUT_TABLE,\n\t\t\t\t\tlayout: defaultLayouts[ LAYOUT_TABLE ].layout,\n\t\t\t\t},\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'trash',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t];\n\t}, [ labels ] );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AASA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,UAAA,GAAAL,OAAA;AArBA;AACA;AACA;;AAgBA;AACA;AACA;;AAQO,MAAMM,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC7B,CAAEE,uBAAY,GAAI;IACjBC,MAAM,EAAE;MACPC,YAAY,EAAE,OAAO;MACrBC,MAAM,EAAE;QACPC,KAAK,EAAE;UACNC,QAAQ,EAAE;QACX;MACD;IACD;EACD,CAAC;EACD,CAAEC,sBAAW,GAAI;IAChBL,MAAM,EAAE;MACPM,UAAU,EAAE,gBAAgB;MAC5BL,YAAY,EAAE;IACf;EACD,CAAC;EACD,CAAEM,sBAAW,GAAI;IAChBP,MAAM,EAAE;MACPC,YAAY,EAAE,OAAO;MACrBK,UAAU,EAAE;IACb;EACD;AACD,CAAC;AAED,MAAME,iBAAiB,GAAG;EACzBC,IAAI,EAAEF,sBAAW;EACjBG,MAAM,EA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oreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_icons","_router","_element","_lockUnlock","_sidebar","_jsxRuntime","useHistory","unlock","routerPrivateApis","SidebarNavigationItem","className","icon","withChevron","suffix","uid","params","onClick","children","props","history","navigate","useContext","SidebarNavigationContext","handleClick","e","preventDefault","push","jsx","__experimentalItem","clsx","id","jsxs","__experimentalHStack","justify","Icon","style","fill","size","FlexBlock","isRTL","chevronLeftSmall","chevronRightSmall"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-item/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n} from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\nimport { chevronRightSmall, chevronLeftSmall, Icon } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationItem( {\n\tclassName,\n\ticon,\n\twithChevron = false,\n\tsuffix,\n\tuid,\n\tparams,\n\tonClick,\n\tchildren,\n\t...props\n} ) {\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\t// If there is no custom click handler, create one that navigates to `params`.\n\tfunction handleClick( e ) {\n\t\tif ( onClick ) {\n\t\t\tonClick( e );\n\t\t\tnavigate( 'forward' );\n\t\t} else if ( params ) {\n\t\t\te.preventDefault();\n\t\t\thistory.push( params );\n\t\t\tnavigate( 'forward', `[id=\"${ uid }\"]` );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Item\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-site-sidebar-navigation-item',\n\t\t\t\t{ 'with-suffix': ! withChevron && suffix },\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tonClick={ handleClick }\n\t\t\tid={ uid }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t{ icon && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tstyle={ { fill: 'currentcolor' } }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t{ withChevron && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ isRTL() ? chevronLeftSmall : chevronRightSmall }\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-item__drilldown-indicator\"\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! withChevron && suffix }\n\t\t\t</HStack>\n\t\t</Item>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAAsD,IAAAQ,WAAA,GAAAR,OAAA;AAtBtD;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAIA,MAAM;EAAES;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEnC,SAASC,qBAAqBA,CAAE;EAC9CC,SAAS;EACTC,IAAI;EACJC,WAAW,GAAG,KAAK;EACnBC,MAAM;EACNC,GAAG;EACHC,MAAM;EACNC,OAAO;EACPC,QAAQ;EACR,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,OAAO,GAAG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,wBAAmB;QACvD/B,SAAS,EAAC,wDAAwD;QAClE2B,IAAI,EAAG;MAAI,CACX,CACD,EACC,CAAEzB,WAAW,IAAIC,MAAM;IAAA,CAClB;EAAC,CACJ,CAAC;AAET","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_icons","_router","_element","_lockUnlock","_sidebar","_jsxRuntime","useHistory","unlock","routerPrivateApis","SidebarNavigationItem","className","icon","withChevron","suffix","uid","params","onClick","children","props","history","navigate","useContext","SidebarNavigationContext","handleClick","e","preventDefault","push","jsx","__experimentalItem","clsx","id","jsxs","__experimentalHStack","justify","Icon","style","fill","size","FlexBlock","isRTL","chevronLeftSmall","chevronRightSmall"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-item/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n} from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\nimport { chevronRightSmall, chevronLeftSmall, Icon } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationItem( {\n\tclassName,\n\ticon,\n\twithChevron = false,\n\tsuffix,\n\tuid,\n\tparams,\n\tonClick,\n\tchildren,\n\t...props\n} ) {\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\t// If there is no custom click handler, create one that navigates to `params`.\n\tfunction handleClick( e ) {\n\t\tif ( onClick ) {\n\t\t\tonClick( e );\n\t\t\tnavigate( 'forward' );\n\t\t} else if ( params ) {\n\t\t\te.preventDefault();\n\t\t\thistory.push( params );\n\t\t\tnavigate( 'forward', `[id=\"${ uid }\"]` );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Item\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-site-sidebar-navigation-item',\n\t\t\t\t{ 'with-suffix': ! withChevron && suffix },\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tonClick={ handleClick }\n\t\t\tid={ uid }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t{ icon && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tstyle={ { fill: 'currentcolor' } }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t{ withChevron && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ isRTL() ? chevronLeftSmall : chevronRightSmall }\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-item__drilldown-indicator\"\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! withChevron && suffix }\n\t\t\t</HStack>\n\t\t</Item>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAAsD,IAAAQ,WAAA,GAAAR,OAAA;AAtBtD;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAIA,MAAM;EAAES;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEnC,SAASC,qBAAqBA,CAAE;EAC9CC,SAAS;EACTC,IAAI;EACJC,WA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BACZ,IAAAP,WAAA,CAAAsB,GAAA,EAAC3B,MAAA,CAAAkC,IAAI;QACJvB,IAAI,EAAG,IAAA4B,WAAK,EAAC,CAAC,GAAGC,uBAAgB,GAAGC,wBAAmB;QACvD/B,SAAS,EAAC,wDAAwD;QAClE2B,IAAI,EAAG;MAAI,CACX,CACD,EACC,CAAEzB,WAAW,IAAIC,MAAM;IAAA,CAClB;EAAC,CACJ,CAAC;AAET","ignoreList":[]}
@@ -97,7 +97,8 @@ function SidebarNavigationScreen({
97
97
  color: '#e0e0e0' /* $gray-200 */,
98
98
  level: 1,
99
99
  size: 20,
100
- children: !(0, _isPreviewingTheme.isPreviewingTheme)() ? title : (0, _i18n.sprintf)('Previewing %1$s: %2$s', previewingThemeName, title)
100
+ children: !(0, _isPreviewingTheme.isPreviewingTheme)() ? title : (0, _i18n.sprintf)(/* translators: 1: theme name. 2: title */
101
+ (0, _i18n.__)('Previewing %1$s: %2$s'), previewingThemeName, title)
101
102
  }), actions && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
102
103
  className: "edit-site-sidebar-navigation-screen__actions",
103
104
  children: actions
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_icons","_coreData","_data","_router","_element","_store","_lockUnlock","_sidebarButton","_isPreviewingTheme","_sidebar","_jsxRuntime","useHistory","useLocation","unlock","routerPrivateApis","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","backPathProp","dashboardLink","dashboardLinkText","previewingThemeName","useSelect","select","getSettings","editSiteStore","currentlyPreviewingThemeId","currentlyPreviewingTheme","__experimentalDashboardLink","__experimentalDashboardLinkText","coreStore","getTheme","name","rendered","undefined","location","history","navigate","useContext","SidebarNavigationContext","state","icon","isRTL","chevronRight","chevronLeft","jsxs","Fragment","children","__experimentalVStack","className","clsx","spacing","justify","__experimentalHStack","alignment","jsx","default","onClick","push","label","__","showTooltip","href","__experimentalHeading","color","level","size","isPreviewingTheme","sprintf"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport SidebarButton from '../sidebar-button';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tmeta,\n\tcontent,\n\tfooter,\n\tdescription,\n\tbackPath: backPathProp,\n} ) {\n\tconst { dashboardLink, dashboardLinkText, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\n\t\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t\t\tdashboardLinkText:\n\t\t\t\t\tgetSettings().__experimentalDashboardLinkText,\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst location = useLocation();\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\tconst backPath = backPathProp ?? location.state?.backPath;\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\n\treturn (\n\t\t<>\n\t\t\t<VStack\n\t\t\t\tclassName={ clsx( 'edit-site-sidebar-navigation-screen__main', {\n\t\t\t\t\t'has-footer': !! footer,\n\t\t\t\t} ) }\n\t\t\t\tspacing={ 0 }\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 3 }\n\t\t\t\t\talignment=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t\t>\n\t\t\t\t\t{ ! isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.push( backPath );\n\t\t\t\t\t\t\t\tnavigate( 'back' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tdashboardLinkText || __( 'Go to the Dashboard' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thref={ dashboardLink || 'index.php' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<Heading\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title\"\n\t\t\t\t\t\tcolor={ '#e0e0e0' /* $gray-200 */ }\n\t\t\t\t\t\tlevel={ 1 }\n\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isPreviewingTheme()\n\t\t\t\t\t\t\t? title\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t'Previewing %1$s: %2$s',\n\t\t\t\t\t\t\t\t\tpreviewingThemeName,\n\t\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t ) }\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{ actions && (\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__actions\">\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t\t{ meta && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__meta\">\n\t\t\t\t\t\t\t{ meta }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t\t{ description && (\n\t\t\t\t\t\t<p className=\"edit-site-sidebar-navigation-screen__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ content }\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t\t{ footer && (\n\t\t\t\t<footer className=\"edit-site-sidebar-navigation-screen__footer\">\n\t\t\t\t\t{ footer }\n\t\t\t\t</footer>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IA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AG,EAAI;UAAAnB,QAAA,EAET,CAAE,IAAAoB,oCAAiB,EAAC,CAAC,GACpBxD,KAAK,GACL,IAAAyD,aAAO,EACP,uBAAuB,EACvB/C,mBAAmB,EACnBV,KACA;QAAC,CACI,CAAC,EACRC,OAAO,iBACR,IAAAR,WAAA,CAAAmD,GAAA;UAAKN,SAAS,EAAC,8CAA8C;UAAAF,QAAA,EAC1DnC;QAAO,CACL,CACL;MAAA,CACM,CAAC,EACPC,IAAI,iBACL,IAAAT,WAAA,CAAAmD,GAAA,EAAAnD,WAAA,CAAA0C,QAAA;QAAAC,QAAA,eACC,IAAA3C,WAAA,CAAAmD,GAAA;UAAKN,SAAS,EAAC,2CAA2C;UAAAF,QAAA,EACvDlC;QAAI,CACF;MAAC,CACL,CACF,eAED,IAAAT,WAAA,CAAAyC,IAAA;QAAKI,SAAS,EAAC,8CAA8C;QAAAF,QAAA,GAC1D/B,WAAW,iBACZ,IAAAZ,WAAA,CAAAmD,GAAA;UAAGN,SAAS,EAAC,kDAAkD;UAAAF,QAAA,EAC5D/B;QAAW,CACX,CACH,EACCF,OAAO;MAAA,CACL,CAAC;IAAA,CACC,CAAC,EACPC,MAAM,iBACP,IAAAX,WAAA,CAAAmD,GAAA;MAAQN,SAAS,EAAC,6CAA6C;MAAAF,QAAA,EAC5DhC;IAAM,CACD,CACR;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_icons","_coreData","_data","_router","_element","_store","_lockUnlock","_sidebarButton","_isPreviewingTheme","_sidebar","_jsxRuntime","useHistory","useLocation","unlock","routerPrivateApis","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","backPathProp","dashboardLink","dashboardLinkText","previewingThemeName","useSelect","select","getSettings","editSiteStore","currentlyPreviewingThemeId","currentlyPreviewingTheme","__experimentalDashboardLink","__experimentalDashboardLinkText","coreStore","getTheme","name","rendered","undefined","location","history","navigate","useContext","SidebarNavigationContext","state","icon","isRTL","chevronRight","chevronLeft","jsxs","Fragment","children","__experimentalVStack","className","clsx","spacing","justify","__experimentalHStack","alignment","jsx","default","onClick","push","label","__","showTooltip","href","__experimentalHeading","color","level","size","isPreviewingTheme","sprintf"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport SidebarButton from '../sidebar-button';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tmeta,\n\tcontent,\n\tfooter,\n\tdescription,\n\tbackPath: backPathProp,\n} ) {\n\tconst { dashboardLink, dashboardLinkText, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\n\t\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t\t\tdashboardLinkText:\n\t\t\t\t\tgetSettings().__experimentalDashboardLinkText,\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst location = useLocation();\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\tconst backPath = backPathProp ?? location.state?.backPath;\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\n\treturn (\n\t\t<>\n\t\t\t<VStack\n\t\t\t\tclassName={ clsx( 'edit-site-sidebar-navigation-screen__main', {\n\t\t\t\t\t'has-footer': !! footer,\n\t\t\t\t} ) }\n\t\t\t\tspacing={ 0 }\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 3 }\n\t\t\t\t\talignment=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t\t>\n\t\t\t\t\t{ ! isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.push( backPath );\n\t\t\t\t\t\t\t\tnavigate( 'back' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tdashboardLinkText || __( 'Go to the Dashboard' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thref={ dashboardLink || 'index.php' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<Heading\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title\"\n\t\t\t\t\t\tcolor={ '#e0e0e0' /* $gray-200 */ }\n\t\t\t\t\t\tlevel={ 1 }\n\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isPreviewingTheme()\n\t\t\t\t\t\t\t? title\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: 1: theme name. 2: title */\n\t\t\t\t\t\t\t\t\t__( 'Previewing %1$s: %2$s' ),\n\t\t\t\t\t\t\t\t\tpreviewingThemeName,\n\t\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t ) }\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{ actions && (\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__actions\">\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t\t{ meta && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__meta\">\n\t\t\t\t\t\t\t{ meta }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t\t{ description && (\n\t\t\t\t\t\t<p className=\"edit-site-sidebar-navigation-screen__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ content }\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t\t{ footer && (\n\t\t\t\t<footer className=\"edit-site-sidebar-navigation-screen__footer\">\n\t\t\t\t\t{ footer }\n\t\t\t\t</footer>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA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AI,EAAG3C,aAAa,IAAI;QAAa,CACrC,CACD,eACD,IAAAf,WAAA,CAAAmD,GAAA,EAAC/D,WAAA,CAAAuE,qBAAO;UACPd,SAAS,EAAC,4CAA4C;UACtDe,KAAK,EAAG,SAAS,CAAC,eAAiB;UACnCC,KAAK,EAAG,CAAG;UACXC,IAAI,EAAG,EAAI;UAAAnB,QAAA,EAET,CAAE,IAAAoB,oCAAiB,EAAC,CAAC,GACpBxD,KAAK,GACL,IAAAyD,aAAO,EACP;UACA,IAAAR,QAAE,EAAE,uBAAwB,CAAC,EAC7BvC,mBAAmB,EACnBV,KACA;QAAC,CACI,CAAC,EACRC,OAAO,iBACR,IAAAR,WAAA,CAAAmD,GAAA;UAAKN,SAAS,EAAC,8CAA8C;UAAAF,QAAA,EAC1DnC;QAAO,CACL,CACL;MAAA,CACM,CAAC,EACPC,IAAI,iBACL,IAAAT,WAAA,CAAAmD,GAAA,EAAAnD,WAAA,CAAA0C,QAAA;QAAAC,QAAA,eACC,IAAA3C,WAAA,CAAAmD,GAAA;UAAKN,SAAS,EAAC,2CAA2C;UAAAF,QAAA,EACvDlC;QAAI,CACF;MAAC,CACL,CACF,eAED,IAAAT,WAAA,CAAAyC,IAAA;QAAKI,SAAS,EAAC,8CAA8C;QAAAF,QAAA,GAC1D/B,WAAW,iBACZ,IAAAZ,WAAA,CAAAmD,GAAA;UAAGN,SAAS,EAAC,kDAAkD;UAAAF,QAAA,EAC5D/B;QAAW,CACX,CACH,EACCF,OAAO;MAAA,CACL,CAAC;IAAA,CACC,CAAC,EACPC,MAAM,iBACP,IAAAX,WAAA,CAAAmD,GAAA;MAAQN,SAAS,EAAC,6CAA6C;MAAAF,QAAA,EAC5DhC;IAAM,CACD,CACR;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -54,7 +54,7 @@ function SidebarNavigationScreenDetailsFooter({
54
54
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenDetailsPanel.SidebarNavigationScreenDetailsPanelLabel, {
55
55
  children: (0, _i18n.__)('Last modified')
56
56
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenDetailsPanel.SidebarNavigationScreenDetailsPanelValue, {
57
- children: (0, _element.createInterpolateElement)((0, _i18n.sprintf)( /* translators: %s: is the relative time when the post was last modified. */
57
+ children: (0, _element.createInterpolateElement)((0, _i18n.sprintf)(/* translators: %s: is the relative time when the post was last modified. */
58
58
  (0, _i18n.__)('<time>%s</time>'), (0, _date.humanTimeDiff)(record.modified)), {
59
59
  time: /*#__PURE__*/(0, _jsxRuntime.jsx)("time", {
60
60
  dateTime: record.modified
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_date","_element","_url","_components","_icons","_sidebarNavigationScreenDetailsPanel","_sidebarNavigationItem","_interopRequireDefault","_jsxRuntime","SidebarNavigationScreenDetailsFooter","record","otherProps","_record$_links$predec","_record$_links$versio","hrefProps","lastRevisionId","_links","id","revisionsCount","count","href","addQueryArgs","revision","as","jsx","__experimentalItemGroup","className","children","default","__","jsxs","SidebarNavigationScreenDetailsPanelRow","justify","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","createInterpolateElement","sprintf","humanTimeDiff","modified","time","dateTime","Icon","icon","backup"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-details-footer/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { addQueryArgs } from '@wordpress/url';\nimport {\n\tIcon,\n\t__experimentalItemGroup as ItemGroup,\n} from '@wordpress/components';\nimport { backup } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\n\nexport default function SidebarNavigationScreenDetailsFooter( {\n\trecord,\n\t...otherProps\n} ) {\n\t/*\n\t * There might be other items in the future,\n\t * but for now it's just modified date.\n\t * Later we might render a list of items and isolate\n\t * the following logic.\n\t */\n\tconst hrefProps = {};\n\tconst lastRevisionId =\n\t\trecord?._links?.[ 'predecessor-version' ]?.[ 0 ]?.id ?? null;\n\tconst revisionsCount =\n\t\trecord?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0;\n\t// Enable the revisions link if there is a last revision and there are more than one revisions.\n\tif ( lastRevisionId && revisionsCount > 1 ) {\n\t\threfProps.href = addQueryArgs( 'revision.php', {\n\t\t\trevision: record?._links[ 'predecessor-version' ][ 0 ].id,\n\t\t} );\n\t\threfProps.as = 'a';\n\t}\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-details-footer\">\n\t\t\t<SidebarNavigationItem\n\t\t\t\taria-label={ __( 'Revisions' ) }\n\t\t\t\t{ ...hrefProps }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow justify=\"space-between\">\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t{ __( 'Last modified' ) }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: is the relative time when the post was last modified. */\n\t\t\t\t\t\t\t\t__( '<time>%s</time>' ),\n\t\t\t\t\t\t\t\thumanTimeDiff( record.modified )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttime: <time dateTime={ record.modified } />,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-details-footer__icon\"\n\t\t\t\t\t\ticon={ backup }\n\t\t\t\t\t/>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t</SidebarNavigationItem>\n\t\t</ItemGroup>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAIA,IAAAK,MAAA,GAAAL,OAAA;AAKA,IAAAM,oCAAA,GAAAN,OAAA;AAKA,IAAAO,sBAAA,GAAAC,sBAAA,CAAAR,OAAA;AAA+D,IAAAS,WAAA,GAAAT,OAAA;AArB/D;AACA;AACA;;AAWA;AACA;AACA;;AAQe,SAASU,oCAAoCA,CAAE;EAC7DC,MAAM;EACN,GAAGC;AACJ,CAAC,EAAG;EAAA,IAAAC,qBAAA,EAAAC,qBAAA;EACH;AACD;AACA;AACA;AACA;AACA;EACC,MAAMC,SAAS,GAAG,CAAC,CAAC;EACpB,MAAMC,cAAc,IAAAH,qBAAA,GACnBF,MAAM,EAAEM,MAAM,GAAI,qBAAqB,CAAE,GAAI,CAAC,CAAE,EAAEC,EAAE,cAAAL,qBAAA,cAAAA,qBAAA,GAAI,IAAI;EAC7D,MAAMM,cAAc,IAAAL,qBAAA,GACnBH,MAAM,EAAEM,MAAM,GAAI,iBAAiB,CAAE,GAAI,CAAC,CAAE,EAAEG,KAAK,cAAAN,qBAAA,cAAAA,qBAAA,GAAI,CAAC;EACzD;EACA,IAAKE,cAAc,IAAIG,cAAc,GAAG,CAAC,EAAG;IAC3CJ,SAAS,CAACM,IAAI,GAAG,IAAAC,iBAAY,EAAE,cAAc,EAAE;MAC9CC,QAAQ,EAAEZ,MAAM,EAAEM,MAAM,CAAE,qBAAqB,CAAE,CAAE,CAAC,CAAE,CAACC;IACxD,CAAE,CAAC;IACHH,SAAS,CAACS,EAAE,GAAG,GAAG;EACnB;EACA,oBACC,IAAAf,WAAA,CAAAgB,GAAA,EAACrB,WAAA,CAAAsB,uBAAS;IAACC,SAAS,EAAC,oDAAoD;IAAAC,QAAA,eACxE,IAAAnB,WAAA,CAAAgB,GAAA,EAAClB,sBAAA,CAAAsB,OAAqB;MACrB,cAAa,IAAAC,QAAE,EAAE,WAAY,CAAG;MAAA,GAC3Bf,SAAS;MAAA,GACTH,UAAU;MAAAgB,QAAA,eAEf,IAAAnB,WAAA,CAAAsB,IAAA,EAACzB,oCAAA,CAAA0B,sCAAsC;QAACC,OAAO,EAAC,eAAe;QAAAL,QAAA,gBAC9D,IAAAnB,WAAA,CAAAgB,GAAA,EAACnB,oCAAA,CAAA4B,wCAAwC;UAAAN,QAAA,EACtC,IAAAE,QAAE,EAAE,eAAgB;QAAC,CACkB,CAAC,eAC3C,IAAArB,WAAA,CAAAgB,GAAA,EAACnB,oCAAA,CAAA6B,wCAAwC;UAAAP,QAAA,EACtC,IAAAQ,iCAAwB,EACzB,IAAAC,aAAO,GACN;UACA,IAAAP,QAAE,EAAE,iBAAkB,CAAC,EACvB,IAAAQ,mBAAa,EAAE3B,MAAM,CAAC4B,QAAS,CAChC,CAAC,EACD;YACCC,IAAI,eAAE,IAAA/B,WAAA,CAAAgB,GAAA;cAAMgB,QAAQ,EAAG9B,MAAM,CAAC4B;YAAU,CAAE;UAC3C,CACD;QAAC,CACwC,CAAC,eAC3C,IAAA9B,WAAA,CAAAgB,GAAA,EAACrB,WAAA,CAAAsC,IAAI;UACJf,SAAS,EAAC,0DAA0D;UACpEgB,IAAI,EAAGC;QAAQ,CACf,CAAC;MAAA,CACqC;IAAC,CACnB;EAAC,CACd,CAAC;AAEd","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_date","_element","_url","_components","_icons","_sidebarNavigationScreenDetailsPanel","_sidebarNavigationItem","_interopRequireDefault","_jsxRuntime","SidebarNavigationScreenDetailsFooter","record","otherProps","_record$_links$predec","_record$_links$versio","hrefProps","lastRevisionId","_links","id","revisionsCount","count","href","addQueryArgs","revision","as","jsx","__experimentalItemGroup","className","children","default","__","jsxs","SidebarNavigationScreenDetailsPanelRow","justify","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","createInterpolateElement","sprintf","humanTimeDiff","modified","time","dateTime","Icon","icon","backup"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-details-footer/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { addQueryArgs } from '@wordpress/url';\nimport {\n\tIcon,\n\t__experimentalItemGroup as ItemGroup,\n} from '@wordpress/components';\nimport { backup } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\n\nexport default function SidebarNavigationScreenDetailsFooter( {\n\trecord,\n\t...otherProps\n} ) {\n\t/*\n\t * There might be other items in the future,\n\t * but for now it's just modified date.\n\t * Later we might render a list of items and isolate\n\t * the following logic.\n\t */\n\tconst hrefProps = {};\n\tconst lastRevisionId =\n\t\trecord?._links?.[ 'predecessor-version' ]?.[ 0 ]?.id ?? null;\n\tconst revisionsCount =\n\t\trecord?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0;\n\t// Enable the revisions link if there is a last revision and there are more than one revisions.\n\tif ( lastRevisionId && revisionsCount > 1 ) {\n\t\threfProps.href = addQueryArgs( 'revision.php', {\n\t\t\trevision: record?._links[ 'predecessor-version' ][ 0 ].id,\n\t\t} );\n\t\threfProps.as = 'a';\n\t}\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-details-footer\">\n\t\t\t<SidebarNavigationItem\n\t\t\t\taria-label={ __( 'Revisions' ) }\n\t\t\t\t{ ...hrefProps }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow justify=\"space-between\">\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t{ __( 'Last modified' ) }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: is the relative time when the post was last modified. */\n\t\t\t\t\t\t\t\t__( '<time>%s</time>' ),\n\t\t\t\t\t\t\t\thumanTimeDiff( record.modified )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttime: <time dateTime={ record.modified } />,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-details-footer__icon\"\n\t\t\t\t\t\ticon={ backup }\n\t\t\t\t\t/>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t</SidebarNavigationItem>\n\t\t</ItemGroup>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAIA,IAAAK,MAAA,GAAAL,OAAA;AAKA,IAAAM,oCAAA,GAAAN,OAAA;AAKA,IAAAO,sBAAA,GAAAC,sBAAA,CAAAR,OAAA;AAA+D,IAAAS,WAAA,GAAAT,OAAA;AArB/D;AACA;AACA;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