@wordpress/edit-site 5.32.0 → 5.34.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 (872) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-page/index.js +3 -0
  3. package/build/components/add-new-page/index.js.map +1 -1
  4. package/build/components/add-new-pattern/index.js +8 -7
  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 +3 -0
  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 +3 -1
  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 +282 -13
  11. package/build/components/add-new-template/index.js.map +1 -1
  12. package/build/components/add-new-template/utils.js +22 -11
  13. package/build/components/add-new-template/utils.js.map +1 -1
  14. package/build/components/app/index.js.map +1 -1
  15. package/build/components/async/index.js +51 -0
  16. package/build/components/async/index.js.map +1 -0
  17. package/build/components/block-editor/block-inspector-button.js +10 -9
  18. package/build/components/block-editor/block-inspector-button.js.map +1 -1
  19. package/build/components/block-editor/editor-canvas.js +15 -6
  20. package/build/components/block-editor/editor-canvas.js.map +1 -1
  21. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  22. package/build/components/block-editor/resizable-editor.js.map +1 -1
  23. package/build/components/block-editor/resize-handle.js +20 -5
  24. package/build/components/block-editor/resize-handle.js.map +1 -1
  25. package/build/components/block-editor/site-editor-canvas.js +5 -1
  26. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  27. package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  28. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  29. package/build/components/canvas-loader/index.js.map +1 -1
  30. package/build/components/code-editor/index.js.map +1 -1
  31. package/build/components/create-template-part-modal/index.js +3 -0
  32. package/build/components/create-template-part-modal/index.js.map +1 -1
  33. package/build/components/editor/index.js +61 -11
  34. package/build/components/editor/index.js.map +1 -1
  35. package/build/components/editor-canvas-container/index.js.map +1 -1
  36. package/build/components/error-boundary/index.js.map +1 -1
  37. package/build/components/error-boundary/warning.js.map +1 -1
  38. package/build/components/global-styles/background-panel.js +13 -1
  39. package/build/components/global-styles/background-panel.js.map +1 -1
  40. package/build/components/global-styles/block-preview-panel.js +6 -1
  41. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  42. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  43. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  44. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  45. package/build/components/global-styles/font-families.js +1 -1
  46. package/build/components/global-styles/font-families.js.map +1 -1
  47. package/build/components/global-styles/font-family-item.js.map +1 -1
  48. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  49. package/build/components/global-styles/font-library-modal/context.js +69 -35
  50. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  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 +18 -6
  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.map +1 -1
  55. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  56. package/build/components/global-styles/font-library-modal/index.js +1 -1
  57. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  58. package/build/components/global-styles/font-library-modal/installed-fonts.js +31 -28
  59. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  60. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  61. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  62. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  63. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  64. package/build/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
  65. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  66. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  67. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  68. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  69. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  70. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
  71. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  72. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
  73. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  74. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  75. package/build/components/global-styles/header.js.map +1 -1
  76. package/build/components/global-styles/highlighted-colors.js +1 -1
  77. package/build/components/global-styles/highlighted-colors.js.map +1 -1
  78. package/build/components/global-styles/hooks.js +11 -3
  79. package/build/components/global-styles/hooks.js.map +1 -1
  80. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  81. package/build/components/global-styles/index.js.map +1 -1
  82. package/build/components/global-styles/navigation-button.js.map +1 -1
  83. package/build/components/global-styles/palette.js.map +1 -1
  84. package/build/components/global-styles/preview-colors.js.map +1 -1
  85. package/build/components/global-styles/preview-iframe.js.map +1 -1
  86. package/build/components/global-styles/preview-styles.js.map +1 -1
  87. package/build/components/global-styles/root-menu.js +2 -2
  88. package/build/components/global-styles/root-menu.js.map +1 -1
  89. package/build/components/global-styles/screen-background.js +1 -1
  90. package/build/components/global-styles/screen-background.js.map +1 -1
  91. package/build/components/global-styles/screen-block-list.js.map +1 -1
  92. package/build/components/global-styles/screen-block.js.map +1 -1
  93. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  94. package/build/components/global-styles/screen-colors.js.map +1 -1
  95. package/build/components/global-styles/screen-css.js.map +1 -1
  96. package/build/components/global-styles/screen-layout.js.map +1 -1
  97. package/build/components/global-styles/screen-revisions/index.js +1 -1
  98. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  99. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  100. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  101. package/build/components/global-styles/screen-root.js.map +1 -1
  102. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  103. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  104. package/build/components/global-styles/screen-typography.js.map +1 -1
  105. package/build/components/global-styles/style-variations-container.js +8 -2
  106. package/build/components/global-styles/style-variations-container.js.map +1 -1
  107. package/build/components/global-styles/subtitle.js.map +1 -1
  108. package/build/components/global-styles/typography-elements.js.map +1 -1
  109. package/build/components/global-styles/typography-example.js.map +1 -1
  110. package/build/components/global-styles/typography-panel.js.map +1 -1
  111. package/build/components/global-styles/typography-preview.js.map +1 -1
  112. package/build/components/global-styles/ui.js +1 -1
  113. package/build/components/global-styles/ui.js.map +1 -1
  114. package/build/components/global-styles/utils.js.map +1 -1
  115. package/build/components/global-styles/variations/variation.js.map +1 -1
  116. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  117. package/build/components/global-styles/variations/variations-panel.js.map +1 -1
  118. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  119. package/build/components/global-styles-renderer/index.js.map +1 -1
  120. package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
  121. package/build/components/header-edit-mode/index.js +36 -52
  122. package/build/components/header-edit-mode/index.js.map +1 -1
  123. package/build/components/header-edit-mode/more-menu/index.js +4 -100
  124. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  125. package/build/components/header-edit-mode/more-menu/site-export.js.map +1 -1
  126. package/build/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
  127. package/build/components/keyboard-shortcuts/global.js.map +1 -1
  128. package/build/components/keyboard-shortcuts/register.js +0 -67
  129. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  130. package/build/components/layout/animation.js +3 -2
  131. package/build/components/layout/animation.js.map +1 -1
  132. package/build/components/layout/hooks.js.map +1 -1
  133. package/build/components/layout/index.js +20 -52
  134. package/build/components/layout/index.js.map +1 -1
  135. package/build/components/layout/router.js +70 -33
  136. package/build/components/layout/router.js.map +1 -1
  137. package/build/components/media/index.js.map +1 -1
  138. package/build/components/page/header.js.map +1 -1
  139. package/build/components/page/index.js +5 -2
  140. package/build/components/page/index.js.map +1 -1
  141. package/build/components/page-pages/index.js +18 -19
  142. package/build/components/page-pages/index.js.map +1 -1
  143. package/build/components/page-patterns/dataviews-pattern-actions.js +16 -11
  144. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  145. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  146. package/build/components/page-patterns/header.js +5 -3
  147. package/build/components/page-patterns/header.js.map +1 -1
  148. package/build/components/page-patterns/index.js +140 -62
  149. package/build/components/page-patterns/index.js.map +1 -1
  150. package/build/components/page-patterns/rename-category-menu-item.js.map +1 -1
  151. package/build/components/page-patterns/search-items.js +2 -1
  152. package/build/components/page-patterns/search-items.js.map +1 -1
  153. package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
  154. package/build/components/page-patterns/use-patterns.js +6 -10
  155. package/build/components/page-patterns/use-patterns.js.map +1 -1
  156. package/build/components/page-patterns/utils.js.map +1 -1
  157. package/build/components/page-templates/hooks.js.map +1 -0
  158. package/build/components/{page-templates-template-parts → page-templates}/index.js +78 -103
  159. package/build/components/page-templates/index.js.map +1 -0
  160. package/build/components/pagination/index.js.map +1 -1
  161. package/build/components/pattern-modal/duplicate.js +13 -8
  162. package/build/components/pattern-modal/duplicate.js.map +1 -1
  163. package/build/components/pattern-modal/index.js.map +1 -1
  164. package/build/components/pattern-modal/rename.js +6 -3
  165. package/build/components/pattern-modal/rename.js.map +1 -1
  166. package/build/components/plugin-template-setting-panel/index.js +9 -0
  167. package/build/components/plugin-template-setting-panel/index.js.map +1 -1
  168. package/build/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +18 -16
  169. package/build/components/rename-post-menu-item/index.js.map +1 -0
  170. package/build/components/resizable-frame/index.js +10 -11
  171. package/build/components/resizable-frame/index.js.map +1 -1
  172. package/build/components/revisions/index.js.map +1 -1
  173. package/build/components/routes/link.js.map +1 -1
  174. package/build/components/routes/use-title.js.map +1 -1
  175. package/build/components/save-button/index.js.map +1 -1
  176. package/build/components/save-hub/index.js.map +1 -1
  177. package/build/components/save-panel/index.js +3 -3
  178. package/build/components/save-panel/index.js.map +1 -1
  179. package/build/components/sidebar/index.js +41 -75
  180. package/build/components/sidebar/index.js.map +1 -1
  181. package/build/components/sidebar-button/index.js.map +1 -1
  182. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  183. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  184. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  185. package/build/components/sidebar-dataviews/default-views.js +1 -1
  186. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  187. package/build/components/sidebar-dataviews/index.js +1 -1
  188. package/build/components/sidebar-dataviews/index.js.map +1 -1
  189. package/build/components/sidebar-edit-mode/default-sidebar.js +18 -7
  190. package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  191. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +5 -3
  192. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  193. package/build/components/sidebar-edit-mode/index.js +31 -55
  194. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  195. package/build/components/sidebar-edit-mode/page-panels/index.js +55 -3
  196. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  197. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  198. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +23 -16
  199. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  200. package/build/components/sidebar-edit-mode/settings-header/index.js +4 -5
  201. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  202. package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
  203. package/build/components/sidebar-edit-mode/template-panel/index.js +3 -6
  204. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  205. package/build/components/sidebar-navigation-item/index.js +31 -0
  206. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  207. package/build/components/sidebar-navigation-screen/index.js +36 -9
  208. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  209. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  210. package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  211. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
  212. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  213. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
  214. package/build/components/sidebar-navigation-screen-global-styles/index.js +1 -2
  215. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  216. package/build/components/sidebar-navigation-screen-main/index.js +6 -15
  217. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  218. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
  219. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  220. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +7 -2
  221. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  222. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  223. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  224. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  225. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  226. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  227. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -15
  228. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  229. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  230. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  231. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  232. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  233. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -5
  234. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  235. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  236. package/build/components/sidebar-navigation-screen-page/index.js +53 -12
  237. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  238. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  239. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  240. package/build/components/sidebar-navigation-screen-pattern/index.js +17 -15
  241. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  242. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  243. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
  244. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  245. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
  246. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  247. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  248. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -1
  249. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  250. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  251. package/build/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
  252. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  253. package/build/components/sidebar-navigation-screen-patterns/index.js +64 -52
  254. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  255. package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
  256. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  257. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  258. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  259. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  260. package/build/components/sidebar-navigation-screen-template/index.js +11 -8
  261. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  262. package/build/components/sidebar-navigation-screen-template/template-areas.js.map +1 -1
  263. package/build/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  264. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  265. package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -36
  266. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  267. package/build/components/site-hub/index.js +22 -21
  268. package/build/components/site-hub/index.js.map +1 -1
  269. package/build/components/site-icon/index.js.map +1 -1
  270. package/build/components/start-template-options/index.js.map +1 -1
  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 +14 -13
  273. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  274. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  275. package/build/components/table/index.js.map +1 -1
  276. package/build/components/template-actions/index.js +7 -8
  277. package/build/components/template-actions/index.js.map +1 -1
  278. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  279. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  280. package/build/components/template-part-converter/index.js.map +1 -1
  281. package/build/components/use-edited-entity-record/index.js.map +1 -1
  282. package/build/components/welcome-guide/editor.js.map +1 -1
  283. package/build/components/welcome-guide/image.js.map +1 -1
  284. package/build/components/welcome-guide/index.js.map +1 -1
  285. package/build/components/welcome-guide/page.js.map +1 -1
  286. package/build/components/welcome-guide/styles.js +6 -3
  287. package/build/components/welcome-guide/styles.js.map +1 -1
  288. package/build/components/welcome-guide/template.js.map +1 -1
  289. package/build/deprecated.js +55 -0
  290. package/build/deprecated.js.map +1 -0
  291. package/build/hooks/commands/use-common-commands.js.map +1 -1
  292. package/build/hooks/commands/use-edit-mode-commands.js +10 -28
  293. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  294. package/build/hooks/components.js.map +1 -1
  295. package/build/hooks/index.js.map +1 -1
  296. package/build/hooks/push-changes-to-global-styles/index.js +3 -40
  297. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  298. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +36 -5
  299. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  300. package/build/index.js +18 -23
  301. package/build/index.js.map +1 -1
  302. package/build/lock-unlock.js.map +1 -1
  303. package/build/store/actions.js +21 -96
  304. package/build/store/actions.js.map +1 -1
  305. package/build/store/constants.js.map +1 -1
  306. package/build/store/index.js +1 -1
  307. package/build/store/index.js.map +1 -1
  308. package/build/store/private-actions.js +1 -85
  309. package/build/store/private-actions.js.map +1 -1
  310. package/build/store/private-selectors.js.map +1 -1
  311. package/build/store/reducer.js.map +1 -1
  312. package/build/store/selectors.js.map +1 -1
  313. package/build/utils/clone-deep.js.map +1 -1
  314. package/build/utils/constants.js +2 -2
  315. package/build/utils/constants.js.map +1 -1
  316. package/build/utils/get-is-list-page.js.map +1 -1
  317. package/build/utils/is-previewing-theme.js.map +1 -1
  318. package/build/utils/is-template-removable.js.map +1 -1
  319. package/build/utils/is-template-revertable.js.map +1 -1
  320. package/build/utils/math.js.map +1 -1
  321. package/build/utils/set-nested-value.js +44 -0
  322. package/build/utils/set-nested-value.js.map +1 -0
  323. package/build/utils/template-part-create.js.map +1 -1
  324. package/build/utils/use-activate-theme.js.map +1 -1
  325. package/build/utils/use-actual-current-theme.js.map +1 -1
  326. package/build-module/components/add-new-page/index.js +3 -0
  327. package/build-module/components/add-new-page/index.js.map +1 -1
  328. package/build-module/components/add-new-pattern/index.js +8 -7
  329. package/build-module/components/add-new-pattern/index.js.map +1 -1
  330. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
  331. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  332. package/build-module/components/add-new-template/add-custom-template-modal-content.js +3 -1
  333. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  334. package/build-module/components/add-new-template/index.js +283 -14
  335. package/build-module/components/add-new-template/index.js.map +1 -1
  336. package/build-module/components/add-new-template/utils.js +21 -11
  337. package/build-module/components/add-new-template/utils.js.map +1 -1
  338. package/build-module/components/app/index.js.map +1 -1
  339. package/build-module/components/async/index.js +44 -0
  340. package/build-module/components/async/index.js.map +1 -0
  341. package/build-module/components/block-editor/block-inspector-button.js +9 -8
  342. package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
  343. package/build-module/components/block-editor/editor-canvas.js +16 -7
  344. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  345. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
  346. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  347. package/build-module/components/block-editor/resize-handle.js +21 -6
  348. package/build-module/components/block-editor/resize-handle.js.map +1 -1
  349. package/build-module/components/block-editor/site-editor-canvas.js +5 -1
  350. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  351. package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  352. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  353. package/build-module/components/canvas-loader/index.js.map +1 -1
  354. package/build-module/components/code-editor/index.js.map +1 -1
  355. package/build-module/components/create-template-part-modal/index.js +3 -0
  356. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  357. package/build-module/components/editor/index.js +61 -11
  358. package/build-module/components/editor/index.js.map +1 -1
  359. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  360. package/build-module/components/error-boundary/index.js.map +1 -1
  361. package/build-module/components/error-boundary/warning.js.map +1 -1
  362. package/build-module/components/global-styles/background-panel.js +14 -1
  363. package/build-module/components/global-styles/background-panel.js.map +1 -1
  364. package/build-module/components/global-styles/block-preview-panel.js +6 -1
  365. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  366. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  367. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  368. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  369. package/build-module/components/global-styles/font-families.js.map +1 -1
  370. package/build-module/components/global-styles/font-family-item.js.map +1 -1
  371. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  372. package/build-module/components/global-styles/font-library-modal/context.js +68 -35
  373. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  374. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
  375. package/build-module/components/global-styles/font-library-modal/font-collection.js +19 -7
  376. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  377. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  378. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  379. package/build-module/components/global-styles/font-library-modal/index.js +2 -2
  380. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  381. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +32 -29
  382. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  383. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  384. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  385. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  386. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  387. package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
  388. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  389. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  390. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  391. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  392. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  393. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
  394. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  395. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
  396. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  397. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  398. package/build-module/components/global-styles/header.js.map +1 -1
  399. package/build-module/components/global-styles/highlighted-colors.js +1 -1
  400. package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
  401. package/build-module/components/global-styles/hooks.js +11 -3
  402. package/build-module/components/global-styles/hooks.js.map +1 -1
  403. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  404. package/build-module/components/global-styles/index.js.map +1 -1
  405. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  406. package/build-module/components/global-styles/palette.js.map +1 -1
  407. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  408. package/build-module/components/global-styles/preview-iframe.js.map +1 -1
  409. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  410. package/build-module/components/global-styles/root-menu.js +2 -2
  411. package/build-module/components/global-styles/root-menu.js.map +1 -1
  412. package/build-module/components/global-styles/screen-background.js +1 -1
  413. package/build-module/components/global-styles/screen-background.js.map +1 -1
  414. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  415. package/build-module/components/global-styles/screen-block.js.map +1 -1
  416. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  417. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  418. package/build-module/components/global-styles/screen-css.js.map +1 -1
  419. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  420. package/build-module/components/global-styles/screen-revisions/index.js +1 -1
  421. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  422. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  423. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  424. package/build-module/components/global-styles/screen-root.js.map +1 -1
  425. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  426. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  427. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  428. package/build-module/components/global-styles/style-variations-container.js +8 -2
  429. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  430. package/build-module/components/global-styles/subtitle.js.map +1 -1
  431. package/build-module/components/global-styles/typography-elements.js.map +1 -1
  432. package/build-module/components/global-styles/typography-example.js.map +1 -1
  433. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  434. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  435. package/build-module/components/global-styles/ui.js.map +1 -1
  436. package/build-module/components/global-styles/utils.js.map +1 -1
  437. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  438. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  439. package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
  440. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  441. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  442. package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
  443. package/build-module/components/header-edit-mode/index.js +41 -57
  444. package/build-module/components/header-edit-mode/index.js.map +1 -1
  445. package/build-module/components/header-edit-mode/more-menu/index.js +6 -100
  446. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  447. package/build-module/components/header-edit-mode/more-menu/site-export.js.map +1 -1
  448. package/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
  449. package/build-module/components/keyboard-shortcuts/global.js.map +1 -1
  450. package/build-module/components/keyboard-shortcuts/register.js +0 -67
  451. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  452. package/build-module/components/layout/animation.js +4 -3
  453. package/build-module/components/layout/animation.js.map +1 -1
  454. package/build-module/components/layout/hooks.js.map +1 -1
  455. package/build-module/components/layout/index.js +20 -52
  456. package/build-module/components/layout/index.js.map +1 -1
  457. package/build-module/components/layout/router.js +70 -33
  458. package/build-module/components/layout/router.js.map +1 -1
  459. package/build-module/components/media/index.js.map +1 -1
  460. package/build-module/components/page/header.js.map +1 -1
  461. package/build-module/components/page/index.js +5 -2
  462. package/build-module/components/page/index.js.map +1 -1
  463. package/build-module/components/page-pages/index.js +18 -19
  464. package/build-module/components/page-pages/index.js.map +1 -1
  465. package/build-module/components/page-patterns/dataviews-pattern-actions.js +16 -11
  466. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  467. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  468. package/build-module/components/page-patterns/header.js +5 -3
  469. package/build-module/components/page-patterns/header.js.map +1 -1
  470. package/build-module/components/page-patterns/index.js +143 -65
  471. package/build-module/components/page-patterns/index.js.map +1 -1
  472. package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
  473. package/build-module/components/page-patterns/search-items.js +3 -2
  474. package/build-module/components/page-patterns/search-items.js.map +1 -1
  475. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
  476. package/build-module/components/page-patterns/use-patterns.js +3 -6
  477. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  478. package/build-module/components/page-patterns/utils.js.map +1 -1
  479. package/build-module/components/page-templates/hooks.js.map +1 -0
  480. package/build-module/components/{page-templates-template-parts → page-templates}/index.js +77 -102
  481. package/build-module/components/page-templates/index.js.map +1 -0
  482. package/build-module/components/pagination/index.js.map +1 -1
  483. package/build-module/components/pattern-modal/duplicate.js +11 -6
  484. package/build-module/components/pattern-modal/duplicate.js.map +1 -1
  485. package/build-module/components/pattern-modal/index.js.map +1 -1
  486. package/build-module/components/pattern-modal/rename.js +4 -1
  487. package/build-module/components/pattern-modal/rename.js.map +1 -1
  488. package/build-module/components/plugin-template-setting-panel/index.js +8 -0
  489. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
  490. package/build-module/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +17 -15
  491. package/build-module/components/rename-post-menu-item/index.js.map +1 -0
  492. package/build-module/components/resizable-frame/index.js +10 -11
  493. package/build-module/components/resizable-frame/index.js.map +1 -1
  494. package/build-module/components/revisions/index.js.map +1 -1
  495. package/build-module/components/routes/link.js.map +1 -1
  496. package/build-module/components/routes/use-title.js.map +1 -1
  497. package/build-module/components/save-button/index.js.map +1 -1
  498. package/build-module/components/save-hub/index.js.map +1 -1
  499. package/build-module/components/save-panel/index.js +2 -2
  500. package/build-module/components/save-panel/index.js.map +1 -1
  501. package/build-module/components/sidebar/index.js +42 -75
  502. package/build-module/components/sidebar/index.js.map +1 -1
  503. package/build-module/components/sidebar-button/index.js.map +1 -1
  504. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  505. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  506. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  507. package/build-module/components/sidebar-dataviews/default-views.js +1 -1
  508. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  509. package/build-module/components/sidebar-dataviews/index.js +1 -1
  510. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  511. package/build-module/components/sidebar-edit-mode/default-sidebar.js +16 -5
  512. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  513. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +5 -3
  514. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  515. package/build-module/components/sidebar-edit-mode/index.js +30 -54
  516. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  517. package/build-module/components/sidebar-edit-mode/page-panels/index.js +58 -6
  518. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  519. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  520. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +25 -17
  521. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  522. package/build-module/components/sidebar-edit-mode/settings-header/index.js +4 -5
  523. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  524. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
  525. package/build-module/components/sidebar-edit-mode/template-panel/index.js +4 -7
  526. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  527. package/build-module/components/sidebar-navigation-item/index.js +31 -0
  528. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  529. package/build-module/components/sidebar-navigation-screen/index.js +37 -10
  530. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  531. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  532. package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  533. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
  534. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  535. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
  536. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +2 -3
  537. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  538. package/build-module/components/sidebar-navigation-screen-main/index.js +7 -16
  539. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  540. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
  541. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  542. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +8 -3
  543. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  544. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  545. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  546. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  547. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  548. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  549. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -15
  550. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  551. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  552. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  553. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  554. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  555. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -5
  556. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  557. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  558. package/build-module/components/sidebar-navigation-screen-page/index.js +56 -15
  559. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  560. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  561. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  562. package/build-module/components/sidebar-navigation-screen-pattern/index.js +17 -15
  563. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  564. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  565. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
  566. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  567. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
  568. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  569. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  570. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -1
  571. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  572. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  573. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
  574. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  575. package/build-module/components/sidebar-navigation-screen-patterns/index.js +66 -54
  576. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  577. package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
  578. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  579. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  580. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  581. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  582. package/build-module/components/sidebar-navigation-screen-template/index.js +13 -9
  583. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  584. package/build-module/components/sidebar-navigation-screen-template/template-areas.js.map +1 -1
  585. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  586. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  587. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -36
  588. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  589. package/build-module/components/site-hub/index.js +22 -21
  590. package/build-module/components/site-hub/index.js.map +1 -1
  591. package/build-module/components/site-icon/index.js.map +1 -1
  592. package/build-module/components/start-template-options/index.js.map +1 -1
  593. package/build-module/components/style-book/index.js.map +1 -1
  594. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +14 -13
  595. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  596. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  597. package/build-module/components/table/index.js.map +1 -1
  598. package/build-module/components/template-actions/index.js +7 -8
  599. package/build-module/components/template-actions/index.js.map +1 -1
  600. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  601. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  602. package/build-module/components/template-part-converter/index.js.map +1 -1
  603. package/build-module/components/use-edited-entity-record/index.js.map +1 -1
  604. package/build-module/components/welcome-guide/editor.js.map +1 -1
  605. package/build-module/components/welcome-guide/image.js.map +1 -1
  606. package/build-module/components/welcome-guide/index.js.map +1 -1
  607. package/build-module/components/welcome-guide/page.js.map +1 -1
  608. package/build-module/components/welcome-guide/styles.js +6 -3
  609. package/build-module/components/welcome-guide/styles.js.map +1 -1
  610. package/build-module/components/welcome-guide/template.js.map +1 -1
  611. package/build-module/deprecated.js +45 -0
  612. package/build-module/deprecated.js.map +1 -0
  613. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  614. package/build-module/hooks/commands/use-edit-mode-commands.js +11 -29
  615. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  616. package/build-module/hooks/components.js.map +1 -1
  617. package/build-module/hooks/index.js.map +1 -1
  618. package/build-module/hooks/push-changes-to-global-styles/index.js +1 -38
  619. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  620. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +35 -5
  621. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  622. package/build-module/index.js +1 -5
  623. package/build-module/index.js.map +1 -1
  624. package/build-module/lock-unlock.js.map +1 -1
  625. package/build-module/store/actions.js +16 -92
  626. package/build-module/store/actions.js.map +1 -1
  627. package/build-module/store/constants.js.map +1 -1
  628. package/build-module/store/index.js.map +1 -1
  629. package/build-module/store/private-actions.js +0 -83
  630. package/build-module/store/private-actions.js.map +1 -1
  631. package/build-module/store/private-selectors.js.map +1 -1
  632. package/build-module/store/reducer.js.map +1 -1
  633. package/build-module/store/selectors.js.map +1 -1
  634. package/build-module/utils/clone-deep.js.map +1 -1
  635. package/build-module/utils/constants.js +1 -1
  636. package/build-module/utils/constants.js.map +1 -1
  637. package/build-module/utils/get-is-list-page.js.map +1 -1
  638. package/build-module/utils/is-previewing-theme.js.map +1 -1
  639. package/build-module/utils/is-template-removable.js.map +1 -1
  640. package/build-module/utils/is-template-revertable.js.map +1 -1
  641. package/build-module/utils/math.js.map +1 -1
  642. package/build-module/utils/set-nested-value.js +38 -0
  643. package/build-module/utils/set-nested-value.js.map +1 -0
  644. package/build-module/utils/template-part-create.js.map +1 -1
  645. package/build-module/utils/use-activate-theme.js.map +1 -1
  646. package/build-module/utils/use-actual-current-theme.js.map +1 -1
  647. package/build-style/style-rtl.css +261 -720
  648. package/build-style/style.css +261 -720
  649. package/package.json +43 -44
  650. package/src/components/add-new-page/index.js +7 -1
  651. package/src/components/add-new-pattern/index.js +15 -12
  652. package/src/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
  653. package/src/components/add-new-template/add-custom-template-modal-content.js +3 -1
  654. package/src/components/add-new-template/index.js +412 -12
  655. package/src/components/add-new-template/style.scss +0 -22
  656. package/src/components/add-new-template/utils.js +44 -24
  657. package/src/components/async/index.js +43 -0
  658. package/src/components/block-editor/block-inspector-button.js +9 -11
  659. package/src/components/block-editor/editor-canvas.js +45 -21
  660. package/src/components/block-editor/resize-handle.js +30 -11
  661. package/src/components/block-editor/site-editor-canvas.js +6 -1
  662. package/src/components/block-editor/style.scss +10 -15
  663. package/src/components/create-template-part-modal/index.js +3 -0
  664. package/src/components/editor/index.js +91 -15
  665. package/src/components/editor/style.scss +6 -1
  666. package/src/components/global-styles/background-panel.js +16 -0
  667. package/src/components/global-styles/block-preview-panel.js +6 -1
  668. package/src/components/global-styles/font-library-modal/context.js +85 -54
  669. package/src/components/global-styles/font-library-modal/font-collection.js +265 -222
  670. package/src/components/global-styles/font-library-modal/index.js +2 -2
  671. package/src/components/global-styles/font-library-modal/installed-fonts.js +184 -147
  672. package/src/components/global-styles/font-library-modal/style.scss +48 -13
  673. package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
  674. package/src/components/global-styles/highlighted-colors.js +1 -1
  675. package/src/components/global-styles/hooks.js +20 -3
  676. package/src/components/global-styles/root-menu.js +2 -2
  677. package/src/components/global-styles/screen-background.js +1 -1
  678. package/src/components/global-styles/screen-revisions/index.js +1 -1
  679. package/src/components/global-styles/style-variations-container.js +11 -2
  680. package/src/components/header-edit-mode/index.js +56 -78
  681. package/src/components/header-edit-mode/more-menu/index.js +9 -157
  682. package/src/components/header-edit-mode/style.scss +14 -86
  683. package/src/components/keyboard-shortcuts/register.js +0 -78
  684. package/src/components/layout/animation.js +6 -3
  685. package/src/components/layout/index.js +23 -52
  686. package/src/components/layout/router.js +73 -50
  687. package/src/components/layout/style.scss +15 -37
  688. package/src/components/page/index.js +7 -2
  689. package/src/components/page-pages/index.js +46 -26
  690. package/src/components/page-pages/style.scss +40 -22
  691. package/src/components/page-patterns/dataviews-pattern-actions.js +13 -15
  692. package/src/components/page-patterns/header.js +7 -3
  693. package/src/components/page-patterns/index.js +162 -109
  694. package/src/components/page-patterns/search-items.js +3 -0
  695. package/src/components/page-patterns/style.scss +21 -7
  696. package/src/components/page-patterns/use-patterns.js +3 -6
  697. package/src/components/{page-templates-template-parts → page-templates}/index.js +46 -84
  698. package/src/components/{page-templates-template-parts → page-templates}/style.scss +2 -2
  699. package/src/components/pattern-modal/duplicate.js +6 -4
  700. package/src/components/pattern-modal/rename.js +2 -1
  701. package/src/components/plugin-template-setting-panel/index.js +8 -0
  702. package/src/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +20 -24
  703. package/src/components/resizable-frame/index.js +6 -9
  704. package/src/components/save-panel/index.js +2 -2
  705. package/src/components/sidebar/index.js +52 -100
  706. package/src/components/sidebar/style.scss +41 -6
  707. package/src/components/sidebar-dataviews/default-views.js +1 -1
  708. package/src/components/sidebar-dataviews/index.js +1 -1
  709. package/src/components/sidebar-edit-mode/default-sidebar.js +13 -6
  710. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +7 -3
  711. package/src/components/sidebar-edit-mode/index.js +50 -75
  712. package/src/components/sidebar-edit-mode/page-panels/index.js +65 -14
  713. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +40 -20
  714. package/src/components/sidebar-edit-mode/settings-header/index.js +4 -5
  715. package/src/components/sidebar-edit-mode/style.scss +1 -1
  716. package/src/components/sidebar-edit-mode/template-panel/index.js +3 -13
  717. package/src/components/sidebar-navigation-item/index.js +29 -0
  718. package/src/components/sidebar-navigation-screen/index.js +29 -12
  719. package/src/components/sidebar-navigation-screen/style.scss +1 -21
  720. package/src/components/sidebar-navigation-screen-global-styles/index.js +2 -11
  721. package/src/components/sidebar-navigation-screen-main/index.js +11 -23
  722. package/src/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
  723. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +7 -6
  724. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  725. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +14 -14
  726. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  727. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +4 -5
  728. package/src/components/sidebar-navigation-screen-page/index.js +63 -14
  729. package/src/components/sidebar-navigation-screen-page/style.scss +8 -2
  730. package/src/components/sidebar-navigation-screen-pattern/index.js +13 -15
  731. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
  732. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  733. package/src/components/sidebar-navigation-screen-patterns/category-item.js +2 -1
  734. package/src/components/sidebar-navigation-screen-patterns/index.js +97 -95
  735. package/src/components/sidebar-navigation-screen-patterns/style.scss +5 -0
  736. package/src/components/sidebar-navigation-screen-template/index.js +9 -13
  737. package/src/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  738. package/src/components/sidebar-navigation-screen-templates-browse/index.js +6 -43
  739. package/src/components/site-hub/index.js +80 -90
  740. package/src/components/site-hub/style.scss +14 -34
  741. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +50 -39
  742. package/src/components/template-actions/index.js +8 -11
  743. package/src/components/welcome-guide/style.scss +1 -1
  744. package/src/components/welcome-guide/styles.js +6 -5
  745. package/src/deprecated.js +42 -0
  746. package/src/hooks/commands/use-edit-mode-commands.js +12 -33
  747. package/src/hooks/push-changes-to-global-styles/index.js +1 -40
  748. package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +4 -0
  749. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +74 -17
  750. package/src/index.js +1 -9
  751. package/src/store/actions.js +25 -141
  752. package/src/store/private-actions.js +0 -133
  753. package/src/store/test/actions.js +7 -2
  754. package/src/style.scss +1 -7
  755. package/src/utils/constants.js +2 -1
  756. package/src/utils/set-nested-value.js +39 -0
  757. package/build/components/add-new-template/new-template.js +0 -298
  758. package/build/components/add-new-template/new-template.js.map +0 -1
  759. package/build/components/add-new-template/template-actions-loading-screen.js +0 -27
  760. package/build/components/add-new-template/template-actions-loading-screen.js.map +0 -1
  761. package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -59
  762. package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
  763. package/build/components/header-edit-mode/plugin-more-menu-item/index.js +0 -78
  764. package/build/components/header-edit-mode/plugin-more-menu-item/index.js.map +0 -1
  765. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -71
  766. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +0 -1
  767. package/build/components/header-edit-mode/tools-more-menu-group/index.js +0 -23
  768. package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
  769. package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
  770. package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  771. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -48
  772. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  773. package/build/components/keyboard-shortcut-help-modal/index.js +0 -119
  774. package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  775. package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -54
  776. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  777. package/build/components/keyboard-shortcuts/edit-mode.js +0 -79
  778. package/build/components/keyboard-shortcuts/edit-mode.js.map +0 -1
  779. package/build/components/page-actions/index.js +0 -35
  780. package/build/components/page-actions/index.js.map +0 -1
  781. package/build/components/page-actions/trash-page-menu-item.js +0 -54
  782. package/build/components/page-actions/trash-page-menu-item.js.map +0 -1
  783. package/build/components/page-templates-template-parts/actions.js +0 -207
  784. package/build/components/page-templates-template-parts/actions.js.map +0 -1
  785. package/build/components/page-templates-template-parts/add-new-template-part.js +0 -64
  786. package/build/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
  787. package/build/components/page-templates-template-parts/hooks.js.map +0 -1
  788. package/build/components/page-templates-template-parts/index.js.map +0 -1
  789. package/build/components/preferences-modal/index.js +0 -38
  790. package/build/components/preferences-modal/index.js.map +0 -1
  791. package/build/components/sidebar-edit-mode/constants.js +0 -9
  792. package/build/components/sidebar-edit-mode/constants.js.map +0 -1
  793. package/build/components/sidebar-edit-mode/page-panels/page-status.js +0 -188
  794. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
  795. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -89
  796. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +0 -1
  797. package/build/components/sidebar-navigation-screen-navigation-item/index.js +0 -54
  798. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +0 -1
  799. package/build/components/sync-state-with-url/use-sync-path-with-url.js +0 -132
  800. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +0 -1
  801. package/build/components/template-actions/rename-menu-item.js.map +0 -1
  802. package/build-module/components/add-new-template/new-template.js +0 -290
  803. package/build-module/components/add-new-template/new-template.js.map +0 -1
  804. package/build-module/components/add-new-template/template-actions-loading-screen.js +0 -20
  805. package/build-module/components/add-new-template/template-actions-loading-screen.js.map +0 -1
  806. package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -52
  807. package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
  808. package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js +0 -73
  809. package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js.map +0 -1
  810. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -65
  811. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +0 -1
  812. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
  813. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
  814. package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
  815. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  816. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -40
  817. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  818. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -110
  819. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  820. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -47
  821. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  822. package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -72
  823. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +0 -1
  824. package/build-module/components/page-actions/index.js +0 -27
  825. package/build-module/components/page-actions/index.js.map +0 -1
  826. package/build-module/components/page-actions/trash-page-menu-item.js +0 -47
  827. package/build-module/components/page-actions/trash-page-menu-item.js.map +0 -1
  828. package/build-module/components/page-templates-template-parts/actions.js +0 -199
  829. package/build-module/components/page-templates-template-parts/actions.js.map +0 -1
  830. package/build-module/components/page-templates-template-parts/add-new-template-part.js +0 -56
  831. package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
  832. package/build-module/components/page-templates-template-parts/hooks.js.map +0 -1
  833. package/build-module/components/page-templates-template-parts/index.js.map +0 -1
  834. package/build-module/components/preferences-modal/index.js +0 -30
  835. package/build-module/components/preferences-modal/index.js.map +0 -1
  836. package/build-module/components/sidebar-edit-mode/constants.js +0 -3
  837. package/build-module/components/sidebar-edit-mode/constants.js.map +0 -1
  838. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +0 -180
  839. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
  840. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -83
  841. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +0 -1
  842. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +0 -46
  843. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +0 -1
  844. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +0 -124
  845. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +0 -1
  846. package/build-module/components/template-actions/rename-menu-item.js.map +0 -1
  847. package/src/components/add-new-template/new-template.js +0 -429
  848. package/src/components/add-new-template/template-actions-loading-screen.js +0 -23
  849. package/src/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -51
  850. package/src/components/header-edit-mode/plugin-more-menu-item/index.js +0 -73
  851. package/src/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -64
  852. package/src/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
  853. package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
  854. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
  855. package/src/components/keyboard-shortcut-help-modal/index.js +0 -151
  856. package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -70
  857. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
  858. package/src/components/keyboard-shortcuts/edit-mode.js +0 -88
  859. package/src/components/page-actions/index.js +0 -30
  860. package/src/components/page-actions/trash-page-menu-item.js +0 -63
  861. package/src/components/page-templates-template-parts/actions.js +0 -277
  862. package/src/components/page-templates-template-parts/add-new-template-part.js +0 -60
  863. package/src/components/preferences-modal/index.js +0 -29
  864. package/src/components/sidebar-edit-mode/constants.js +0 -2
  865. package/src/components/sidebar-edit-mode/page-panels/page-status.js +0 -249
  866. package/src/components/sidebar-edit-mode/page-panels/style.scss +0 -40
  867. package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -80
  868. package/src/components/sidebar-navigation-screen-navigation-item/index.js +0 -59
  869. package/src/components/sync-state-with-url/use-sync-path-with-url.js +0 -147
  870. /package/build/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
  871. /package/build-module/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
  872. /package/src/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["addFilter","createHigherOrderComponent","InspectorAdvancedControls","store","blockEditorStore","privateApis","blockEditorPrivateApis","useBlockEditingMode","BaseControl","Button","__","sprintf","__EXPERIMENTAL_STYLE_PROPERTY","getBlockType","hasBlockSupport","useContext","useMemo","useCallback","useDispatch","useSelect","noticesStore","coreStore","useSupportedStyles","unlock","cloneDeep","cleanEmptyObject","GlobalStylesContext","STYLE_PROPERTY","blockGap","value","STYLE_PATH_TO_CSS_VAR_INFIX","STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE","SUPPORTED_STYLES","getValueFromObjectPath","object","path","forEach","fieldName","flatBorderProperties","sides","getBorderStyleChanges","border","presetColor","userStyle","changes","getFallbackBorderStyleChange","color","customColor","style","width","hasColorOrWidth","side","push","globalBorderStyle","useChangesToPush","name","attributes","userConfig","supports","blockUserConfig","styles","blocks","flatMap","key","presetAttributeKey","join","presetAttributeValue","linkChanges","hoverPath","hoverValue","includes","borderChanges","currentPath","splice","borderColor","change","setNestedValue","reduce","acc","idx","undefined","Number","isInteger","length","PushChangesToGlobalStylesControl","setAttributes","user","setUserConfig","__unstableMarkNextChangeAsNotPersistent","createSuccessNotice","pushChanges","blockStyles","newBlockStyles","newUserConfig","newBlockAttributes","backgroundColor","textColor","gradient","fontSize","fontFamily","undoIgnore","title","type","actions","label","onClick","createElement","className","help","VisualLabel","variant","disabled","PushChangesToGlobalStyles","props","blockEditingMode","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","supportsStyles","some","feature","isDisplayed","withPushChangesToGlobalStyles","BlockEdit","Fragment","isSelected"],"sources":["@wordpress/edit-site/src/hooks/push-changes-to-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport {\n\tInspectorAdvancedControls,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { BaseControl, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__EXPERIMENTAL_STYLE_PROPERTY,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { useContext, useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useSupportedStyles } from '../../components/global-styles/hooks';\nimport { unlock } from '../../lock-unlock';\nimport cloneDeep from '../../utils/clone-deep';\n\nconst { cleanEmptyObject, GlobalStylesContext } = unlock(\n\tblockEditorPrivateApis\n);\n\n// Block Gap is a special case and isn't defined within the blocks\n// style properties config. We'll add it here to allow it to be pushed\n// to global styles as well.\nconst STYLE_PROPERTY = {\n\t...__EXPERIMENTAL_STYLE_PROPERTY,\n\tblockGap: { value: [ 'spacing', 'blockGap' ] },\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_CSS_VAR_INFIX = {\n\t'border.color': 'color',\n\t'color.background': 'color',\n\t'color.text': 'color',\n\t'elements.link.color.text': 'color',\n\t'elements.link.:hover.color.text': 'color',\n\t'elements.link.typography.fontFamily': 'font-family',\n\t'elements.link.typography.fontSize': 'font-size',\n\t'elements.button.color.text': 'color',\n\t'elements.button.color.background': 'color',\n\t'elements.button.typography.fontFamily': 'font-family',\n\t'elements.button.typography.fontSize': 'font-size',\n\t'elements.caption.color.text': 'color',\n\t'elements.heading.color': 'color',\n\t'elements.heading.color.background': 'color',\n\t'elements.heading.typography.fontFamily': 'font-family',\n\t'elements.heading.gradient': 'gradient',\n\t'elements.heading.color.gradient': 'gradient',\n\t'elements.h1.color': 'color',\n\t'elements.h1.color.background': 'color',\n\t'elements.h1.typography.fontFamily': 'font-family',\n\t'elements.h1.color.gradient': 'gradient',\n\t'elements.h2.color': 'color',\n\t'elements.h2.color.background': 'color',\n\t'elements.h2.typography.fontFamily': 'font-family',\n\t'elements.h2.color.gradient': 'gradient',\n\t'elements.h3.color': 'color',\n\t'elements.h3.color.background': 'color',\n\t'elements.h3.typography.fontFamily': 'font-family',\n\t'elements.h3.color.gradient': 'gradient',\n\t'elements.h4.color': 'color',\n\t'elements.h4.color.background': 'color',\n\t'elements.h4.typography.fontFamily': 'font-family',\n\t'elements.h4.color.gradient': 'gradient',\n\t'elements.h5.color': 'color',\n\t'elements.h5.color.background': 'color',\n\t'elements.h5.typography.fontFamily': 'font-family',\n\t'elements.h5.color.gradient': 'gradient',\n\t'elements.h6.color': 'color',\n\t'elements.h6.color.background': 'color',\n\t'elements.h6.typography.fontFamily': 'font-family',\n\t'elements.h6.color.gradient': 'gradient',\n\t'color.gradient': 'gradient',\n\tblockGap: 'spacing',\n\t'typography.fontSize': 'font-size',\n\t'typography.fontFamily': 'font-family',\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {\n\t'border.color': 'borderColor',\n\t'color.background': 'backgroundColor',\n\t'color.text': 'textColor',\n\t'color.gradient': 'gradient',\n\t'typography.fontSize': 'fontSize',\n\t'typography.fontFamily': 'fontFamily',\n};\n\nconst SUPPORTED_STYLES = [ 'border', 'color', 'spacing', 'typography' ];\n\nconst getValueFromObjectPath = ( object, path ) => {\n\tlet value = object;\n\tpath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\nconst flatBorderProperties = [ 'borderColor', 'borderWidth', 'borderStyle' ];\nconst sides = [ 'top', 'right', 'bottom', 'left' ];\n\nfunction getBorderStyleChanges( border, presetColor, userStyle ) {\n\tif ( ! border && ! presetColor ) {\n\t\treturn [];\n\t}\n\n\tconst changes = [\n\t\t...getFallbackBorderStyleChange( 'top', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'right', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'bottom', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'left', border, userStyle ),\n\t];\n\n\t// Handle a flat border i.e. all sides the same, CSS shorthand.\n\tconst { color: customColor, style, width } = border || {};\n\tconst hasColorOrWidth = presetColor || customColor || width;\n\n\tif ( hasColorOrWidth && ! style ) {\n\t\t// Global Styles need individual side configurations to overcome\n\t\t// theme.json configurations which are per side as well.\n\t\tsides.forEach( ( side ) => {\n\t\t\t// Only add fallback border-style if global styles don't already\n\t\t\t// have something set.\n\t\t\tif ( ! userStyle?.[ side ]?.style ) {\n\t\t\t\tchanges.push( {\n\t\t\t\t\tpath: [ 'border', side, 'style' ],\n\t\t\t\t\tvalue: 'solid',\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}\n\n\treturn changes;\n}\n\nfunction getFallbackBorderStyleChange( side, border, globalBorderStyle ) {\n\tif ( ! border?.[ side ] || globalBorderStyle?.[ side ]?.style ) {\n\t\treturn [];\n\t}\n\n\tconst { color, style, width } = border[ side ];\n\tconst hasColorOrWidth = color || width;\n\n\tif ( ! hasColorOrWidth || style ) {\n\t\treturn [];\n\t}\n\n\treturn [ { path: [ 'border', side, 'style' ], value: 'solid' } ];\n}\n\nfunction useChangesToPush( name, attributes, userConfig ) {\n\tconst supports = useSupportedStyles( name );\n\tconst blockUserConfig = userConfig?.styles?.blocks?.[ name ];\n\n\treturn useMemo( () => {\n\t\tconst changes = supports.flatMap( ( key ) => {\n\t\t\tif ( ! STYLE_PROPERTY[ key ] ) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst { value: path } = STYLE_PROPERTY[ key ];\n\t\t\tconst presetAttributeKey = path.join( '.' );\n\t\t\tconst presetAttributeValue =\n\t\t\t\tattributes[\n\t\t\t\t\tSTYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE[ presetAttributeKey ]\n\t\t\t\t];\n\t\t\tconst value = presetAttributeValue\n\t\t\t\t? `var:preset|${ STYLE_PATH_TO_CSS_VAR_INFIX[ presetAttributeKey ] }|${ presetAttributeValue }`\n\t\t\t\t: getValueFromObjectPath( attributes.style, path );\n\n\t\t\t// Links only have a single support entry but have two element\n\t\t\t// style properties, color and hover color. The following check\n\t\t\t// will add the hover color to the changes if required.\n\t\t\tif ( key === 'linkColor' ) {\n\t\t\t\tconst linkChanges = value ? [ { path, value } ] : [];\n\t\t\t\tconst hoverPath = [\n\t\t\t\t\t'elements',\n\t\t\t\t\t'link',\n\t\t\t\t\t':hover',\n\t\t\t\t\t'color',\n\t\t\t\t\t'text',\n\t\t\t\t];\n\t\t\t\tconst hoverValue = getValueFromObjectPath(\n\t\t\t\t\tattributes.style,\n\t\t\t\t\thoverPath\n\t\t\t\t);\n\n\t\t\t\tif ( hoverValue ) {\n\t\t\t\t\tlinkChanges.push( { path: hoverPath, value: hoverValue } );\n\t\t\t\t}\n\n\t\t\t\treturn linkChanges;\n\t\t\t}\n\n\t\t\t// The shorthand border styles can't be mapped directly as global\n\t\t\t// styles requires longhand config.\n\t\t\tif ( flatBorderProperties.includes( key ) && value ) {\n\t\t\t\t// The shorthand config path is included to clear the block attribute.\n\t\t\t\tconst borderChanges = [ { path, value } ];\n\t\t\t\tsides.forEach( ( side ) => {\n\t\t\t\t\tconst currentPath = [ ...path ];\n\t\t\t\t\tcurrentPath.splice( -1, 0, side );\n\t\t\t\t\tborderChanges.push( { path: currentPath, value } );\n\t\t\t\t} );\n\t\t\t\treturn borderChanges;\n\t\t\t}\n\n\t\t\treturn value ? [ { path, value } ] : [];\n\t\t} );\n\n\t\t// To ensure display of a visible border, global styles require a\n\t\t// default border style if a border color or width is present.\n\t\tgetBorderStyleChanges(\n\t\t\tattributes.style?.border,\n\t\t\tattributes.borderColor,\n\t\t\tblockUserConfig?.border\n\t\t).forEach( ( change ) => changes.push( change ) );\n\n\t\treturn changes;\n\t}, [ supports, attributes, blockUserConfig ] );\n}\n\n/**\n * Sets the value at path of object.\n * If a portion of path doesn’t exist, it’s created.\n * Arrays are created for missing index properties while objects are created\n * for all other missing properties.\n *\n * This function intentionally mutates the input object.\n *\n * Inspired by _.set().\n *\n * @see https://lodash.com/docs/4.17.15#set\n *\n * @todo Needs to be deduplicated with its copy in `@wordpress/core-data`.\n *\n * @param {Object} object Object to modify\n * @param {Array} path Path of the property to set.\n * @param {*} value Value to set.\n */\nfunction setNestedValue( object, path, value ) {\n\tif ( ! object || typeof object !== 'object' ) {\n\t\treturn object;\n\t}\n\n\tpath.reduce( ( acc, key, idx ) => {\n\t\tif ( acc[ key ] === undefined ) {\n\t\t\tif ( Number.isInteger( path[ idx + 1 ] ) ) {\n\t\t\t\tacc[ key ] = [];\n\t\t\t} else {\n\t\t\t\tacc[ key ] = {};\n\t\t\t}\n\t\t}\n\t\tif ( idx === path.length - 1 ) {\n\t\t\tacc[ key ] = value;\n\t\t}\n\t\treturn acc[ key ];\n\t}, object );\n\n\treturn object;\n}\n\nfunction PushChangesToGlobalStylesControl( {\n\tname,\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst { user: userConfig, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\n\n\tconst changes = useChangesToPush( name, attributes, userConfig );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst pushChanges = useCallback( () => {\n\t\tif ( changes.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( changes.length > 0 ) {\n\t\t\tconst { style: blockStyles } = attributes;\n\n\t\t\tconst newBlockStyles = cloneDeep( blockStyles );\n\t\t\tconst newUserConfig = cloneDeep( userConfig );\n\n\t\t\tfor ( const { path, value } of changes ) {\n\t\t\t\tsetNestedValue( newBlockStyles, path, undefined );\n\t\t\t\tsetNestedValue(\n\t\t\t\t\tnewUserConfig,\n\t\t\t\t\t[ 'styles', 'blocks', name, ...path ],\n\t\t\t\t\tvalue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst newBlockAttributes = {\n\t\t\t\tborderColor: undefined,\n\t\t\t\tbackgroundColor: undefined,\n\t\t\t\ttextColor: undefined,\n\t\t\t\tgradient: undefined,\n\t\t\t\tfontSize: undefined,\n\t\t\t\tfontFamily: undefined,\n\t\t\t\tstyle: cleanEmptyObject( newBlockStyles ),\n\t\t\t};\n\n\t\t\t// @wordpress/core-data doesn't support editing multiple entity types in\n\t\t\t// a single undo level. So for now, we disable @wordpress/core-data undo\n\t\t\t// tracking and implement our own Undo button in the snackbar\n\t\t\t// notification.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( newBlockAttributes );\n\t\t\tsetUserConfig( () => newUserConfig, { undoIgnore: true } );\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t\t__( '%s styles applied.' ),\n\t\t\t\t\tgetBlockType( name ).title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick() {\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tsetAttributes( attributes );\n\t\t\t\t\t\t\t\tsetUserConfig( () => userConfig, {\n\t\t\t\t\t\t\t\t\tundoIgnore: true,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}, [\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tattributes,\n\t\tchanges,\n\t\tcreateSuccessNotice,\n\t\tname,\n\t\tsetAttributes,\n\t\tsetUserConfig,\n\t\tuserConfig,\n\t] );\n\n\treturn (\n\t\t<BaseControl\n\t\t\tclassName=\"edit-site-push-changes-to-global-styles-control\"\n\t\t\thelp={ sprintf(\n\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t__(\n\t\t\t\t\t'Apply this block’s typography, spacing, dimensions, and color styles to all %s blocks.'\n\t\t\t\t),\n\t\t\t\tgetBlockType( name ).title\n\t\t\t) }\n\t\t>\n\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t{ __( 'Styles' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<Button\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tdisabled={ changes.length === 0 }\n\t\t\t\tonClick={ pushChanges }\n\t\t\t>\n\t\t\t\t{ __( 'Apply globally' ) }\n\t\t\t</Button>\n\t\t</BaseControl>\n\t);\n}\n\nfunction PushChangesToGlobalStyles( props ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst isBlockBasedTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t[]\n\t);\n\tconst supportsStyles = SUPPORTED_STYLES.some( ( feature ) =>\n\t\thasBlockSupport( props.name, feature )\n\t);\n\tconst isDisplayed =\n\t\tblockEditingMode === 'default' && supportsStyles && isBlockBasedTheme;\n\n\tif ( ! isDisplayed ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorAdvancedControls>\n\t\t\t<PushChangesToGlobalStylesControl { ...props } />\n\t\t</InspectorAdvancedControls>\n\t);\n}\n\nconst withPushChangesToGlobalStyles = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => (\n\t\t<>\n\t\t\t<BlockEdit { ...props } />\n\t\t\t{ props.isSelected && <PushChangesToGlobalStyles { ...props } /> }\n\t\t</>\n\t)\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-site/push-changes-to-global-styles',\n\twithPushChangesToGlobalStyles\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,0BAA0B,QAAQ,oBAAoB;AAC/D,SACCC,yBAAyB,EACzBC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,sBAAsB,EACrCC,mBAAmB,QACb,yBAAyB;AAChC,SAASC,WAAW,EAAEC,MAAM,QAAQ,uBAAuB;AAC3D,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,6BAA6B,EAC7BC,YAAY,EACZC,eAAe,QACT,mBAAmB;AAC1B,SAASC,UAAU,EAAEC,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACrE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAAShB,KAAK,IAAIiB,YAAY,QAAQ,oBAAoB;AAC1D,SA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S,IAAQX,KAAK,IACvBP,aAAA,CAAAmB,QAAA,QACCnB,aAAA,CAACkB,SAAS;EAAA,GAAMX;AAAK,CAAI,CAAC,EACxBA,KAAK,CAACa,UAAU,IAAIpB,aAAA,CAACM,yBAAyB;EAAA,GAAMC;AAAK,CAAI,CAC9D,CAEJ,CAAC;AAEDjH,SAAS,CACR,kBAAkB,EAClB,8CAA8C,EAC9C2H,6BACD,CAAC"}
1
+ {"version":3,"names":["addFilter","createHigherOrderComponent","InspectorAdvancedControls","store","blockEditorStore","privateApis","blockEditorPrivateApis","useBlockEditingMode","BaseControl","Button","__","sprintf","__EXPERIMENTAL_STYLE_PROPERTY","getBlockType","hasBlockSupport","useContext","useMemo","useCallback","useDispatch","useSelect","noticesStore","coreStore","useSupportedStyles","unlock","cloneDeep","setNestedValue","cleanEmptyObject","GlobalStylesContext","STYLE_PROPERTY","blockGap","value","STYLE_PATH_TO_CSS_VAR_INFIX","STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE","SUPPORTED_STYLES","getValueFromObjectPath","object","path","forEach","fieldName","flatBorderProperties","sides","getBorderStyleChanges","border","presetColor","userStyle","changes","getFallbackBorderStyleChange","color","customColor","style","width","hasColorOrWidth","side","push","globalBorderStyle","useChangesToPush","name","attributes","userConfig","supports","blockUserConfig","styles","blocks","flatMap","key","presetAttributeKey","join","presetAttributeValue","linkChanges","hoverPath","hoverValue","includes","borderChanges","currentPath","splice","borderColor","change","PushChangesToGlobalStylesControl","setAttributes","user","setUserConfig","__unstableMarkNextChangeAsNotPersistent","createSuccessNotice","pushChanges","length","blockStyles","newBlockStyles","newUserConfig","undefined","newBlockAttributes","backgroundColor","textColor","gradient","fontSize","fontFamily","undoIgnore","title","type","actions","label","onClick","createElement","className","help","VisualLabel","variant","disabled","PushChangesToGlobalStyles","props","blockEditingMode","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","supportsStyles","some","feature","isDisplayed","withPushChangesToGlobalStyles","BlockEdit","Fragment","isSelected"],"sources":["@wordpress/edit-site/src/hooks/push-changes-to-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport {\n\tInspectorAdvancedControls,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { BaseControl, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__EXPERIMENTAL_STYLE_PROPERTY,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { useContext, useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useSupportedStyles } from '../../components/global-styles/hooks';\nimport { unlock } from '../../lock-unlock';\nimport cloneDeep from '../../utils/clone-deep';\nimport setNestedValue from '../../utils/set-nested-value';\n\nconst { cleanEmptyObject, GlobalStylesContext } = unlock(\n\tblockEditorPrivateApis\n);\n\n// Block Gap is a special case and isn't defined within the blocks\n// style properties config. We'll add it here to allow it to be pushed\n// to global styles as well.\nconst STYLE_PROPERTY = {\n\t...__EXPERIMENTAL_STYLE_PROPERTY,\n\tblockGap: { value: [ 'spacing', 'blockGap' ] },\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_CSS_VAR_INFIX = {\n\t'border.color': 'color',\n\t'color.background': 'color',\n\t'color.text': 'color',\n\t'elements.link.color.text': 'color',\n\t'elements.link.:hover.color.text': 'color',\n\t'elements.link.typography.fontFamily': 'font-family',\n\t'elements.link.typography.fontSize': 'font-size',\n\t'elements.button.color.text': 'color',\n\t'elements.button.color.background': 'color',\n\t'elements.button.typography.fontFamily': 'font-family',\n\t'elements.button.typography.fontSize': 'font-size',\n\t'elements.caption.color.text': 'color',\n\t'elements.heading.color': 'color',\n\t'elements.heading.color.background': 'color',\n\t'elements.heading.typography.fontFamily': 'font-family',\n\t'elements.heading.gradient': 'gradient',\n\t'elements.heading.color.gradient': 'gradient',\n\t'elements.h1.color': 'color',\n\t'elements.h1.color.background': 'color',\n\t'elements.h1.typography.fontFamily': 'font-family',\n\t'elements.h1.color.gradient': 'gradient',\n\t'elements.h2.color': 'color',\n\t'elements.h2.color.background': 'color',\n\t'elements.h2.typography.fontFamily': 'font-family',\n\t'elements.h2.color.gradient': 'gradient',\n\t'elements.h3.color': 'color',\n\t'elements.h3.color.background': 'color',\n\t'elements.h3.typography.fontFamily': 'font-family',\n\t'elements.h3.color.gradient': 'gradient',\n\t'elements.h4.color': 'color',\n\t'elements.h4.color.background': 'color',\n\t'elements.h4.typography.fontFamily': 'font-family',\n\t'elements.h4.color.gradient': 'gradient',\n\t'elements.h5.color': 'color',\n\t'elements.h5.color.background': 'color',\n\t'elements.h5.typography.fontFamily': 'font-family',\n\t'elements.h5.color.gradient': 'gradient',\n\t'elements.h6.color': 'color',\n\t'elements.h6.color.background': 'color',\n\t'elements.h6.typography.fontFamily': 'font-family',\n\t'elements.h6.color.gradient': 'gradient',\n\t'color.gradient': 'gradient',\n\tblockGap: 'spacing',\n\t'typography.fontSize': 'font-size',\n\t'typography.fontFamily': 'font-family',\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {\n\t'border.color': 'borderColor',\n\t'color.background': 'backgroundColor',\n\t'color.text': 'textColor',\n\t'color.gradient': 'gradient',\n\t'typography.fontSize': 'fontSize',\n\t'typography.fontFamily': 'fontFamily',\n};\n\nconst SUPPORTED_STYLES = [ 'border', 'color', 'spacing', 'typography' ];\n\nconst getValueFromObjectPath = ( object, path ) => {\n\tlet value = object;\n\tpath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\nconst flatBorderProperties = [ 'borderColor', 'borderWidth', 'borderStyle' ];\nconst sides = [ 'top', 'right', 'bottom', 'left' ];\n\nfunction getBorderStyleChanges( border, presetColor, userStyle ) {\n\tif ( ! border && ! presetColor ) {\n\t\treturn [];\n\t}\n\n\tconst changes = [\n\t\t...getFallbackBorderStyleChange( 'top', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'right', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'bottom', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'left', border, userStyle ),\n\t];\n\n\t// Handle a flat border i.e. all sides the same, CSS shorthand.\n\tconst { color: customColor, style, width } = border || {};\n\tconst hasColorOrWidth = presetColor || customColor || width;\n\n\tif ( hasColorOrWidth && ! style ) {\n\t\t// Global Styles need individual side configurations to overcome\n\t\t// theme.json configurations which are per side as well.\n\t\tsides.forEach( ( side ) => {\n\t\t\t// Only add fallback border-style if global styles don't already\n\t\t\t// have something set.\n\t\t\tif ( ! userStyle?.[ side ]?.style ) {\n\t\t\t\tchanges.push( {\n\t\t\t\t\tpath: [ 'border', side, 'style' ],\n\t\t\t\t\tvalue: 'solid',\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}\n\n\treturn changes;\n}\n\nfunction getFallbackBorderStyleChange( side, border, globalBorderStyle ) {\n\tif ( ! border?.[ side ] || globalBorderStyle?.[ side ]?.style ) {\n\t\treturn [];\n\t}\n\n\tconst { color, style, width } = border[ side ];\n\tconst hasColorOrWidth = color || width;\n\n\tif ( ! hasColorOrWidth || style ) {\n\t\treturn [];\n\t}\n\n\treturn [ { path: [ 'border', side, 'style' ], value: 'solid' } ];\n}\n\nfunction useChangesToPush( name, attributes, userConfig ) {\n\tconst supports = useSupportedStyles( name );\n\tconst blockUserConfig = userConfig?.styles?.blocks?.[ name ];\n\n\treturn useMemo( () => {\n\t\tconst changes = supports.flatMap( ( key ) => {\n\t\t\tif ( ! STYLE_PROPERTY[ key ] ) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst { value: path } = STYLE_PROPERTY[ key ];\n\t\t\tconst presetAttributeKey = path.join( '.' );\n\t\t\tconst presetAttributeValue =\n\t\t\t\tattributes[\n\t\t\t\t\tSTYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE[ presetAttributeKey ]\n\t\t\t\t];\n\t\t\tconst value = presetAttributeValue\n\t\t\t\t? `var:preset|${ STYLE_PATH_TO_CSS_VAR_INFIX[ presetAttributeKey ] }|${ presetAttributeValue }`\n\t\t\t\t: getValueFromObjectPath( attributes.style, path );\n\n\t\t\t// Links only have a single support entry but have two element\n\t\t\t// style properties, color and hover color. The following check\n\t\t\t// will add the hover color to the changes if required.\n\t\t\tif ( key === 'linkColor' ) {\n\t\t\t\tconst linkChanges = value ? [ { path, value } ] : [];\n\t\t\t\tconst hoverPath = [\n\t\t\t\t\t'elements',\n\t\t\t\t\t'link',\n\t\t\t\t\t':hover',\n\t\t\t\t\t'color',\n\t\t\t\t\t'text',\n\t\t\t\t];\n\t\t\t\tconst hoverValue = getValueFromObjectPath(\n\t\t\t\t\tattributes.style,\n\t\t\t\t\thoverPath\n\t\t\t\t);\n\n\t\t\t\tif ( hoverValue ) {\n\t\t\t\t\tlinkChanges.push( { path: hoverPath, value: hoverValue } );\n\t\t\t\t}\n\n\t\t\t\treturn linkChanges;\n\t\t\t}\n\n\t\t\t// The shorthand border styles can't be mapped directly as global\n\t\t\t// styles requires longhand config.\n\t\t\tif ( flatBorderProperties.includes( key ) && value ) {\n\t\t\t\t// The shorthand config path is included to clear the block attribute.\n\t\t\t\tconst borderChanges = [ { path, value } ];\n\t\t\t\tsides.forEach( ( side ) => {\n\t\t\t\t\tconst currentPath = [ ...path ];\n\t\t\t\t\tcurrentPath.splice( -1, 0, side );\n\t\t\t\t\tborderChanges.push( { path: currentPath, value } );\n\t\t\t\t} );\n\t\t\t\treturn borderChanges;\n\t\t\t}\n\n\t\t\treturn value ? [ { path, value } ] : [];\n\t\t} );\n\n\t\t// To ensure display of a visible border, global styles require a\n\t\t// default border style if a border color or width is present.\n\t\tgetBorderStyleChanges(\n\t\t\tattributes.style?.border,\n\t\t\tattributes.borderColor,\n\t\t\tblockUserConfig?.border\n\t\t).forEach( ( change ) => changes.push( change ) );\n\n\t\treturn changes;\n\t}, [ supports, attributes, blockUserConfig ] );\n}\n\nfunction PushChangesToGlobalStylesControl( {\n\tname,\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst { user: userConfig, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\n\n\tconst changes = useChangesToPush( name, attributes, userConfig );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst pushChanges = useCallback( () => {\n\t\tif ( changes.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( changes.length > 0 ) {\n\t\t\tconst { style: blockStyles } = attributes;\n\n\t\t\tconst newBlockStyles = cloneDeep( blockStyles );\n\t\t\tconst newUserConfig = cloneDeep( userConfig );\n\n\t\t\tfor ( const { path, value } of changes ) {\n\t\t\t\tsetNestedValue( newBlockStyles, path, undefined );\n\t\t\t\tsetNestedValue(\n\t\t\t\t\tnewUserConfig,\n\t\t\t\t\t[ 'styles', 'blocks', name, ...path ],\n\t\t\t\t\tvalue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst newBlockAttributes = {\n\t\t\t\tborderColor: undefined,\n\t\t\t\tbackgroundColor: undefined,\n\t\t\t\ttextColor: undefined,\n\t\t\t\tgradient: undefined,\n\t\t\t\tfontSize: undefined,\n\t\t\t\tfontFamily: undefined,\n\t\t\t\tstyle: cleanEmptyObject( newBlockStyles ),\n\t\t\t};\n\n\t\t\t// @wordpress/core-data doesn't support editing multiple entity types in\n\t\t\t// a single undo level. So for now, we disable @wordpress/core-data undo\n\t\t\t// tracking and implement our own Undo button in the snackbar\n\t\t\t// notification.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( newBlockAttributes );\n\t\t\tsetUserConfig( () => newUserConfig, { undoIgnore: true } );\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t\t__( '%s styles applied.' ),\n\t\t\t\t\tgetBlockType( name ).title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick() {\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tsetAttributes( attributes );\n\t\t\t\t\t\t\t\tsetUserConfig( () => userConfig, {\n\t\t\t\t\t\t\t\t\tundoIgnore: true,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}, [\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tattributes,\n\t\tchanges,\n\t\tcreateSuccessNotice,\n\t\tname,\n\t\tsetAttributes,\n\t\tsetUserConfig,\n\t\tuserConfig,\n\t] );\n\n\treturn (\n\t\t<BaseControl\n\t\t\tclassName=\"edit-site-push-changes-to-global-styles-control\"\n\t\t\thelp={ sprintf(\n\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t__(\n\t\t\t\t\t'Apply this block’s typography, spacing, dimensions, and color styles to all %s blocks.'\n\t\t\t\t),\n\t\t\t\tgetBlockType( name ).title\n\t\t\t) }\n\t\t>\n\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t{ __( 'Styles' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<Button\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tdisabled={ changes.length === 0 }\n\t\t\t\tonClick={ pushChanges }\n\t\t\t>\n\t\t\t\t{ __( 'Apply globally' ) }\n\t\t\t</Button>\n\t\t</BaseControl>\n\t);\n}\n\nfunction PushChangesToGlobalStyles( props ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst isBlockBasedTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t[]\n\t);\n\tconst supportsStyles = SUPPORTED_STYLES.some( ( feature ) =>\n\t\thasBlockSupport( props.name, feature )\n\t);\n\tconst isDisplayed =\n\t\tblockEditingMode === 'default' && supportsStyles && isBlockBasedTheme;\n\n\tif ( ! isDisplayed ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorAdvancedControls>\n\t\t\t<PushChangesToGlobalStylesControl { ...props } />\n\t\t</InspectorAdvancedControls>\n\t);\n}\n\nconst withPushChangesToGlobalStyles = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => (\n\t\t<>\n\t\t\t<BlockEdit { ...props } />\n\t\t\t{ props.isSelected && <PushChangesToGlobalStyles { ...props } /> }\n\t\t</>\n\t)\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-site/push-changes-to-global-styles',\n\twithPushChangesToGlobalStyles\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,0BAA0B,QAAQ,oBAAoB;AAC/D,SACCC,yBAAyB,EACzBC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,sBAAsB,EACrCC,mBAAmB,QACb,yBAAyB;AAChC,SAASC,WAAW,EAAEC,MAAM,QAAQ,uBAAuB;AAC3D,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,6BAA6B,EAC7BC,YAAY,EACZC,eAAe,QACT,mBAAmB;AAC1B,SAASC,UAAU,EAAEC,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACrE,S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,GAAG3F,SAAS,CAChC4F,MAAM,IAAMA,MAAM,CAAE1F,SAAU,CAAC,CAAC2F,eAAe,CAAC,CAAC,EAAEC,cAAc,EACnE,EACD,CAAC;EACD,MAAMC,cAAc,GAAGjF,gBAAgB,CAACkF,IAAI,CAAIC,OAAO,IACtDtG,eAAe,CAAE8F,KAAK,CAACpD,IAAI,EAAE4D,OAAQ,CACtC,CAAC;EACD,MAAMC,WAAW,GAChBR,gBAAgB,KAAK,SAAS,IAAIK,cAAc,IAAIJ,iBAAiB;EAEtE,IAAK,CAAEO,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,OACChB,aAAA,CAACnG,yBAAyB,QACzBmG,aAAA,CAACxB,gCAAgC;IAAA,GAAM+B;EAAK,CAAI,CACtB,CAAC;AAE9B;AAEA,MAAMU,6BAA6B,GAAGrH,0BAA0B,CAC7DsH,SAAS,IAAQX,KAAK,IACvBP,aAAA,CAAAmB,QAAA,QACCnB,aAAA,CAACkB,SAAS;EAAA,GAAMX;AAAK,CAAI,CAAC,EACxBA,KAAK,CAACa,UAAU,IAAIpB,aAAA,CAACM,yBAAyB;EAAA,GAAMC;AAAK,CAAI,CAC9D,CAEJ,CAAC;AAED5G,SAAS,CACR,kBAAkB,EAClB,8CAA8C,EAC9CsH,6BACD,CAAC","ignoreList":[]}
@@ -28,7 +28,7 @@ export function removePropertyFromObject(object, property) {
28
28
  if (!property || typeof property !== 'string') {
29
29
  return object;
30
30
  }
31
- if (typeof object !== 'object' || !Object.keys(object).length) {
31
+ if (typeof object !== 'object' || !object || !Object.keys(object).length) {
32
32
  return object;
33
33
  }
34
34
  for (const key in object) {
@@ -133,9 +133,14 @@ export default function useThemeStyleVariationsByProperty({
133
133
  return variations;
134
134
  }
135
135
  const clonedBaseVariation = typeof baseVariation === 'object' && Object.keys(baseVariation).length > 0 ? cloneDeep(baseVariation) : null;
136
- let processedStyleVariations = variations.map(variation => {
136
+ let processedStyleVariations = variations.reduce((accumulator, variation) => {
137
+ const variationFilteredByProperty = filterObjectByProperty(cloneDeep(variation), property);
138
+ // Remove variations that are empty once the property is filtered out.
139
+ if (Object.keys(variationFilteredByProperty).length === 0) {
140
+ return accumulator;
141
+ }
137
142
  let result = {
138
- ...filterObjectByProperty(cloneDeep(variation), property),
143
+ ...variationFilteredByProperty,
139
144
  title: variation?.title,
140
145
  description: variation?.description
141
146
  };
@@ -146,12 +151,37 @@ export default function useThemeStyleVariationsByProperty({
146
151
  */
147
152
  result = mergeBaseAndUserConfigs(clonedBaseVariation, result);
148
153
  }
149
- return result;
150
- });
154
+
155
+ // Detect if this is a duplicate variation.
156
+ const isDuplicate = accumulator.some(item => {
157
+ return JSON.stringify(item.styles) === JSON.stringify(result?.styles) && JSON.stringify(item.settings) === JSON.stringify(result?.settings);
158
+ });
159
+ if (isDuplicate) {
160
+ return accumulator;
161
+ }
162
+
163
+ // If the variation is not a duplicate, add it to the accumulator.
164
+ accumulator.push(result);
165
+ return accumulator;
166
+ }, [] // Initial accumulator value.
167
+ );
151
168
  if ('function' === typeof filter) {
152
169
  processedStyleVariations = processedStyleVariations.filter(filter);
153
170
  }
154
171
  return processedStyleVariations;
155
172
  }, [variations, property, baseVariation, filter]);
156
173
  }
174
+
175
+ /**
176
+ * Compares a style variation to the same variation filtered by a single property.
177
+ * Returns true if the variation contains only the property specified.
178
+ *
179
+ * @param {Object} variation The variation to compare.
180
+ * @param {string} property The property to compare.
181
+ * @return {boolean} Whether the variation contains only a single property.
182
+ */
183
+ export function isVariationWithSingleProperty(variation, property) {
184
+ const variationWithProperty = filterObjectByProperty(cloneDeep(variation), property);
185
+ return JSON.stringify(variationWithProperty?.styles) === JSON.stringify(variation?.styles) && JSON.stringify(variationWithProperty?.settings) === JSON.stringify(variation?.settings);
186
+ }
157
187
  //# sourceMappingURL=use-theme-style-variations-by-property.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","store","coreStore","useContext","useMemo","privateApis","blockEditorPrivateApis","__","mergeBaseAndUserConfigs","cloneDeep","unlock","GlobalStylesContext","removePropertyFromObject","object","property","Object","keys","length","key","useCurrentMergeThemeStyleVariationsWithUserConfig","filter","variationsFromTheme","select","_variationsFromTheme","__experimentalGetCurrentThemeGlobalStylesVariations","user","baseVariation","variations","title","settings","styles","useThemeStyleVariationsByProperty","filterObjectByProperty","newObject","forEach","newFilter","clonedBaseVariation","processedStyleVariations","map","variation","result","description"],"sources":["@wordpress/edit-site/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { mergeBaseAndUserConfigs } from '../../components/global-styles/global-styles-provider';\nimport cloneDeep from '../../utils/clone-deep';\nimport { unlock } from '../../lock-unlock';\n\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\n\n/**\n * Removes all instances of a property from an object.\n *\n * @param {Object} object The object to remove the property from.\n * @param {string} property The property to remove.\n * @return {Object} The modified object.\n */\nexport function removePropertyFromObject( object, property ) {\n\tif ( ! property || typeof property !== 'string' ) {\n\t\treturn object;\n\t}\n\n\tif ( typeof object !== 'object' || ! Object.keys( object ).length ) {\n\t\treturn object;\n\t}\n\n\tfor ( const key in object ) {\n\t\tif ( key === property ) {\n\t\t\tdelete object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tremovePropertyFromObject( object[ key ], property );\n\t\t}\n\t}\n\treturn object;\n}\n\n/**\n * A convenience wrapper for `useThemeStyleVariationsByProperty()` that fetches the current theme style variations,\n * and user-defined global style/settings object.\n *\n * @param {Object} props Object of hook args.\n * @param {string} props.property The property to filter by.\n * @param {Function} props.filter Optional. The filter function to apply to the variations.\n * @return {Object[]|*} The merged object.\n */\nexport function useCurrentMergeThemeStyleVariationsWithUserConfig( {\n\tproperty,\n\tfilter,\n} ) {\n\tconst { variationsFromTheme } = useSelect( ( select ) => {\n\t\tconst _variationsFromTheme =\n\t\t\tselect(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations();\n\n\t\treturn {\n\t\t\tvariationsFromTheme: _variationsFromTheme || [],\n\t\t};\n\t}, [] );\n\tconst { user: baseVariation } = useContext( GlobalStylesContext );\n\n\tconst variations = useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: __( 'Default' ),\n\t\t\t\tsettings: {},\n\t\t\t\tstyles: {},\n\t\t\t},\n\t\t\t...variationsFromTheme,\n\t\t];\n\t}, [ variationsFromTheme ] );\n\n\treturn useThemeStyleVariationsByProperty( {\n\t\tvariations,\n\t\tproperty,\n\t\tfilter,\n\t\tbaseVariation: removePropertyFromObject(\n\t\t\tcloneDeep( baseVariation ),\n\t\t\tproperty\n\t\t),\n\t} );\n}\n\n/**\n * Returns a new object, with properties specified in `property`,\n * maintain the original object tree structure.\n * The function is recursive, so it will perform a deep search for the given property.\n * E.g., the function will return `{ a: { b: { c: { test: 1 } } } }` if the property is `test`.\n *\n * @param {Object} object The object to filter\n * @param {Object} property The property to filter by\n * @return {Object} The merged object.\n */\nexport const filterObjectByProperty = ( object, property ) => {\n\tif ( ! object ) {\n\t\treturn {};\n\t}\n\n\tconst newObject = {};\n\tObject.keys( object ).forEach( ( key ) => {\n\t\tif ( key === property ) {\n\t\t\tnewObject[ key ] = object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tconst newFilter = filterObjectByProperty( object[ key ], property );\n\t\t\tif ( Object.keys( newFilter ).length ) {\n\t\t\t\tnewObject[ key ] = newFilter;\n\t\t\t}\n\t\t}\n\t} );\n\treturn newObject;\n};\n\n/**\n * Returns a new object with only the properties specified in `property`.\n * Optional merges the baseVariation object with the variation object.\n * Note: this function will only overwrite the specified property in baseVariation if it exists.\n * The baseVariation will not be otherwise modified. To strip a property from the baseVariation object, use `removePropertyFromObject`.\n * See useCurrentMergeThemeStyleVariationsWithUserConfig for an example of how to use this function.\n *\n * @param {Object} props Object of hook args.\n * @param {Object[]} props.variations The theme style variations to filter.\n * @param {string} props.property The property to filter by.\n * @param {Function} props.filter Optional. The filter function to apply to the variations.\n * @param {Object} props.baseVariation Optional. Base or user settings to be updated with variation properties.\n * @return {Object[]|*} The merged object.\n */\nexport default function useThemeStyleVariationsByProperty( {\n\tvariations,\n\tproperty,\n\tfilter,\n\tbaseVariation,\n} ) {\n\treturn useMemo( () => {\n\t\tif ( ! property || ! variations || variations?.length === 0 ) {\n\t\t\treturn variations;\n\t\t}\n\n\t\tconst clonedBaseVariation =\n\t\t\ttypeof baseVariation === 'object' &&\n\t\t\tObject.keys( baseVariation ).length > 0\n\t\t\t\t? cloneDeep( baseVariation )\n\t\t\t\t: null;\n\n\t\tlet processedStyleVariations = variations.map( ( variation ) => {\n\t\t\tlet result = {\n\t\t\t\t...filterObjectByProperty( cloneDeep( variation ), property ),\n\t\t\t\ttitle: variation?.title,\n\t\t\t\tdescription: variation?.description,\n\t\t\t};\n\n\t\t\tif ( clonedBaseVariation ) {\n\t\t\t\t/*\n\t\t\t\t * Overwrites all baseVariation object `styleProperty` properties\n\t\t\t\t * with the theme variation `styleProperty` properties.\n\t\t\t\t */\n\t\t\t\tresult = mergeBaseAndUserConfigs( clonedBaseVariation, result );\n\t\t\t}\n\t\t\treturn result;\n\t\t} );\n\n\t\tif ( 'function' === typeof filter ) {\n\t\t\tprocessedStyleVariations =\n\t\t\t\tprocessedStyleVariations.filter( filter );\n\t\t}\n\n\t\treturn processedStyleVariations;\n\t}, [ variations, property, baseVariation, filter ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;AACxD,SAASC,WAAW,I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SAAS;AACjB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASF,iCAAiCA,CAAE;EAC1DJ,UAAU;EACVb,QAAQ;EACRM,MAAM;EACNM;AACD,CAAC,EAAG;EACH,OAAOtB,OAAO,CAAE,MAAM;IACrB,IAAK,CAAEU,QAAQ,IAAI,CAAEa,UAAU,IAAIA,UAAU,EAAEV,MAAM,KAAK,CAAC,EAAG;MAC7D,OAAOU,UAAU;IAClB;IAEA,MAAMS,mBAAmB,GACxB,OAAOV,aAAa,KAAK,QAAQ,IACjCX,MAAM,CAACC,IAAI,CAAEU,aAAc,CAAC,CAACT,MAAM,GAAG,CAAC,GACpCR,SAAS,CAAEiB,aAAc,CAAC,GAC1B,IAAI;IAER,IAAIW,wBAAwB,GAAGV,UAAU,CAACW,GAAG,CAAIC,SAAS,IAAM;MAC/D,IAAIC,MAAM,GAAG;QACZ,GAAGR,sBAAsB,CAAEvB,SAAS,CAAE8B,SAAU,CAAC,EAAEzB,QAAS,CAAC;QAC7Dc,KAAK,EAAEW,SAAS,EAAEX,KAAK;QACvBa,WAAW,EAAEF,SAAS,EAAEE;MACzB,CAAC;MAED,IAAKL,mBAAmB,EAAG;QAC1B;AACJ;AACA;AACA;QACII,MAAM,GAAGhC,uBAAuB,CAAE4B,mBAAmB,EAAEI,MAAO,CAAC;MAChE;MACA,OAAOA,MAAM;IACd,CAAE,CAAC;IAEH,IAAK,UAAU,KAAK,OAAOpB,MAAM,EAAG;MACnCiB,wBAAwB,GACvBA,wBAAwB,CAACjB,MAAM,CAAEA,MAAO,CAAC;IAC3C;IAEA,OAAOiB,wBAAwB;EAChC,CAAC,EAAE,CAAEV,UAAU,EAAEb,QAAQ,EAAEY,aAAa,EAAEN,MAAM,CAAG,CAAC;AACrD"}
1
+ {"version":3,"names":["useSelect","store","coreStore","useContext","useMemo","privateApis","blockEditorPrivateApis","__","mergeBaseAndUserConfigs","cloneDeep","unlock","GlobalStylesContext","removePropertyFromObject","object","property","Object","keys","length","key","useCurrentMergeThemeStyleVariationsWithUserConfig","filter","variationsFromTheme","select","_variationsFromTheme","__experimentalGetCurrentThemeGlobalStylesVariations","user","baseVariation","variations","title","settings","styles","useThemeStyleVariationsByProperty","filterObjectByProperty","newObject","forEach","newFilter","clonedBaseVariation","processedStyleVariations","reduce","accumulator","variation","variationFilteredByProperty","result","description","isDuplicate","some","item","JSON","stringify","push","isVariationWithSingleProperty","variationWithProperty"],"sources":["@wordpress/edit-site/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { mergeBaseAndUserConfigs } from '../../components/global-styles/global-styles-provider';\nimport cloneDeep from '../../utils/clone-deep';\nimport { unlock } from '../../lock-unlock';\n\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\n\n/**\n * Removes all instances of a property from an object.\n *\n * @param {Object} object The object to remove the property from.\n * @param {string} property The property to remove.\n * @return {Object} The modified object.\n */\nexport function removePropertyFromObject( object, property ) {\n\tif ( ! property || typeof property !== 'string' ) {\n\t\treturn object;\n\t}\n\n\tif (\n\t\ttypeof object !== 'object' ||\n\t\t! object ||\n\t\t! Object.keys( object ).length\n\t) {\n\t\treturn object;\n\t}\n\n\tfor ( const key in object ) {\n\t\tif ( key === property ) {\n\t\t\tdelete object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tremovePropertyFromObject( object[ key ], property );\n\t\t}\n\t}\n\treturn object;\n}\n\n/**\n * A convenience wrapper for `useThemeStyleVariationsByProperty()` that fetches the current theme style variations,\n * and user-defined global style/settings object.\n *\n * @param {Object} props Object of hook args.\n * @param {string} props.property The property to filter by.\n * @param {Function} props.filter Optional. The filter function to apply to the variations.\n * @return {Object[]|*} The merged object.\n */\nexport function useCurrentMergeThemeStyleVariationsWithUserConfig( {\n\tproperty,\n\tfilter,\n} ) {\n\tconst { variationsFromTheme } = useSelect( ( select ) => {\n\t\tconst _variationsFromTheme =\n\t\t\tselect(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations();\n\n\t\treturn {\n\t\t\tvariationsFromTheme: _variationsFromTheme || [],\n\t\t};\n\t}, [] );\n\tconst { user: baseVariation } = useContext( GlobalStylesContext );\n\n\tconst variations = useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: __( 'Default' ),\n\t\t\t\tsettings: {},\n\t\t\t\tstyles: {},\n\t\t\t},\n\t\t\t...variationsFromTheme,\n\t\t];\n\t}, [ variationsFromTheme ] );\n\n\treturn useThemeStyleVariationsByProperty( {\n\t\tvariations,\n\t\tproperty,\n\t\tfilter,\n\t\tbaseVariation: removePropertyFromObject(\n\t\t\tcloneDeep( baseVariation ),\n\t\t\tproperty\n\t\t),\n\t} );\n}\n\n/**\n * Returns a new object, with properties specified in `property`,\n * maintain the original object tree structure.\n * The function is recursive, so it will perform a deep search for the given property.\n * E.g., the function will return `{ a: { b: { c: { test: 1 } } } }` if the property is `test`.\n *\n * @param {Object} object The object to filter\n * @param {Object} property The property to filter by\n * @return {Object} The merged object.\n */\nexport const filterObjectByProperty = ( object, property ) => {\n\tif ( ! object ) {\n\t\treturn {};\n\t}\n\n\tconst newObject = {};\n\tObject.keys( object ).forEach( ( key ) => {\n\t\tif ( key === property ) {\n\t\t\tnewObject[ key ] = object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tconst newFilter = filterObjectByProperty( object[ key ], property );\n\t\t\tif ( Object.keys( newFilter ).length ) {\n\t\t\t\tnewObject[ key ] = newFilter;\n\t\t\t}\n\t\t}\n\t} );\n\treturn newObject;\n};\n\n/**\n * Returns a new object with only the properties specified in `property`.\n * Optional merges the baseVariation object with the variation object.\n * Note: this function will only overwrite the specified property in baseVariation if it exists.\n * The baseVariation will not be otherwise modified. To strip a property from the baseVariation object, use `removePropertyFromObject`.\n * See useCurrentMergeThemeStyleVariationsWithUserConfig for an example of how to use this function.\n *\n * @param {Object} props Object of hook args.\n * @param {Object[]} props.variations The theme style variations to filter.\n * @param {string} props.property The property to filter by.\n * @param {Function} props.filter Optional. The filter function to apply to the variations.\n * @param {Object} props.baseVariation Optional. Base or user settings to be updated with variation properties.\n * @return {Object[]|*} The merged object.\n */\nexport default function useThemeStyleVariationsByProperty( {\n\tvariations,\n\tproperty,\n\tfilter,\n\tbaseVariation,\n} ) {\n\treturn useMemo( () => {\n\t\tif ( ! property || ! variations || variations?.length === 0 ) {\n\t\t\treturn variations;\n\t\t}\n\n\t\tconst clonedBaseVariation =\n\t\t\ttypeof baseVariation === 'object' &&\n\t\t\tObject.keys( baseVariation ).length > 0\n\t\t\t\t? cloneDeep( baseVariation )\n\t\t\t\t: null;\n\n\t\tlet processedStyleVariations = variations.reduce(\n\t\t\t( accumulator, variation ) => {\n\t\t\t\tconst variationFilteredByProperty = filterObjectByProperty(\n\t\t\t\t\tcloneDeep( variation ),\n\t\t\t\t\tproperty\n\t\t\t\t);\n\t\t\t\t// Remove variations that are empty once the property is filtered out.\n\t\t\t\tif ( Object.keys( variationFilteredByProperty ).length === 0 ) {\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}\n\n\t\t\t\tlet result = {\n\t\t\t\t\t...variationFilteredByProperty,\n\t\t\t\t\ttitle: variation?.title,\n\t\t\t\t\tdescription: variation?.description,\n\t\t\t\t};\n\n\t\t\t\tif ( clonedBaseVariation ) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Overwrites all baseVariation object `styleProperty` properties\n\t\t\t\t\t * with the theme variation `styleProperty` properties.\n\t\t\t\t\t */\n\t\t\t\t\tresult = mergeBaseAndUserConfigs(\n\t\t\t\t\t\tclonedBaseVariation,\n\t\t\t\t\t\tresult\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Detect if this is a duplicate variation.\n\t\t\t\tconst isDuplicate = accumulator.some( ( item ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tJSON.stringify( item.styles ) ===\n\t\t\t\t\t\t\tJSON.stringify( result?.styles ) &&\n\t\t\t\t\t\tJSON.stringify( item.settings ) ===\n\t\t\t\t\t\t\tJSON.stringify( result?.settings )\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t\tif ( isDuplicate ) {\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}\n\n\t\t\t\t// If the variation is not a duplicate, add it to the accumulator.\n\t\t\t\taccumulator.push( result );\n\t\t\t\treturn accumulator;\n\t\t\t},\n\t\t\t[] // Initial accumulator value.\n\t\t);\n\n\t\tif ( 'function' === typeof filter ) {\n\t\t\tprocessedStyleVariations =\n\t\t\t\tprocessedStyleVariations.filter( filter );\n\t\t}\n\n\t\treturn processedStyleVariations;\n\t}, [ variations, property, baseVariation, filter ] );\n}\n\n/**\n * Compares a style variation to the same variation filtered by a single property.\n * Returns true if the variation contains only the property specified.\n *\n * @param {Object} variation The variation to compare.\n * @param {string} property The property to compare.\n * @return {boolean} Whether the variation contains only a single property.\n */\nexport function isVariationWithSingleProperty( variation, property ) {\n\tconst variationWithProperty = filterObjectByProperty(\n\t\tcloneDeep( variation ),\n\t\tproperty\n\t);\n\n\treturn (\n\t\tJSON.stringify( variationWithProperty?.styles ) ===\n\t\t\tJSON.stringify( variation?.styles ) &&\n\t\tJSON.stringify( variationWithProperty?.settings ) ===\n\t\t\tJSON.stringify( variation?.settings )\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,y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AAC,IACjCiB,IAAI,CAACC,SAAS,CAAEF,IAAI,CAACjB,QAAS,CAAC,KAC9BkB,IAAI,CAACC,SAAS,CAAEN,MAAM,EAAEb,QAAS,CAAC;MAErC,CAAE,CAAC;MACH,IAAKe,WAAW,EAAG;QAClB,OAAOL,WAAW;MACnB;;MAEA;MACAA,WAAW,CAACU,IAAI,CAAEP,MAAO,CAAC;MAC1B,OAAOH,WAAW;IACnB,CAAC,EACD,EAAE,CAAC;IACJ,CAAC;IAED,IAAK,UAAU,KAAK,OAAOnB,MAAM,EAAG;MACnCiB,wBAAwB,GACvBA,wBAAwB,CAACjB,MAAM,CAAEA,MAAO,CAAC;IAC3C;IAEA,OAAOiB,wBAAwB;EAChC,CAAC,EAAE,CAAEV,UAAU,EAAEb,QAAQ,EAAEY,aAAa,EAAEN,MAAM,CAAG,CAAC;AACrD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS8B,6BAA6BA,CAAEV,SAAS,EAAE1B,QAAQ,EAAG;EACpE,MAAMqC,qBAAqB,GAAGnB,sBAAsB,CACnDvB,SAAS,CAAE+B,SAAU,CAAC,EACtB1B,QACD,CAAC;EAED,OACCiC,IAAI,CAACC,SAAS,CAAEG,qBAAqB,EAAErB,MAAO,CAAC,KAC9CiB,IAAI,CAACC,SAAS,CAAER,SAAS,EAAEV,MAAO,CAAC,IACpCiB,IAAI,CAACC,SAAS,CAAEG,qBAAqB,EAAEtB,QAAS,CAAC,KAChDkB,IAAI,CAACC,SAAS,CAAER,SAAS,EAAEX,QAAS,CAAC;AAExC","ignoreList":[]}
@@ -8,7 +8,6 @@ import { dispatch } from '@wordpress/data';
8
8
  import deprecated from '@wordpress/deprecated';
9
9
  import { createRoot } from '@wordpress/element';
10
10
  import { store as editorStore } from '@wordpress/editor';
11
- import { store as interfaceStore } from '@wordpress/interface';
12
11
  import { store as preferencesStore } from '@wordpress/preferences';
13
12
  import { registerLegacyWidgetBlock, registerWidgetGroupBlock } from '@wordpress/widgets';
14
13
 
@@ -66,7 +65,6 @@ export function initializeEditor(id, settings) {
66
65
  showBlockBreadcrumbs: true,
67
66
  showListViewByDefault: false
68
67
  });
69
- dispatch(interfaceStore).setDefaultComplementaryArea('core/edit-site', 'edit-site/template');
70
68
  dispatch(editSiteStore).updateSettings(settings);
71
69
 
72
70
  // Keep the defaultTemplateTypes in the core/editor settings too,
@@ -90,9 +88,7 @@ export function reinitializeEditor() {
90
88
  version: '6.3'
91
89
  });
92
90
  }
93
- export { default as PluginSidebar } from './components/sidebar-edit-mode/plugin-sidebar';
94
- export { default as PluginSidebarMoreMenuItem } from './components/header-edit-mode/plugin-sidebar-more-menu-item';
95
- export { default as PluginMoreMenuItem } from './components/header-edit-mode/plugin-more-menu-item';
96
91
  export { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';
97
92
  export { store } from './store';
93
+ export * from './deprecated';
98
94
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","deprecated","createRoot","editorStore","interfaceStore","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editSiteStore","App","initializeEditor","id","settings","target","document","getElementById","root","reapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","setDefaults","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","allowRightClickOverrides","distractionFree","editorMode","fixedToolbar","focusMode","inactivePanels","keepCaretInsideBlock","openPanels","showBlockBreadcrumbs","showListViewByDefault","setDefaultComplementaryArea","updateSettings","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","render","createElement","reinitializeEditor","since","version","default","PluginSidebar","PluginSidebarMoreMenuItem","PluginMoreMenuItem","PluginTemplateSettingPanel"],"sources":["@wordpress/edit-site/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport App from './components/app';\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\tdistractionFree: false,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tinactivePanels: [],\n\t\tkeepCaretInsideBlock: false,\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowListViewByDefault: false,\n\t} );\n\n\tdispatch( interfaceStore ).setDefaultComplementaryArea(\n\t\t'core/edit-site',\n\t\t'edit-site/template'\n\t);\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t// so that they can be selected with core/editor selectors in any editor.\n\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t// which internally uses updateEditorSettings as well.\n\tdispatch( editorStore ).updateEditorSettings( {\n\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t} );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render( <App /> );\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginSidebar } from './components/sidebar-edit-mode/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header-edit-mode/plugin-sidebar-more-menu-item';\nexport { default as PluginMoreMenuItem } from './components/header-edit-mode/plugin-more-menu-item';\nexport { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';\nexport { store } from './store';\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SACCC,kBAAkB,EAClBC,2BAA2B,EAC3BC,4CAA4C,QACtC,0BAA0B;AACjC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UA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C,aAAa,QAAQ,+CAA+C;AACxF,SAASD,OAAO,IAAIE,yBAAyB,QAAQ,6DAA6D;AAClH,SAASF,OAAO,IAAIG,kBAAkB,QAAQ,qDAAqD;AACnG,SAASH,OAAO,IAAII,0BAA0B,QAAQ,4CAA4C;AAClG,SAASjE,KAAK,QAAQ,SAAS"}
1
+ {"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","deprecated","createRoot","editorStore","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editSiteStore","App","initializeEditor","id","settings","target","document","getElementById","root","reapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","setDefaults","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","allowRightClickOverrides","distractionFree","editorMode","fixedToolbar","focusMode","inactivePanels","keepCaretInsideBlock","openPanels","showBlockBreadcrumbs","showListViewByDefault","updateSettings","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","render","createElement","reinitializeEditor","since","version","default","PluginTemplateSettingPanel"],"sources":["@wordpress/edit-site/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport App from './components/app';\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\tdistractionFree: false,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tinactivePanels: [],\n\t\tkeepCaretInsideBlock: false,\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowListViewByDefault: false,\n\t} );\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t// so that they can be selected with core/editor selectors in any editor.\n\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t// which internally uses updateEditorSettings as well.\n\tdispatch( editorStore ).updateEditorSettings( {\n\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t} );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render( <App /> );\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';\nexport { store } from './store';\nexport * from './deprecated';\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SACCC,kBAAkB,EAClBC,2BAA2B,EAC3BC,4CAA4C,QACtC,0BAA0B;AACjC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASP,KAAK,IAAIQ,WAAW,QAAQ,mBAAmB;AACxD,SAASR,KAAK,IAAIS,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,yBAAyB,EACzBC,wBAAwB,QAClB,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAO,SAAS;AAChB,SAASX,KAAK,IAAIY,aAAa,QAAQ,SAAS;AAChD,OAAOC,GAAG,MAAM,kBAAkB;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAEC,EAAE,EAAEC,QAAQ,EAAG;EAChD,MAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAc,CAAEJ,EAAG,CAAC;EAC5C,MAAMK,IAAI,GAAGb,UAAU,CAAEU,MAAO,CAAC;EAEjCZ,QAAQ,CAAEJ,WAAY,CAAC,CAACoB,uBAAuB,CAAC,CAAC;EACjD,MAAMC,UAAU,GAAGnB,2BAA2B,CAAC,CAAC,CAACoB,MAAM,CACtD,CAAE;IAAEC;EAAK,CAAC,KAAMA,IAAI,KAAK,eAC1B,CAAC;EACDtB,kBAAkB,CAAEoB,U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C,EAAE,KAAM,CAAC;EACzEH,MAAM,CAACC,gBAAgB,CAAE,MAAM,EAAIC,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EAErEjC,IAAI,CAACkC,MAAM,CAAEC,aAAA,CAAC1C,GAAG,MAAE,CAAE,CAAC;EAEtB,OAAOO,IAAI;AACZ;AAEA,OAAO,SAASoC,kBAAkBA,CAAA,EAAG;EACpClD,UAAU,CAAE,gCAAgC,EAAE;IAC7CmD,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;AAEA,SAASC,OAAO,IAAIC,0BAA0B,QAAQ,4CAA4C;AAClG,SAAS5D,KAAK,QAAQ,SAAS;AAC/B,cAAc,cAAc","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"sources":["@wordpress/edit-site/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',\n\t\t'@wordpress/edit-site'\n\t);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAgD,QAAQ,yBAAyB;AAE1F,OAAO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5BF,gDAAgD,CAC/C,iHAAiH,EACjH,sBACD,CAAC"}
1
+ {"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"sources":["@wordpress/edit-site/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',\n\t\t'@wordpress/edit-site'\n\t);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAgD,QAAQ,yBAAyB;AAE1F,OAAO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5BF,gDAAgD,CAC/C,iHAAiH,EACjH,sBACD,CAAC","ignoreList":[]}
@@ -1,25 +1,21 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import apiFetch from '@wordpress/api-fetch';
5
- import { parse, __unstableSerializeAndClean } from '@wordpress/blocks';
4
+ import { parse } from '@wordpress/blocks';
6
5
  import deprecated from '@wordpress/deprecated';
7
- import { addQueryArgs } from '@wordpress/url';
8
- import { __ } from '@wordpress/i18n';
9
- import { store as noticesStore } from '@wordpress/notices';
10
6
  import { store as coreStore } from '@wordpress/core-data';
11
- import { store as interfaceStore } from '@wordpress/interface';
12
7
  import { store as blockEditorStore } from '@wordpress/block-editor';
13
- import { store as editorStore } from '@wordpress/editor';
8
+ import { store as editorStore, privateApis as editorPrivateApis } from '@wordpress/editor';
14
9
  import { store as preferencesStore } from '@wordpress/preferences';
15
10
 
16
11
  /**
17
12
  * Internal dependencies
18
13
  */
19
- import { STORE_NAME as editSiteStoreName } from './constants';
20
- import isTemplateRevertable from '../utils/is-template-revertable';
21
14
  import { TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE } from '../utils/constants';
22
- import { removeTemplates } from './private-actions';
15
+ import { unlock } from '../lock-unlock';
16
+ const {
17
+ interfaceStore
18
+ } = unlock(editorPrivateApis);
23
19
 
24
20
  /**
25
21
  * Dispatches an action that toggles a feature flag.
@@ -112,8 +108,10 @@ export const addTemplate = template => async ({
112
108
  *
113
109
  * @param {Object} template The template object.
114
110
  */
115
- export const removeTemplate = template => {
116
- return removeTemplates([template]);
111
+ export const removeTemplate = template => ({
112
+ registry
113
+ }) => {
114
+ return unlock(registry.dispatch(editorStore)).removeTemplates([template]);
117
115
  };
118
116
 
119
117
  /**
@@ -197,7 +195,7 @@ export function setEditedPostContext(context) {
197
195
  *
198
196
  * @deprecated
199
197
  *
200
- * @return {number} The resolved template ID for the page route.
198
+ * @return {Object} Action object.
201
199
  */
202
200
  export function setPage() {
203
201
  deprecated("dispatch( 'core/edit-site' ).setPage", {
@@ -326,86 +324,12 @@ export function setIsSaveViewOpened(isOpen) {
326
324
  * @param {boolean} [options.allowUndo] Whether to allow the user to undo
327
325
  * reverting the template. Default true.
328
326
  */
329
- export const revertTemplate = (template, {
330
- allowUndo = true
331
- } = {}) => async ({
327
+ export const revertTemplate = (template, options) => ({
332
328
  registry
333
329
  }) => {
334
- const noticeId = 'edit-site-template-reverted';
335
- registry.dispatch(noticesStore).removeNotice(noticeId);
336
- if (!isTemplateRevertable(template)) {
337
- registry.dispatch(noticesStore).createErrorNotice(__('This template is not revertable.'), {
338
- type: 'snackbar'
339
- });
340
- return;
341
- }
342
- try {
343
- const templateEntityConfig = registry.select(coreStore).getEntityConfig('postType', template.type);
344
- if (!templateEntityConfig) {
345
- registry.dispatch(noticesStore).createErrorNotice(__('The editor has encountered an unexpected error. Please reload.'), {
346
- type: 'snackbar'
347
- });
348
- return;
349
- }
350
- const fileTemplatePath = addQueryArgs(`${templateEntityConfig.baseURL}/${template.id}`, {
351
- context: 'edit',
352
- source: 'theme'
353
- });
354
- const fileTemplate = await apiFetch({
355
- path: fileTemplatePath
356
- });
357
- if (!fileTemplate) {
358
- registry.dispatch(noticesStore).createErrorNotice(__('The editor has encountered an unexpected error. Please reload.'), {
359
- type: 'snackbar'
360
- });
361
- return;
362
- }
363
- const serializeBlocks = ({
364
- blocks: blocksForSerialization = []
365
- }) => __unstableSerializeAndClean(blocksForSerialization);
366
- const edited = registry.select(coreStore).getEditedEntityRecord('postType', template.type, template.id);
367
-
368
- // We are fixing up the undo level here to make sure we can undo
369
- // the revert in the header toolbar correctly.
370
- registry.dispatch(coreStore).editEntityRecord('postType', template.type, template.id, {
371
- content: serializeBlocks,
372
- // Required to make the `undo` behave correctly.
373
- blocks: edited.blocks,
374
- // Required to revert the blocks in the editor.
375
- source: 'custom' // required to avoid turning the editor into a dirty state
376
- }, {
377
- undoIgnore: true // Required to merge this edit with the last undo level.
378
- });
379
- const blocks = parse(fileTemplate?.content?.raw);
380
- registry.dispatch(coreStore).editEntityRecord('postType', template.type, fileTemplate.id, {
381
- content: serializeBlocks,
382
- blocks,
383
- source: 'theme'
384
- });
385
- if (allowUndo) {
386
- const undoRevert = () => {
387
- registry.dispatch(coreStore).editEntityRecord('postType', template.type, edited.id, {
388
- content: serializeBlocks,
389
- blocks: edited.blocks,
390
- source: 'custom'
391
- });
392
- };
393
- registry.dispatch(noticesStore).createSuccessNotice(__('Template reverted.'), {
394
- type: 'snackbar',
395
- id: noticeId,
396
- actions: [{
397
- label: __('Undo'),
398
- onClick: undoRevert
399
- }]
400
- });
401
- }
402
- } catch (error) {
403
- const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : __('Template revert failed. Please reload.');
404
- registry.dispatch(noticesStore).createErrorNotice(errorMessage, {
405
- type: 'snackbar'
406
- });
407
- }
330
+ return unlock(registry.dispatch(editorStore)).revertTemplate(template, options);
408
331
  };
332
+
409
333
  /**
410
334
  * Action that opens an editor sidebar.
411
335
  *
@@ -414,7 +338,7 @@ export const revertTemplate = (template, {
414
338
  export const openGeneralSidebar = name => ({
415
339
  registry
416
340
  }) => {
417
- registry.dispatch(interfaceStore).enableComplementaryArea(editSiteStoreName, name);
341
+ registry.dispatch(interfaceStore).enableComplementaryArea('core', name);
418
342
  };
419
343
 
420
344
  /**
@@ -423,7 +347,7 @@ export const openGeneralSidebar = name => ({
423
347
  export const closeGeneralSidebar = () => ({
424
348
  registry
425
349
  }) => {
426
- registry.dispatch(interfaceStore).disableComplementaryArea(editSiteStoreName);
350
+ registry.dispatch(interfaceStore).disableComplementaryArea('core');
427
351
  };
428
352
 
429
353
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["apiFetch","parse","__unstableSerializeAndClean","deprecated","addQueryArgs","__","store","noticesStore","coreStore","interfaceStore","blockEditorStore","editorStore","preferencesStore","STORE_NAME","editSiteStoreName","isTemplateRevertable","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","removeTemplates","toggleFeature","featureName","registry","since","alternative","dispatch","toggle","__experimentalSetPreviewDeviceType","deviceType","version","hint","setDeviceType","setTemplate","type","addTemplate","template","newTemplate","saveEntityRecord","content","editEntityRecord","id","blocks","undoIgnore","postType","removeTemplate","setTemplatePart","templatePartId","setNavigationMenu","navigationMenuId","setEditedEntity","postId","context","setHomeTemplateId","setEditedPostContext","setPage","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","setIsListViewOpened","isOpen","updateSettings","settings","setIsSaveViewOpened","revertTemplate","allowUndo","noticeId","removeNotice","createErrorNotice","templateEntityConfig","select","getEntityConfig","fileTemplatePath","baseURL","source","fileTemplate","path","serializeBlocks","blocksForSerialization","edited","getEditedEntityRecord","raw","undoRevert","createSuccessNotice","actions","label","onClick","error","errorMessage","message","code","openGeneralSidebar","name","enableComplementaryArea","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","setHasPageContentFocus","hasPageContentFocus","clearSelectedBlock","toggleDistractionFree"],"sources":["@wordpress/edit-site/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME as editSiteStoreName } from './constants';\nimport isTemplateRevertable from '../utils/is-template-revertable';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../utils/constants';\nimport { removeTemplates } from './private-actions';\n\n/**\n * Dispatches an action that toggles a feature flag.\n *\n * @param {string} featureName Feature name.\n */\nexport function toggleFeature( featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-site' ).toggleFeature( featureName )\",\n\t\t\t{\n\t\t\t\tsince: '6.0',\n\t\t\t\talternative:\n\t\t\t\t\t\"dispatch( 'core/preferences').toggle( 'core/edit-site', featureName )\",\n\t\t\t}\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-site', featureName );\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @deprecated\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport const __experimentalSetPreviewDeviceType =\n\t( deviceType ) =>\n\t( { registry } ) => {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-site' ).__experimentalSetPreviewDeviceType\",\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\thint: 'registry.dispatch( editorStore ).setDeviceType',\n\t\t\t}\n\t\t);\n\t\tregistry.dispatch( editorStore ).setDeviceType( deviceType );\n\t};\n\n/**\n * Action that sets a template, optionally fetching it from REST API.\n *\n * @return {Object} Action object.\n */\nexport function setTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setTemplate\", {\n\t\tsince: '6.5',\n\t\tversion: '6.8',\n\t\thint: 'The setTemplate is not needed anymore, the correct entity is resolved from the URL automatically.',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Action that adds a new template and sets it as the current template.\n *\n * @param {Object} template The template.\n *\n * @deprecated\n *\n * @return {Object} Action object used to set the current template.\n */\nexport const addTemplate =\n\t( template ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).addTemplate\", {\n\t\t\tsince: '6.5',\n\t\t\tversion: '6.8',\n\t\t\thint: 'use saveEntityRecord directly',\n\t\t} );\n\n\t\tconst newTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', TEMPLATE_POST_TYPE, template );\n\n\t\tif ( template.content ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tnewTemplate.id,\n\t\t\t\t\t{ blocks: parse( template.content ) },\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tid: newTemplate.id,\n\t\t} );\n\t};\n\n/**\n * Action that removes a template.\n *\n * @param {Object} template The template object.\n */\nexport const removeTemplate = ( template ) => {\n\treturn removeTemplates( [ template ] );\n};\n\n/**\n * Action that sets a template part.\n *\n * @param {string} templatePartId The template part ID.\n *\n * @return {Object} Action object.\n */\nexport function setTemplatePart( templatePartId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: TEMPLATE_PART_POST_TYPE,\n\t\tid: templatePartId,\n\t};\n}\n\n/**\n * Action that sets a navigation menu.\n *\n * @param {string} navigationMenuId The Navigation Menu Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setNavigationMenu( navigationMenuId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: NAVIGATION_POST_TYPE,\n\t\tid: navigationMenuId,\n\t};\n}\n\n/**\n * Action that sets an edited entity.\n *\n * @param {string} postType The entity's post type.\n * @param {string} postId The entity's ID.\n * @param {Object} context The entity's context.\n *\n * @return {Object} Action object.\n */\nexport function setEditedEntity( postType, postId, context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tid: postId,\n\t\tcontext,\n\t};\n}\n\n/**\n * @deprecated\n */\nexport function setHomeTemplateId() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Set's the current block editor context.\n *\n * @param {Object} context The context object.\n *\n * @return {Object} Action object.\n */\nexport function setEditedPostContext( context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST_CONTEXT',\n\t\tcontext,\n\t};\n}\n\n/**\n * Resolves the template for a page and displays both. If no path is given, attempts\n * to use the postId to generate a path like `?p=${ postId }`.\n *\n * @deprecated\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport function setPage() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setPage\", {\n\t\tsince: '6.5',\n\t\tversion: '6.8',\n\t\thint: 'The setPage is not needed anymore, the correct entity is resolved from the URL automatically.',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Action that sets the active navigation panel menu.\n *\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function setNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens the navigation panel and sets its active menu at the same time.\n *\n * @deprecated\n */\nexport function openNavigationPanelToMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).openNavigationPanelToMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Sets whether the navigation panel should be open.\n *\n * @deprecated\n */\nexport function setIsNavigationPanelOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setIsNavigationPanelOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @deprecated\n *\n * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false).\n */\nexport const setIsInserterOpened =\n\t( value ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).setIsInserterOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsInserterOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( value );\n\t};\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @deprecated\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).setIsListViewOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsListViewOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsListViewOpened( isOpen );\n\t};\n\n/**\n * Returns an action object used to update the settings.\n *\n * @param {Object} settings New settings.\n *\n * @return {Object} Action object.\n */\nexport function updateSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Sets whether the save view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the save view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport function setIsSaveViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_SAVE_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Reverts a template to its original theme-provided file.\n *\n * @param {Object} template The template to revert.\n * @param {Object} [options]\n * @param {boolean} [options.allowUndo] Whether to allow the user to undo\n * reverting the template. Default true.\n */\nexport const revertTemplate =\n\t( template, { allowUndo = true } = {} ) =>\n\tasync ( { registry } ) => {\n\t\tconst noticeId = 'edit-site-template-reverted';\n\t\tregistry.dispatch( noticesStore ).removeNotice( noticeId );\n\t\tif ( ! isTemplateRevertable( template ) ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( __( 'This template is not revertable.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst templateEntityConfig = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityConfig( 'postType', template.type );\n\n\t\t\tif ( ! templateEntityConfig ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fileTemplatePath = addQueryArgs(\n\t\t\t\t`${ templateEntityConfig.baseURL }/${ template.id }`,\n\t\t\t\t{ context: 'edit', source: 'theme' }\n\t\t\t);\n\n\t\t\tconst fileTemplate = await apiFetch( { path: fileTemplatePath } );\n\t\t\tif ( ! fileTemplate ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst serializeBlocks = ( {\n\t\t\t\tblocks: blocksForSerialization = [],\n\t\t\t} ) => __unstableSerializeAndClean( blocksForSerialization );\n\n\t\t\tconst edited = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\t// We are fixing up the undo level here to make sure we can undo\n\t\t\t// the revert in the header toolbar correctly.\n\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: serializeBlocks, // Required to make the `undo` behave correctly.\n\t\t\t\t\tblocks: edited.blocks, // Required to revert the blocks in the editor.\n\t\t\t\t\tsource: 'custom', // required to avoid turning the editor into a dirty state\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tundoIgnore: true, // Required to merge this edit with the last undo level.\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst blocks = parse( fileTemplate?.content?.raw );\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord( 'postType', template.type, fileTemplate.id, {\n\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\tblocks,\n\t\t\t\t\tsource: 'theme',\n\t\t\t\t} );\n\n\t\t\tif ( allowUndo ) {\n\t\t\t\tconst undoRevert = () => {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\ttemplate.type,\n\t\t\t\t\t\t\tedited.id,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\t\t\t\tblocks: edited.blocks,\n\t\t\t\t\t\t\t\tsource: 'custom',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( __( 'Template reverted.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: noticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: undoRevert,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t} );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'Template revert failed. Please reload.' );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n/**\n * Action that opens an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( editSiteStoreName, name );\n\t};\n\n/**\n * Action that closes the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editSiteStoreName );\n\t};\n\n/**\n * Triggers an action used to switch editor mode.\n *\n * @deprecated\n *\n * @param {string} mode The editor mode.\n */\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).switchEditorMode\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').switchEditorMode\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).switchEditorMode( mode );\n\t};\n\n/**\n * Sets whether or not the editor allows only page content to be edited.\n *\n * @param {boolean} hasPageContentFocus True to allow only page content to be\n * edited, false to allow template to be\n * edited.\n */\nexport const setHasPageContentFocus =\n\t( hasPageContentFocus ) =>\n\t( { dispatch, registry } ) => {\n\t\tdeprecated( `dispatch( 'core/edit-site' ).setHasPageContentFocus`, {\n\t\t\tsince: '6.5',\n\t\t} );\n\n\t\tif ( hasPageContentFocus ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_HAS_PAGE_CONTENT_FOCUS',\n\t\t\thasPageContentFocus,\n\t\t} );\n\t};\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n *\n * @deprecated\n */\nexport const toggleDistractionFree =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).toggleDistractionFree\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').toggleDistractionFree\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).toggleDistractionFree();\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,QAAQ,MAAM,sBAAsB;AAC3C,SAASC,KAAK,EAAEC,2BAA2B,QAAQ,mBAAmB;AACtE,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASF,KAAK,IAAIG,cAAc,QAAQ,sBAAsB;AAC9D,SAASH,KAAK,IAAII,gBAAgB,QAAQ,yBAAyB;AACnE,SAASJ,KAAK,IAAIK,WAAW,QAAQ,mBAAmB;AACxD,SAASL,KAAK,IAAIM,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASC,UAAU,IAAIC,iBAAiB,QAAQ,aAAa;AAC7D,OAAOC,oBAAoB,MAAM,iCAAiC;AAClE,SACCC,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,QACd,oBAAoB;AAC3B,SAASC,eAAe,QAAQ,mBAAmB;;AAEnD;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAEC,WAAW,EAAG;EAC5C,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gBAAiB,CAAC,CAAC2F,kBAAkB,CAAC,CAAC;EAC3D;EACA5E,QAAQ,CAAE;IACTQ,IAAI,EAAE,4BAA4B;IAClCmE;EACD,CAAE,CAAC;AACJ,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,qBAAqB,GACjCA,CAAA,KACA,CAAE;EAAEhF;AAAS,CAAC,KAAM;EACnBnB,UAAU,CAAE,oDAAoD,EAAE;IACjEoB,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE;EACd,CAAE,CAAC;EACHF,QAAQ,CAACG,QAAQ,CAAEd,WAAY,CAAC,CAAC2F,qBAAqB,CAAC,CAAC;AACzD,CAAC"}
1
+ {"version":3,"names":["parse","deprecated","store","coreStore","blockEditorStore","editorStore","privateApis","editorPrivateApis","preferencesStore","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","unlock","interfaceStore","toggleFeature","featureName","registry","since","alternative","dispatch","toggle","__experimentalSetPreviewDeviceType","deviceType","version","hint","setDeviceType","setTemplate","type","addTemplate","template","newTemplate","saveEntityRecord","content","editEntityRecord","id","blocks","undoIgnore","postType","removeTemplate","removeTemplates","setTemplatePart","templatePartId","setNavigationMenu","navigationMenuId","setEditedEntity","postId","context","setHomeTemplateId","setEditedPostContext","setPage","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","setIsListViewOpened","isOpen","updateSettings","settings","setIsSaveViewOpened","revertTemplate","options","openGeneralSidebar","name","enableComplementaryArea","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","setHasPageContentFocus","hasPageContentFocus","clearSelectedBlock","toggleDistractionFree"],"sources":["@wordpress/edit-site/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { parse } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../utils/constants';\nimport { unlock } from '../lock-unlock';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\n/**\n * Dispatches an action that toggles a feature flag.\n *\n * @param {string} featureName Feature name.\n */\nexport function toggleFeature( featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-site' ).toggleFeature( featureName )\",\n\t\t\t{\n\t\t\t\tsince: '6.0',\n\t\t\t\talternative:\n\t\t\t\t\t\"dispatch( 'core/preferences').toggle( 'core/edit-site', featureName )\",\n\t\t\t}\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-site', featureName );\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @deprecated\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport const __experimentalSetPreviewDeviceType =\n\t( deviceType ) =>\n\t( { registry } ) => {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-site' ).__experimentalSetPreviewDeviceType\",\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\thint: 'registry.dispatch( editorStore ).setDeviceType',\n\t\t\t}\n\t\t);\n\t\tregistry.dispatch( editorStore ).setDeviceType( deviceType );\n\t};\n\n/**\n * Action that sets a template, optionally fetching it from REST API.\n *\n * @return {Object} Action object.\n */\nexport function setTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setTemplate\", {\n\t\tsince: '6.5',\n\t\tversion: '6.8',\n\t\thint: 'The setTemplate is not needed anymore, the correct entity is resolved from the URL automatically.',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Action that adds a new template and sets it as the current template.\n *\n * @param {Object} template The template.\n *\n * @deprecated\n *\n * @return {Object} Action object used to set the current template.\n */\nexport const addTemplate =\n\t( template ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).addTemplate\", {\n\t\t\tsince: '6.5',\n\t\t\tversion: '6.8',\n\t\t\thint: 'use saveEntityRecord directly',\n\t\t} );\n\n\t\tconst newTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', TEMPLATE_POST_TYPE, template );\n\n\t\tif ( template.content ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tnewTemplate.id,\n\t\t\t\t\t{ blocks: parse( template.content ) },\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tid: newTemplate.id,\n\t\t} );\n\t};\n\n/**\n * Action that removes a template.\n *\n * @param {Object} template The template object.\n */\nexport const removeTemplate =\n\t( template ) =>\n\t( { registry } ) => {\n\t\treturn unlock( registry.dispatch( editorStore ) ).removeTemplates( [\n\t\t\ttemplate,\n\t\t] );\n\t};\n\n/**\n * Action that sets a template part.\n *\n * @param {string} templatePartId The template part ID.\n *\n * @return {Object} Action object.\n */\nexport function setTemplatePart( templatePartId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: TEMPLATE_PART_POST_TYPE,\n\t\tid: templatePartId,\n\t};\n}\n\n/**\n * Action that sets a navigation menu.\n *\n * @param {string} navigationMenuId The Navigation Menu Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setNavigationMenu( navigationMenuId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: NAVIGATION_POST_TYPE,\n\t\tid: navigationMenuId,\n\t};\n}\n\n/**\n * Action that sets an edited entity.\n *\n * @param {string} postType The entity's post type.\n * @param {string} postId The entity's ID.\n * @param {Object} context The entity's context.\n *\n * @return {Object} Action object.\n */\nexport function setEditedEntity( postType, postId, context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tid: postId,\n\t\tcontext,\n\t};\n}\n\n/**\n * @deprecated\n */\nexport function setHomeTemplateId() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Set's the current block editor context.\n *\n * @param {Object} context The context object.\n *\n * @return {Object} Action object.\n */\nexport function setEditedPostContext( context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST_CONTEXT',\n\t\tcontext,\n\t};\n}\n\n/**\n * Resolves the template for a page and displays both. If no path is given, attempts\n * to use the postId to generate a path like `?p=${ postId }`.\n *\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function setPage() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setPage\", {\n\t\tsince: '6.5',\n\t\tversion: '6.8',\n\t\thint: 'The setPage is not needed anymore, the correct entity is resolved from the URL automatically.',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Action that sets the active navigation panel menu.\n *\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function setNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens the navigation panel and sets its active menu at the same time.\n *\n * @deprecated\n */\nexport function openNavigationPanelToMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).openNavigationPanelToMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Sets whether the navigation panel should be open.\n *\n * @deprecated\n */\nexport function setIsNavigationPanelOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setIsNavigationPanelOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @deprecated\n *\n * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false).\n */\nexport const setIsInserterOpened =\n\t( value ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).setIsInserterOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsInserterOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( value );\n\t};\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @deprecated\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).setIsListViewOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsListViewOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsListViewOpened( isOpen );\n\t};\n\n/**\n * Returns an action object used to update the settings.\n *\n * @param {Object} settings New settings.\n *\n * @return {Object} Action object.\n */\nexport function updateSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Sets whether the save view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the save view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport function setIsSaveViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_SAVE_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Reverts a template to its original theme-provided file.\n *\n * @param {Object} template The template to revert.\n * @param {Object} [options]\n * @param {boolean} [options.allowUndo] Whether to allow the user to undo\n * reverting the template. Default true.\n */\nexport const revertTemplate =\n\t( template, options ) =>\n\t( { registry } ) => {\n\t\treturn unlock( registry.dispatch( editorStore ) ).revertTemplate(\n\t\t\ttemplate,\n\t\t\toptions\n\t\t);\n\t};\n\n/**\n * Action that opens an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( 'core', name );\n\t};\n\n/**\n * Action that closes the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( interfaceStore ).disableComplementaryArea( 'core' );\n\t};\n\n/**\n * Triggers an action used to switch editor mode.\n *\n * @deprecated\n *\n * @param {string} mode The editor mode.\n */\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).switchEditorMode\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').switchEditorMode\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).switchEditorMode( mode );\n\t};\n\n/**\n * Sets whether or not the editor allows only page content to be edited.\n *\n * @param {boolean} hasPageContentFocus True to allow only page content to be\n * edited, false to allow template to be\n * edited.\n */\nexport const setHasPageContentFocus =\n\t( hasPageContentFocus ) =>\n\t( { dispatch, registry } ) => {\n\t\tdeprecated( `dispatch( 'core/edit-site' ).setHasPageContentFocus`, {\n\t\t\tsince: '6.5',\n\t\t} );\n\n\t\tif ( hasPageContentFocus ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_HAS_PAGE_CONTENT_FOCUS',\n\t\t\thasPageContentFocus,\n\t\t} );\n\t};\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n *\n * @deprecated\n */\nexport const toggleDistractionFree =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).toggleDistractionFree\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').toggleDistractionFree\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).toggleDistractionFree();\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,mBAAmB;AACzC,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,yBAAyB;AACnE,SACCF,KAAK,IAAIG,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;AAC1B,SAASL,KAAK,IAAIM,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SACCC,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,QACd,oBAAoB;AAC3B,SAASC,MAAM,QAAQ,gBAAgB;AAEvC,MAAM;EAAEC;AAAe,CAAC,GAAGD,MAAM,CAAEL,iBAAkB,CAAC;;AAEtD;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,aAAaA,CAAEC,WAAW,EAAG;EAC5C,OAAO,UAAW;IAAEC;EAAS,CAAC,EAAG;IAChCf,UAAU,CACT,2DAA2D,EAC3D;MACCgB,KAAK,EAAE,KAAK;MACZC,WAAW,EACV;IACF,CACD,CAAC;IAEDF,QAAQ,CACNG,QAAQ,CAAEX,gBAAiB,CAAC,CAC5BY,MAAM,CAAE,gBAAgB,EAAEL,WAAY,CAAC;EAC1C,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMM,kCAAkC,GAC5CC,UAAU,IACZ,CAAE;EAAEN;AAAS,CAAC,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AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAC1BC,IAAI,IACN,CAAE;EAAEpD;AAAS,CAAC,KAAM;EACnBf,UAAU,CAAE,+CAA+C,EAAE;IAC5DgB,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE;EACd,CAAE,CAAC;EACHF,QAAQ,CAACG,QAAQ,CAAEd,WAAY,CAAC,CAAC8D,gBAAgB,CAAEC,IAAK,CAAC;AAC1D,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAChCC,mBAAmB,IACrB,CAAE;EAAEnD,QAAQ;EAAEH;AAAS,CAAC,KAAM;EAC7Bf,UAAU,CAAG,qDAAoD,EAAE;IAClEgB,KAAK,EAAE;EACR,CAAE,CAAC;EAEH,IAAKqD,mBAAmB,EAAG;IAC1BtD,QAAQ,CAACG,QAAQ,CAAEf,gBAAiB,CAAC,CAACmE,kBAAkB,CAAC,CAAC;EAC3D;EACApD,QAAQ,CAAE;IACTQ,IAAI,EAAE,4BAA4B;IAClC2C;EACD,CAAE,CAAC;AACJ,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,qBAAqB,GACjCA,CAAA,KACA,CAAE;EAAExD;AAAS,CAAC,KAAM;EACnBf,UAAU,CAAE,oDAAoD,EAAE;IACjEgB,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE;EACd,CAAE,CAAC;EACHF,QAAQ,CAACG,QAAQ,CAAEd,WAAY,CAAC,CAACmE,qBAAqB,CAAC,CAAC;AACzD,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["STORE_NAME"],"sources":["@wordpress/edit-site/src/store/constants.js"],"sourcesContent":["/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/edit-site';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,UAAU,GAAG,gBAAgB"}
1
+ {"version":3,"names":["STORE_NAME"],"sources":["@wordpress/edit-site/src/store/constants.js"],"sourcesContent":["/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/edit-site';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,UAAU,GAAG,gBAAgB","ignoreList":[]}