@wordpress/edit-site 5.34.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (977) hide show
  1. package/CHANGELOG.md +16 -3
  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 +89 -73
  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 +13 -5
  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/use-editor-iframe-props.js +88 -0
  19. package/build/components/block-editor/use-editor-iframe-props.js.map +1 -0
  20. package/build/components/canvas-loader/index.js +13 -12
  21. package/build/components/canvas-loader/index.js.map +1 -1
  22. package/build/components/dataviews-actions/index.js +49 -0
  23. package/build/components/dataviews-actions/index.js.map +1 -0
  24. package/build/components/editor/index.js +107 -140
  25. package/build/components/editor/index.js.map +1 -1
  26. package/build/components/editor-canvas-container/index.js +27 -29
  27. package/build/components/editor-canvas-container/index.js.map +1 -1
  28. package/build/components/error-boundary/index.js +2 -2
  29. package/build/components/error-boundary/index.js.map +1 -1
  30. package/build/components/error-boundary/warning.js +13 -11
  31. package/build/components/error-boundary/warning.js.map +1 -1
  32. package/build/components/global-styles/background-panel.js +19 -6
  33. package/build/components/global-styles/background-panel.js.map +1 -1
  34. package/build/components/global-styles/block-preview-panel.js +19 -17
  35. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  36. package/build/components/global-styles/color-indicator-wrapper.js +4 -4
  37. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  38. package/build/components/global-styles/color-palette-panel.js +32 -28
  39. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  40. package/build/components/global-styles/dimensions-panel.js +2 -2
  41. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  42. package/build/components/global-styles/font-families.js +55 -39
  43. package/build/components/global-styles/font-families.js.map +1 -1
  44. package/build/components/global-styles/font-family-item.js +17 -13
  45. package/build/components/global-styles/font-family-item.js.map +1 -1
  46. package/build/components/global-styles/font-library-modal/collection-font-variant.js +25 -22
  47. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  48. package/build/components/global-styles/font-library-modal/context.js +7 -30
  49. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  50. package/build/components/global-styles/font-library-modal/font-card.js +24 -16
  51. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
  52. package/build/components/global-styles/font-library-modal/font-collection.js +195 -152
  53. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  54. package/build/components/global-styles/font-library-modal/font-demo.js +14 -12
  55. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  56. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +29 -20
  57. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  58. package/build/components/global-styles/font-library-modal/index.js +41 -36
  59. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  60. package/build/components/global-styles/font-library-modal/installed-fonts.js +153 -109
  61. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  62. package/build/components/global-styles/font-library-modal/library-font-details.js +16 -14
  63. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  64. package/build/components/global-styles/font-library-modal/library-font-variant.js +25 -22
  65. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  66. package/build/components/global-styles/font-library-modal/upload-fonts.js +40 -34
  67. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  68. package/build/components/global-styles/font-library-modal/utils/index.js +3 -3
  69. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  70. package/build/components/global-styles/gradients-palette-panel.js +41 -38
  71. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  72. package/build/components/global-styles/header.js +37 -28
  73. package/build/components/global-styles/header.js.map +1 -1
  74. package/build/components/global-styles/highlighted-colors.js +3 -4
  75. package/build/components/global-styles/highlighted-colors.js.map +1 -1
  76. package/build/components/global-styles/hooks.js +11 -20
  77. package/build/components/global-styles/hooks.js.map +1 -1
  78. package/build/components/global-styles/icon-with-current-color.js +4 -4
  79. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  80. package/build/components/global-styles/navigation-button.js +15 -11
  81. package/build/components/global-styles/navigation-button.js.map +1 -1
  82. package/build/components/global-styles/palette.js +39 -32
  83. package/build/components/global-styles/palette.js.map +1 -1
  84. package/build/components/global-styles/preset-colors.js +28 -0
  85. package/build/components/global-styles/preset-colors.js.map +1 -0
  86. package/build/components/global-styles/preview-colors.js +23 -25
  87. package/build/components/global-styles/preview-colors.js.map +1 -1
  88. package/build/components/global-styles/preview-iframe.js +34 -29
  89. package/build/components/global-styles/preview-iframe.js.map +1 -1
  90. package/build/components/global-styles/preview-styles.js +95 -90
  91. package/build/components/global-styles/preview-styles.js.map +1 -1
  92. package/build/components/global-styles/root-menu.js +28 -21
  93. package/build/components/global-styles/root-menu.js.map +1 -1
  94. package/build/components/global-styles/screen-background.js +6 -4
  95. package/build/components/global-styles/screen-background.js.map +1 -1
  96. package/build/components/global-styles/screen-block-list.js +33 -27
  97. package/build/components/global-styles/screen-block-list.js.map +1 -1
  98. package/build/components/global-styles/screen-block.js +62 -53
  99. package/build/components/global-styles/screen-block.js.map +1 -1
  100. package/build/components/global-styles/screen-color-palette.js +29 -19
  101. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  102. package/build/components/global-styles/screen-colors.js +18 -17
  103. package/build/components/global-styles/screen-colors.js.map +1 -1
  104. package/build/components/global-styles/screen-css.js +20 -14
  105. package/build/components/global-styles/screen-css.js.map +1 -1
  106. package/build/components/global-styles/screen-layout.js +9 -4
  107. package/build/components/global-styles/screen-layout.js.map +1 -1
  108. package/build/components/global-styles/screen-revisions/index.js +52 -42
  109. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  110. package/build/components/global-styles/screen-revisions/revisions-buttons.js +82 -71
  111. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  112. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
  113. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  114. package/build/components/global-styles/screen-root.js +76 -42
  115. package/build/components/global-styles/screen-root.js.map +1 -1
  116. package/build/components/global-styles/screen-shadows.js +22 -0
  117. package/build/components/global-styles/screen-shadows.js.map +1 -0
  118. package/build/components/global-styles/screen-style-variations.js +14 -9
  119. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  120. package/build/components/global-styles/screen-typography-element.js +50 -45
  121. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  122. package/build/components/global-styles/screen-typography.js +15 -11
  123. package/build/components/global-styles/screen-typography.js.map +1 -1
  124. package/build/components/global-styles/shadow-utils.js +230 -0
  125. package/build/components/global-styles/shadow-utils.js.map +1 -0
  126. package/build/components/global-styles/shadows-edit-panel.js +458 -0
  127. package/build/components/global-styles/shadows-edit-panel.js.map +1 -0
  128. package/build/components/global-styles/shadows-panel.js +128 -0
  129. package/build/components/global-styles/shadows-panel.js.map +1 -0
  130. package/build/components/global-styles/style-variations-container.js +67 -18
  131. package/build/components/global-styles/style-variations-container.js.map +1 -1
  132. package/build/components/global-styles/subtitle.js +5 -4
  133. package/build/components/global-styles/subtitle.js.map +1 -1
  134. package/build/components/global-styles/typography-elements.js +53 -45
  135. package/build/components/global-styles/typography-elements.js.map +1 -1
  136. package/build/components/global-styles/typography-example.js +16 -10
  137. package/build/components/global-styles/typography-example.js.map +1 -1
  138. package/build/components/global-styles/typography-panel.js +2 -2
  139. package/build/components/global-styles/typography-panel.js.map +1 -1
  140. package/build/components/global-styles/typography-preview.js +5 -4
  141. package/build/components/global-styles/typography-preview.js.map +1 -1
  142. package/build/components/global-styles/ui.js +124 -89
  143. package/build/components/global-styles/ui.js.map +1 -1
  144. package/build/components/global-styles/utils.js +28 -0
  145. package/build/components/global-styles/utils.js.map +1 -1
  146. package/build/components/global-styles/variations/variation.js +36 -25
  147. package/build/components/global-styles/variations/variation.js.map +1 -1
  148. package/build/components/global-styles/variations/variations-color.js +19 -14
  149. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  150. package/build/components/global-styles/variations/variations-panel.js +27 -17
  151. package/build/components/global-styles/variations/variations-panel.js.map +1 -1
  152. package/build/components/global-styles/variations/variations-typography.js +37 -31
  153. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  154. package/build/components/global-styles-renderer/index.js +5 -1
  155. package/build/components/global-styles-renderer/index.js.map +1 -1
  156. package/build/components/global-styles-sidebar/default-sidebar.js +56 -0
  157. package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -0
  158. package/build/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +37 -26
  159. package/build/components/global-styles-sidebar/index.js.map +1 -0
  160. package/build/components/layout/index.js +113 -99
  161. package/build/components/layout/index.js.map +1 -1
  162. package/build/components/layout/router.js +110 -75
  163. package/build/components/layout/router.js.map +1 -1
  164. package/build/components/media/index.js +2 -2
  165. package/build/components/media/index.js.map +1 -1
  166. package/build/components/{header-edit-mode/more-menu → more-menu}/index.js +7 -3
  167. package/build/components/more-menu/index.js.map +1 -0
  168. package/build/components/{header-edit-mode/more-menu → more-menu}/site-export.js +5 -4
  169. package/build/components/more-menu/site-export.js.map +1 -0
  170. package/build/components/{header-edit-mode/more-menu → more-menu}/welcome-guide-menu-item.js +5 -4
  171. package/build/components/more-menu/welcome-guide-menu-item.js.map +1 -0
  172. package/build/components/page/header.js +24 -20
  173. package/build/components/page/header.js.map +1 -1
  174. package/build/components/page/index.js +14 -12
  175. package/build/components/page/index.js.map +1 -1
  176. package/build/components/page-pages/index.js +136 -66
  177. package/build/components/page-pages/index.js.map +1 -1
  178. package/build/components/page-patterns/delete-category-menu-item.js +23 -20
  179. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  180. package/build/components/page-patterns/header.js +47 -32
  181. package/build/components/page-patterns/header.js.map +1 -1
  182. package/build/components/page-patterns/index.js +120 -125
  183. package/build/components/page-patterns/index.js.map +1 -1
  184. package/build/components/page-patterns/rename-category-menu-item.js +14 -11
  185. package/build/components/page-patterns/rename-category-menu-item.js.map +1 -1
  186. package/build/components/page-patterns/use-patterns.js +7 -6
  187. package/build/components/page-patterns/use-patterns.js.map +1 -1
  188. package/build/components/page-templates/index.js +83 -72
  189. package/build/components/page-templates/index.js.map +1 -1
  190. package/build/components/pagination/index.js +51 -42
  191. package/build/components/pagination/index.js.map +1 -1
  192. package/build/components/plugin-template-setting-panel/index.js +4 -2
  193. package/build/components/plugin-template-setting-panel/index.js.map +1 -1
  194. package/build/components/resizable-frame/index.js +48 -34
  195. package/build/components/resizable-frame/index.js.map +1 -1
  196. package/build/components/revisions/index.js +31 -22
  197. package/build/components/revisions/index.js.map +1 -1
  198. package/build/components/routes/link.js +5 -4
  199. package/build/components/routes/link.js.map +1 -1
  200. package/build/components/save-button/index.js +5 -4
  201. package/build/components/save-button/index.js.map +1 -1
  202. package/build/components/save-hub/index.js +12 -11
  203. package/build/components/save-hub/index.js.map +1 -1
  204. package/build/components/save-panel/index.js +36 -30
  205. package/build/components/save-panel/index.js.map +1 -1
  206. package/build/components/sidebar/index.js +68 -35
  207. package/build/components/sidebar/index.js.map +1 -1
  208. package/build/components/sidebar-button/index.js +4 -4
  209. package/build/components/sidebar-button/index.js.map +1 -1
  210. package/build/components/sidebar-dataviews/add-new-view.js +56 -48
  211. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  212. package/build/components/sidebar-dataviews/custom-dataviews-list.js +106 -89
  213. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  214. package/build/components/sidebar-dataviews/dataview-item.js +14 -12
  215. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  216. package/build/components/sidebar-dataviews/default-views.js +48 -0
  217. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  218. package/build/components/sidebar-dataviews/index.js +21 -22
  219. package/build/components/sidebar-dataviews/index.js.map +1 -1
  220. package/build/components/sidebar-navigation-item/index.js +32 -28
  221. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  222. package/build/components/sidebar-navigation-screen/index.js +56 -70
  223. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  224. package/build/components/sidebar-navigation-screen-details-footer/index.js +24 -17
  225. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  226. package/build/components/sidebar-navigation-screen-details-panel/index.js +9 -7
  227. package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  228. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +5 -4
  229. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
  230. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +7 -7
  231. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  232. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +5 -4
  233. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
  234. package/build/components/sidebar-navigation-screen-global-styles/index.js +57 -45
  235. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  236. package/build/components/sidebar-navigation-screen-main/index.js +45 -22
  237. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  238. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +5 -4
  239. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  240. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +20 -12
  241. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  242. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +61 -35
  243. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  244. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +10 -8
  245. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  246. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +42 -36
  247. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  248. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +18 -12
  249. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  250. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
  251. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  252. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +36 -22
  253. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  254. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +48 -40
  255. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  256. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +12 -9
  257. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  258. package/build/components/sidebar-navigation-screen-patterns/category-item.js +12 -10
  259. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  260. package/build/components/sidebar-navigation-screen-patterns/index.js +62 -77
  261. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  262. package/build/components/sidebar-navigation-screen-templates-browse/content.js +17 -17
  263. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  264. package/build/components/sidebar-navigation-screen-templates-browse/index.js +8 -5
  265. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  266. package/build/components/site-hub/index.js +83 -74
  267. package/build/components/site-hub/index.js.map +1 -1
  268. package/build/components/site-icon/index.js +9 -8
  269. package/build/components/site-icon/index.js.map +1 -1
  270. package/build/components/style-book/index.js +122 -103
  271. package/build/components/style-book/index.js.map +1 -1
  272. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -30
  273. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  274. package/build/components/table/index.js +23 -15
  275. package/build/components/table/index.js.map +1 -1
  276. package/build/components/template-part-converter/convert-to-regular.js +5 -4
  277. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  278. package/build/components/template-part-converter/convert-to-template-part.js +23 -17
  279. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  280. package/build/components/template-part-converter/index.js +30 -11
  281. package/build/components/template-part-converter/index.js.map +1 -1
  282. package/build/components/welcome-guide/editor.js +20 -15
  283. package/build/components/welcome-guide/editor.js.map +1 -1
  284. package/build/components/welcome-guide/image.js +13 -12
  285. package/build/components/welcome-guide/image.js.map +1 -1
  286. package/build/components/welcome-guide/index.js +4 -2
  287. package/build/components/welcome-guide/index.js.map +1 -1
  288. package/build/components/welcome-guide/page.js +18 -13
  289. package/build/components/welcome-guide/page.js.map +1 -1
  290. package/build/components/welcome-guide/styles.js +45 -28
  291. package/build/components/welcome-guide/styles.js.map +1 -1
  292. package/build/components/welcome-guide/template.js +18 -13
  293. package/build/components/welcome-guide/template.js.map +1 -1
  294. package/build/deprecated.js +4 -4
  295. package/build/deprecated.js.map +1 -1
  296. package/build/hooks/commands/use-common-commands.js +12 -24
  297. package/build/hooks/commands/use-common-commands.js.map +1 -1
  298. package/build/hooks/commands/use-edit-mode-commands.js +2 -116
  299. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  300. package/build/hooks/index.js +0 -1
  301. package/build/hooks/index.js.map +1 -1
  302. package/build/hooks/push-changes-to-global-styles/index.js +25 -16
  303. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  304. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +7 -3
  305. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  306. package/build/index.js +3 -3
  307. package/build/index.js.map +1 -1
  308. package/build/store/private-actions.js +7 -1
  309. package/build/store/private-actions.js.map +1 -1
  310. package/build/store/selectors.js +2 -2
  311. package/build/store/selectors.js.map +1 -1
  312. package/build/utils/template-part-create.js +0 -62
  313. package/build/utils/template-part-create.js.map +1 -1
  314. package/build/utils/use-activate-theme.js +9 -7
  315. package/build/utils/use-activate-theme.js.map +1 -1
  316. package/build-module/components/add-new-page/index.js +34 -27
  317. package/build-module/components/add-new-page/index.js.map +1 -1
  318. package/build-module/components/add-new-pattern/index.js +98 -78
  319. package/build-module/components/add-new-pattern/index.js.map +1 -1
  320. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +36 -30
  321. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  322. package/build-module/components/add-new-template/add-custom-template-modal-content.js +121 -95
  323. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  324. package/build-module/components/add-new-template/index.js +91 -73
  325. package/build-module/components/add-new-template/index.js.map +1 -1
  326. package/build-module/components/add-new-template/utils.js +36 -17
  327. package/build-module/components/add-new-template/utils.js.map +1 -1
  328. package/build-module/components/app/index.js +15 -6
  329. package/build-module/components/app/index.js.map +1 -1
  330. package/build-module/components/block-editor/block-inspector-button.js +5 -4
  331. package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
  332. package/build-module/components/block-editor/use-editor-iframe-props.js +80 -0
  333. package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -0
  334. package/build-module/components/canvas-loader/index.js +14 -13
  335. package/build-module/components/canvas-loader/index.js.map +1 -1
  336. package/build-module/components/dataviews-actions/index.js +41 -0
  337. package/build-module/components/dataviews-actions/index.js.map +1 -0
  338. package/build-module/components/editor/index.js +113 -144
  339. package/build-module/components/editor/index.js.map +1 -1
  340. package/build-module/components/editor-canvas-container/index.js +29 -30
  341. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  342. package/build-module/components/error-boundary/index.js +2 -2
  343. package/build-module/components/error-boundary/index.js.map +1 -1
  344. package/build-module/components/error-boundary/warning.js +13 -11
  345. package/build-module/components/error-boundary/warning.js.map +1 -1
  346. package/build-module/components/global-styles/background-panel.js +18 -6
  347. package/build-module/components/global-styles/background-panel.js.map +1 -1
  348. package/build-module/components/global-styles/block-preview-panel.js +19 -17
  349. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  350. package/build-module/components/global-styles/color-indicator-wrapper.js +4 -4
  351. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  352. package/build-module/components/global-styles/color-palette-panel.js +32 -28
  353. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  354. package/build-module/components/global-styles/dimensions-panel.js +2 -2
  355. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  356. package/build-module/components/global-styles/font-families.js +58 -40
  357. package/build-module/components/global-styles/font-families.js.map +1 -1
  358. package/build-module/components/global-styles/font-family-item.js +18 -13
  359. package/build-module/components/global-styles/font-family-item.js.map +1 -1
  360. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +26 -22
  361. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  362. package/build-module/components/global-styles/font-library-modal/context.js +7 -30
  363. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  364. package/build-module/components/global-styles/font-library-modal/font-card.js +25 -16
  365. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
  366. package/build-module/components/global-styles/font-library-modal/font-collection.js +198 -153
  367. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  368. package/build-module/components/global-styles/font-library-modal/font-demo.js +14 -12
  369. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  370. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +30 -20
  371. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  372. package/build-module/components/global-styles/font-library-modal/index.js +42 -36
  373. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  374. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +157 -111
  375. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  376. package/build-module/components/global-styles/font-library-modal/library-font-details.js +18 -14
  377. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  378. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +26 -22
  379. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  380. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +42 -35
  381. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  382. package/build-module/components/global-styles/font-library-modal/utils/index.js +3 -3
  383. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  384. package/build-module/components/global-styles/gradients-palette-panel.js +42 -38
  385. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  386. package/build-module/components/global-styles/header.js +38 -28
  387. package/build-module/components/global-styles/header.js.map +1 -1
  388. package/build-module/components/global-styles/highlighted-colors.js +3 -4
  389. package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
  390. package/build-module/components/global-styles/hooks.js +11 -20
  391. package/build-module/components/global-styles/hooks.js.map +1 -1
  392. package/build-module/components/global-styles/icon-with-current-color.js +4 -4
  393. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  394. package/build-module/components/global-styles/navigation-button.js +16 -11
  395. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  396. package/build-module/components/global-styles/palette.js +42 -34
  397. package/build-module/components/global-styles/palette.js.map +1 -1
  398. package/build-module/components/global-styles/preset-colors.js +21 -0
  399. package/build-module/components/global-styles/preset-colors.js.map +1 -0
  400. package/build-module/components/global-styles/preview-colors.js +23 -25
  401. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  402. package/build-module/components/global-styles/preview-iframe.js +36 -29
  403. package/build-module/components/global-styles/preview-iframe.js.map +1 -1
  404. package/build-module/components/global-styles/preview-styles.js +96 -90
  405. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  406. package/build-module/components/global-styles/root-menu.js +31 -22
  407. package/build-module/components/global-styles/root-menu.js.map +1 -1
  408. package/build-module/components/global-styles/screen-background.js +8 -4
  409. package/build-module/components/global-styles/screen-background.js.map +1 -1
  410. package/build-module/components/global-styles/screen-block-list.js +35 -27
  411. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  412. package/build-module/components/global-styles/screen-block.js +64 -53
  413. package/build-module/components/global-styles/screen-block.js.map +1 -1
  414. package/build-module/components/global-styles/screen-color-palette.js +31 -19
  415. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  416. package/build-module/components/global-styles/screen-colors.js +20 -17
  417. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  418. package/build-module/components/global-styles/screen-css.js +22 -14
  419. package/build-module/components/global-styles/screen-css.js.map +1 -1
  420. package/build-module/components/global-styles/screen-layout.js +11 -4
  421. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  422. package/build-module/components/global-styles/screen-revisions/index.js +54 -42
  423. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  424. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +83 -71
  425. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  426. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
  427. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  428. package/build-module/components/global-styles/screen-root.js +78 -42
  429. package/build-module/components/global-styles/screen-root.js.map +1 -1
  430. package/build-module/components/global-styles/screen-shadows.js +13 -0
  431. package/build-module/components/global-styles/screen-shadows.js.map +1 -0
  432. package/build-module/components/global-styles/screen-style-variations.js +16 -9
  433. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  434. package/build-module/components/global-styles/screen-typography-element.js +52 -45
  435. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  436. package/build-module/components/global-styles/screen-typography.js +17 -11
  437. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  438. package/build-module/components/global-styles/shadow-utils.js +221 -0
  439. package/build-module/components/global-styles/shadow-utils.js.map +1 -0
  440. package/build-module/components/global-styles/shadows-edit-panel.js +452 -0
  441. package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -0
  442. package/build-module/components/global-styles/shadows-panel.js +121 -0
  443. package/build-module/components/global-styles/shadows-panel.js.map +1 -0
  444. package/build-module/components/global-styles/style-variations-container.js +68 -19
  445. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  446. package/build-module/components/global-styles/subtitle.js +5 -4
  447. package/build-module/components/global-styles/subtitle.js.map +1 -1
  448. package/build-module/components/global-styles/typography-elements.js +54 -45
  449. package/build-module/components/global-styles/typography-elements.js.map +1 -1
  450. package/build-module/components/global-styles/typography-example.js +16 -9
  451. package/build-module/components/global-styles/typography-example.js.map +1 -1
  452. package/build-module/components/global-styles/typography-panel.js +2 -2
  453. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  454. package/build-module/components/global-styles/typography-preview.js +5 -4
  455. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  456. package/build-module/components/global-styles/ui.js +126 -89
  457. package/build-module/components/global-styles/ui.js.map +1 -1
  458. package/build-module/components/global-styles/utils.js +27 -0
  459. package/build-module/components/global-styles/utils.js.map +1 -1
  460. package/build-module/components/global-styles/variations/variation.js +35 -24
  461. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  462. package/build-module/components/global-styles/variations/variations-color.js +21 -15
  463. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  464. package/build-module/components/global-styles/variations/variations-panel.js +28 -18
  465. package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
  466. package/build-module/components/global-styles/variations/variations-typography.js +38 -31
  467. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  468. package/build-module/components/global-styles-renderer/index.js +5 -1
  469. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  470. package/build-module/components/global-styles-sidebar/default-sidebar.js +51 -0
  471. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -0
  472. package/build-module/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +38 -26
  473. package/build-module/components/global-styles-sidebar/index.js.map +1 -0
  474. package/build-module/components/layout/index.js +116 -100
  475. package/build-module/components/layout/index.js.map +1 -1
  476. package/build-module/components/layout/router.js +110 -76
  477. package/build-module/components/layout/router.js.map +1 -1
  478. package/build-module/components/media/index.js +2 -2
  479. package/build-module/components/media/index.js.map +1 -1
  480. package/build-module/components/{header-edit-mode/more-menu → more-menu}/index.js +9 -3
  481. package/build-module/components/more-menu/index.js.map +1 -0
  482. package/build-module/components/{header-edit-mode/more-menu → more-menu}/site-export.js +5 -4
  483. package/build-module/components/more-menu/site-export.js.map +1 -0
  484. package/build-module/components/{header-edit-mode/more-menu → more-menu}/welcome-guide-menu-item.js +5 -4
  485. package/build-module/components/more-menu/welcome-guide-menu-item.js.map +1 -0
  486. package/build-module/components/page/header.js +25 -19
  487. package/build-module/components/page/header.js.map +1 -1
  488. package/build-module/components/page/index.js +16 -13
  489. package/build-module/components/page/index.js.map +1 -1
  490. package/build-module/components/page-pages/index.js +141 -69
  491. package/build-module/components/page-pages/index.js.map +1 -1
  492. package/build-module/components/page-patterns/delete-category-menu-item.js +25 -20
  493. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  494. package/build-module/components/page-patterns/header.js +48 -32
  495. package/build-module/components/page-patterns/header.js.map +1 -1
  496. package/build-module/components/page-patterns/index.js +121 -125
  497. package/build-module/components/page-patterns/index.js.map +1 -1
  498. package/build-module/components/page-patterns/rename-category-menu-item.js +16 -11
  499. package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
  500. package/build-module/components/page-patterns/use-patterns.js +7 -6
  501. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  502. package/build-module/components/page-templates/index.js +85 -72
  503. package/build-module/components/page-templates/index.js.map +1 -1
  504. package/build-module/components/pagination/index.js +52 -42
  505. package/build-module/components/pagination/index.js.map +1 -1
  506. package/build-module/components/plugin-template-setting-panel/index.js +4 -2
  507. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
  508. package/build-module/components/resizable-frame/index.js +51 -35
  509. package/build-module/components/resizable-frame/index.js.map +1 -1
  510. package/build-module/components/revisions/index.js +31 -21
  511. package/build-module/components/revisions/index.js.map +1 -1
  512. package/build-module/components/routes/link.js +5 -4
  513. package/build-module/components/routes/link.js.map +1 -1
  514. package/build-module/components/save-button/index.js +5 -4
  515. package/build-module/components/save-button/index.js.map +1 -1
  516. package/build-module/components/save-hub/index.js +12 -11
  517. package/build-module/components/save-hub/index.js.map +1 -1
  518. package/build-module/components/save-panel/index.js +37 -30
  519. package/build-module/components/save-panel/index.js.map +1 -1
  520. package/build-module/components/sidebar/index.js +69 -36
  521. package/build-module/components/sidebar/index.js.map +1 -1
  522. package/build-module/components/sidebar-button/index.js +4 -4
  523. package/build-module/components/sidebar-button/index.js.map +1 -1
  524. package/build-module/components/sidebar-dataviews/add-new-view.js +58 -48
  525. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  526. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +108 -89
  527. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  528. package/build-module/components/sidebar-dataviews/dataview-item.js +15 -12
  529. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  530. package/build-module/components/sidebar-dataviews/default-views.js +49 -1
  531. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  532. package/build-module/components/sidebar-dataviews/index.js +23 -22
  533. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  534. package/build-module/components/sidebar-navigation-item/index.js +33 -28
  535. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  536. package/build-module/components/sidebar-navigation-screen/index.js +58 -70
  537. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  538. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +25 -17
  539. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  540. package/build-module/components/sidebar-navigation-screen-details-panel/index.js +10 -7
  541. package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  542. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +5 -4
  543. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
  544. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +7 -7
  545. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  546. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +5 -4
  547. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
  548. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +59 -45
  549. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  550. package/build-module/components/sidebar-navigation-screen-main/index.js +47 -22
  551. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  552. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +5 -4
  553. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  554. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +20 -12
  555. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  556. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +63 -35
  557. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  558. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +10 -8
  559. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  560. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +43 -36
  561. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  562. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +19 -12
  563. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  564. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
  565. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  566. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +36 -22
  567. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  568. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +50 -40
  569. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  570. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +14 -9
  571. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  572. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +12 -10
  573. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  574. package/build-module/components/sidebar-navigation-screen-patterns/index.js +64 -77
  575. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  576. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +18 -17
  577. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  578. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +8 -5
  579. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  580. package/build-module/components/site-hub/index.js +85 -75
  581. package/build-module/components/site-hub/index.js.map +1 -1
  582. package/build-module/components/site-icon/index.js +9 -8
  583. package/build-module/components/site-icon/index.js.map +1 -1
  584. package/build-module/components/style-book/index.js +122 -102
  585. package/build-module/components/style-book/index.js.map +1 -1
  586. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -30
  587. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  588. package/build-module/components/table/index.js +24 -15
  589. package/build-module/components/table/index.js.map +1 -1
  590. package/build-module/components/template-part-converter/convert-to-regular.js +5 -4
  591. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  592. package/build-module/components/template-part-converter/convert-to-template-part.js +25 -16
  593. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  594. package/build-module/components/template-part-converter/index.js +30 -11
  595. package/build-module/components/template-part-converter/index.js.map +1 -1
  596. package/build-module/components/welcome-guide/editor.js +22 -15
  597. package/build-module/components/welcome-guide/editor.js.map +1 -1
  598. package/build-module/components/welcome-guide/image.js +14 -12
  599. package/build-module/components/welcome-guide/image.js.map +1 -1
  600. package/build-module/components/welcome-guide/index.js +6 -2
  601. package/build-module/components/welcome-guide/index.js.map +1 -1
  602. package/build-module/components/welcome-guide/page.js +20 -13
  603. package/build-module/components/welcome-guide/page.js.map +1 -1
  604. package/build-module/components/welcome-guide/styles.js +47 -28
  605. package/build-module/components/welcome-guide/styles.js.map +1 -1
  606. package/build-module/components/welcome-guide/template.js +20 -13
  607. package/build-module/components/welcome-guide/template.js.map +1 -1
  608. package/build-module/deprecated.js +4 -4
  609. package/build-module/deprecated.js.map +1 -1
  610. package/build-module/hooks/commands/use-common-commands.js +12 -23
  611. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  612. package/build-module/hooks/commands/use-edit-mode-commands.js +4 -118
  613. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  614. package/build-module/hooks/index.js +0 -1
  615. package/build-module/hooks/index.js.map +1 -1
  616. package/build-module/hooks/push-changes-to-global-styles/index.js +27 -16
  617. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  618. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +6 -2
  619. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  620. package/build-module/index.js +3 -3
  621. package/build-module/index.js.map +1 -1
  622. package/build-module/store/private-actions.js +7 -1
  623. package/build-module/store/private-actions.js.map +1 -1
  624. package/build-module/store/selectors.js +2 -2
  625. package/build-module/store/selectors.js.map +1 -1
  626. package/build-module/utils/template-part-create.js +0 -52
  627. package/build-module/utils/template-part-create.js.map +1 -1
  628. package/build-module/utils/use-activate-theme.js +9 -7
  629. package/build-module/utils/use-activate-theme.js.map +1 -1
  630. package/build-style/style-rtl.css +486 -981
  631. package/build-style/style.css +486 -981
  632. package/package.json +44 -47
  633. package/src/components/add-new-pattern/index.js +46 -37
  634. package/src/components/add-new-template/index.js +4 -2
  635. package/src/components/add-new-template/utils.js +77 -39
  636. package/src/components/app/index.js +5 -2
  637. package/src/components/block-editor/style.scss +4 -139
  638. package/src/components/block-editor/use-editor-iframe-props.js +79 -0
  639. package/src/components/canvas-loader/index.js +5 -2
  640. package/src/components/dataviews-actions/index.js +43 -0
  641. package/src/components/editor/index.js +129 -215
  642. package/src/components/editor/style.scss +2 -17
  643. package/src/components/editor-canvas-container/index.js +30 -35
  644. package/src/components/editor-canvas-container/style.scss +16 -0
  645. package/src/components/global-styles/background-panel.js +20 -4
  646. package/src/components/global-styles/color-indicator-wrapper.js +2 -2
  647. package/src/components/global-styles/color-palette-panel.js +3 -4
  648. package/src/components/global-styles/font-families.js +25 -18
  649. package/src/components/global-styles/font-family-item.js +2 -2
  650. package/src/components/global-styles/font-library-modal/collection-font-variant.js +2 -1
  651. package/src/components/global-styles/font-library-modal/context.js +6 -44
  652. package/src/components/global-styles/font-library-modal/font-collection.js +3 -5
  653. package/src/components/global-styles/font-library-modal/installed-fonts.js +42 -12
  654. package/src/components/global-styles/font-library-modal/library-font-variant.js +2 -1
  655. package/src/components/global-styles/font-library-modal/upload-fonts.js +1 -4
  656. package/src/components/global-styles/font-library-modal/utils/index.js +1 -1
  657. package/src/components/global-styles/gradients-palette-panel.js +1 -4
  658. package/src/components/global-styles/hooks.js +10 -36
  659. package/src/components/global-styles/icon-with-current-color.js +2 -2
  660. package/src/components/global-styles/palette.js +9 -18
  661. package/src/components/global-styles/preset-colors.js +18 -0
  662. package/src/components/global-styles/preview-colors.js +4 -7
  663. package/src/components/global-styles/root-menu.js +16 -12
  664. package/src/components/global-styles/screen-block.js +1 -1
  665. package/src/components/global-styles/screen-color-palette.js +4 -4
  666. package/src/components/global-styles/screen-colors.js +0 -2
  667. package/src/components/global-styles/screen-layout.js +9 -2
  668. package/src/components/global-styles/screen-revisions/index.js +6 -0
  669. package/src/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  670. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
  671. package/src/components/global-styles/screen-shadows.js +13 -0
  672. package/src/components/global-styles/screen-typography.js +1 -1
  673. package/src/components/global-styles/shadow-utils.js +158 -0
  674. package/src/components/global-styles/shadows-edit-panel.js +555 -0
  675. package/src/components/global-styles/shadows-panel.js +147 -0
  676. package/src/components/global-styles/stories/index.story.js +2 -1
  677. package/src/components/global-styles/style-variations-container.js +73 -10
  678. package/src/components/global-styles/style.scss +54 -5
  679. package/src/components/global-styles/test/shadow-utils.spec.js +251 -0
  680. package/src/components/global-styles/test/utils.spec.js +59 -0
  681. package/src/components/global-styles/typography-example.js +2 -1
  682. package/src/components/global-styles/ui.js +15 -7
  683. package/src/components/global-styles/utils.js +27 -0
  684. package/src/components/global-styles/variations/style.scss +17 -30
  685. package/src/components/global-styles/variations/variation.js +15 -10
  686. package/src/components/global-styles/variations/variations-color.js +7 -9
  687. package/src/components/global-styles/variations/variations-panel.js +16 -5
  688. package/src/components/global-styles/variations/variations-typography.js +2 -1
  689. package/src/components/global-styles-renderer/index.js +7 -1
  690. package/src/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +7 -2
  691. package/src/components/{sidebar-edit-mode → global-styles-sidebar}/style.scss +0 -11
  692. package/src/components/layout/index.js +10 -10
  693. package/src/components/layout/router.js +96 -61
  694. package/src/components/layout/style.scss +10 -6
  695. package/src/components/{header-edit-mode/more-menu → more-menu}/index.js +1 -1
  696. package/src/components/page/header.js +17 -13
  697. package/src/components/page/index.js +3 -7
  698. package/src/components/page/style.scss +21 -7
  699. package/src/components/page-pages/index.js +162 -68
  700. package/src/components/page-pages/style.scss +14 -10
  701. package/src/components/page-patterns/delete-category-menu-item.js +1 -2
  702. package/src/components/page-patterns/header.js +45 -33
  703. package/src/components/page-patterns/index.js +25 -81
  704. package/src/components/page-patterns/style.scss +21 -14
  705. package/src/components/page-patterns/use-patterns.js +13 -6
  706. package/src/components/page-templates/index.js +10 -29
  707. package/src/components/pagination/index.js +2 -2
  708. package/src/components/resizable-frame/index.js +17 -5
  709. package/src/components/revisions/index.js +2 -1
  710. package/src/components/save-panel/index.js +5 -7
  711. package/src/components/sidebar/index.js +61 -37
  712. package/src/components/sidebar-button/index.js +2 -5
  713. package/src/components/sidebar-dataviews/add-new-view.js +5 -5
  714. package/src/components/sidebar-dataviews/custom-dataviews-list.js +5 -7
  715. package/src/components/sidebar-dataviews/dataview-item.js +6 -9
  716. package/src/components/sidebar-dataviews/default-views.js +61 -1
  717. package/src/components/sidebar-dataviews/index.js +4 -9
  718. package/src/components/sidebar-navigation-item/index.js +10 -10
  719. package/src/components/sidebar-navigation-screen/index.js +7 -31
  720. package/src/components/sidebar-navigation-screen/style.scss +11 -9
  721. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
  722. package/src/components/sidebar-navigation-screen-global-styles/index.js +10 -3
  723. package/src/components/sidebar-navigation-screen-main/index.js +14 -4
  724. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +6 -1
  725. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +18 -1
  726. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
  727. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
  728. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +8 -4
  729. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -13
  730. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +0 -61
  731. package/src/components/sidebar-navigation-screen-patterns/category-item.js +5 -3
  732. package/src/components/sidebar-navigation-screen-patterns/index.js +8 -29
  733. package/src/components/sidebar-navigation-screen-templates-browse/content.js +1 -1
  734. package/src/components/sidebar-navigation-screen-templates-browse/index.js +3 -2
  735. package/src/components/site-hub/index.js +14 -15
  736. package/src/components/site-hub/style.scss +46 -9
  737. package/src/components/site-icon/index.js +2 -2
  738. package/src/components/style-book/index.js +8 -7
  739. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +18 -23
  740. package/src/components/template-part-converter/convert-to-template-part.js +4 -1
  741. package/src/components/template-part-converter/index.js +16 -3
  742. package/src/hooks/commands/use-common-commands.js +12 -23
  743. package/src/hooks/commands/use-edit-mode-commands.js +4 -118
  744. package/src/hooks/index.js +0 -1
  745. package/src/hooks/push-changes-to-global-styles/index.js +2 -1
  746. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +7 -2
  747. package/src/index.js +1 -1
  748. package/src/store/private-actions.js +9 -1
  749. package/src/store/selectors.js +2 -2
  750. package/src/style.scss +1 -17
  751. package/src/utils/template-part-create.js +0 -67
  752. package/src/utils/use-activate-theme.js +5 -5
  753. package/build/components/block-editor/editor-canvas.js +0 -153
  754. package/build/components/block-editor/editor-canvas.js.map +0 -1
  755. package/build/components/block-editor/resizable-editor.js +0 -86
  756. package/build/components/block-editor/resizable-editor.js.map +0 -1
  757. package/build/components/block-editor/resize-handle.js +0 -57
  758. package/build/components/block-editor/resize-handle.js.map +0 -1
  759. package/build/components/block-editor/site-editor-canvas.js +0 -95
  760. package/build/components/block-editor/site-editor-canvas.js.map +0 -1
  761. package/build/components/code-editor/index.js +0 -111
  762. package/build/components/code-editor/index.js.map +0 -1
  763. package/build/components/create-template-part-modal/index.js +0 -151
  764. package/build/components/create-template-part-modal/index.js.map +0 -1
  765. package/build/components/global-styles/global-styles-provider.js +0 -129
  766. package/build/components/global-styles/global-styles-provider.js.map +0 -1
  767. package/build/components/header-edit-mode/document-tools/index.js +0 -68
  768. package/build/components/header-edit-mode/document-tools/index.js.map +0 -1
  769. package/build/components/header-edit-mode/index.js +0 -150
  770. package/build/components/header-edit-mode/index.js.map +0 -1
  771. package/build/components/header-edit-mode/more-menu/index.js.map +0 -1
  772. package/build/components/header-edit-mode/more-menu/site-export.js.map +0 -1
  773. package/build/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +0 -1
  774. package/build/components/page-patterns/dataviews-pattern-actions.js +0 -387
  775. package/build/components/page-patterns/dataviews-pattern-actions.js.map +0 -1
  776. package/build/components/pattern-modal/duplicate.js +0 -70
  777. package/build/components/pattern-modal/duplicate.js.map +0 -1
  778. package/build/components/pattern-modal/index.js +0 -23
  779. package/build/components/pattern-modal/index.js.map +0 -1
  780. package/build/components/pattern-modal/rename.js +0 -45
  781. package/build/components/pattern-modal/rename.js.map +0 -1
  782. package/build/components/rename-post-menu-item/index.js +0 -109
  783. package/build/components/rename-post-menu-item/index.js.map +0 -1
  784. package/build/components/sidebar-edit-mode/default-sidebar.js +0 -52
  785. package/build/components/sidebar-edit-mode/default-sidebar.js.map +0 -1
  786. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +0 -1
  787. package/build/components/sidebar-edit-mode/index.js +0 -147
  788. package/build/components/sidebar-edit-mode/index.js.map +0 -1
  789. package/build/components/sidebar-edit-mode/page-panels/index.js +0 -129
  790. package/build/components/sidebar-edit-mode/page-panels/index.js.map +0 -1
  791. package/build/components/sidebar-edit-mode/page-panels/page-content.js +0 -34
  792. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +0 -1
  793. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +0 -46
  794. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +0 -1
  795. package/build/components/sidebar-edit-mode/settings-header/index.js +0 -42
  796. package/build/components/sidebar-edit-mode/settings-header/index.js.map +0 -1
  797. package/build/components/sidebar-edit-mode/template-panel/hooks.js +0 -86
  798. package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +0 -1
  799. package/build/components/sidebar-edit-mode/template-panel/index.js +0 -127
  800. package/build/components/sidebar-edit-mode/template-panel/index.js.map +0 -1
  801. package/build/components/sidebar-navigation-screen-page/index.js +0 -163
  802. package/build/components/sidebar-navigation-screen-page/index.js.map +0 -1
  803. package/build/components/sidebar-navigation-screen-page/page-details.js +0 -127
  804. package/build/components/sidebar-navigation-screen-page/page-details.js.map +0 -1
  805. package/build/components/sidebar-navigation-screen-page/status-label.js +0 -65
  806. package/build/components/sidebar-navigation-screen-page/status-label.js.map +0 -1
  807. package/build/components/sidebar-navigation-screen-pattern/index.js +0 -72
  808. package/build/components/sidebar-navigation-screen-pattern/index.js.map +0 -1
  809. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +0 -38
  810. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +0 -1
  811. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +0 -29
  812. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +0 -1
  813. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +0 -37
  814. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +0 -1
  815. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +0 -45
  816. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +0 -1
  817. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +0 -88
  818. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +0 -1
  819. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js +0 -29
  820. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +0 -1
  821. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +0 -138
  822. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +0 -1
  823. package/build/components/sidebar-navigation-screen-template/home-template-details.js +0 -110
  824. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +0 -1
  825. package/build/components/sidebar-navigation-screen-template/index.js +0 -118
  826. package/build/components/sidebar-navigation-screen-template/index.js.map +0 -1
  827. package/build/components/sidebar-navigation-screen-template/template-areas.js +0 -117
  828. package/build/components/sidebar-navigation-screen-template/template-areas.js.map +0 -1
  829. package/build/components/start-template-options/index.js +0 -191
  830. package/build/components/start-template-options/index.js.map +0 -1
  831. package/build/components/template-actions/index.js +0 -131
  832. package/build/components/template-actions/index.js.map +0 -1
  833. package/build/hooks/components.js +0 -10
  834. package/build/hooks/components.js.map +0 -1
  835. package/build/utils/get-is-list-page.js +0 -28
  836. package/build/utils/get-is-list-page.js.map +0 -1
  837. package/build/utils/math.js +0 -98
  838. package/build/utils/math.js.map +0 -1
  839. package/build-module/components/block-editor/editor-canvas.js +0 -145
  840. package/build-module/components/block-editor/editor-canvas.js.map +0 -1
  841. package/build-module/components/block-editor/resizable-editor.js +0 -79
  842. package/build-module/components/block-editor/resizable-editor.js.map +0 -1
  843. package/build-module/components/block-editor/resize-handle.js +0 -50
  844. package/build-module/components/block-editor/resize-handle.js.map +0 -1
  845. package/build-module/components/block-editor/site-editor-canvas.js +0 -86
  846. package/build-module/components/block-editor/site-editor-canvas.js.map +0 -1
  847. package/build-module/components/code-editor/index.js +0 -103
  848. package/build-module/components/code-editor/index.js.map +0 -1
  849. package/build-module/components/create-template-part-modal/index.js +0 -143
  850. package/build-module/components/create-template-part-modal/index.js.map +0 -1
  851. package/build-module/components/global-styles/global-styles-provider.js +0 -120
  852. package/build-module/components/global-styles/global-styles-provider.js.map +0 -1
  853. package/build-module/components/header-edit-mode/document-tools/index.js +0 -61
  854. package/build-module/components/header-edit-mode/document-tools/index.js.map +0 -1
  855. package/build-module/components/header-edit-mode/index.js +0 -142
  856. package/build-module/components/header-edit-mode/index.js.map +0 -1
  857. package/build-module/components/header-edit-mode/more-menu/index.js.map +0 -1
  858. package/build-module/components/header-edit-mode/more-menu/site-export.js.map +0 -1
  859. package/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +0 -1
  860. package/build-module/components/page-patterns/dataviews-pattern-actions.js +0 -380
  861. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +0 -1
  862. package/build-module/components/pattern-modal/duplicate.js +0 -62
  863. package/build-module/components/pattern-modal/duplicate.js.map +0 -1
  864. package/build-module/components/pattern-modal/index.js +0 -14
  865. package/build-module/components/pattern-modal/index.js.map +0 -1
  866. package/build-module/components/pattern-modal/rename.js +0 -37
  867. package/build-module/components/pattern-modal/rename.js.map +0 -1
  868. package/build-module/components/rename-post-menu-item/index.js +0 -102
  869. package/build-module/components/rename-post-menu-item/index.js.map +0 -1
  870. package/build-module/components/sidebar-edit-mode/default-sidebar.js +0 -45
  871. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +0 -1
  872. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +0 -1
  873. package/build-module/components/sidebar-edit-mode/index.js +0 -138
  874. package/build-module/components/sidebar-edit-mode/index.js.map +0 -1
  875. package/build-module/components/sidebar-edit-mode/page-panels/index.js +0 -121
  876. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +0 -1
  877. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +0 -27
  878. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +0 -1
  879. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +0 -39
  880. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +0 -1
  881. package/build-module/components/sidebar-edit-mode/settings-header/index.js +0 -35
  882. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +0 -1
  883. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js +0 -79
  884. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +0 -1
  885. package/build-module/components/sidebar-edit-mode/template-panel/index.js +0 -119
  886. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +0 -1
  887. package/build-module/components/sidebar-navigation-screen-page/index.js +0 -155
  888. package/build-module/components/sidebar-navigation-screen-page/index.js.map +0 -1
  889. package/build-module/components/sidebar-navigation-screen-page/page-details.js +0 -120
  890. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +0 -1
  891. package/build-module/components/sidebar-navigation-screen-page/status-label.js +0 -57
  892. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +0 -1
  893. package/build-module/components/sidebar-navigation-screen-pattern/index.js +0 -64
  894. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +0 -1
  895. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +0 -30
  896. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +0 -1
  897. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +0 -20
  898. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +0 -1
  899. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +0 -29
  900. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +0 -1
  901. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +0 -36
  902. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +0 -1
  903. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +0 -80
  904. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +0 -1
  905. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js +0 -22
  906. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +0 -1
  907. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +0 -130
  908. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +0 -1
  909. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +0 -103
  910. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +0 -1
  911. package/build-module/components/sidebar-navigation-screen-template/index.js +0 -110
  912. package/build-module/components/sidebar-navigation-screen-template/index.js.map +0 -1
  913. package/build-module/components/sidebar-navigation-screen-template/template-areas.js +0 -109
  914. package/build-module/components/sidebar-navigation-screen-template/template-areas.js.map +0 -1
  915. package/build-module/components/start-template-options/index.js +0 -184
  916. package/build-module/components/start-template-options/index.js.map +0 -1
  917. package/build-module/components/template-actions/index.js +0 -123
  918. package/build-module/components/template-actions/index.js.map +0 -1
  919. package/build-module/hooks/components.js +0 -7
  920. package/build-module/hooks/components.js.map +0 -1
  921. package/build-module/utils/get-is-list-page.js +0 -22
  922. package/build-module/utils/get-is-list-page.js.map +0 -1
  923. package/build-module/utils/math.js +0 -92
  924. package/build-module/utils/math.js.map +0 -1
  925. package/src/components/block-editor/editor-canvas.js +0 -178
  926. package/src/components/block-editor/resizable-editor.js +0 -82
  927. package/src/components/block-editor/resize-handle.js +0 -66
  928. package/src/components/block-editor/site-editor-canvas.js +0 -107
  929. package/src/components/code-editor/index.js +0 -94
  930. package/src/components/code-editor/style.scss +0 -95
  931. package/src/components/create-template-part-modal/index.js +0 -199
  932. package/src/components/create-template-part-modal/style.scss +0 -69
  933. package/src/components/global-styles/global-styles-provider.js +0 -162
  934. package/src/components/header-edit-mode/document-tools/index.js +0 -68
  935. package/src/components/header-edit-mode/index.js +0 -190
  936. package/src/components/header-edit-mode/style.scss +0 -201
  937. package/src/components/page-patterns/dataviews-pattern-actions.js +0 -439
  938. package/src/components/pattern-modal/duplicate.js +0 -55
  939. package/src/components/pattern-modal/index.js +0 -19
  940. package/src/components/pattern-modal/rename.js +0 -30
  941. package/src/components/rename-post-menu-item/index.js +0 -138
  942. package/src/components/sidebar-edit-mode/index.js +0 -173
  943. package/src/components/sidebar-edit-mode/page-panels/index.js +0 -133
  944. package/src/components/sidebar-edit-mode/page-panels/page-content.js +0 -29
  945. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +0 -61
  946. package/src/components/sidebar-edit-mode/settings-header/index.js +0 -43
  947. package/src/components/sidebar-edit-mode/settings-header/style.scss +0 -14
  948. package/src/components/sidebar-edit-mode/template-panel/hooks.js +0 -114
  949. package/src/components/sidebar-edit-mode/template-panel/index.js +0 -134
  950. package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -16
  951. package/src/components/sidebar-navigation-screen-page/index.js +0 -204
  952. package/src/components/sidebar-navigation-screen-page/page-details.js +0 -161
  953. package/src/components/sidebar-navigation-screen-page/status-label.js +0 -71
  954. package/src/components/sidebar-navigation-screen-page/style.scss +0 -69
  955. package/src/components/sidebar-navigation-screen-pattern/index.js +0 -63
  956. package/src/components/sidebar-navigation-screen-pattern/style.scss +0 -26
  957. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +0 -31
  958. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +0 -21
  959. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +0 -33
  960. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +0 -36
  961. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +0 -98
  962. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js +0 -32
  963. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +0 -205
  964. package/src/components/sidebar-navigation-screen-template/home-template-details.js +0 -144
  965. package/src/components/sidebar-navigation-screen-template/index.js +0 -133
  966. package/src/components/sidebar-navigation-screen-template/style.scss +0 -53
  967. package/src/components/sidebar-navigation-screen-template/template-areas.js +0 -135
  968. package/src/components/start-template-options/index.js +0 -231
  969. package/src/components/start-template-options/style.scss +0 -55
  970. package/src/components/template-actions/index.js +0 -165
  971. package/src/hooks/components.js +0 -11
  972. package/src/utils/get-is-list-page.js +0 -25
  973. package/src/utils/math.js +0 -93
  974. package/src/utils/test/template-part-create.js +0 -63
  975. /package/src/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
  976. /package/src/components/{header-edit-mode/more-menu → more-menu}/site-export.js +0 -0
  977. /package/src/components/{header-edit-mode/more-menu → more-menu}/welcome-guide-menu-item.js +0 -0
@@ -1,10 +1,10 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
5
4
  import { Disabled } from '@wordpress/components';
6
5
  import { __ } from '@wordpress/i18n';
7
6
  import { BlockList, privateApis as blockEditorPrivateApis, store as blockEditorStore, __unstableEditorStyles as EditorStyles, __unstableIframe as Iframe } from '@wordpress/block-editor';
7
+ import { privateApis as editorPrivateApis } from '@wordpress/editor';
8
8
  import { useSelect } from '@wordpress/data';
9
9
  import { useContext, useMemo } from '@wordpress/element';
10
10
 
@@ -13,13 +13,17 @@ import { useContext, useMemo } from '@wordpress/element';
13
13
  */
14
14
 
15
15
  import { unlock } from '../../lock-unlock';
16
- import { mergeBaseAndUserConfigs } from '../global-styles/global-styles-provider';
17
16
  import EditorCanvasContainer from '../editor-canvas-container';
17
+ import { jsx as _jsx } from "react/jsx-runtime";
18
+ import { jsxs as _jsxs } from "react/jsx-runtime";
18
19
  const {
19
20
  ExperimentalBlockEditorProvider,
20
21
  GlobalStylesContext,
21
22
  useGlobalStylesOutputWithConfig
22
23
  } = unlock(blockEditorPrivateApis);
24
+ const {
25
+ mergeBaseAndUserConfigs
26
+ } = unlock(editorPrivateApis);
23
27
  function isObjectEmpty(object) {
24
28
  return !object || Object.keys(object).length === 0;
25
29
  }
@@ -44,27 +48,33 @@ function Revisions({
44
48
  }), [originalSettings]);
45
49
  const [globalStyles] = useGlobalStylesOutputWithConfig(mergedConfig);
46
50
  const editorStyles = !isObjectEmpty(globalStyles) && !isObjectEmpty(userConfig) ? globalStyles : settings.styles;
47
- return createElement(EditorCanvasContainer, {
51
+ return /*#__PURE__*/_jsx(EditorCanvasContainer, {
48
52
  title: __('Revisions'),
49
53
  closeButtonLabel: __('Close revisions'),
50
- enableResizing: true
51
- }, createElement(Iframe, {
52
- className: "edit-site-revisions__iframe",
53
- name: "revisions",
54
- tabIndex: 0
55
- }, createElement(EditorStyles, {
56
- styles: editorStyles
57
- }), createElement("style", null,
58
- // Forming a "block formatting context" to prevent margin collapsing.
59
- // @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
60
- `.is-root-container { display: flow-root; }`), createElement(Disabled, {
61
- className: "edit-site-revisions__example-preview__content"
62
- }, createElement(ExperimentalBlockEditorProvider, {
63
- value: renderedBlocksArray,
64
- settings: settings
65
- }, createElement(BlockList, {
66
- renderAppender: false
67
- })))));
54
+ enableResizing: true,
55
+ children: /*#__PURE__*/_jsxs(Iframe, {
56
+ className: "edit-site-revisions__iframe",
57
+ name: "revisions",
58
+ tabIndex: 0,
59
+ children: [/*#__PURE__*/_jsx(EditorStyles, {
60
+ styles: editorStyles
61
+ }), /*#__PURE__*/_jsx("style", {
62
+ children:
63
+ // Forming a "block formatting context" to prevent margin collapsing.
64
+ // @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
65
+ `.is-root-container { display: flow-root; }`
66
+ }), /*#__PURE__*/_jsx(Disabled, {
67
+ className: "edit-site-revisions__example-preview__content",
68
+ children: /*#__PURE__*/_jsx(ExperimentalBlockEditorProvider, {
69
+ value: renderedBlocksArray,
70
+ settings: settings,
71
+ children: /*#__PURE__*/_jsx(BlockList, {
72
+ renderAppender: false
73
+ })
74
+ })
75
+ })]
76
+ })
77
+ });
68
78
  }
69
79
  export default Revisions;
70
80
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Disabled","__","BlockList","privateApis","blockEditorPrivateApis","store","blockEditorStore","__unstableEditorStyles","EditorStyles","__unstableIframe","Iframe","useSelect","useContext","useMemo","unlock","mergeBaseAndUserConfigs","EditorCanvasContainer","ExperimentalBlockEditorProvider","GlobalStylesContext","useGlobalStylesOutputWithConfig","isObjectEmpty","object","Object","keys","length","Revisions","userConfig","blocks","base","baseConfig","mergedConfig","renderedBlocksArray","Array","isArray","originalSettings","select","getSettings","settings","__unstableIsPreviewMode","globalStyles","editorStyles","styles","createElement","title","closeButtonLabel","enableResizing","className","name","tabIndex","value","renderAppender"],"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 { useSelect } from '@wordpress/data';\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nimport { unlock } from '../../lock-unlock';\nimport { mergeBaseAndUserConfigs } from '../global-styles/global-styles-provider';\nimport EditorCanvasContainer from '../editor-canvas-container';\n\nconst {\n\tExperimentalBlockEditorProvider,\n\tGlobalStylesContext,\n\tuseGlobalStylesOutputWithConfig,\n} = unlock( blockEditorPrivateApis );\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":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC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AiB,CAAC,CAAC8B,WAAW,CAAC,CAAC,EACtD,EACD,CAAC;EACD,MAAMC,QAAQ,GAAGxB,OAAO,CACvB,OAAQ;IAAE,GAAGqB,gBAAgB;IAAEI,uBAAuB,EAAE;EAAK,CAAC,CAAE,EAChE,CAAEJ,gBAAgB,CACnB,CAAC;EAED,MAAM,CAAEK,YAAY,CAAE,GAAGpB,+BAA+B,CAAEW,YAAa,CAAC;EAExE,MAAMU,YAAY,GACjB,CAAEpB,aAAa,CAAEmB,YAAa,CAAC,IAAI,CAAEnB,aAAa,CAAEM,UAAW,CAAC,GAC7Da,YAAY,GACZF,QAAQ,CAACI,MAAM;EAEnB,OACCC,aAAA,CAAC1B,qBAAqB;IACrB2B,KAAK,EAAG1C,EAAE,CAAE,WAAY,CAAG;IAC3B2C,gBAAgB,EAAG3C,EAAE,CAAE,iBAAkB,CAAG;IAC5C4C,cAAc;EAAA,GAEdH,aAAA,CAAChC,MAAM;IACNoC,SAAS,EAAC,6BAA6B;IACvCC,IAAI,EAAC,WAAW;IAChBC,QAAQ,EAAG;EAAG,GAEdN,aAAA,CAAClC,YAAY;IAACiC,MAAM,EAAGD;EAAc,CAAE,CAAC,EACxCE,aAAA;EAEE;EACA;EACC,4CAEI,CAAC,EACRA,aAAA,CAAC1C,QAAQ;IAAC8C,SAAS,EAAC;EAA+C,GAClEJ,aAAA,CAACzB,+BAA+B;IAC/BgC,KAAK,EAAGlB,mBAAqB;IAC7BM,QAAQ,EAAGA;EAAU,GAErBK,aAAA,CAACxC,SAAS;IAACgD,cAAc,EAAG;EAAO,CAAE,CACL,CACxB,CACH,CACc,CAAC;AAE1B;AAEA,eAAezB,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["Disabled","__","BlockList","privateApis","blockEditorPrivateApis","store","blockEditorStore","__unstableEditorStyles","EditorStyles","__unstableIframe","Iframe","editorPrivateApis","useSelect","useContext","useMemo","unlock","EditorCanvasContainer","jsx","_jsx","jsxs","_jsxs","ExperimentalBlockEditorProvider","GlobalStylesContext","useGlobalStylesOutputWithConfig","mergeBaseAndUserConfigs","isObjectEmpty","object","Object","keys","length","Revisions","userConfig","blocks","base","baseConfig","mergedConfig","renderedBlocksArray","Array","isArray","originalSettings","select","getSettings","settings","__unstableIsPreviewMode","globalStyles","editorStyles","styles","title","closeButtonLabel","enableResizing","children","className","name","tabIndex","value","renderAppender"],"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":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,SAAS,EACTC,WAAW,IAAIC,sBAAsB,EACrCC,KAAK,IAAIC,gBAAgB,EACzBC,sBAAsB,IAAIC,YAAY,E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";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -10,6 +9,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
10
9
  */
11
10
  import { unlock } from '../../lock-unlock';
12
11
  import { isPreviewingTheme, currentlyPreviewingTheme } from '../../utils/is-previewing-theme';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  const {
14
14
  useHistory
15
15
  } = unlock(routerPrivateApis);
@@ -48,10 +48,11 @@ export default function Link({
48
48
  href,
49
49
  onClick
50
50
  } = useLink(params, state, shouldReplace);
51
- return createElement("a", {
51
+ return /*#__PURE__*/_jsx("a", {
52
52
  href: href,
53
53
  onClick: onClick,
54
- ...props
55
- }, children);
54
+ ...props,
55
+ children: children
56
+ });
56
57
  }
57
58
  //# sourceMappingURL=link.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["addQueryArgs","getQueryArgs","removeQueryArgs","privateApis","routerPrivateApis","unlock","isPreviewingTheme","currentlyPreviewingTheme","useHistory","useLink","params","state","shouldReplace","history","onClick","event","preventDefault","replace","push","currentArgs","window","location","href","currentUrlWithoutArgs","Object","keys","wp_theme_preview","newUrl","Link","children","props","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":";AAAA;AACA;AACA;AACA,SAASA,YAAY,EAAEC,YAAY,EAAEC,eAAe,QAAQ,gBAAgB;AAC5E,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SACCC,iBAAiB,EACjBC,wBAAwB,QAClB,iCAAiC;AAExC,MAAM;EAAEC;AAAW,CAAC,GAAGH,MAAM,CAAED,iBAAkB,CAAC;AAElD,OAAO,SAASK,OAAOA,CAAEC,MAAM,EAAEC,KAAK,EAAEC,aAAa,GAAG,KAAK,EAAG;EAC/D,MAAMC,OAAO,GAAGL,UAAU,CAAC,CAAC;EAC5B,SAASM,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,GAAGlB,YAAY,CAAEmB,MAAM,CAACC,QAAQ,CAACC,IAAK,CAAC;EACxD,MAAMC,qBAAqB,GAAGrB,eAAe,CAC5CkB,MAAM,CAACC,QAAQ,CAACC,IAAI,EACpB,GAAGE,MAAM,CAACC,IAAI,CAAEN,WAAY,CAC7B,CAAC;EAED,IAAKb,iBAAiB,CAAC,CAAC,EAAG;IAC1BI,MAAM,GAAG;MACR,GAAGA,MAAM;MACTgB,gBAAgB,EAAEnB,wBAAwB,CAAC;IAC5C,CAAC;EACF;EAEA,MAAMoB,MAAM,GAAG3B,YAAY,CAAEuB,qBAAqB,EAAEb,MAAO,CAAC;EAE5D,OAAO;IACNY,IAAI,EAAEK,MAAM;IACZb;EACD,CAAC;AACF;AAEA,eAAe,SAASc,IAAIA,CAAE;EAC7BlB,MAAM,GAAG,CAAC,CAAC;EACXC,KAAK;EACLM,OAAO,EAAEL,aAAa,GAAG,KAAK;EAC9BiB,QAAQ;EACR,GAAGC;AACJ,CAAC,EAAG;EACH,MAAM;IAAER,IAAI;IAAER;EAAQ,CAAC,GAAGL,OAAO,CAAEC,MAAM,EAAEC,KAAK,EAAEC,aAAc,CAAC;EAEjE,OACCmB,aAAA;IAAGT,IAAI,EAAGA,IAAM;IAACR,OAAO,EAAGA,OAAS;IAAA,GAAMgB;EAAK,GAC5CD,QACA,CAAC;AAEN","ignoreList":[]}
1
+ {"version":3,"names":["addQueryArgs","getQueryArgs","removeQueryArgs","privateApis","routerPrivateApis","unlock","isPreviewingTheme","currentlyPreviewingTheme","jsx","_jsx","useHistory","useLink","params","state","shouldReplace","history","onClick","event","preventDefault","replace","push","currentArgs","window","location","href","currentUrlWithoutArgs","Object","keys","wp_theme_preview","newUrl","Link","children","props"],"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":"AAAA;AACA;AACA;AACA,SAASA,YAAY,EAAEC,YAAY,EAAEC,eAAe,QAAQ,gBAAgB;AAC5E,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SACCC,iBAAiB,EACjBC,wBAAwB,QAClB,iCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzC,MAAM;EAAEC;AAAW,CAAC,GAAGL,MAAM,CAAED,iBAAkB,CAAC;AAElD,OAAO,SAASO,OAAOA,CAAEC,MAAM,EAAEC,KAAK,EAAEC,aAAa,GAAG,KAAK,EAAG;EAC/D,MAAMC,OAAO,GAAGL,UAAU,CAAC,CAAC;EAC5B,SAASM,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,GAAGpB,YAAY,CAAEqB,MAAM,CAACC,QAAQ,CAACC,IAAK,CAAC;EACxD,MAAMC,qBAAqB,GAAGvB,eAAe,CAC5CoB,MAAM,CAACC,QAAQ,CAACC,IAAI,EACpB,GAAGE,MAAM,CAACC,IAAI,CAAEN,WAAY,CAC7B,CAAC;EAED,IAAKf,iBAAiB,CAAC,CAAC,EAAG;IAC1BM,MAAM,GAAG;MACR,GAAGA,MAAM;MACTgB,gBAAgB,EAAErB,wBAAwB,CAAC;IAC5C,CAAC;EACF;EAEA,MAAMsB,MAAM,GAAG7B,YAAY,CAAEyB,qBAAqB,EAAEb,MAAO,CAAC;EAE5D,OAAO;IACNY,IAAI,EAAEK,MAAM;IACZb;EACD,CAAC;AACF;AAEA,eAAe,SAASc,IAAIA,CAAE;EAC7BlB,MAAM,GAAG,CAAC,CAAC;EACXC,KAAK;EACLM,OAAO,EAAEL,aAAa,GAAG,KAAK;EAC9BiB,QAAQ;EACR,GAAGC;AACJ,CAAC,EAAG;EACH,MAAM;IAAER,IAAI;IAAER;EAAQ,CAAC,GAAGL,OAAO,CAAEC,MAAM,EAAEC,KAAK,EAAEC,aAAc,CAAC;EAEjE,oBACCL,IAAA;IAAGe,IAAI,EAAGA,IAAM;IAACR,OAAO,EAAGA,OAAS;IAAA,GAAMgB,KAAK;IAAAD,QAAA,EAC5CA;EAAQ,CACR,CAAC;AAEN","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -16,6 +15,7 @@ import { useEntitiesSavedStatesIsDirty, store as editorStore } from '@wordpress/
16
15
  import { store as editSiteStore } from '../../store';
17
16
  import { currentlyPreviewingTheme, isPreviewingTheme } from '../../utils/is-previewing-theme';
18
17
  import { unlock } from '../../lock-unlock';
18
+ import { jsx as _jsx } from "react/jsx-runtime";
19
19
  const {
20
20
  useLocation
21
21
  } = unlock(routerPrivateApis);
@@ -106,7 +106,7 @@ export default function SaveButton({
106
106
  const onClick = isOnlyCurrentEntityDirty ? () => saveDirtyEntities({
107
107
  dirtyEntityRecords
108
108
  }) : () => setIsSaveViewOpened(true);
109
- return createElement(Button, {
109
+ return /*#__PURE__*/_jsx(Button, {
110
110
  variant: variant,
111
111
  className: className,
112
112
  "aria-disabled": disabled,
@@ -128,7 +128,8 @@ export default function SaveButton({
128
128
  showTooltip: showTooltip,
129
129
  icon: icon,
130
130
  __next40pxDefaultSize: __next40pxDefaultSize,
131
- size: size
132
- }, label);
131
+ size: size,
132
+ children: label
133
+ });
133
134
  }
134
135
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useDispatch","Button","__","_n","sprintf","store","coreStore","displayShortcut","privateApis","routerPrivateApis","useEntitiesSavedStatesIsDirty","editorStore","editSiteStore","currentlyPreviewingTheme","isPreviewingTheme","unlock","useLocation","SaveButton","className","variant","showTooltip","showReviewMessage","icon","size","__next40pxDefaultSize","params","setIsSaveViewOpened","saveDirtyEntities","dirtyEntityRecords","isSaving","isSaveViewOpen","previewingThemeName","select","isSavingEntityRecord","isResolving","isSaveViewOpened","isActivatingTheme","currentlyPreviewingThemeId","some","record","kind","name","key","getTheme","rendered","undefined","hasDirtyEntities","length","isOnlyCurrentEntityDirty","postId","postType","path","includes","disabled","getLabel","label","onClick","createElement","isBusy","shortcut","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":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,eAAe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AGA,qBAAuB;IAC/CD,IAAI,EAAGA;EAAM,GAEXgC,KACK,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","useDispatch","Button","__","_n","sprintf","store","coreStore","displayShortcut","privateApis","routerPrivateApis","useEntitiesSavedStatesIsDirty","editorStore","editSiteStore","currentlyPreviewingTheme","isPreviewingTheme","unlock","jsx","_jsx","useLocation","SaveButton","className","variant","showTooltip","showReviewMessage","icon","size","__next40pxDefaultSize","params","setIsSaveViewOpened","saveDirtyEntities","dirtyEntityRecords","isSaving","isSaveViewOpen","previewingThemeName","select","isSavingEntityRecord","isResolving","isSaveViewOpened","isActivatingTheme","currentlyPreviewingThemeId","some","record","kind","name","key","getTheme","rendered","undefined","hasDirtyEntities","length","isOnlyCurrentEntityDirty","postId","postType","path","includes","disabled","getLabel","label","onClick","isBusy","shortcut","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":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SACCC,6BAA6B,EAC7BL,KAAK,IAAIM,WAAW,QACd,mBAAmB;;AAE1B;AACA;AACA;AACA,SAASN,KAAK,IAAIO,aAAa,QAAQ,aAAa;AACpD,SACCC,wBAAwB,EACxBC,iBAAiB,QACX,iCAAiC;AACxC,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAM;EAAEC;AAAY,CAAC,GAAGH,MAAM,CAAEN,iBAAkB,CAAC;AAEnD,eAAe,SAASU,UAAUA,CAAE;EACnCC,SAAS,GAAG,+BAA+B;EAC3CC,OAAO,GAAG,SAAS;EACnBC,WAAW,GAAG,IAAI;EAClBC,iBAAiB;EACjBC,IAAI;EACJC,IAAI;EACJC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ACmB,MACpB,CAAC,EACDnB,kBAAkB,CAACmB,MACpB,CAAC;IACF;IACA,OAAO/C,EAAE,CAAE,MAAO,CAAC;EACpB,CAAC;EACD,MAAMuD,KAAK,GAAGD,QAAQ,CAAC,CAAC;EACxB,MAAME,OAAO,GAAGR,wBAAwB,GACrC,MAAMrB,iBAAiB,CAAE;IAAEC;EAAmB,CAAE,CAAC,GACjD,MAAMF,mBAAmB,CAAE,IAAK,CAAC;EACpC,oBACCX,IAAA,CAAChB,MAAM;IACNoB,OAAO,EAAGA,OAAS;IACnBD,SAAS,EAAGA,SAAW;IACvB,iBAAgBmC,QAAU;IAC1B,iBAAgBvB,cAAgB;IAChC2B,MAAM,EAAG5B,QAAU;IACnB2B,OAAO,EAAGH,QAAQ,GAAGR,SAAS,GAAGW,OAAS;IAC1CD,KAAK,EAAGA;IACR;AACH;AACA;AACA,OAHG;IAIAG,QAAQ,EAAGL,QAAQ,GAAGR,SAAS,GAAGxC,eAAe,CAACsD,OAAO,CAAE,GAAI;IAC/D;AACH;AACA;AACA;AACA;AACA,OALG;IAMAvC,WAAW,EAAGA,WAAa;IAC3BE,IAAI,EAAGA,IAAM;IACbE,qBAAqB,EAAGA,qBAAuB;IAC/CD,IAAI,EAAGA,IAAM;IAAAqC,QAAA,EAEXL;EAAK,CACA,CAAC;AAEX","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -12,6 +11,7 @@ import { check } from '@wordpress/icons';
12
11
  */
13
12
  import SaveButton from '../save-button';
14
13
  import { isPreviewingTheme } from '../../utils/is-previewing-theme';
14
+ import { jsx as _jsx } from "react/jsx-runtime";
15
15
  export default function SaveHub() {
16
16
  const {
17
17
  isDisabled,
@@ -28,17 +28,18 @@ export default function SaveHub() {
28
28
  isDisabled: _isSaving || !dirtyEntityRecords.length && !isPreviewingTheme()
29
29
  };
30
30
  }, []);
31
- return createElement(HStack, {
31
+ return /*#__PURE__*/_jsx(HStack, {
32
32
  className: "edit-site-save-hub",
33
33
  alignment: "right",
34
- spacing: 4
35
- }, createElement(SaveButton, {
36
- className: "edit-site-save-hub__button",
37
- variant: isDisabled ? null : 'primary',
38
- showTooltip: false,
39
- icon: isDisabled && !isSaving ? check : null,
40
- showReviewMessage: true,
41
- __next40pxDefaultSize: true
42
- }));
34
+ spacing: 4,
35
+ children: /*#__PURE__*/_jsx(SaveButton, {
36
+ className: "edit-site-save-hub__button",
37
+ variant: isDisabled ? null : 'primary',
38
+ showTooltip: false,
39
+ icon: isDisabled && !isSaving ? check : null,
40
+ showReviewMessage: true,
41
+ __next40pxDefaultSize: true
42
+ })
43
+ });
43
44
  }
44
45
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","__experimentalHStack","HStack","store","coreStore","check","SaveButton","isPreviewingTheme","SaveHub","isDisabled","isSaving","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","dirtyEntityRecords","_isSaving","some","record","kind","name","key","length","createElement","className","alignment","spacing","variant","showTooltip","icon","showReviewMessage","__next40pxDefaultSize"],"sources":["@wordpress/edit-site/src/components/save-hub/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SaveButton from '../save-button';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nexport default function SaveHub() {\n\tconst { isDisabled, isSaving } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst _isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\t\treturn {\n\t\t\tisSaving: _isSaving,\n\t\t\tisDisabled:\n\t\t\t\t_isSaving ||\n\t\t\t\t( ! dirtyEntityRecords.length && ! isPreviewingTheme() ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<HStack className=\"edit-site-save-hub\" alignment=\"right\" spacing={ 4 }>\n\t\t\t<SaveButton\n\t\t\t\tclassName=\"edit-site-save-hub__button\"\n\t\t\t\tvariant={ isDisabled ? null : 'primary' }\n\t\t\t\tshowTooltip={ false }\n\t\t\t\ticon={ isDisabled && ! isSaving ? check : null }\n\t\t\t\tshowReviewMessage\n\t\t\t\t__next40pxDefaultSize\n\t\t\t/>\n\t\t</HStack>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AACtE,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,KAAK,QAAQ,kBAAkB;;AAExC;AACA;AACA;AACA,OAAOC,UAAU,MAAM,gBAAgB;AACvC,SAASC,iBAAiB,QAAQ,iCAAiC;AAEnE,eAAe,SAASC,OAAOA,CAAA,EAAG;EACjC,MAAM;IAAEC,UAAU;IAAEC;EAAS,CAAC,GAAGV,SAAS,CAAIW,MAAM,IAAM;IACzD,MAAM;MAAEC,mCAAmC;MAAEC;IAAqB,CAAC,GAClEF,MAAM,CAAEP,SAAU,CAAC;IACpB,MAAMU,kBAAkB,GAAGF,mCAAmC,CAAC,CAAC;IAChE,MAAMG,SAAS,GAAGD,kBAAkB,CAACE,IAAI,CAAIC,MAAM,IAClDJ,oBAAoB,CAAEI,MAAM,CAACC,IAAI,EAAED,MAAM,CAACE,IAAI,EAAEF,MAAM,CAACG,GAAI,CAC5D,CAAC;IACD,OAAO;MACNV,QAAQ,EAAEK,SAAS;MACnBN,UAAU,EACTM,SAAS,IACP,CAAED,kBAAkB,CAACO,MAAM,IAAI,CAAEd,iBAAiB,CAAC;IACvD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,OACCe,aAAA,CAACpB,MAAM;IAACqB,SAAS,EAAC,oBAAoB;IAACC,SAAS,EAAC,OAAO;IAACC,OAAO,EAAG;EAAG,GACrEH,aAAA,CAAChB,UAAU;IACViB,SAAS,EAAC,4BAA4B;IACtCG,OAAO,EAAGjB,UAAU,GAAG,IAAI,GAAG,SAAW;IACzCkB,WAAW,EAAG,KAAO;IACrBC,IAAI,EAAGnB,UAAU,IAAI,CAAEC,QAAQ,GAAGL,KAAK,GAAG,IAAM;IAChDwB,iBAAiB;IACjBC,qBAAqB;EAAA,CACrB,CACM,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","__experimentalHStack","HStack","store","coreStore","check","SaveButton","isPreviewingTheme","jsx","_jsx","SaveHub","isDisabled","isSaving","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","dirtyEntityRecords","_isSaving","some","record","kind","name","key","length","className","alignment","spacing","children","variant","showTooltip","icon","showReviewMessage","__next40pxDefaultSize"],"sources":["@wordpress/edit-site/src/components/save-hub/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SaveButton from '../save-button';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nexport default function SaveHub() {\n\tconst { isDisabled, isSaving } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst _isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\t\treturn {\n\t\t\tisSaving: _isSaving,\n\t\t\tisDisabled:\n\t\t\t\t_isSaving ||\n\t\t\t\t( ! dirtyEntityRecords.length && ! isPreviewingTheme() ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<HStack className=\"edit-site-save-hub\" alignment=\"right\" spacing={ 4 }>\n\t\t\t<SaveButton\n\t\t\t\tclassName=\"edit-site-save-hub__button\"\n\t\t\t\tvariant={ isDisabled ? null : 'primary' }\n\t\t\t\tshowTooltip={ false }\n\t\t\t\ticon={ isDisabled && ! isSaving ? check : null }\n\t\t\t\tshowReviewMessage\n\t\t\t\t__next40pxDefaultSize\n\t\t\t/>\n\t\t</HStack>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AACtE,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,KAAK,QAAQ,kBAAkB;;AAExC;AACA;AACA;AACA,OAAOC,UAAU,MAAM,gBAAgB;AACvC,SAASC,iBAAiB,QAAQ,iCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEpE,eAAe,SAASC,OAAOA,CAAA,EAAG;EACjC,MAAM;IAAEC,UAAU;IAAEC;EAAS,CAAC,GAAGZ,SAAS,CAAIa,MAAM,IAAM;IACzD,MAAM;MAAEC,mCAAmC;MAAEC;IAAqB,CAAC,GAClEF,MAAM,CAAET,SAAU,CAAC;IACpB,MAAMY,kBAAkB,GAAGF,mCAAmC,CAAC,CAAC;IAChE,MAAMG,SAAS,GAAGD,kBAAkB,CAACE,IAAI,CAAIC,MAAM,IAClDJ,oBAAoB,CAAEI,MAAM,CAACC,IAAI,EAAED,MAAM,CAACE,IAAI,EAAEF,MAAM,CAACG,GAAI,CAC5D,CAAC;IACD,OAAO;MACNV,QAAQ,EAAEK,SAAS;MACnBN,UAAU,EACTM,SAAS,IACP,CAAED,kBAAkB,CAACO,MAAM,IAAI,CAAEhB,iBAAiB,CAAC;IACvD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,oBACCE,IAAA,CAACP,MAAM;IAACsB,SAAS,EAAC,oBAAoB;IAACC,SAAS,EAAC,OAAO;IAACC,OAAO,EAAG,CAAG;IAAAC,QAAA,eACrElB,IAAA,CAACH,UAAU;MACVkB,SAAS,EAAC,4BAA4B;MACtCI,OAAO,EAAGjB,UAAU,GAAG,IAAI,GAAG,SAAW;MACzCkB,WAAW,EAAG,KAAO;MACrBC,IAAI,EAAGnB,UAAU,IAAI,CAAEC,QAAQ,GAAGP,KAAK,GAAG,IAAM;MAChD0B,iBAAiB;MACjBC,qBAAqB;IAAA,CACrB;EAAC,CACK,CAAC;AAEX","ignoreList":[]}
@@ -1,8 +1,7 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * External dependencies
4
3
  */
5
- import classnames from 'classnames';
4
+ import clsx from 'clsx';
6
5
 
7
6
  /**
8
7
  * WordPress dependencies
@@ -21,6 +20,8 @@ import { unlock } from '../../lock-unlock';
21
20
  import { useActivateTheme } from '../../utils/use-activate-theme';
22
21
  import { useActualCurrentTheme } from '../../utils/use-actual-current-theme';
23
22
  import { isPreviewingTheme } from '../../utils/is-previewing-theme';
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { jsxs as _jsxs } from "react/jsx-runtime";
24
25
  const {
25
26
  EntitiesSavedStatesExtensible,
26
27
  NavigableRegion
@@ -38,14 +39,16 @@ const EntitiesSavedStatesForPreview = ({
38
39
  }
39
40
  const currentTheme = useActualCurrentTheme();
40
41
  const previewingTheme = useSelect(select => select(coreStore).getCurrentTheme(), []);
41
- const additionalPrompt = createElement("p", null, sprintf( /* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */
42
- __('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 : '...'));
42
+ const additionalPrompt = /*#__PURE__*/_jsx("p", {
43
+ children: sprintf( /* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */
44
+ __('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 : '...')
45
+ });
43
46
  const activateTheme = useActivateTheme();
44
47
  const onSave = async values => {
45
48
  await activateTheme();
46
49
  return values;
47
50
  };
48
- return createElement(EntitiesSavedStatesExtensible, {
51
+ return /*#__PURE__*/_jsx(EntitiesSavedStatesExtensible, {
49
52
  ...isDirtyProps,
50
53
  additionalPrompt,
51
54
  close: onClose,
@@ -59,11 +62,11 @@ const _EntitiesSavedStates = ({
59
62
  renderDialog = undefined
60
63
  }) => {
61
64
  if (isPreviewingTheme()) {
62
- return createElement(EntitiesSavedStatesForPreview, {
65
+ return /*#__PURE__*/_jsx(EntitiesSavedStatesForPreview, {
63
66
  onClose: onClose
64
67
  });
65
68
  }
66
- return createElement(EntitiesSavedStates, {
69
+ return /*#__PURE__*/_jsx(EntitiesSavedStates, {
67
70
  close: onClose,
68
71
  renderDialog: renderDialog
69
72
  });
@@ -101,36 +104,40 @@ export default function SavePanel() {
101
104
  } = useDispatch(editSiteStore);
102
105
  const onClose = () => setIsSaveViewOpened(false);
103
106
  if (canvasMode === 'view') {
104
- return isSaveViewOpen ? createElement(Modal, {
107
+ return isSaveViewOpen ? /*#__PURE__*/_jsx(Modal, {
105
108
  className: "edit-site-save-panel__modal",
106
109
  onRequestClose: onClose,
107
110
  __experimentalHideHeader: true,
108
- contentLabel: __('Save site, content, and template changes')
109
- }, createElement(_EntitiesSavedStates, {
110
- onClose: onClose
111
- })) : null;
111
+ contentLabel: __('Save site, content, and template changes'),
112
+ children: /*#__PURE__*/_jsx(_EntitiesSavedStates, {
113
+ onClose: onClose
114
+ })
115
+ }) : null;
112
116
  }
113
117
  const activateSaveEnabled = isPreviewingTheme() || isDirty;
114
118
  const disabled = isSaving || !activateSaveEnabled;
115
- return createElement(NavigableRegion, {
116
- className: classnames('edit-site-layout__actions', {
119
+ return /*#__PURE__*/_jsxs(NavigableRegion, {
120
+ className: clsx('edit-site-layout__actions', {
117
121
  'is-entity-save-view-open': isSaveViewOpen
118
122
  }),
119
- ariaLabel: __('Save panel')
120
- }, createElement("div", {
121
- className: classnames('edit-site-editor__toggle-save-panel', {
122
- 'screen-reader-text': isSaveViewOpen
123
- })
124
- }, createElement(Button, {
125
- variant: "secondary",
126
- className: classnames('edit-site-editor__toggle-save-panel-button'),
127
- onClick: () => setIsSaveViewOpened(true),
128
- "aria-haspopup": 'dialog',
129
- disabled: disabled,
130
- __experimentalIsFocusable: true
131
- }, __('Open save panel'))), isSaveViewOpen && createElement(_EntitiesSavedStates, {
132
- onClose: onClose,
133
- renderDialog: true
134
- }));
123
+ ariaLabel: __('Save panel'),
124
+ children: [/*#__PURE__*/_jsx("div", {
125
+ className: clsx('edit-site-editor__toggle-save-panel', {
126
+ 'screen-reader-text': isSaveViewOpen
127
+ }),
128
+ children: /*#__PURE__*/_jsx(Button, {
129
+ variant: "secondary",
130
+ className: "edit-site-editor__toggle-save-panel-button",
131
+ onClick: () => setIsSaveViewOpened(true),
132
+ "aria-haspopup": "dialog",
133
+ disabled: disabled,
134
+ __experimentalIsFocusable: true,
135
+ children: __('Open save panel')
136
+ })
137
+ }), isSaveViewOpen && /*#__PURE__*/_jsx(_EntitiesSavedStates, {
138
+ onClose: onClose,
139
+ renderDialog: true
140
+ })]
141
+ });
135
142
  }
136
143
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","Button","Modal","EntitiesSavedStates","useEntitiesSavedStatesIsDirty","privateApis","useDispatch","useSelect","__","sprintf","store","coreStore","editSiteStore","unlock","useActivateTheme","useActualCurrentTheme","isPreviewingTheme","EntitiesSavedStatesExtensible","NavigableRegion","EntitiesSavedStatesForPreview","onClose","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","activateSaveLabel","isDirty","currentTheme","previewingTheme","select","getCurrentTheme","additionalPrompt","createElement","name","rendered","activateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","renderDialog","undefined","SavePanel","isSaveViewOpen","canvasMode","isSaving","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isActivatingTheme","isSaveViewOpened","getCanvasMode","length","some","record","kind","key","setIsSaveViewOpened","className","onRequestClose","__experimentalHideHeader","contentLabel","activateSaveEnabled","disabled","ariaLabel","variant","onClick","__experimentalIsFocusable"],"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport { useActualCurrentTheme } from '../../utils/use-actual-current-theme';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible, NavigableRegion } =\n\tunlock( privateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose } ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t}\n\n\tconst currentTheme = useActualCurrentTheme();\n\n\tconst previewingTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */\n\t\t\t\t__(\n\t\t\t\t\t'Saving your changes will change your active theme from %1$s to %2$s.'\n\t\t\t\t),\n\t\t\t\tcurrentTheme?.name?.rendered ?? '...',\n\t\t\t\tpreviewingTheme?.name?.rendered ?? '...'\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose, renderDialog = undefined } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn <EntitiesSavedStatesForPreview onClose={ onClose } />;\n\t}\n\treturn (\n\t\t<EntitiesSavedStates close={ onClose } renderDialog={ renderDialog } />\n\t);\n};\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode, isDirty, isSaving } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tisSavingEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\n\t\t\t// The currently selected entity to display.\n\t\t\t// Typically template or template part in the site editor.\n\t\t\treturn {\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\n\tif ( canvasMode === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ classnames( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ classnames( 'edit-site-editor__toggle-save-panel', {\n\t\t\t\t\t'screen-reader-text': isSaveViewOpen,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'edit-site-editor__toggle-save-panel-button'\n\t\t\t\t\t) }\n\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\taria-haspopup={ 'dialog' }\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t{ isSaveViewOpen && (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } renderDialog />\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,KAAK,QAAQ,uBAAuB;AACrD,SACCC,mBAAmB,EACnBC,6BAA6B,EAC7BC,WAAW,QACL,mBAAmB;AAC1B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,SAASC,qBAAqB,QAAQ,sCAAsC;AAC5E,SAASC,iBAAiB,QAAQ,iCAAiC;AAEnE,MAAM;EAAEC,6BAA6B;EAAEC;AAAgB,CAAC,GACvDL,MAAM,CAAER,WAAY,CAAC;AAEtB,MAAMc,6BAA6B,GAAGA,CAAE;EAAEC;AAAQ,CAAC,KAAM;EAAA,IAAAC,qBAAA,EAAAC,qBAAA;EACxD,MAAMC,YAAY,GAAGnB,6BAA6B,CAAC,CAAC;EACpD,IAAIoB,iBAAiB;EACrB,IAAKD,YAAY,CAACE,OAAO,EAAG;IAC3BD,iBAAiB,GAAGhB,EAAE,CAAE,iBAAkB,CAAC;EAC5C,CAAC,MAAM;IACNgB,iBAAiB,GAAGhB,EAAE,CAAE,UAAW,CAAC;EACrC;EAEA,MAAMkB,YAAY,GAAGX,qBAAqB,CAAC,CAAC;EAE5C,MA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EAAG5D,UAAU,CAAE,2BAA2B,EAAE;MACpD,0BAA0B,EAAE4C;IAC7B,CAAE,CAAG;IACLsB,SAAS,EAAG1D,EAAE,CAAE,YAAa;EAAG,GAEhCuB,aAAA;IACC6B,SAAS,EAAG5D,UAAU,CAAE,qCAAqC,EAAE;MAC9D,oBAAoB,EAAE4C;IACvB,CAAE;EAAG,GAELb,aAAA,CAAC9B,MAAM;IACNkE,OAAO,EAAC,WAAW;IACnBP,SAAS,EAAG5D,UAAU,CACrB,4CACD,CAAG;IACHoE,OAAO,EAAGA,CAAA,KAAMT,mBAAmB,CAAE,IAAK,CAAG;IAC7C,iBAAgB,QAAU;IAC1BM,QAAQ,EAAGA,QAAU;IACrBI,yBAAyB;EAAA,GAEvB7D,EAAE,CAAE,iBAAkB,CACjB,CACJ,CAAC,EACJoC,cAAc,IACfb,aAAA,CAACS,oBAAoB;IAACpB,OAAO,EAAGA,OAAS;IAACqB,YAAY;EAAA,CAAE,CAEzC,CAAC;AAEpB","ignoreList":[]}
1
+ {"version":3,"names":["clsx","Button","Modal","EntitiesSavedStates","useEntitiesSavedStatesIsDirty","privateApis","useDispatch","useSelect","__","sprintf","store","coreStore","editSiteStore","unlock","useActivateTheme","useActualCurrentTheme","isPreviewingTheme","jsx","_jsx","jsxs","_jsxs","EntitiesSavedStatesExtensible","NavigableRegion","EntitiesSavedStatesForPreview","onClose","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","activateSaveLabel","isDirty","currentTheme","previewingTheme","select","getCurrentTheme","additionalPrompt","children","name","rendered","activateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","renderDialog","undefined","SavePanel","isSaveViewOpen","canvasMode","isSaving","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isActivatingTheme","isSaveViewOpened","getCanvasMode","length","some","record","kind","key","setIsSaveViewOpened","className","onRequestClose","__experimentalHideHeader","contentLabel","activateSaveEnabled","disabled","ariaLabel","variant","onClick","__experimentalIsFocusable"],"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport 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":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,MAAM,EAAEC,KAAK,QAAQ,uBAAuB;AACrD,SACCC,mBAAmB,EACnBC,6BAA6B,EAC7BC,WAAW,QACL,mBAAmB;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AC,WAAW;QACnBP,SAAS,EAAC,4CAA4C;QACtDQ,OAAO,EAAGA,CAAA,KAAMT,mBAAmB,CAAE,IAAK,CAAG;QAC7C,iBAAc,QAAQ;QACtBM,QAAQ,EAAGA,QAAU;QACrBI,yBAAyB;QAAAtC,QAAA,EAEvB3B,EAAE,CAAE,iBAAkB;MAAC,CAClB;IAAC,CACL,CAAC,EACJwC,cAAc,iBACf9B,IAAA,CAAC0B,oBAAoB;MAACpB,OAAO,EAAGA,OAAS;MAACqB,YAAY;IAAA,CAAE,CACxD;EAAA,CACe,CAAC;AAEpB","ignoreList":[]}
@@ -1,53 +1,86 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * External dependencies
4
3
  */
5
- import classnames from 'classnames';
4
+ import clsx from 'clsx';
6
5
 
7
6
  /**
8
7
  * WordPress dependencies
9
8
  */
10
- import { useCallback, createContext, useState, useRef, useEffect } from '@wordpress/element';
9
+ import { createContext, useContext, useState, useRef, useLayoutEffect } from '@wordpress/element';
11
10
  import { focus } from '@wordpress/dom';
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
12
  export const SidebarNavigationContext = createContext(() => {});
13
- export default function SidebarContent({
14
- routeKey,
15
- children
16
- }) {
17
- const [navState, setNavState] = useState({
13
+ // Focus a sidebar element after a navigation. The element to focus is either
14
+ // specified by `focusSelector` (when navigating back) or it is the first
15
+ // tabbable element (usually the "Back" button).
16
+ function focusSidebarElement(el, direction, focusSelector) {
17
+ let elementToFocus;
18
+ if (direction === 'back' && focusSelector) {
19
+ elementToFocus = el.querySelector(focusSelector);
20
+ }
21
+ if (direction !== null && !elementToFocus) {
22
+ const [firstTabbable] = focus.tabbable.find(el);
23
+ elementToFocus = firstTabbable !== null && firstTabbable !== void 0 ? firstTabbable : el;
24
+ }
25
+ elementToFocus?.focus();
26
+ }
27
+
28
+ // Navigation state that is updated when navigating back or forward. Helps us
29
+ // manage the animations and also focus.
30
+ function createNavState() {
31
+ let state = {
18
32
  direction: null,
19
33
  focusSelector: null
20
- });
21
- const navigate = useCallback((direction, focusSelector = null) => {
22
- setNavState(prevState => ({
23
- direction,
24
- focusSelector: direction === 'forward' && focusSelector ? focusSelector : prevState.focusSelector
25
- }));
26
- }, []);
27
- const wrapperRef = useRef();
28
- useEffect(() => {
29
- let elementToFocus;
30
- if (navState.direction === 'back' && navState.focusSelector) {
31
- elementToFocus = wrapperRef.current.querySelector(navState.focusSelector);
34
+ };
35
+ return {
36
+ get() {
37
+ return state;
38
+ },
39
+ navigate(direction, focusSelector = null) {
40
+ state = {
41
+ direction,
42
+ focusSelector: direction === 'forward' && focusSelector ? focusSelector : state.focusSelector
43
+ };
32
44
  }
33
- if (navState.direction !== null && !elementToFocus) {
34
- const [firstTabbable] = focus.tabbable.find(wrapperRef.current);
35
- elementToFocus = firstTabbable !== null && firstTabbable !== void 0 ? firstTabbable : wrapperRef.current;
36
- }
37
- elementToFocus?.focus();
45
+ };
46
+ }
47
+ function SidebarContentWrapper({
48
+ children
49
+ }) {
50
+ const navState = useContext(SidebarNavigationContext);
51
+ const wrapperRef = useRef();
52
+ const [navAnimation, setNavAnimation] = useState(null);
53
+ useLayoutEffect(() => {
54
+ const {
55
+ direction,
56
+ focusSelector
57
+ } = navState.get();
58
+ focusSidebarElement(wrapperRef.current, direction, focusSelector);
59
+ setNavAnimation(direction);
38
60
  }, [navState]);
39
- const wrapperCls = classnames('edit-site-sidebar__screen-wrapper', {
40
- 'slide-from-left': navState.direction === 'back',
41
- 'slide-from-right': navState.direction === 'forward'
61
+ const wrapperCls = clsx('edit-site-sidebar__screen-wrapper', {
62
+ 'slide-from-left': navAnimation === 'back',
63
+ 'slide-from-right': navAnimation === 'forward'
42
64
  });
43
- return createElement(SidebarNavigationContext.Provider, {
44
- value: navigate
45
- }, createElement("div", {
46
- className: "edit-site-sidebar__content"
47
- }, createElement("div", {
65
+ return /*#__PURE__*/_jsx("div", {
48
66
  ref: wrapperRef,
49
- key: routeKey,
50
- className: wrapperCls
51
- }, children)));
67
+ className: wrapperCls,
68
+ children: children
69
+ });
70
+ }
71
+ export default function SidebarContent({
72
+ routeKey,
73
+ children
74
+ }) {
75
+ const [navState] = useState(createNavState);
76
+ return /*#__PURE__*/_jsx(SidebarNavigationContext.Provider, {
77
+ value: navState,
78
+ children: /*#__PURE__*/_jsx("div", {
79
+ className: "edit-site-sidebar__content",
80
+ children: /*#__PURE__*/_jsx(SidebarContentWrapper, {
81
+ children: children
82
+ }, routeKey)
83
+ })
84
+ });
52
85
  }
53
86
  //# sourceMappingURL=index.js.map