@wordpress/edit-site 5.35.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (905) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/components/add-new-page/index.js +33 -27
  3. package/build/components/add-new-page/index.js.map +1 -1
  4. package/build/components/add-new-pattern/index.js +95 -78
  5. package/build/components/add-new-pattern/index.js.map +1 -1
  6. package/build/components/add-new-template/add-custom-generic-template-modal-content.js +35 -30
  7. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  8. package/build/components/add-new-template/add-custom-template-modal-content.js +119 -95
  9. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  10. package/build/components/add-new-template/index.js +87 -71
  11. package/build/components/add-new-template/index.js.map +1 -1
  12. package/build/components/add-new-template/utils.js +36 -17
  13. package/build/components/add-new-template/utils.js.map +1 -1
  14. package/build/components/app/index.js +10 -4
  15. package/build/components/app/index.js.map +1 -1
  16. package/build/components/block-editor/block-inspector-button.js +5 -4
  17. package/build/components/block-editor/block-inspector-button.js.map +1 -1
  18. package/build/components/block-editor/inserter-media-categories.js +1 -1
  19. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  20. package/build/components/block-editor/use-editor-iframe-props.js +88 -0
  21. package/build/components/block-editor/use-editor-iframe-props.js.map +1 -0
  22. package/build/components/canvas-loader/index.js +13 -12
  23. package/build/components/canvas-loader/index.js.map +1 -1
  24. package/build/components/dataviews-actions/index.js +7 -4
  25. package/build/components/dataviews-actions/index.js.map +1 -1
  26. package/build/components/editor/index.js +86 -182
  27. package/build/components/editor/index.js.map +1 -1
  28. package/build/components/editor/use-editor-title.js +39 -0
  29. package/build/components/editor/use-editor-title.js.map +1 -0
  30. package/build/components/editor-canvas-container/index.js +27 -29
  31. package/build/components/editor-canvas-container/index.js.map +1 -1
  32. package/build/components/error-boundary/index.js +2 -2
  33. package/build/components/error-boundary/index.js.map +1 -1
  34. package/build/components/error-boundary/warning.js +13 -11
  35. package/build/components/error-boundary/warning.js.map +1 -1
  36. package/build/components/global-styles/background-panel.js +6 -5
  37. package/build/components/global-styles/background-panel.js.map +1 -1
  38. package/build/components/global-styles/block-preview-panel.js +19 -17
  39. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  40. package/build/components/global-styles/color-indicator-wrapper.js +2 -2
  41. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  42. package/build/components/global-styles/color-palette-panel.js +30 -29
  43. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  44. package/build/components/global-styles/dimensions-panel.js +2 -2
  45. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  46. package/build/components/global-styles/font-families.js +55 -39
  47. package/build/components/global-styles/font-families.js.map +1 -1
  48. package/build/components/global-styles/font-family-item.js +17 -13
  49. package/build/components/global-styles/font-family-item.js.map +1 -1
  50. package/build/components/global-styles/font-library-modal/collection-font-variant.js +25 -22
  51. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  52. package/build/components/global-styles/font-library-modal/context.js +7 -30
  53. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  54. package/build/components/global-styles/font-library-modal/font-card.js +24 -16
  55. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
  56. package/build/components/global-styles/font-library-modal/font-collection.js +195 -152
  57. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  58. package/build/components/global-styles/font-library-modal/font-demo.js +14 -12
  59. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  60. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +29 -20
  61. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  62. package/build/components/global-styles/font-library-modal/index.js +41 -36
  63. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  64. package/build/components/global-styles/font-library-modal/installed-fonts.js +153 -109
  65. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  66. package/build/components/global-styles/font-library-modal/library-font-details.js +16 -14
  67. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  68. package/build/components/global-styles/font-library-modal/library-font-variant.js +25 -22
  69. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  70. package/build/components/global-styles/font-library-modal/upload-fonts.js +40 -34
  71. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  72. package/build/components/global-styles/font-library-modal/utils/index.js +3 -3
  73. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  74. package/build/components/global-styles/gradients-palette-panel.js +41 -37
  75. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  76. package/build/components/global-styles/header.js +37 -28
  77. package/build/components/global-styles/header.js.map +1 -1
  78. package/build/components/global-styles/highlighted-colors.js +3 -4
  79. package/build/components/global-styles/highlighted-colors.js.map +1 -1
  80. package/build/components/global-styles/hooks.js +11 -23
  81. package/build/components/global-styles/hooks.js.map +1 -1
  82. package/build/components/global-styles/icon-with-current-color.js +2 -2
  83. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  84. package/build/components/global-styles/navigation-button.js +15 -11
  85. package/build/components/global-styles/navigation-button.js.map +1 -1
  86. package/build/components/global-styles/palette.js +39 -32
  87. package/build/components/global-styles/palette.js.map +1 -1
  88. package/build/components/global-styles/preset-colors.js +3 -4
  89. package/build/components/global-styles/preset-colors.js.map +1 -1
  90. package/build/components/global-styles/preview-colors.js +22 -20
  91. package/build/components/global-styles/preview-colors.js.map +1 -1
  92. package/build/components/global-styles/preview-iframe.js +34 -29
  93. package/build/components/global-styles/preview-iframe.js.map +1 -1
  94. package/build/components/global-styles/preview-styles.js +95 -90
  95. package/build/components/global-styles/preview-styles.js.map +1 -1
  96. package/build/components/global-styles/root-menu.js +28 -21
  97. package/build/components/global-styles/root-menu.js.map +1 -1
  98. package/build/components/global-styles/screen-background.js +6 -4
  99. package/build/components/global-styles/screen-background.js.map +1 -1
  100. package/build/components/global-styles/screen-block-list.js +33 -27
  101. package/build/components/global-styles/screen-block-list.js.map +1 -1
  102. package/build/components/global-styles/screen-block.js +62 -53
  103. package/build/components/global-styles/screen-block.js.map +1 -1
  104. package/build/components/global-styles/screen-color-palette.js +29 -19
  105. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  106. package/build/components/global-styles/screen-colors.js +18 -14
  107. package/build/components/global-styles/screen-colors.js.map +1 -1
  108. package/build/components/global-styles/screen-css.js +20 -14
  109. package/build/components/global-styles/screen-css.js.map +1 -1
  110. package/build/components/global-styles/screen-layout.js +9 -4
  111. package/build/components/global-styles/screen-layout.js.map +1 -1
  112. package/build/components/global-styles/screen-revisions/index.js +52 -42
  113. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  114. package/build/components/global-styles/screen-revisions/revisions-buttons.js +81 -70
  115. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  116. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
  117. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  118. package/build/components/global-styles/screen-root.js +76 -42
  119. package/build/components/global-styles/screen-root.js.map +1 -1
  120. package/build/components/global-styles/screen-shadows.js +22 -0
  121. package/build/components/global-styles/screen-shadows.js.map +1 -0
  122. package/build/components/global-styles/screen-style-variations.js +14 -9
  123. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  124. package/build/components/global-styles/screen-typography-element.js +50 -45
  125. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  126. package/build/components/global-styles/screen-typography.js +15 -11
  127. package/build/components/global-styles/screen-typography.js.map +1 -1
  128. package/build/components/global-styles/shadow-utils.js +230 -0
  129. package/build/components/global-styles/shadow-utils.js.map +1 -0
  130. package/build/components/global-styles/shadows-edit-panel.js +458 -0
  131. package/build/components/global-styles/shadows-edit-panel.js.map +1 -0
  132. package/build/components/global-styles/shadows-panel.js +128 -0
  133. package/build/components/global-styles/shadows-panel.js.map +1 -0
  134. package/build/components/global-styles/style-variations-container.js +67 -18
  135. package/build/components/global-styles/style-variations-container.js.map +1 -1
  136. package/build/components/global-styles/subtitle.js +5 -4
  137. package/build/components/global-styles/subtitle.js.map +1 -1
  138. package/build/components/global-styles/typography-elements.js +53 -45
  139. package/build/components/global-styles/typography-elements.js.map +1 -1
  140. package/build/components/global-styles/typography-example.js +11 -8
  141. package/build/components/global-styles/typography-example.js.map +1 -1
  142. package/build/components/global-styles/typography-panel.js +2 -2
  143. package/build/components/global-styles/typography-panel.js.map +1 -1
  144. package/build/components/global-styles/typography-preview.js +5 -4
  145. package/build/components/global-styles/typography-preview.js.map +1 -1
  146. package/build/components/global-styles/ui.js +124 -92
  147. package/build/components/global-styles/ui.js.map +1 -1
  148. package/build/components/global-styles/utils.js +28 -0
  149. package/build/components/global-styles/utils.js.map +1 -1
  150. package/build/components/global-styles/variations/variation.js +27 -22
  151. package/build/components/global-styles/variations/variation.js.map +1 -1
  152. package/build/components/global-styles/variations/variations-color.js +18 -13
  153. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  154. package/build/components/global-styles/variations/variations-panel.js +27 -17
  155. package/build/components/global-styles/variations/variations-panel.js.map +1 -1
  156. package/build/components/global-styles/variations/variations-typography.js +37 -31
  157. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  158. package/build/components/global-styles-renderer/index.js +5 -1
  159. package/build/components/global-styles-renderer/index.js.map +1 -1
  160. package/build/components/global-styles-sidebar/default-sidebar.js +22 -18
  161. package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -1
  162. package/build/components/global-styles-sidebar/index.js +36 -26
  163. package/build/components/global-styles-sidebar/index.js.map +1 -1
  164. package/build/components/layout/index.js +92 -118
  165. package/build/components/layout/index.js.map +1 -1
  166. package/build/components/layout/router.js +83 -103
  167. package/build/components/layout/router.js.map +1 -1
  168. package/build/components/media/index.js +2 -2
  169. package/build/components/media/index.js.map +1 -1
  170. package/build/components/{header-edit-mode/more-menu → more-menu}/index.js +7 -3
  171. package/build/components/more-menu/index.js.map +1 -0
  172. package/build/components/{header-edit-mode/more-menu → more-menu}/site-export.js +5 -4
  173. package/build/components/more-menu/site-export.js.map +1 -0
  174. package/build/components/{header-edit-mode/more-menu → more-menu}/welcome-guide-menu-item.js +5 -4
  175. package/build/components/more-menu/welcome-guide-menu-item.js.map +1 -0
  176. package/build/components/page/header.js +24 -20
  177. package/build/components/page/header.js.map +1 -1
  178. package/build/components/page/index.js +12 -10
  179. package/build/components/page/index.js.map +1 -1
  180. package/build/components/page-pages/index.js +133 -52
  181. package/build/components/page-pages/index.js.map +1 -1
  182. package/build/components/page-patterns/delete-category-menu-item.js +23 -20
  183. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  184. package/build/components/page-patterns/header.js +47 -32
  185. package/build/components/page-patterns/header.js.map +1 -1
  186. package/build/components/page-patterns/index.js +116 -110
  187. package/build/components/page-patterns/index.js.map +1 -1
  188. package/build/components/page-patterns/rename-category-menu-item.js +14 -11
  189. package/build/components/page-patterns/rename-category-menu-item.js.map +1 -1
  190. package/build/components/page-patterns/use-patterns.js +7 -6
  191. package/build/components/page-patterns/use-patterns.js.map +1 -1
  192. package/build/components/page-templates/index.js +78 -59
  193. package/build/components/page-templates/index.js.map +1 -1
  194. package/build/components/pagination/index.js +59 -41
  195. package/build/components/pagination/index.js.map +1 -1
  196. package/build/components/plugin-template-setting-panel/index.js +4 -2
  197. package/build/components/plugin-template-setting-panel/index.js.map +1 -1
  198. package/build/components/resizable-frame/index.js +38 -32
  199. package/build/components/resizable-frame/index.js.map +1 -1
  200. package/build/components/revisions/index.js +26 -20
  201. package/build/components/revisions/index.js.map +1 -1
  202. package/build/components/routes/link.js +5 -4
  203. package/build/components/routes/link.js.map +1 -1
  204. package/build/components/save-button/index.js +5 -4
  205. package/build/components/save-button/index.js.map +1 -1
  206. package/build/components/save-hub/index.js +12 -11
  207. package/build/components/save-hub/index.js.map +1 -1
  208. package/build/components/save-panel/index.js +34 -28
  209. package/build/components/save-panel/index.js.map +1 -1
  210. package/build/components/sidebar/index.js +14 -11
  211. package/build/components/sidebar/index.js.map +1 -1
  212. package/build/components/sidebar-button/index.js +2 -2
  213. package/build/components/sidebar-button/index.js.map +1 -1
  214. package/build/components/sidebar-dataviews/add-new-view.js +56 -48
  215. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  216. package/build/components/sidebar-dataviews/custom-dataviews-list.js +106 -89
  217. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  218. package/build/components/sidebar-dataviews/dataview-item.js +18 -12
  219. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  220. package/build/components/sidebar-dataviews/default-views.js +48 -0
  221. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  222. package/build/components/sidebar-dataviews/index.js +21 -22
  223. package/build/components/sidebar-dataviews/index.js.map +1 -1
  224. package/build/components/sidebar-navigation-item/index.js +27 -25
  225. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  226. package/build/components/sidebar-navigation-screen/index.js +51 -39
  227. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  228. package/build/components/sidebar-navigation-screen-details-footer/index.js +24 -17
  229. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  230. package/build/components/sidebar-navigation-screen-details-panel/index.js +9 -7
  231. package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  232. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +5 -4
  233. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
  234. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +5 -5
  235. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  236. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +5 -4
  237. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
  238. package/build/components/sidebar-navigation-screen-global-styles/index.js +54 -45
  239. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  240. package/build/components/sidebar-navigation-screen-main/index.js +45 -22
  241. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  242. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +5 -4
  243. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  244. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +11 -10
  245. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  246. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +53 -42
  247. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  248. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +10 -8
  249. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  250. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +43 -36
  251. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  252. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +16 -13
  253. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  254. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
  255. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  256. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +27 -23
  257. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  258. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +50 -35
  259. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  260. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +12 -9
  261. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  262. package/build/components/sidebar-navigation-screen-patterns/category-item.js +12 -10
  263. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  264. package/build/components/sidebar-navigation-screen-patterns/index.js +59 -64
  265. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  266. package/build/components/sidebar-navigation-screen-templates-browse/content.js +17 -17
  267. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  268. package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -4
  269. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  270. package/build/components/site-hub/index.js +52 -133
  271. package/build/components/site-hub/index.js.map +1 -1
  272. package/build/components/site-icon/index.js +8 -7
  273. package/build/components/site-icon/index.js.map +1 -1
  274. package/build/components/style-book/index.js +115 -99
  275. package/build/components/style-book/index.js.map +1 -1
  276. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -30
  277. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  278. package/build/components/table/index.js +23 -15
  279. package/build/components/table/index.js.map +1 -1
  280. package/build/components/template-part-converter/convert-to-regular.js +5 -4
  281. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  282. package/build/components/template-part-converter/convert-to-template-part.js +23 -17
  283. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  284. package/build/components/template-part-converter/index.js +12 -10
  285. package/build/components/template-part-converter/index.js.map +1 -1
  286. package/build/components/welcome-guide/editor.js +20 -15
  287. package/build/components/welcome-guide/editor.js.map +1 -1
  288. package/build/components/welcome-guide/image.js +13 -12
  289. package/build/components/welcome-guide/image.js.map +1 -1
  290. package/build/components/welcome-guide/index.js +4 -2
  291. package/build/components/welcome-guide/index.js.map +1 -1
  292. package/build/components/welcome-guide/page.js +18 -13
  293. package/build/components/welcome-guide/page.js.map +1 -1
  294. package/build/components/welcome-guide/styles.js +45 -28
  295. package/build/components/welcome-guide/styles.js.map +1 -1
  296. package/build/components/welcome-guide/template.js +18 -13
  297. package/build/components/welcome-guide/template.js.map +1 -1
  298. package/build/deprecated.js +4 -4
  299. package/build/deprecated.js.map +1 -1
  300. package/build/hooks/commands/use-common-commands.js +12 -24
  301. package/build/hooks/commands/use-common-commands.js.map +1 -1
  302. package/build/hooks/commands/use-edit-mode-commands.js +2 -116
  303. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  304. package/build/hooks/index.js +0 -1
  305. package/build/hooks/index.js.map +1 -1
  306. package/build/hooks/push-changes-to-global-styles/index.js +26 -16
  307. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  308. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
  309. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  310. package/build/index.js +3 -3
  311. package/build/index.js.map +1 -1
  312. package/build/store/private-actions.js +34 -13
  313. package/build/store/private-actions.js.map +1 -1
  314. package/build/store/selectors.js +2 -2
  315. package/build/store/selectors.js.map +1 -1
  316. package/build/utils/template-part-create.js +0 -62
  317. package/build/utils/template-part-create.js.map +1 -1
  318. package/build/utils/use-activate-theme.js +4 -5
  319. package/build/utils/use-activate-theme.js.map +1 -1
  320. package/build-module/components/add-new-page/index.js +34 -27
  321. package/build-module/components/add-new-page/index.js.map +1 -1
  322. package/build-module/components/add-new-pattern/index.js +98 -78
  323. package/build-module/components/add-new-pattern/index.js.map +1 -1
  324. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +36 -30
  325. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  326. package/build-module/components/add-new-template/add-custom-template-modal-content.js +121 -95
  327. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  328. package/build-module/components/add-new-template/index.js +89 -71
  329. package/build-module/components/add-new-template/index.js.map +1 -1
  330. package/build-module/components/add-new-template/utils.js +36 -17
  331. package/build-module/components/add-new-template/utils.js.map +1 -1
  332. package/build-module/components/app/index.js +11 -4
  333. package/build-module/components/app/index.js.map +1 -1
  334. package/build-module/components/block-editor/block-inspector-button.js +5 -4
  335. package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
  336. package/build-module/components/block-editor/inserter-media-categories.js +1 -1
  337. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
  338. package/build-module/components/block-editor/use-editor-iframe-props.js +80 -0
  339. package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -0
  340. package/build-module/components/canvas-loader/index.js +14 -13
  341. package/build-module/components/canvas-loader/index.js.map +1 -1
  342. package/build-module/components/dataviews-actions/index.js +7 -4
  343. package/build-module/components/dataviews-actions/index.js.map +1 -1
  344. package/build-module/components/editor/index.js +91 -185
  345. package/build-module/components/editor/index.js.map +1 -1
  346. package/build-module/components/editor/use-editor-title.js +31 -0
  347. package/build-module/components/editor/use-editor-title.js.map +1 -0
  348. package/build-module/components/editor-canvas-container/index.js +29 -30
  349. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  350. package/build-module/components/error-boundary/index.js +2 -2
  351. package/build-module/components/error-boundary/index.js.map +1 -1
  352. package/build-module/components/error-boundary/warning.js +13 -11
  353. package/build-module/components/error-boundary/warning.js.map +1 -1
  354. package/build-module/components/global-styles/background-panel.js +6 -5
  355. package/build-module/components/global-styles/background-panel.js.map +1 -1
  356. package/build-module/components/global-styles/block-preview-panel.js +19 -17
  357. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  358. package/build-module/components/global-styles/color-indicator-wrapper.js +2 -2
  359. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  360. package/build-module/components/global-styles/color-palette-panel.js +31 -29
  361. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  362. package/build-module/components/global-styles/dimensions-panel.js +2 -2
  363. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  364. package/build-module/components/global-styles/font-families.js +58 -40
  365. package/build-module/components/global-styles/font-families.js.map +1 -1
  366. package/build-module/components/global-styles/font-family-item.js +18 -13
  367. package/build-module/components/global-styles/font-family-item.js.map +1 -1
  368. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +26 -22
  369. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  370. package/build-module/components/global-styles/font-library-modal/context.js +7 -30
  371. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  372. package/build-module/components/global-styles/font-library-modal/font-card.js +25 -16
  373. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
  374. package/build-module/components/global-styles/font-library-modal/font-collection.js +198 -153
  375. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  376. package/build-module/components/global-styles/font-library-modal/font-demo.js +14 -12
  377. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  378. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +30 -20
  379. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  380. package/build-module/components/global-styles/font-library-modal/index.js +42 -36
  381. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  382. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +157 -111
  383. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  384. package/build-module/components/global-styles/font-library-modal/library-font-details.js +18 -14
  385. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  386. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +26 -22
  387. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  388. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +42 -35
  389. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  390. package/build-module/components/global-styles/font-library-modal/utils/index.js +3 -3
  391. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  392. package/build-module/components/global-styles/gradients-palette-panel.js +42 -37
  393. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  394. package/build-module/components/global-styles/header.js +38 -28
  395. package/build-module/components/global-styles/header.js.map +1 -1
  396. package/build-module/components/global-styles/highlighted-colors.js +3 -4
  397. package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
  398. package/build-module/components/global-styles/hooks.js +11 -23
  399. package/build-module/components/global-styles/hooks.js.map +1 -1
  400. package/build-module/components/global-styles/icon-with-current-color.js +2 -2
  401. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  402. package/build-module/components/global-styles/navigation-button.js +16 -11
  403. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  404. package/build-module/components/global-styles/palette.js +42 -34
  405. package/build-module/components/global-styles/palette.js.map +1 -1
  406. package/build-module/components/global-styles/preset-colors.js +3 -4
  407. package/build-module/components/global-styles/preset-colors.js.map +1 -1
  408. package/build-module/components/global-styles/preview-colors.js +22 -20
  409. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  410. package/build-module/components/global-styles/preview-iframe.js +36 -29
  411. package/build-module/components/global-styles/preview-iframe.js.map +1 -1
  412. package/build-module/components/global-styles/preview-styles.js +96 -90
  413. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  414. package/build-module/components/global-styles/root-menu.js +31 -22
  415. package/build-module/components/global-styles/root-menu.js.map +1 -1
  416. package/build-module/components/global-styles/screen-background.js +8 -4
  417. package/build-module/components/global-styles/screen-background.js.map +1 -1
  418. package/build-module/components/global-styles/screen-block-list.js +35 -27
  419. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  420. package/build-module/components/global-styles/screen-block.js +64 -53
  421. package/build-module/components/global-styles/screen-block.js.map +1 -1
  422. package/build-module/components/global-styles/screen-color-palette.js +31 -19
  423. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  424. package/build-module/components/global-styles/screen-colors.js +20 -14
  425. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  426. package/build-module/components/global-styles/screen-css.js +22 -14
  427. package/build-module/components/global-styles/screen-css.js.map +1 -1
  428. package/build-module/components/global-styles/screen-layout.js +11 -4
  429. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  430. package/build-module/components/global-styles/screen-revisions/index.js +54 -42
  431. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  432. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +82 -70
  433. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  434. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
  435. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  436. package/build-module/components/global-styles/screen-root.js +78 -42
  437. package/build-module/components/global-styles/screen-root.js.map +1 -1
  438. package/build-module/components/global-styles/screen-shadows.js +13 -0
  439. package/build-module/components/global-styles/screen-shadows.js.map +1 -0
  440. package/build-module/components/global-styles/screen-style-variations.js +16 -9
  441. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  442. package/build-module/components/global-styles/screen-typography-element.js +52 -45
  443. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  444. package/build-module/components/global-styles/screen-typography.js +17 -11
  445. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  446. package/build-module/components/global-styles/shadow-utils.js +221 -0
  447. package/build-module/components/global-styles/shadow-utils.js.map +1 -0
  448. package/build-module/components/global-styles/shadows-edit-panel.js +452 -0
  449. package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -0
  450. package/build-module/components/global-styles/shadows-panel.js +121 -0
  451. package/build-module/components/global-styles/shadows-panel.js.map +1 -0
  452. package/build-module/components/global-styles/style-variations-container.js +68 -19
  453. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  454. package/build-module/components/global-styles/subtitle.js +5 -4
  455. package/build-module/components/global-styles/subtitle.js.map +1 -1
  456. package/build-module/components/global-styles/typography-elements.js +54 -45
  457. package/build-module/components/global-styles/typography-elements.js.map +1 -1
  458. package/build-module/components/global-styles/typography-example.js +12 -8
  459. package/build-module/components/global-styles/typography-example.js.map +1 -1
  460. package/build-module/components/global-styles/typography-panel.js +2 -2
  461. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  462. package/build-module/components/global-styles/typography-preview.js +5 -4
  463. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  464. package/build-module/components/global-styles/ui.js +126 -92
  465. package/build-module/components/global-styles/ui.js.map +1 -1
  466. package/build-module/components/global-styles/utils.js +27 -0
  467. package/build-module/components/global-styles/utils.js.map +1 -1
  468. package/build-module/components/global-styles/variations/variation.js +27 -22
  469. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  470. package/build-module/components/global-styles/variations/variations-color.js +20 -14
  471. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  472. package/build-module/components/global-styles/variations/variations-panel.js +28 -18
  473. package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
  474. package/build-module/components/global-styles/variations/variations-typography.js +38 -31
  475. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  476. package/build-module/components/global-styles-renderer/index.js +5 -1
  477. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  478. package/build-module/components/global-styles-sidebar/default-sidebar.js +24 -18
  479. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -1
  480. package/build-module/components/global-styles-sidebar/index.js +37 -26
  481. package/build-module/components/global-styles-sidebar/index.js.map +1 -1
  482. package/build-module/components/layout/index.js +97 -121
  483. package/build-module/components/layout/index.js.map +1 -1
  484. package/build-module/components/layout/router.js +83 -103
  485. package/build-module/components/layout/router.js.map +1 -1
  486. package/build-module/components/media/index.js +2 -2
  487. package/build-module/components/media/index.js.map +1 -1
  488. package/build-module/components/{header-edit-mode/more-menu → more-menu}/index.js +9 -3
  489. package/build-module/components/more-menu/index.js.map +1 -0
  490. package/build-module/components/{header-edit-mode/more-menu → more-menu}/site-export.js +5 -4
  491. package/build-module/components/more-menu/site-export.js.map +1 -0
  492. package/build-module/components/{header-edit-mode/more-menu → more-menu}/welcome-guide-menu-item.js +5 -4
  493. package/build-module/components/more-menu/welcome-guide-menu-item.js.map +1 -0
  494. package/build-module/components/page/header.js +25 -19
  495. package/build-module/components/page/header.js.map +1 -1
  496. package/build-module/components/page/index.js +14 -11
  497. package/build-module/components/page/index.js.map +1 -1
  498. package/build-module/components/page-pages/index.js +138 -55
  499. package/build-module/components/page-pages/index.js.map +1 -1
  500. package/build-module/components/page-patterns/delete-category-menu-item.js +25 -20
  501. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  502. package/build-module/components/page-patterns/header.js +48 -32
  503. package/build-module/components/page-patterns/header.js.map +1 -1
  504. package/build-module/components/page-patterns/index.js +117 -110
  505. package/build-module/components/page-patterns/index.js.map +1 -1
  506. package/build-module/components/page-patterns/rename-category-menu-item.js +16 -11
  507. package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
  508. package/build-module/components/page-patterns/use-patterns.js +7 -6
  509. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  510. package/build-module/components/page-templates/index.js +80 -59
  511. package/build-module/components/page-templates/index.js.map +1 -1
  512. package/build-module/components/pagination/index.js +60 -41
  513. package/build-module/components/pagination/index.js.map +1 -1
  514. package/build-module/components/plugin-template-setting-panel/index.js +4 -2
  515. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
  516. package/build-module/components/resizable-frame/index.js +40 -32
  517. package/build-module/components/resizable-frame/index.js.map +1 -1
  518. package/build-module/components/revisions/index.js +27 -20
  519. package/build-module/components/revisions/index.js.map +1 -1
  520. package/build-module/components/routes/link.js +5 -4
  521. package/build-module/components/routes/link.js.map +1 -1
  522. package/build-module/components/save-button/index.js +5 -4
  523. package/build-module/components/save-button/index.js.map +1 -1
  524. package/build-module/components/save-hub/index.js +12 -11
  525. package/build-module/components/save-hub/index.js.map +1 -1
  526. package/build-module/components/save-panel/index.js +35 -28
  527. package/build-module/components/save-panel/index.js.map +1 -1
  528. package/build-module/components/sidebar/index.js +14 -11
  529. package/build-module/components/sidebar/index.js.map +1 -1
  530. package/build-module/components/sidebar-button/index.js +2 -2
  531. package/build-module/components/sidebar-button/index.js.map +1 -1
  532. package/build-module/components/sidebar-dataviews/add-new-view.js +58 -48
  533. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  534. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +108 -89
  535. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  536. package/build-module/components/sidebar-dataviews/dataview-item.js +19 -12
  537. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  538. package/build-module/components/sidebar-dataviews/default-views.js +49 -1
  539. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  540. package/build-module/components/sidebar-dataviews/index.js +23 -22
  541. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  542. package/build-module/components/sidebar-navigation-item/index.js +28 -25
  543. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  544. package/build-module/components/sidebar-navigation-screen/index.js +53 -39
  545. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  546. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +25 -17
  547. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  548. package/build-module/components/sidebar-navigation-screen-details-panel/index.js +10 -7
  549. package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  550. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +5 -4
  551. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
  552. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +5 -5
  553. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  554. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +5 -4
  555. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
  556. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +56 -45
  557. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  558. package/build-module/components/sidebar-navigation-screen-main/index.js +47 -22
  559. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  560. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +5 -4
  561. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  562. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +11 -10
  563. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  564. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +55 -42
  565. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  566. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +10 -8
  567. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  568. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +44 -36
  569. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  570. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +17 -13
  571. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  572. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
  573. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  574. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +27 -23
  575. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  576. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +52 -35
  577. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  578. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +14 -9
  579. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  580. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +12 -10
  581. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  582. package/build-module/components/sidebar-navigation-screen-patterns/index.js +61 -64
  583. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  584. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +18 -17
  585. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  586. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -4
  587. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  588. package/build-module/components/site-hub/index.js +56 -136
  589. package/build-module/components/site-hub/index.js.map +1 -1
  590. package/build-module/components/site-icon/index.js +8 -7
  591. package/build-module/components/site-icon/index.js.map +1 -1
  592. package/build-module/components/style-book/index.js +116 -99
  593. package/build-module/components/style-book/index.js.map +1 -1
  594. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -30
  595. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  596. package/build-module/components/table/index.js +24 -15
  597. package/build-module/components/table/index.js.map +1 -1
  598. package/build-module/components/template-part-converter/convert-to-regular.js +5 -4
  599. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  600. package/build-module/components/template-part-converter/convert-to-template-part.js +25 -16
  601. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  602. package/build-module/components/template-part-converter/index.js +12 -10
  603. package/build-module/components/template-part-converter/index.js.map +1 -1
  604. package/build-module/components/welcome-guide/editor.js +22 -15
  605. package/build-module/components/welcome-guide/editor.js.map +1 -1
  606. package/build-module/components/welcome-guide/image.js +14 -12
  607. package/build-module/components/welcome-guide/image.js.map +1 -1
  608. package/build-module/components/welcome-guide/index.js +6 -2
  609. package/build-module/components/welcome-guide/index.js.map +1 -1
  610. package/build-module/components/welcome-guide/page.js +20 -13
  611. package/build-module/components/welcome-guide/page.js.map +1 -1
  612. package/build-module/components/welcome-guide/styles.js +47 -28
  613. package/build-module/components/welcome-guide/styles.js.map +1 -1
  614. package/build-module/components/welcome-guide/template.js +20 -13
  615. package/build-module/components/welcome-guide/template.js.map +1 -1
  616. package/build-module/deprecated.js +4 -4
  617. package/build-module/deprecated.js.map +1 -1
  618. package/build-module/hooks/commands/use-common-commands.js +12 -23
  619. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  620. package/build-module/hooks/commands/use-edit-mode-commands.js +4 -118
  621. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  622. package/build-module/hooks/index.js +0 -1
  623. package/build-module/hooks/index.js.map +1 -1
  624. package/build-module/hooks/push-changes-to-global-styles/index.js +28 -16
  625. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  626. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
  627. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  628. package/build-module/index.js +3 -3
  629. package/build-module/index.js.map +1 -1
  630. package/build-module/store/private-actions.js +34 -13
  631. package/build-module/store/private-actions.js.map +1 -1
  632. package/build-module/store/selectors.js +2 -2
  633. package/build-module/store/selectors.js.map +1 -1
  634. package/build-module/utils/template-part-create.js +0 -52
  635. package/build-module/utils/template-part-create.js.map +1 -1
  636. package/build-module/utils/use-activate-theme.js +4 -5
  637. package/build-module/utils/use-activate-theme.js.map +1 -1
  638. package/build-style/style-rtl.css +327 -634
  639. package/build-style/style.css +327 -634
  640. package/package.json +43 -44
  641. package/src/components/add-new-pattern/index.js +46 -37
  642. package/src/components/add-new-template/index.js +2 -0
  643. package/src/components/add-new-template/utils.js +77 -39
  644. package/src/components/block-editor/inserter-media-categories.js +1 -3
  645. package/src/components/block-editor/style.scss +12 -136
  646. package/src/components/block-editor/use-editor-iframe-props.js +79 -0
  647. package/src/components/canvas-loader/index.js +5 -2
  648. package/src/components/dataviews-actions/index.js +7 -2
  649. package/src/components/editor/index.js +116 -290
  650. package/src/components/editor/style.scss +1 -16
  651. package/src/components/editor/use-editor-title.js +35 -0
  652. package/src/components/editor-canvas-container/index.js +30 -35
  653. package/src/components/editor-canvas-container/style.scss +16 -0
  654. package/src/components/global-styles/background-panel.js +3 -2
  655. package/src/components/global-styles/color-palette-panel.js +1 -1
  656. package/src/components/global-styles/font-families.js +25 -18
  657. package/src/components/global-styles/font-family-item.js +2 -2
  658. package/src/components/global-styles/font-library-modal/collection-font-variant.js +2 -1
  659. package/src/components/global-styles/font-library-modal/context.js +6 -44
  660. package/src/components/global-styles/font-library-modal/font-collection.js +3 -5
  661. package/src/components/global-styles/font-library-modal/installed-fonts.js +42 -12
  662. package/src/components/global-styles/font-library-modal/library-font-variant.js +2 -1
  663. package/src/components/global-styles/font-library-modal/upload-fonts.js +1 -4
  664. package/src/components/global-styles/font-library-modal/utils/index.js +1 -1
  665. package/src/components/global-styles/hooks.js +10 -37
  666. package/src/components/global-styles/palette.js +9 -18
  667. package/src/components/global-styles/root-menu.js +16 -12
  668. package/src/components/global-styles/screen-block.js +1 -1
  669. package/src/components/global-styles/screen-css.js +1 -1
  670. package/src/components/global-styles/screen-layout.js +9 -2
  671. package/src/components/global-styles/screen-revisions/index.js +6 -0
  672. package/src/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
  673. package/src/components/global-styles/screen-revisions/style.scss +4 -8
  674. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
  675. package/src/components/global-styles/screen-shadows.js +13 -0
  676. package/src/components/global-styles/screen-typography.js +1 -1
  677. package/src/components/global-styles/shadow-utils.js +158 -0
  678. package/src/components/global-styles/shadows-edit-panel.js +555 -0
  679. package/src/components/global-styles/shadows-panel.js +147 -0
  680. package/src/components/global-styles/style-variations-container.js +73 -10
  681. package/src/components/global-styles/style.scss +54 -5
  682. package/src/components/global-styles/test/shadow-utils.spec.js +251 -0
  683. package/src/components/global-styles/test/utils.spec.js +59 -0
  684. package/src/components/global-styles/ui.js +10 -6
  685. package/src/components/global-styles/utils.js +27 -0
  686. package/src/components/global-styles/variations/style.scss +7 -4
  687. package/src/components/global-styles/variations/variation.js +2 -0
  688. package/src/components/global-styles/variations/variations-color.js +8 -4
  689. package/src/components/global-styles/variations/variations-panel.js +16 -5
  690. package/src/components/global-styles/variations/variations-typography.js +2 -1
  691. package/src/components/global-styles-renderer/index.js +7 -1
  692. package/src/components/global-styles-sidebar/index.js +2 -0
  693. package/src/components/layout/index.js +24 -69
  694. package/src/components/layout/router.js +64 -79
  695. package/src/components/layout/style.scss +29 -66
  696. package/src/components/{header-edit-mode/more-menu → more-menu}/index.js +1 -1
  697. package/src/components/page/header.js +17 -13
  698. package/src/components/page/index.js +1 -5
  699. package/src/components/page/style.scss +21 -7
  700. package/src/components/page-pages/index.js +154 -30
  701. package/src/components/page-pages/style.scss +15 -0
  702. package/src/components/page-patterns/delete-category-menu-item.js +1 -2
  703. package/src/components/page-patterns/header.js +45 -33
  704. package/src/components/page-patterns/index.js +29 -63
  705. package/src/components/page-patterns/style.scss +21 -14
  706. package/src/components/page-patterns/use-patterns.js +13 -6
  707. package/src/components/pagination/index.js +21 -16
  708. package/src/components/resizable-frame/index.js +1 -1
  709. package/src/components/save-panel/index.js +2 -4
  710. package/src/components/sidebar-dataviews/add-new-view.js +5 -5
  711. package/src/components/sidebar-dataviews/custom-dataviews-list.js +5 -7
  712. package/src/components/sidebar-dataviews/dataview-item.js +8 -4
  713. package/src/components/sidebar-dataviews/default-views.js +61 -1
  714. package/src/components/sidebar-dataviews/index.js +4 -9
  715. package/src/components/sidebar-navigation-item/index.js +7 -7
  716. package/src/components/sidebar-navigation-screen/index.js +1 -1
  717. package/src/components/sidebar-navigation-screen/style.scss +2 -2
  718. package/src/components/sidebar-navigation-screen-global-styles/index.js +8 -2
  719. package/src/components/sidebar-navigation-screen-main/index.js +14 -4
  720. package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -0
  721. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
  722. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  723. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -3
  724. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +0 -61
  725. package/src/components/sidebar-navigation-screen-patterns/category-item.js +15 -4
  726. package/src/components/sidebar-navigation-screen-patterns/index.js +11 -17
  727. package/src/components/sidebar-navigation-screen-templates-browse/content.js +1 -1
  728. package/src/components/sidebar-navigation-screen-templates-browse/index.js +1 -1
  729. package/src/components/site-hub/index.js +56 -148
  730. package/src/components/site-hub/style.scss +47 -13
  731. package/src/components/site-icon/style.scss +0 -4
  732. package/src/components/style-book/index.js +1 -1
  733. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +18 -23
  734. package/src/components/template-part-converter/convert-to-template-part.js +4 -1
  735. package/src/hooks/commands/use-common-commands.js +12 -23
  736. package/src/hooks/commands/use-edit-mode-commands.js +4 -118
  737. package/src/hooks/index.js +0 -1
  738. package/src/hooks/push-changes-to-global-styles/index.js +3 -1
  739. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +5 -1
  740. package/src/index.js +1 -1
  741. package/src/store/private-actions.js +59 -23
  742. package/src/store/selectors.js +2 -2
  743. package/src/style.scss +0 -6
  744. package/src/utils/template-part-create.js +0 -67
  745. package/src/utils/use-activate-theme.js +2 -2
  746. package/build/components/block-editor/editor-canvas.js +0 -139
  747. package/build/components/block-editor/editor-canvas.js.map +0 -1
  748. package/build/components/block-editor/resizable-editor.js +0 -86
  749. package/build/components/block-editor/resizable-editor.js.map +0 -1
  750. package/build/components/block-editor/resize-handle.js +0 -57
  751. package/build/components/block-editor/resize-handle.js.map +0 -1
  752. package/build/components/block-editor/site-editor-canvas.js +0 -95
  753. package/build/components/block-editor/site-editor-canvas.js.map +0 -1
  754. package/build/components/code-editor/index.js +0 -111
  755. package/build/components/code-editor/index.js.map +0 -1
  756. package/build/components/create-template-part-modal/index.js +0 -151
  757. package/build/components/create-template-part-modal/index.js.map +0 -1
  758. package/build/components/header-edit-mode/index.js +0 -50
  759. package/build/components/header-edit-mode/index.js.map +0 -1
  760. package/build/components/header-edit-mode/more-menu/index.js.map +0 -1
  761. package/build/components/header-edit-mode/more-menu/site-export.js.map +0 -1
  762. package/build/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +0 -1
  763. package/build/components/page-patterns/dataviews-pattern-actions.js +0 -311
  764. package/build/components/page-patterns/dataviews-pattern-actions.js.map +0 -1
  765. package/build/components/pattern-modal/duplicate.js +0 -70
  766. package/build/components/pattern-modal/duplicate.js.map +0 -1
  767. package/build/components/pattern-modal/index.js +0 -23
  768. package/build/components/pattern-modal/index.js.map +0 -1
  769. package/build/components/pattern-modal/rename.js +0 -45
  770. package/build/components/pattern-modal/rename.js.map +0 -1
  771. package/build/components/rename-post-menu-item/index.js +0 -109
  772. package/build/components/rename-post-menu-item/index.js.map +0 -1
  773. package/build/components/sidebar-navigation-screen-page/index.js +0 -163
  774. package/build/components/sidebar-navigation-screen-page/index.js.map +0 -1
  775. package/build/components/sidebar-navigation-screen-page/page-details.js +0 -127
  776. package/build/components/sidebar-navigation-screen-page/page-details.js.map +0 -1
  777. package/build/components/sidebar-navigation-screen-page/status-label.js +0 -65
  778. package/build/components/sidebar-navigation-screen-page/status-label.js.map +0 -1
  779. package/build/components/sidebar-navigation-screen-pattern/index.js +0 -67
  780. package/build/components/sidebar-navigation-screen-pattern/index.js.map +0 -1
  781. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +0 -38
  782. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +0 -1
  783. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +0 -29
  784. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +0 -1
  785. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +0 -37
  786. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +0 -1
  787. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +0 -45
  788. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +0 -1
  789. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +0 -88
  790. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +0 -1
  791. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js +0 -29
  792. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +0 -1
  793. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +0 -138
  794. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +0 -1
  795. package/build/components/sidebar-navigation-screen-template/home-template-details.js +0 -110
  796. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +0 -1
  797. package/build/components/sidebar-navigation-screen-template/index.js +0 -121
  798. package/build/components/sidebar-navigation-screen-template/index.js.map +0 -1
  799. package/build/components/sidebar-navigation-screen-template/template-areas.js +0 -117
  800. package/build/components/sidebar-navigation-screen-template/template-areas.js.map +0 -1
  801. package/build/components/template-actions/index.js +0 -131
  802. package/build/components/template-actions/index.js.map +0 -1
  803. package/build/hooks/components.js +0 -10
  804. package/build/hooks/components.js.map +0 -1
  805. package/build/utils/get-is-list-page.js +0 -28
  806. package/build/utils/get-is-list-page.js.map +0 -1
  807. package/build-module/components/block-editor/editor-canvas.js +0 -131
  808. package/build-module/components/block-editor/editor-canvas.js.map +0 -1
  809. package/build-module/components/block-editor/resizable-editor.js +0 -79
  810. package/build-module/components/block-editor/resizable-editor.js.map +0 -1
  811. package/build-module/components/block-editor/resize-handle.js +0 -50
  812. package/build-module/components/block-editor/resize-handle.js.map +0 -1
  813. package/build-module/components/block-editor/site-editor-canvas.js +0 -86
  814. package/build-module/components/block-editor/site-editor-canvas.js.map +0 -1
  815. package/build-module/components/code-editor/index.js +0 -103
  816. package/build-module/components/code-editor/index.js.map +0 -1
  817. package/build-module/components/create-template-part-modal/index.js +0 -143
  818. package/build-module/components/create-template-part-modal/index.js.map +0 -1
  819. package/build-module/components/header-edit-mode/index.js +0 -42
  820. package/build-module/components/header-edit-mode/index.js.map +0 -1
  821. package/build-module/components/header-edit-mode/more-menu/index.js.map +0 -1
  822. package/build-module/components/header-edit-mode/more-menu/site-export.js.map +0 -1
  823. package/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +0 -1
  824. package/build-module/components/page-patterns/dataviews-pattern-actions.js +0 -304
  825. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +0 -1
  826. package/build-module/components/pattern-modal/duplicate.js +0 -62
  827. package/build-module/components/pattern-modal/duplicate.js.map +0 -1
  828. package/build-module/components/pattern-modal/index.js +0 -14
  829. package/build-module/components/pattern-modal/index.js.map +0 -1
  830. package/build-module/components/pattern-modal/rename.js +0 -37
  831. package/build-module/components/pattern-modal/rename.js.map +0 -1
  832. package/build-module/components/rename-post-menu-item/index.js +0 -102
  833. package/build-module/components/rename-post-menu-item/index.js.map +0 -1
  834. package/build-module/components/sidebar-navigation-screen-page/index.js +0 -155
  835. package/build-module/components/sidebar-navigation-screen-page/index.js.map +0 -1
  836. package/build-module/components/sidebar-navigation-screen-page/page-details.js +0 -120
  837. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +0 -1
  838. package/build-module/components/sidebar-navigation-screen-page/status-label.js +0 -57
  839. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +0 -1
  840. package/build-module/components/sidebar-navigation-screen-pattern/index.js +0 -59
  841. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +0 -1
  842. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +0 -30
  843. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +0 -1
  844. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +0 -20
  845. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +0 -1
  846. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +0 -29
  847. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +0 -1
  848. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +0 -36
  849. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +0 -1
  850. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +0 -80
  851. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +0 -1
  852. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js +0 -22
  853. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +0 -1
  854. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +0 -130
  855. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +0 -1
  856. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +0 -103
  857. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +0 -1
  858. package/build-module/components/sidebar-navigation-screen-template/index.js +0 -113
  859. package/build-module/components/sidebar-navigation-screen-template/index.js.map +0 -1
  860. package/build-module/components/sidebar-navigation-screen-template/template-areas.js +0 -109
  861. package/build-module/components/sidebar-navigation-screen-template/template-areas.js.map +0 -1
  862. package/build-module/components/template-actions/index.js +0 -123
  863. package/build-module/components/template-actions/index.js.map +0 -1
  864. package/build-module/hooks/components.js +0 -7
  865. package/build-module/hooks/components.js.map +0 -1
  866. package/build-module/utils/get-is-list-page.js +0 -22
  867. package/build-module/utils/get-is-list-page.js.map +0 -1
  868. package/src/components/block-editor/editor-canvas.js +0 -158
  869. package/src/components/block-editor/resizable-editor.js +0 -82
  870. package/src/components/block-editor/resize-handle.js +0 -66
  871. package/src/components/block-editor/site-editor-canvas.js +0 -107
  872. package/src/components/code-editor/index.js +0 -94
  873. package/src/components/code-editor/style.scss +0 -95
  874. package/src/components/create-template-part-modal/index.js +0 -199
  875. package/src/components/create-template-part-modal/style.scss +0 -69
  876. package/src/components/header-edit-mode/index.js +0 -51
  877. package/src/components/header-edit-mode/style.scss +0 -3
  878. package/src/components/page-patterns/dataviews-pattern-actions.js +0 -350
  879. package/src/components/pattern-modal/duplicate.js +0 -55
  880. package/src/components/pattern-modal/index.js +0 -19
  881. package/src/components/pattern-modal/rename.js +0 -30
  882. package/src/components/rename-post-menu-item/index.js +0 -138
  883. package/src/components/sidebar-navigation-screen-page/index.js +0 -204
  884. package/src/components/sidebar-navigation-screen-page/page-details.js +0 -161
  885. package/src/components/sidebar-navigation-screen-page/status-label.js +0 -71
  886. package/src/components/sidebar-navigation-screen-page/style.scss +0 -69
  887. package/src/components/sidebar-navigation-screen-pattern/index.js +0 -57
  888. package/src/components/sidebar-navigation-screen-pattern/style.scss +0 -26
  889. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +0 -31
  890. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +0 -21
  891. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +0 -33
  892. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +0 -36
  893. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +0 -98
  894. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js +0 -32
  895. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +0 -205
  896. package/src/components/sidebar-navigation-screen-template/home-template-details.js +0 -144
  897. package/src/components/sidebar-navigation-screen-template/index.js +0 -134
  898. package/src/components/sidebar-navigation-screen-template/style.scss +0 -53
  899. package/src/components/sidebar-navigation-screen-template/template-areas.js +0 -135
  900. package/src/components/template-actions/index.js +0 -165
  901. package/src/hooks/components.js +0 -11
  902. package/src/utils/get-is-list-page.js +0 -23
  903. package/src/utils/test/template-part-create.js +0 -63
  904. /package/src/components/{header-edit-mode/more-menu → more-menu}/site-export.js +0 -0
  905. /package/src/components/{header-edit-mode/more-menu → more-menu}/welcome-guide-menu-item.js +0 -0
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _react = require("react");
9
8
  var _components = require("@wordpress/components");
10
9
  var _i18n = require("@wordpress/i18n");
11
10
  var _blockEditor = require("@wordpress/block-editor");
@@ -14,6 +13,7 @@ var _data = require("@wordpress/data");
14
13
  var _element = require("@wordpress/element");
15
14
  var _lockUnlock = require("../../lock-unlock");
16
15
  var _editorCanvasContainer = _interopRequireDefault(require("../editor-canvas-container"));
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
17
  /**
18
18
  * WordPress dependencies
19
19
  */
@@ -54,27 +54,33 @@ function Revisions({
54
54
  }), [originalSettings]);
55
55
  const [globalStyles] = useGlobalStylesOutputWithConfig(mergedConfig);
56
56
  const editorStyles = !isObjectEmpty(globalStyles) && !isObjectEmpty(userConfig) ? globalStyles : settings.styles;
57
- return (0, _react.createElement)(_editorCanvasContainer.default, {
57
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_editorCanvasContainer.default, {
58
58
  title: (0, _i18n.__)('Revisions'),
59
59
  closeButtonLabel: (0, _i18n.__)('Close revisions'),
60
- enableResizing: true
61
- }, (0, _react.createElement)(_blockEditor.__unstableIframe, {
62
- className: "edit-site-revisions__iframe",
63
- name: "revisions",
64
- tabIndex: 0
65
- }, (0, _react.createElement)(_blockEditor.__unstableEditorStyles, {
66
- styles: editorStyles
67
- }), (0, _react.createElement)("style", null,
68
- // Forming a "block formatting context" to prevent margin collapsing.
69
- // @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
70
- `.is-root-container { display: flow-root; }`), (0, _react.createElement)(_components.Disabled, {
71
- className: "edit-site-revisions__example-preview__content"
72
- }, (0, _react.createElement)(ExperimentalBlockEditorProvider, {
73
- value: renderedBlocksArray,
74
- settings: settings
75
- }, (0, _react.createElement)(_blockEditor.BlockList, {
76
- renderAppender: false
77
- })))));
60
+ enableResizing: true,
61
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_blockEditor.__unstableIframe, {
62
+ className: "edit-site-revisions__iframe",
63
+ name: "revisions",
64
+ tabIndex: 0,
65
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.__unstableEditorStyles, {
66
+ styles: editorStyles
67
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("style", {
68
+ children:
69
+ // Forming a "block formatting context" to prevent margin collapsing.
70
+ // @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
71
+ `.is-root-container { display: flow-root; }`
72
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Disabled, {
73
+ className: "edit-site-revisions__example-preview__content",
74
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ExperimentalBlockEditorProvider, {
75
+ value: renderedBlocksArray,
76
+ settings: settings,
77
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockList, {
78
+ renderAppender: false
79
+ })
80
+ })
81
+ })]
82
+ })
83
+ });
78
84
  }
79
85
  var _default = exports.default = Revisions;
80
86
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_blockEditor","_editor","_data","_element","_lockUnlock","_editorCanvasContainer","_interopRequireDefault","ExperimentalBlockEditorProvider","GlobalStylesContext","useGlobalStylesOutputWithConfig","unlock","blockEditorPrivateApis","mergeBaseAndUserConfigs","editorPrivateApis","isObjectEmpty","object","Object","keys","length","Revisions","userConfig","blocks","base","baseConfig","useContext","mergedConfig","useMemo","renderedBlocksArray","Array","isArray","originalSettings","useSelect","select","blockEditorStore","getSettings","settings","__unstableIsPreviewMode","globalStyles","editorStyles","styles","_react","createElement","default","title","__","closeButtonLabel","enableResizing","__unstableIframe","className","name","tabIndex","__unstableEditorStyles","Disabled","value","BlockList","renderAppender","_default","exports"],"sources":["@wordpress/edit-site/src/components/revisions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Disabled } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n} from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nimport { unlock } from '../../lock-unlock';\nimport EditorCanvasContainer from '../editor-canvas-container';\n\nconst {\n\tExperimentalBlockEditorProvider,\n\tGlobalStylesContext,\n\tuseGlobalStylesOutputWithConfig,\n} = unlock( blockEditorPrivateApis );\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\nfunction Revisions( { userConfig, blocks } ) {\n\tconst { base: baseConfig } = useContext( GlobalStylesContext );\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\tconst renderedBlocksArray = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),\n\t\t[ originalSettings ]\n\t);\n\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst editorStyles =\n\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )\n\t\t\t? globalStyles\n\t\t\t: settings.styles;\n\n\treturn (\n\t\t<EditorCanvasContainer\n\t\t\ttitle={ __( 'Revisions' ) }\n\t\t\tcloseButtonLabel={ __( 'Close revisions' ) }\n\t\t\tenableResizing\n\t\t>\n\t\t\t<Iframe\n\t\t\t\tclassName=\"edit-site-revisions__iframe\"\n\t\t\t\tname=\"revisions\"\n\t\t\t\ttabIndex={ 0 }\n\t\t\t>\n\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t<style>\n\t\t\t\t\t{\n\t\t\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\t\t\t`.is-root-container { display: flow-root; }`\n\t\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t\t<Disabled className=\"edit-site-revisions__example-preview__content\">\n\t\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\t\tvalue={ renderedBlocksArray }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList renderAppender={ false } />\n\t\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t\t</Disabled>\n\t\t\t</Iframe>\n\t\t</EditorCanvasContainer>\n\t);\n}\n\nexport default Revisions;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAOA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAMA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAC,sBAAA,CAAAR,OAAA;AArBA;AACA;AACA;;AAcA;AACA;AACA;;AAKA,MAAM;EACLS,+BAA+B;EAC/BC,mBAAmB;EACnBC;AACD,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AACpC,MAAM;EAAEC;AAAwB,CAAC,GAAG,IAAAF,kBAAM,EAAEG,mBAAkB,CAAC;AAE/D,SAASC,aAAaA,CAAEC,MAAM,EAAG;EAChC,OAAO,CAAEA,MAAM,IAAIC,MAAM,CAACC,IAAI,CAAEF,MAAO,CAAC,CAACG,MAAM,KAAK,CAAC;AACtD;AAEA,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E,iBAAkB,CAAG;IAC5CE,cAAc;EAAA,GAEd,IAAAN,MAAA,CAAAC,aAAA,EAACzC,YAAA,CAAA+C,gBAAM;IACNC,SAAS,EAAC,6BAA6B;IACvCC,IAAI,EAAC,WAAW;IAChBC,QAAQ,EAAG;EAAG,GAEd,IAAAV,MAAA,CAAAC,aAAA,EAACzC,YAAA,CAAAmD,sBAAY;IAACZ,MAAM,EAAGD;EAAc,CAAE,CAAC,EACxC,IAAAE,MAAA,CAAAC,aAAA;EAEE;EACA;EACC,4CAEI,CAAC,EACR,IAAAD,MAAA,CAAAC,aAAA,EAAC5C,WAAA,CAAAuD,QAAQ;IAACJ,SAAS,EAAC;EAA+C,GAClE,IAAAR,MAAA,CAAAC,aAAA,EAAClC,+BAA+B;IAC/B8C,KAAK,EAAG1B,mBAAqB;IAC7BQ,QAAQ,EAAGA;EAAU,GAErB,IAAAK,MAAA,CAAAC,aAAA,EAACzC,YAAA,CAAAsD,SAAS;IAACC,cAAc,EAAG;EAAO,CAAE,CACL,CACxB,CACH,CACc,CAAC;AAE1B;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAf,OAAA,GAEcvB,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_blockEditor","_editor","_data","_element","_lockUnlock","_editorCanvasContainer","_interopRequireDefault","_jsxRuntime","ExperimentalBlockEditorProvider","GlobalStylesContext","useGlobalStylesOutputWithConfig","unlock","blockEditorPrivateApis","mergeBaseAndUserConfigs","editorPrivateApis","isObjectEmpty","object","Object","keys","length","Revisions","userConfig","blocks","base","baseConfig","useContext","mergedConfig","useMemo","renderedBlocksArray","Array","isArray","originalSettings","useSelect","select","blockEditorStore","getSettings","settings","__unstableIsPreviewMode","globalStyles","editorStyles","styles","jsx","default","title","__","closeButtonLabel","enableResizing","children","jsxs","__unstableIframe","className","name","tabIndex","__unstableEditorStyles","Disabled","value","BlockList","renderAppender","_default","exports"],"sources":["@wordpress/edit-site/src/components/revisions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Disabled } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n} from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nimport { unlock } from '../../lock-unlock';\nimport EditorCanvasContainer from '../editor-canvas-container';\n\nconst {\n\tExperimentalBlockEditorProvider,\n\tGlobalStylesContext,\n\tuseGlobalStylesOutputWithConfig,\n} = unlock( blockEditorPrivateApis );\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\nfunction Revisions( { userConfig, blocks } ) {\n\tconst { base: baseConfig } = useContext( GlobalStylesContext );\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\tconst renderedBlocksArray = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),\n\t\t[ originalSettings ]\n\t);\n\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst editorStyles =\n\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )\n\t\t\t? globalStyles\n\t\t\t: settings.styles;\n\n\treturn (\n\t\t<EditorCanvasContainer\n\t\t\ttitle={ __( 'Revisions' ) }\n\t\t\tcloseButtonLabel={ __( 'Close revisions' ) }\n\t\t\tenableResizing\n\t\t>\n\t\t\t<Iframe\n\t\t\t\tclassName=\"edit-site-revisions__iframe\"\n\t\t\t\tname=\"revisions\"\n\t\t\t\ttabIndex={ 0 }\n\t\t\t>\n\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t<style>\n\t\t\t\t\t{\n\t\t\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\t\t\t`.is-root-container { display: flow-root; }`\n\t\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t\t<Disabled className=\"edit-site-revisions__example-preview__content\">\n\t\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\t\tvalue={ renderedBlocksArray }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList renderAppender={ false } />\n\t\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t\t</Disabled>\n\t\t\t</Iframe>\n\t\t</EditorCanvasContainer>\n\t);\n}\n\nexport default Revisions;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAOA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAMA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAC,sBAAA,CAAAR,OAAA;AAA+D,IAAAS,WAAA,GAAAT,OAAA;AArB/D;AACA;AACA;;AAcA;AACA;AACA;;AAKA,MAAM;EACLU,+BAA+B;EAC/BC,mBAAmB;EACnBC;AACD,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AACpC,MAAM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AW,CAAC,GAC7DiB,YAAY,GACZF,QAAQ,CAACI,MAAM;EAEnB,oBACC,IAAAjC,WAAA,CAAAkC,GAAA,EAACpC,sBAAA,CAAAqC,OAAqB;IACrBC,KAAK,EAAG,IAAAC,QAAE,EAAE,WAAY,CAAG;IAC3BC,gBAAgB,EAAG,IAAAD,QAAE,EAAE,iBAAkB,CAAG;IAC5CE,cAAc;IAAAC,QAAA,eAEd,IAAAxC,WAAA,CAAAyC,IAAA,EAAChD,YAAA,CAAAiD,gBAAM;MACNC,SAAS,EAAC,6BAA6B;MACvCC,IAAI,EAAC,WAAW;MAChBC,QAAQ,EAAG,CAAG;MAAAL,QAAA,gBAEd,IAAAxC,WAAA,CAAAkC,GAAA,EAACzC,YAAA,CAAAqD,sBAAY;QAACb,MAAM,EAAGD;MAAc,CAAE,CAAC,eACxC,IAAAhC,WAAA,CAAAkC,GAAA;QAAAM,QAAA;QAEE;QACA;QACC;MAA2C,CAEvC,CAAC,eACR,IAAAxC,WAAA,CAAAkC,GAAA,EAAC5C,WAAA,CAAAyD,QAAQ;QAACJ,SAAS,EAAC,+CAA+C;QAAAH,QAAA,eAClE,IAAAxC,WAAA,CAAAkC,GAAA,EAACjC,+BAA+B;UAC/B+C,KAAK,EAAG3B,mBAAqB;UAC7BQ,QAAQ,EAAGA,QAAU;UAAAW,QAAA,eAErB,IAAAxC,WAAA,CAAAkC,GAAA,EAACzC,YAAA,CAAAwD,SAAS;YAACC,cAAc,EAAG;UAAO,CAAE;QAAC,CACN;MAAC,CACzB,CAAC;IAAA,CACJ;EAAC,CACa,CAAC;AAE1B;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjB,OAAA,GAEctB,SAAS","ignoreList":[]}
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = Link;
7
7
  exports.useLink = useLink;
8
- var _react = require("react");
9
8
  var _url = require("@wordpress/url");
10
9
  var _router = require("@wordpress/router");
11
10
  var _lockUnlock = require("../../lock-unlock");
12
11
  var _isPreviewingTheme = require("../../utils/is-previewing-theme");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
13
  /**
14
14
  * WordPress dependencies
15
15
  */
@@ -56,10 +56,11 @@ function Link({
56
56
  href,
57
57
  onClick
58
58
  } = useLink(params, state, shouldReplace);
59
- return (0, _react.createElement)("a", {
59
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
60
60
  href: href,
61
61
  onClick: onClick,
62
- ...props
63
- }, children);
62
+ ...props,
63
+ children: children
64
+ });
64
65
  }
65
66
  //# sourceMappingURL=link.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_url","require","_router","_lockUnlock","_isPreviewingTheme","useHistory","unlock","routerPrivateApis","useLink","params","state","shouldReplace","history","onClick","event","preventDefault","replace","push","currentArgs","getQueryArgs","window","location","href","currentUrlWithoutArgs","removeQueryArgs","Object","keys","isPreviewingTheme","wp_theme_preview","currentlyPreviewingTheme","newUrl","addQueryArgs","Link","children","props","_react","createElement"],"sources":["@wordpress/edit-site/src/components/routes/link.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs, getQueryArgs, removeQueryArgs } from '@wordpress/url';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport function useLink( params, state, shouldReplace = false ) {\n\tconst history = useHistory();\n\tfunction onClick( event ) {\n\t\tevent?.preventDefault();\n\n\t\tif ( shouldReplace ) {\n\t\t\thistory.replace( params, state );\n\t\t} else {\n\t\t\thistory.push( params, state );\n\t\t}\n\t}\n\n\tconst currentArgs = getQueryArgs( window.location.href );\n\tconst currentUrlWithoutArgs = removeQueryArgs(\n\t\twindow.location.href,\n\t\t...Object.keys( currentArgs )\n\t);\n\n\tif ( isPreviewingTheme() ) {\n\t\tparams = {\n\t\t\t...params,\n\t\t\twp_theme_preview: currentlyPreviewingTheme(),\n\t\t};\n\t}\n\n\tconst newUrl = addQueryArgs( currentUrlWithoutArgs, params );\n\n\treturn {\n\t\thref: newUrl,\n\t\tonClick,\n\t};\n}\n\nexport default function Link( {\n\tparams = {},\n\tstate,\n\treplace: shouldReplace = false,\n\tchildren,\n\t...props\n} ) {\n\tconst { href, onClick } = useLink( params, state, shouldReplace );\n\n\treturn (\n\t\t<a href={ href } onClick={ onClick } { ...props }>\n\t\t\t{ children }\n\t\t</a>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAOA,MAAM;EAAEI;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAE3C,SAASC,OAAOA,CAAEC,MAAM,EAAEC,KAAK,EAAEC,aAAa,GAAG,KAAK,EAAG;EAC/D,MAAMC,OAAO,GAAGP,UAAU,CAAC,CAAC;EAC5B,SAASQ,OAAOA,CAAEC,KAAK,EAAG;IACzBA,KAAK,EAAEC,cAAc,CAAC,CAAC;IAEvB,IAAKJ,aAAa,EAAG;MACpBC,OAAO,CAACI,OAAO,CAAEP,MAAM,EAAEC,KAAM,CAAC;IACjC,CAAC,MAAM;MACNE,OAAO,CAACK,IAAI,CAAER,MAAM,EAAEC,KAAM,CAAC;IAC9B;EACD;EAEA,MAAMQ,WAAW,GAAG,IAAAC,iBAAY,EAAEC,MAAM,CAACC,QAAQ,CAACC,IAAK,CAAC;EACxD,MAAMC,qBAAqB,GAAG,IAAAC,oBAAe,EAC5CJ,MAAM,CAACC,QAAQ,CAACC,IAAI,EACpB,GAAGG,MAAM,CAACC,IAAI,CAAER,WAAY,CAC7B,CAAC;EAED,IAAK,IAAAS,oCAAiB,EAAC,CAAC,EAAG;IAC1BlB,MAAM,GAAG;MACR,GAAGA,MAAM;MACTmB,gBAAgB,EAAE,IAAAC,2CAAwB,EAAC;IAC5C,CAAC;EACF;EAEA,MAAMC,MAAM,GAAG,IAAAC,iBAAY,EAAER,qBAAqB,EAAEd,MAAO,CAAC;EAE5D,OAAO;IACNa,IAAI,EAAEQ,MAAM;IACZjB;EACD,CAAC;AACF;AAEe,SAASmB,IAAIA,CAAE;EAC7BvB,MAAM,GAAG,CAAC,CAAC;EACXC,KAAK;EACLM,OAAO,EAAEL,aAAa,GAAG,KAAK;EAC9BsB,QAAQ;EACR,GAAGC;AACJ,CAAC,EAAG;EACH,MAAM;IAAEZ,IAAI;IAAET;EAAQ,CAAC,GAAGL,OAAO,CAAEC,MAAM,EAAEC,KAAK,EAAEC,aAAc,CAAC;EAEjE,OACC,IAAAwB,MAAA,CAAAC,aAAA;IAAGd,IAAI,EAAGA,IAAM;IAACT,OAAO,EAAGA,OAAS;IAAA,GAAMqB;EAAK,GAC5CD,QACA,CAAC;AAEN","ignoreList":[]}
1
+ {"version":3,"names":["_url","require","_router","_lockUnlock","_isPreviewingTheme","_jsxRuntime","useHistory","unlock","routerPrivateApis","useLink","params","state","shouldReplace","history","onClick","event","preventDefault","replace","push","currentArgs","getQueryArgs","window","location","href","currentUrlWithoutArgs","removeQueryArgs","Object","keys","isPreviewingTheme","wp_theme_preview","currentlyPreviewingTheme","newUrl","addQueryArgs","Link","children","props","jsx"],"sources":["@wordpress/edit-site/src/components/routes/link.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs, getQueryArgs, removeQueryArgs } from '@wordpress/url';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport function useLink( params, state, shouldReplace = false ) {\n\tconst history = useHistory();\n\tfunction onClick( event ) {\n\t\tevent?.preventDefault();\n\n\t\tif ( shouldReplace ) {\n\t\t\thistory.replace( params, state );\n\t\t} else {\n\t\t\thistory.push( params, state );\n\t\t}\n\t}\n\n\tconst currentArgs = getQueryArgs( window.location.href );\n\tconst currentUrlWithoutArgs = removeQueryArgs(\n\t\twindow.location.href,\n\t\t...Object.keys( currentArgs )\n\t);\n\n\tif ( isPreviewingTheme() ) {\n\t\tparams = {\n\t\t\t...params,\n\t\t\twp_theme_preview: currentlyPreviewingTheme(),\n\t\t};\n\t}\n\n\tconst newUrl = addQueryArgs( currentUrlWithoutArgs, params );\n\n\treturn {\n\t\thref: newUrl,\n\t\tonClick,\n\t};\n}\n\nexport default function Link( {\n\tparams = {},\n\tstate,\n\treplace: shouldReplace = false,\n\tchildren,\n\t...props\n} ) {\n\tconst { href, onClick } = useLink( params, state, shouldReplace );\n\n\treturn (\n\t\t<a href={ href } onClick={ onClick } { ...props }>\n\t\t\t{ children }\n\t\t</a>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AAGyC,IAAAI,WAAA,GAAAJ,OAAA;AAbzC;AACA;AACA;;AAIA;AACA;AACA;;AAOA,MAAM;EAAEK;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAE3C,SAASC,OAAOA,CAAEC,MAAM,EAAEC,KAAK,EAAEC,aAAa,GAAG,KAAK,EAAG;EAC/D,MAAMC,OAAO,GAAGP,UAAU,CAAC,CAAC;EAC5B,SAASQ,OAAOA,CAAEC,KAAK,EAAG;IACzBA,KAAK,EAAEC,cAAc,CAAC,CAAC;IAEvB,IAAKJ,aAAa,EAAG;MACpBC,OAAO,CAACI,OAAO,CAAEP,MAAM,EAAEC,KAAM,CAAC;IACjC,CAAC,MAAM;MACNE,OAAO,CAACK,IAAI,CAAER,MAAM,EAAEC,KAAM,CAAC;IAC9B;EACD;EAEA,MAAMQ,WAAW,GAAG,IAAAC,iBAAY,EAAEC,MAAM,CAACC,QAAQ,CAACC,IAAK,CAAC;EACxD,MAAMC,qBAAqB,GAAG,IAAAC,oBAAe,EAC5CJ,MAAM,CAACC,QAAQ,CAACC,IAAI,EACpB,GAAGG,MAAM,CAACC,IAAI,CAAER,WAAY,CAC7B,CAAC;EAED,IAAK,IAAAS,oCAAiB,EAAC,CAAC,EAAG;IAC1BlB,MAAM,GAAG;MACR,GAAGA,MAAM;MACTmB,gBAAgB,EAAE,IAAAC,2CAAwB,EAAC;IAC5C,CAAC;EACF;EAEA,MAAMC,MAAM,GAAG,IAAAC,iBAAY,EAAER,qBAAqB,EAAEd,MAAO,CAAC;EAE5D,OAAO;IACNa,IAAI,EAAEQ,MAAM;IACZjB;EACD,CAAC;AACF;AAEe,SAASmB,IAAIA,CAAE;EAC7BvB,MAAM,GAAG,CAAC,CAAC;EACXC,KAAK;EACLM,OAAO,EAAEL,aAAa,GAAG,KAAK;EAC9BsB,QAAQ;EACR,GAAGC;AACJ,CAAC,EAAG;EACH,MAAM;IAAEZ,IAAI;IAAET;EAAQ,CAAC,GAAGL,OAAO,CAAEC,MAAM,EAAEC,KAAK,EAAEC,aAAc,CAAC;EAEjE,oBACC,IAAAP,WAAA,CAAA+B,GAAA;IAAGb,IAAI,EAAGA,IAAM;IAACT,OAAO,EAAGA,OAAS;IAAA,GAAMqB,KAAK;IAAAD,QAAA,EAC5CA;EAAQ,CACR,CAAC;AAEN","ignoreList":[]}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = SaveButton;
7
- var _react = require("react");
8
7
  var _data = require("@wordpress/data");
9
8
  var _components = require("@wordpress/components");
10
9
  var _i18n = require("@wordpress/i18n");
@@ -15,6 +14,7 @@ var _editor = require("@wordpress/editor");
15
14
  var _store = require("../../store");
16
15
  var _isPreviewingTheme = require("../../utils/is-previewing-theme");
17
16
  var _lockUnlock = require("../../lock-unlock");
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
18
  /**
19
19
  * WordPress dependencies
20
20
  */
@@ -113,7 +113,7 @@ function SaveButton({
113
113
  const onClick = isOnlyCurrentEntityDirty ? () => saveDirtyEntities({
114
114
  dirtyEntityRecords
115
115
  }) : () => setIsSaveViewOpened(true);
116
- return (0, _react.createElement)(_components.Button, {
116
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
117
117
  variant: variant,
118
118
  className: className,
119
119
  "aria-disabled": disabled,
@@ -135,7 +135,8 @@ function SaveButton({
135
135
  showTooltip: showTooltip,
136
136
  icon: icon,
137
137
  __next40pxDefaultSize: __next40pxDefaultSize,
138
- size: size
139
- }, label);
138
+ size: size,
139
+ children: label
140
+ });
140
141
  }
141
142
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_components","_i18n","_coreData","_keycodes","_router","_editor","_store","_isPreviewingTheme","_lockUnlock","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","_react","createElement","Button","isBusy","shortcut","displayShortcut","primary"],"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,OAA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WAAW,EAAGA,WAAa;IAC3BE,IAAI,EAAGA,IAAM;IACbE,qBAAqB,EAAGA,qBAAuB;IAC/CD,IAAI,EAAGA;EAAM,GAEX2C,KACK,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,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,qBA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D,OAAO,IAAA0C,aAAO;MACb;MACA,IAAAE,QAAE,EACD,mBAAmB,EACnB,oBAAoB,EACpBlC,kBAAkB,CAACuB,MACpB,CAAC,EACDvB,kBAAkB,CAACuB,MACpB,CAAC;IACF;IACA,OAAO,IAAAU,QAAE,EAAE,MAAO,CAAC;EACpB,CAAC;EACD,MAAME,KAAK,GAAGJ,QAAQ,CAAC,CAAC;EACxB,MAAMK,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":[]}
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = SaveHub;
8
- var _react = require("react");
9
8
  var _data = require("@wordpress/data");
10
9
  var _components = require("@wordpress/components");
11
10
  var _coreData = require("@wordpress/core-data");
12
11
  var _icons = require("@wordpress/icons");
13
12
  var _saveButton = _interopRequireDefault(require("../save-button"));
14
13
  var _isPreviewingTheme = require("../../utils/is-previewing-theme");
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
15
  /**
16
16
  * WordPress dependencies
17
17
  */
@@ -36,17 +36,18 @@ function SaveHub() {
36
36
  isDisabled: _isSaving || !dirtyEntityRecords.length && !(0, _isPreviewingTheme.isPreviewingTheme)()
37
37
  };
38
38
  }, []);
39
- return (0, _react.createElement)(_components.__experimentalHStack, {
39
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalHStack, {
40
40
  className: "edit-site-save-hub",
41
41
  alignment: "right",
42
- spacing: 4
43
- }, (0, _react.createElement)(_saveButton.default, {
44
- className: "edit-site-save-hub__button",
45
- variant: isDisabled ? null : 'primary',
46
- showTooltip: false,
47
- icon: isDisabled && !isSaving ? _icons.check : null,
48
- showReviewMessage: true,
49
- __next40pxDefaultSize: true
50
- }));
42
+ spacing: 4,
43
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_saveButton.default, {
44
+ className: "edit-site-save-hub__button",
45
+ variant: isDisabled ? null : 'primary',
46
+ showTooltip: false,
47
+ icon: isDisabled && !isSaving ? _icons.check : null,
48
+ showReviewMessage: true,
49
+ __next40pxDefaultSize: true
50
+ })
51
+ });
51
52
  }
52
53
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_components","_coreData","_icons","_saveButton","_interopRequireDefault","_isPreviewingTheme","SaveHub","isDisabled","isSaving","useSelect","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","_isSaving","some","record","kind","name","key","length","isPreviewingTheme","_react","createElement","__experimentalHStack","className","alignment","spacing","default","variant","showTooltip","icon","check","showReviewMessage","__next40pxDefaultSize"],"sources":["@wordpress/edit-site/src/components/save-hub/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SaveButton from '../save-button';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nexport default function SaveHub() {\n\tconst { isDisabled, isSaving } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst _isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\t\treturn {\n\t\t\tisSaving: _isSaving,\n\t\t\tisDisabled:\n\t\t\t\t_isSaving ||\n\t\t\t\t( ! dirtyEntityRecords.length && ! isPreviewingTheme() ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<HStack className=\"edit-site-save-hub\" alignment=\"right\" spacing={ 4 }>\n\t\t\t<SaveButton\n\t\t\t\tclassName=\"edit-site-save-hub__button\"\n\t\t\t\tvariant={ isDisabled ? null : 'primary' }\n\t\t\t\tshowTooltip={ false }\n\t\t\t\ticon={ isDisabled && ! isSaving ? check : null }\n\t\t\t\tshowReviewMessage\n\t\t\t\t__next40pxDefaultSize\n\t\t\t/>\n\t\t</HStack>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AAZA;AACA;AACA;;AAMA;AACA;AACA;;AAIe,SAASO,OAAOA,CAAA,EAAG;EACjC,MAAM;IAAEC,UAAU;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACzD,MAAM;MAAEC,mCAAmC;MAAEC;IAAqB,CAAC,GAClEF,MAAM,CAAEG,eAAU,CAAC;IACpB,MAAMC,kBAAkB,GAAGH,mCAAmC,CAAC,CAAC;IAChE,MAAMI,SAAS,GAAGD,kBAAkB,CAACE,IAAI,CAAIC,MAAM,IAClDL,oBAAoB,CAAEK,MAAM,CAACC,IAAI,EAAED,MAAM,CAACE,IAAI,EAAEF,MAAM,CAACG,GAAI,CAC5D,CAAC;IACD,OAAO;MACNZ,QAAQ,EAAEO,SAAS;MACnBR,UAAU,EACTQ,SAAS,IACP,CAAED,kBAAkB,CAACO,MAAM,IAAI,CAAE,IAAAC,oCAAiB,EAAC;IACvD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACxB,WAAA,CAAAyB,oBAAM;IAACC,SAAS,EAAC,oBAAoB;IAACC,SAAS,EAAC,OAAO;IAACC,OAAO,EAAG;EAAG,GACrE,IAAAL,MAAA,CAAAC,aAAA,EAACrB,WAAA,CAAA0B,OAAU;IACVH,SAAS,EAAC,4BAA4B;IACtCI,OAAO,EAAGvB,UAAU,GAAG,IAAI,GAAG,SAAW;IACzCwB,WAAW,EAAG,KAAO;IACrBC,IAAI,EAAGzB,UAAU,IAAI,CAAEC,QAAQ,GAAGyB,YAAK,GAAG,IAAM;IAChDC,iBAAiB;IACjBC,qBAAqB;EAAA,CACrB,CACM,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_components","_coreData","_icons","_saveButton","_interopRequireDefault","_isPreviewingTheme","_jsxRuntime","SaveHub","isDisabled","isSaving","useSelect","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","_isSaving","some","record","kind","name","key","length","isPreviewingTheme","jsx","__experimentalHStack","className","alignment","spacing","children","default","variant","showTooltip","icon","check","showReviewMessage","__next40pxDefaultSize"],"sources":["@wordpress/edit-site/src/components/save-hub/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SaveButton from '../save-button';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nexport default function SaveHub() {\n\tconst { isDisabled, isSaving } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst _isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\t\treturn {\n\t\t\tisSaving: _isSaving,\n\t\t\tisDisabled:\n\t\t\t\t_isSaving ||\n\t\t\t\t( ! dirtyEntityRecords.length && ! isPreviewingTheme() ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<HStack className=\"edit-site-save-hub\" alignment=\"right\" spacing={ 4 }>\n\t\t\t<SaveButton\n\t\t\t\tclassName=\"edit-site-save-hub__button\"\n\t\t\t\tvariant={ isDisabled ? null : 'primary' }\n\t\t\t\tshowTooltip={ false }\n\t\t\t\ticon={ isDisabled && ! isSaving ? check : null }\n\t\t\t\tshowReviewMessage\n\t\t\t\t__next40pxDefaultSize\n\t\t\t/>\n\t\t</HStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AAAoE,IAAAO,WAAA,GAAAP,OAAA;AAZpE;AACA;AACA;;AAMA;AACA;AACA;;AAIe,SAASQ,OAAOA,CAAA,EAAG;EACjC,MAAM;IAAEC,UAAU;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACzD,MAAM;MAAEC,mCAAmC;MAAEC;IAAqB,CAAC,GAClEF,MAAM,CAAEG,eAAU,CAAC;IACpB,MAAMC,kBAAkB,GAAGH,mCAAmC,CAAC,CAAC;IAChE,MAAMI,SAAS,GAAGD,kBAAkB,CAACE,IAAI,CAAIC,MAAM,IAClDL,oBAAoB,CAAEK,MAAM,CAACC,IAAI,EAAED,MAAM,CAACE,IAAI,EAAEF,MAAM,CAACG,GAAI,CAC5D,CAAC;IACD,OAAO;MACNZ,QAAQ,EAAEO,SAAS;MACnBR,UAAU,EACTQ,SAAS,IACP,CAAED,kBAAkB,CAACO,MAAM,IAAI,CAAE,IAAAC,oCAAiB,EAAC;IACvD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,oBACC,IAAAjB,WAAA,CAAAkB,GAAA,EAACxB,WAAA,CAAAyB,oBAAM;IAACC,SAAS,EAAC,oBAAoB;IAACC,SAAS,EAAC,OAAO;IAACC,OAAO,EAAG,CAAG;IAAAC,QAAA,eACrE,IAAAvB,WAAA,CAAAkB,GAAA,EAACrB,WAAA,CAAA2B,OAAU;MACVJ,SAAS,EAAC,4BAA4B;MACtCK,OAAO,EAAGvB,UAAU,GAAG,IAAI,GAAG,SAAW;MACzCwB,WAAW,EAAG,KAAO;MACrBC,IAAI,EAAGzB,UAAU,IAAI,CAAEC,QAAQ,GAAGyB,YAAK,GAAG,IAAM;MAChDC,iBAAiB;MACjBC,qBAAqB;IAAA,CACrB;EAAC,CACK,CAAC;AAEX","ignoreList":[]}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = SavePanel;
8
- var _react = require("react");
9
8
  var _clsx = _interopRequireDefault(require("clsx"));
10
9
  var _components = require("@wordpress/components");
11
10
  var _editor = require("@wordpress/editor");
@@ -17,6 +16,7 @@ var _lockUnlock = require("../../lock-unlock");
17
16
  var _useActivateTheme = require("../../utils/use-activate-theme");
18
17
  var _useActualCurrentTheme = require("../../utils/use-actual-current-theme");
19
18
  var _isPreviewingTheme = require("../../utils/is-previewing-theme");
19
+ var _jsxRuntime = require("react/jsx-runtime");
20
20
  /**
21
21
  * External dependencies
22
22
  */
@@ -46,14 +46,16 @@ const EntitiesSavedStatesForPreview = ({
46
46
  }
47
47
  const currentTheme = (0, _useActualCurrentTheme.useActualCurrentTheme)();
48
48
  const previewingTheme = (0, _data.useSelect)(select => select(_coreData.store).getCurrentTheme(), []);
49
- const additionalPrompt = (0, _react.createElement)("p", null, (0, _i18n.sprintf)( /* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */
50
- (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 : '...'));
49
+ 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. */
51
+ (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
+ });
51
53
  const activateTheme = (0, _useActivateTheme.useActivateTheme)();
52
54
  const onSave = async values => {
53
55
  await activateTheme();
54
56
  return values;
55
57
  };
56
- return (0, _react.createElement)(EntitiesSavedStatesExtensible, {
58
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(EntitiesSavedStatesExtensible, {
57
59
  ...isDirtyProps,
58
60
  additionalPrompt,
59
61
  close: onClose,
@@ -67,11 +69,11 @@ const _EntitiesSavedStates = ({
67
69
  renderDialog = undefined
68
70
  }) => {
69
71
  if ((0, _isPreviewingTheme.isPreviewingTheme)()) {
70
- return (0, _react.createElement)(EntitiesSavedStatesForPreview, {
72
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(EntitiesSavedStatesForPreview, {
71
73
  onClose: onClose
72
74
  });
73
75
  }
74
- return (0, _react.createElement)(_editor.EntitiesSavedStates, {
76
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.EntitiesSavedStates, {
75
77
  close: onClose,
76
78
  renderDialog: renderDialog
77
79
  });
@@ -109,36 +111,40 @@ function SavePanel() {
109
111
  } = (0, _data.useDispatch)(_store.store);
110
112
  const onClose = () => setIsSaveViewOpened(false);
111
113
  if (canvasMode === 'view') {
112
- return isSaveViewOpen ? (0, _react.createElement)(_components.Modal, {
114
+ return isSaveViewOpen ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Modal, {
113
115
  className: "edit-site-save-panel__modal",
114
116
  onRequestClose: onClose,
115
117
  __experimentalHideHeader: true,
116
- contentLabel: (0, _i18n.__)('Save site, content, and template changes')
117
- }, (0, _react.createElement)(_EntitiesSavedStates, {
118
- onClose: onClose
119
- })) : null;
118
+ contentLabel: (0, _i18n.__)('Save site, content, and template changes'),
119
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_EntitiesSavedStates, {
120
+ onClose: onClose
121
+ })
122
+ }) : null;
120
123
  }
121
124
  const activateSaveEnabled = (0, _isPreviewingTheme.isPreviewingTheme)() || isDirty;
122
125
  const disabled = isSaving || !activateSaveEnabled;
123
- return (0, _react.createElement)(NavigableRegion, {
126
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(NavigableRegion, {
124
127
  className: (0, _clsx.default)('edit-site-layout__actions', {
125
128
  'is-entity-save-view-open': isSaveViewOpen
126
129
  }),
127
- ariaLabel: (0, _i18n.__)('Save panel')
128
- }, (0, _react.createElement)("div", {
129
- className: (0, _clsx.default)('edit-site-editor__toggle-save-panel', {
130
- 'screen-reader-text': isSaveViewOpen
131
- })
132
- }, (0, _react.createElement)(_components.Button, {
133
- variant: "secondary",
134
- className: (0, _clsx.default)('edit-site-editor__toggle-save-panel-button'),
135
- onClick: () => setIsSaveViewOpened(true),
136
- "aria-haspopup": 'dialog',
137
- disabled: disabled,
138
- __experimentalIsFocusable: true
139
- }, (0, _i18n.__)('Open save panel'))), isSaveViewOpen && (0, _react.createElement)(_EntitiesSavedStates, {
140
- onClose: onClose,
141
- renderDialog: true
142
- }));
130
+ ariaLabel: (0, _i18n.__)('Save panel'),
131
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
132
+ className: (0, _clsx.default)('edit-site-editor__toggle-save-panel', {
133
+ 'screen-reader-text': isSaveViewOpen
134
+ }),
135
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
136
+ variant: "secondary",
137
+ className: "edit-site-editor__toggle-save-panel-button",
138
+ onClick: () => setIsSaveViewOpened(true),
139
+ "aria-haspopup": "dialog",
140
+ disabled: disabled,
141
+ __experimentalIsFocusable: true,
142
+ children: (0, _i18n.__)('Open save panel')
143
+ })
144
+ }), isSaveViewOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(_EntitiesSavedStates, {
145
+ onClose: onClose,
146
+ renderDialog: true
147
+ })]
148
+ });
143
149
  }
144
150
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_editor","_data","_i18n","_coreData","_store","_lockUnlock","_useActivateTheme","_useActualCurrentTheme","_isPreviewingTheme","EntitiesSavedStatesExtensible","NavigableRegion","unlock","privateApis","EntitiesSavedStatesForPreview","onClose","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","useEntitiesSavedStatesIsDirty","activateSaveLabel","isDirty","__","currentTheme","useActualCurrentTheme","previewingTheme","useSelect","select","coreStore","getCurrentTheme","additionalPrompt","_react","createElement","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","clsx","ariaLabel","Button","variant","onClick","__experimentalIsFocusable"],"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\tvariant=\"secondary\"\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'edit-site-editor__toggle-save-panel-button'\n\t\t\t\t\t) }\n\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\taria-haspopup={ 'dialog' }\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t{ isSaveViewOpen && (\n\t\t\t\t<_Entities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,EAAE,2BAA2B,EAAE;MAC9C,0BAA0B,EAAEzB;IAC7B,CAAE,CAAG;IACL0B,SAAS,EAAG,IAAArD,QAAE,EAAE,YAAa;EAAG,GAEhC,IAAAS,MAAA,CAAAC,aAAA;IACCoC,SAAS,EAAG,IAAAM,aAAI,EAAE,qCAAqC,EAAE;MACxD,oBAAoB,EAAEzB;IACvB,CAAE;EAAG,GAEL,IAAAlB,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAA4E,MAAM;IACNC,OAAO,EAAC,WAAW;IACnBT,SAAS,EAAG,IAAAM,aAAI,EACf,4CACD,CAAG;IACHI,OAAO,EAAGA,CAAA,KAAMb,mBAAmB,CAAE,IAAK,CAAG;IAC7C,iBAAgB,QAAU;IAC1BQ,QAAQ,EAAGA,QAAU;IACrBM,yBAAyB;EAAA,GAEvB,IAAAzD,QAAE,EAAE,iBAAkB,CACjB,CACJ,CAAC,EACJ2B,cAAc,IACf,IAAAlB,MAAA,CAAAC,aAAA,EAACW,oBAAoB;IAAC5B,OAAO,EAAGA,OAAS;IAAC6B,YAAY;EAAA,CAAE,CAEzC,CAAC;AAEpB","ignoreList":[]}
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","variant","onClick","__experimentalIsFocusable"],"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\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\t__experimentalIsFocusable\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t{ isSaveViewOpen && (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } renderDialog />\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"],"mappings":";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G,IAAAO,aAAI,EAAE,2BAA2B,EAAE;MAC9C,0BAA0B,EAAE1B;IAC7B,CAAE,CAAG;IACL2B,SAAS,EAAG,IAAAtD,QAAE,EAAE,YAAa,CAAG;IAAAU,QAAA,gBAEhC,IAAAvB,WAAA,CAAAsB,GAAA;MACCqC,SAAS,EAAG,IAAAO,aAAI,EAAE,qCAAqC,EAAE;QACxD,oBAAoB,EAAE1B;MACvB,CAAE,CAAG;MAAAjB,QAAA,eAEL,IAAAvB,WAAA,CAAAsB,GAAA,EAAChC,WAAA,CAAA8E,MAAM;QACNC,OAAO,EAAC,WAAW;QACnBV,SAAS,EAAC,4CAA4C;QACtDW,OAAO,EAAGA,CAAA,KAAMd,mBAAmB,CAAE,IAAK,CAAG;QAC7C,iBAAc,QAAQ;QACtBQ,QAAQ,EAAGA,QAAU;QACrBO,yBAAyB;QAAAhD,QAAA,EAEvB,IAAAV,QAAE,EAAE,iBAAkB;MAAC,CAClB;IAAC,CACL,CAAC,EACJ2B,cAAc,iBACf,IAAAxC,WAAA,CAAAsB,GAAA,EAACY,oBAAoB;MAAC5B,OAAO,EAAGA,OAAS;MAAC6B,YAAY;IAAA,CAAE,CACxD;EAAA,CACe,CAAC;AAEpB","ignoreList":[]}
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.SidebarNavigationContext = void 0;
8
8
  exports.default = SidebarContent;
9
- var _react = require("react");
10
9
  var _clsx = _interopRequireDefault(require("clsx"));
11
10
  var _element = require("@wordpress/element");
12
11
  var _dom = require("@wordpress/dom");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
13
  /**
14
14
  * External dependencies
15
15
  */
@@ -71,22 +71,25 @@ function SidebarContentWrapper({
71
71
  'slide-from-left': navAnimation === 'back',
72
72
  'slide-from-right': navAnimation === 'forward'
73
73
  });
74
- return (0, _react.createElement)("div", {
74
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
75
75
  ref: wrapperRef,
76
- className: wrapperCls
77
- }, children);
76
+ className: wrapperCls,
77
+ children: children
78
+ });
78
79
  }
79
80
  function SidebarContent({
80
81
  routeKey,
81
82
  children
82
83
  }) {
83
84
  const [navState] = (0, _element.useState)(createNavState);
84
- return (0, _react.createElement)(SidebarNavigationContext.Provider, {
85
- value: navState
86
- }, (0, _react.createElement)("div", {
87
- className: "edit-site-sidebar__content"
88
- }, (0, _react.createElement)(SidebarContentWrapper, {
89
- key: routeKey
90
- }, children)));
85
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(SidebarNavigationContext.Provider, {
86
+ value: navState,
87
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
88
+ className: "edit-site-sidebar__content",
89
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(SidebarContentWrapper, {
90
+ children: children
91
+ }, routeKey)
92
+ })
93
+ });
91
94
  }
92
95
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_dom","SidebarNavigationContext","exports","createContext","focusSidebarElement","el","direction","focusSelector","elementToFocus","querySelector","firstTabbable","focus","tabbable","find","createNavState","state","get","navigate","SidebarContentWrapper","children","navState","useContext","wrapperRef","useRef","navAnimation","setNavAnimation","useState","useLayoutEffect","current","wrapperCls","clsx","_react","createElement","ref","className","SidebarContent","routeKey","Provider","value","key"],"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseContext,\n\tuseState,\n\tuseRef,\n\tuseLayoutEffect,\n} from '@wordpress/element';\nimport { focus } from '@wordpress/dom';\n\nexport const SidebarNavigationContext = createContext( () => {} );\n// Focus a sidebar element after a navigation. The element to focus is either\n// specified by `focusSelector` (when navigating back) or it is the first\n// tabbable element (usually the \"Back\" button).\nfunction focusSidebarElement( el, direction, focusSelector ) {\n\tlet elementToFocus;\n\tif ( direction === 'back' && focusSelector ) {\n\t\telementToFocus = el.querySelector( focusSelector );\n\t}\n\tif ( direction !== null && ! elementToFocus ) {\n\t\tconst [ firstTabbable ] = focus.tabbable.find( el );\n\t\telementToFocus = firstTabbable ?? el;\n\t}\n\telementToFocus?.focus();\n}\n\n// Navigation state that is updated when navigating back or forward. Helps us\n// manage the animations and also focus.\nfunction createNavState() {\n\tlet state = {\n\t\tdirection: null,\n\t\tfocusSelector: null,\n\t};\n\n\treturn {\n\t\tget() {\n\t\t\treturn state;\n\t\t},\n\t\tnavigate( direction, focusSelector = null ) {\n\t\t\tstate = {\n\t\t\t\tdirection,\n\t\t\t\tfocusSelector:\n\t\t\t\t\tdirection === 'forward' && focusSelector\n\t\t\t\t\t\t? focusSelector\n\t\t\t\t\t\t: state.focusSelector,\n\t\t\t};\n\t\t},\n\t};\n}\n\nfunction SidebarContentWrapper( { children } ) {\n\tconst navState = useContext( SidebarNavigationContext );\n\tconst wrapperRef = useRef();\n\tconst [ navAnimation, setNavAnimation ] = useState( null );\n\n\tuseLayoutEffect( () => {\n\t\tconst { direction, focusSelector } = navState.get();\n\t\tfocusSidebarElement( wrapperRef.current, direction, focusSelector );\n\t\tsetNavAnimation( direction );\n\t}, [ navState ] );\n\n\tconst wrapperCls = clsx( 'edit-site-sidebar__screen-wrapper', {\n\t\t'slide-from-left': navAnimation === 'back',\n\t\t'slide-from-right': navAnimation === 'forward',\n\t} );\n\n\treturn (\n\t\t<div ref={ wrapperRef } className={ wrapperCls }>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default function SidebarContent( { routeKey, children } ) {\n\tconst [ navState ] = useState( createNavState );\n\n\treturn (\n\t\t<SidebarNavigationContext.Provider value={ navState }>\n\t\t\t<div className=\"edit-site-sidebar__content\">\n\t\t\t\t<SidebarContentWrapper key={ routeKey }>\n\t\t\t\t\t{ children }\n\t\t\t\t</SidebarContentWrapper>\n\t\t\t</div>\n\t\t</SidebarNavigationContext.Provider>\n\t);\n}\n"],"mappings":";;;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,CAAC;EACvD,MAAMqB,UAAU,GAAG,IAAAC,eAAM,EAAC,CAAC;EAC3B,MAAM,CAAEC,YAAY,EAAEC,eAAe,CAAE,GAAG,IAAAC,iBAAQ,EAAE,IAAK,CAAC;EAE1D,IAAAC,wBAAe,EAAE,MAAM;IACtB,MAAM;MAAErB,SAAS;MAAEC;IAAc,CAAC,GAAGa,QAAQ,CAACJ,GAAG,CAAC,CAAC;IACnDZ,mBAAmB,CAAEkB,UAAU,CAACM,OAAO,EAAEtB,SAAS,EAAEC,aAAc,CAAC;IACnEkB,eAAe,CAAEnB,SAAU,CAAC;EAC7B,CAAC,EAAE,CAAEc,QAAQ,CAAG,CAAC;EAEjB,MAAMS,UAAU,GAAG,IAAAC,aAAI,EAAE,mCAAmC,EAAE;IAC7D,iBAAiB,EAAEN,YAAY,KAAK,MAAM;IAC1C,kBAAkB,EAAEA,YAAY,KAAK;EACtC,CAAE,CAAC;EAEH,OACC,IAAAO,MAAA,CAAAC,aAAA;IAAKC,GAAG,EAAGX,UAAY;IAACY,SAAS,EAAGL;EAAY,GAC7CV,QACE,CAAC;AAER;AAEe,SAASgB,cAAcA,CAAE;EAAEC,QAAQ;EAAEjB;AAAS,CAAC,EAAG;EAChE,MAAM,CAAEC,QAAQ,CAAE,GAAG,IAAAM,iBAAQ,EAAEZ,cAAe,CAAC;EAE/C,OACC,IAAAiB,MAAA,CAAAC,aAAA,EAAC/B,wBAAwB,CAACoC,QAAQ;IAACC,KAAK,EAAGlB;EAAU,GACpD,IAAAW,MAAA,CAAAC,aAAA;IAAKE,SAAS,EAAC;EAA4B,GAC1C,IAAAH,MAAA,CAAAC,aAAA,EAACd,qBAAqB;IAACqB,GAAG,EAAGH;EAAU,GACpCjB,QACoB,CACnB,CAC6B,CAAC;AAEtC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_dom","_jsxRuntime","SidebarNavigationContext","exports","createContext","focusSidebarElement","el","direction","focusSelector","elementToFocus","querySelector","firstTabbable","focus","tabbable","find","createNavState","state","get","navigate","SidebarContentWrapper","children","navState","useContext","wrapperRef","useRef","navAnimation","setNavAnimation","useState","useLayoutEffect","current","wrapperCls","clsx","jsx","ref","className","SidebarContent","routeKey","Provider","value"],"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseContext,\n\tuseState,\n\tuseRef,\n\tuseLayoutEffect,\n} from '@wordpress/element';\nimport { focus } from '@wordpress/dom';\n\nexport const SidebarNavigationContext = createContext( () => {} );\n// Focus a sidebar element after a navigation. The element to focus is either\n// specified by `focusSelector` (when navigating back) or it is the first\n// tabbable element (usually the \"Back\" button).\nfunction focusSidebarElement( el, direction, focusSelector ) {\n\tlet elementToFocus;\n\tif ( direction === 'back' && focusSelector ) {\n\t\telementToFocus = el.querySelector( focusSelector );\n\t}\n\tif ( direction !== null && ! elementToFocus ) {\n\t\tconst [ firstTabbable ] = focus.tabbable.find( el );\n\t\telementToFocus = firstTabbable ?? el;\n\t}\n\telementToFocus?.focus();\n}\n\n// Navigation state that is updated when navigating back or forward. Helps us\n// manage the animations and also focus.\nfunction createNavState() {\n\tlet state = {\n\t\tdirection: null,\n\t\tfocusSelector: null,\n\t};\n\n\treturn {\n\t\tget() {\n\t\t\treturn state;\n\t\t},\n\t\tnavigate( direction, focusSelector = null ) {\n\t\t\tstate = {\n\t\t\t\tdirection,\n\t\t\t\tfocusSelector:\n\t\t\t\t\tdirection === 'forward' && focusSelector\n\t\t\t\t\t\t? focusSelector\n\t\t\t\t\t\t: state.focusSelector,\n\t\t\t};\n\t\t},\n\t};\n}\n\nfunction SidebarContentWrapper( { children } ) {\n\tconst navState = useContext( SidebarNavigationContext );\n\tconst wrapperRef = useRef();\n\tconst [ navAnimation, setNavAnimation ] = useState( null );\n\n\tuseLayoutEffect( () => {\n\t\tconst { direction, focusSelector } = navState.get();\n\t\tfocusSidebarElement( wrapperRef.current, direction, focusSelector );\n\t\tsetNavAnimation( direction );\n\t}, [ navState ] );\n\n\tconst wrapperCls = clsx( 'edit-site-sidebar__screen-wrapper', {\n\t\t'slide-from-left': navAnimation === 'back',\n\t\t'slide-from-right': navAnimation === 'forward',\n\t} );\n\n\treturn (\n\t\t<div ref={ wrapperRef } className={ wrapperCls }>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default function SidebarContent( { routeKey, children } ) {\n\tconst [ navState ] = useState( createNavState );\n\n\treturn (\n\t\t<SidebarNavigationContext.Provider value={ navState }>\n\t\t\t<div className=\"edit-site-sidebar__content\">\n\t\t\t\t<SidebarContentWrapper key={ routeKey }>\n\t\t\t\t\t{ children }\n\t\t\t\t</SidebarContentWrapper>\n\t\t\t</div>\n\t\t</SidebarNavigationContext.Provider>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAOA,IAAAE,IAAA,GAAAF,OAAA;AAAuC,IAAAG,WAAA,GAAAH,OAAA;AAfvC;AACA;AACA;;AAGA;AACA;AACA;;AAUO,MAAMI,wBAAwB,GAAAC,OAAA,CAAAD,wBAAA,GAAG,IAAAE,sBAAa,EAAE,MAAM,CAAC,CAAE,CAAC;AACjE;AACA;AACA;AACA,SAASC,mBAAmBA,CAAEC,EAAE,EAAEC,SAAS,EAAEC,aAAa,EAAG;EAC5D,IAAIC,cAAc;EAClB,IAAKF,SAAS,KAAK,MAAM,IAAIC,aAAa,EAAG;IAC5CC,cAAc,GAAGH,EAAE,CAACI,aAAa,CAAEF,aAAc,CAAC;EACnD;EACA,IAAKD,SAAS,KAAK,IAAI,IAAI,CAAEE,cAAc,EAAG;IAC7C,MAAM,CAAEE,aAAa,CAAE,GAAGC,UAAK,CAACC,QAAQ,CAACC,IAAI,CAAER,EAAG,CAAC;IACnDG,cAAc,GAAGE,aAAa,aAAbA,aAAa,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AAGJ,UAAY;IAAAV,QAAA,EAC7CA;EAAQ,CACN,CAAC;AAER;AAEe,SAASe,cAAcA,CAAE;EAAEC,QAAQ;EAAEhB;AAAS,CAAC,EAAG;EAChE,MAAM,CAAEC,QAAQ,CAAE,GAAG,IAAAM,iBAAQ,EAAEZ,cAAe,CAAC;EAE/C,oBACC,IAAAd,WAAA,CAAA+B,GAAA,EAAC9B,wBAAwB,CAACmC,QAAQ;IAACC,KAAK,EAAGjB,QAAU;IAAAD,QAAA,eACpD,IAAAnB,WAAA,CAAA+B,GAAA;MAAKE,SAAS,EAAC,4BAA4B;MAAAd,QAAA,eAC1C,IAAAnB,WAAA,CAAA+B,GAAA,EAACb,qBAAqB;QAAAC,QAAA,EACnBA;MAAQ,GADkBgB,QAEN;IAAC,CACpB;EAAC,CAC4B,CAAC;AAEtC","ignoreList":[]}
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = SidebarButton;
8
- var _react = require("react");
9
8
  var _clsx = _interopRequireDefault(require("clsx"));
10
9
  var _components = require("@wordpress/components");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
11
  /**
12
12
  * External dependencies
13
13
  */
@@ -17,7 +17,7 @@ var _components = require("@wordpress/components");
17
17
  */
18
18
 
19
19
  function SidebarButton(props) {
20
- return (0, _react.createElement)(_components.Button, {
20
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
21
21
  ...props,
22
22
  className: (0, _clsx.default)('edit-site-sidebar-button', props.className)
23
23
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","SidebarButton","props","_react","createElement","Button","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{ ...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;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGe,SAASE,aAAaA,CAAEC,KAAK,EAAG;EAC9C,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACJ,WAAA,CAAAK,MAAM;IAAA,GACDH,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","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{ ...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;IAAA,GACDF,KAAK;IACVG,SAAS,EAAG,IAAAC,aAAI,EAAE,0BAA0B,EAAEJ,KAAK,CAACG,SAAU;EAAG,CACjE,CAAC;AAEJ","ignoreList":[]}