@wordpress/edit-site 5.12.0 → 5.12.2

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 (904) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/build/components/add-new-pattern/index.js +99 -0
  3. package/build/components/add-new-pattern/index.js.map +1 -0
  4. package/build/components/add-new-template/add-custom-template-modal-content.js +9 -23
  5. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  6. package/build/components/add-new-template/index.js +2 -10
  7. package/build/components/add-new-template/index.js.map +1 -1
  8. package/build/components/add-new-template/new-template.js +75 -22
  9. package/build/components/add-new-template/new-template.js.map +1 -1
  10. package/build/components/app/index.js +2 -2
  11. package/build/components/app/index.js.map +1 -1
  12. package/build/components/block-editor/back-button.js +5 -3
  13. package/build/components/block-editor/back-button.js.map +1 -1
  14. package/build/components/block-editor/constants.js +9 -0
  15. package/build/components/block-editor/constants.js.map +1 -0
  16. package/build/components/block-editor/editor-canvas.js +8 -8
  17. package/build/components/block-editor/editor-canvas.js.map +1 -1
  18. package/build/components/block-editor/get-block-editor-provider.js +42 -0
  19. package/build/components/block-editor/get-block-editor-provider.js.map +1 -0
  20. package/build/components/block-editor/index.js +6 -132
  21. package/build/components/block-editor/index.js.map +1 -1
  22. package/build/components/block-editor/providers/default-block-editor-provider.js +58 -0
  23. package/build/components/block-editor/providers/default-block-editor-provider.js.map +1 -0
  24. package/build/components/block-editor/providers/navigation-block-editor-provider.js +117 -0
  25. package/build/components/block-editor/providers/navigation-block-editor-provider.js.map +1 -0
  26. package/build/components/block-editor/site-editor-canvas.js +137 -0
  27. package/build/components/block-editor/site-editor-canvas.js.map +1 -0
  28. package/build/components/block-editor/use-site-editor-settings.js +82 -0
  29. package/build/components/block-editor/use-site-editor-settings.js.map +1 -0
  30. package/build/components/canvas-spinner/index.js +18 -1
  31. package/build/components/canvas-spinner/index.js.map +1 -1
  32. package/build/components/create-pattern-modal/index.js +125 -0
  33. package/build/components/create-pattern-modal/index.js.map +1 -0
  34. package/build/components/create-template-part-modal/index.js +50 -6
  35. package/build/components/create-template-part-modal/index.js.map +1 -1
  36. package/build/components/editor/index.js +24 -13
  37. package/build/components/editor/index.js.map +1 -1
  38. package/build/components/editor-canvas-container/index.js +22 -4
  39. package/build/components/editor-canvas-container/index.js.map +1 -1
  40. package/build/components/global-styles/color-indicator-wrapper.js +4 -5
  41. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  42. package/build/components/global-styles/color-palette-panel.js +2 -2
  43. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  44. package/build/components/global-styles/dimensions-panel.js +2 -2
  45. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  46. package/build/components/global-styles/global-styles-provider.js +12 -16
  47. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  48. package/build/components/global-styles/gradients-palette-panel.js +2 -2
  49. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  50. package/build/components/global-styles/hooks.js +3 -3
  51. package/build/components/global-styles/hooks.js.map +1 -1
  52. package/build/components/global-styles/icon-with-current-color.js +4 -5
  53. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  54. package/build/components/global-styles/navigation-button.js +10 -11
  55. package/build/components/global-styles/navigation-button.js.map +1 -1
  56. package/build/components/global-styles/palette.js +3 -3
  57. package/build/components/global-styles/palette.js.map +1 -1
  58. package/build/components/global-styles/preview.js +2 -2
  59. package/build/components/global-styles/preview.js.map +1 -1
  60. package/build/components/global-styles/root-menu.js +2 -2
  61. package/build/components/global-styles/root-menu.js.map +1 -1
  62. package/build/components/global-styles/screen-block-list.js +2 -2
  63. package/build/components/global-styles/screen-block-list.js.map +1 -1
  64. package/build/components/global-styles/screen-block.js +2 -2
  65. package/build/components/global-styles/screen-block.js.map +1 -1
  66. package/build/components/global-styles/screen-colors.js +2 -2
  67. package/build/components/global-styles/screen-colors.js.map +1 -1
  68. package/build/components/global-styles/screen-css.js +2 -2
  69. package/build/components/global-styles/screen-css.js.map +1 -1
  70. package/build/components/global-styles/screen-layout.js +2 -2
  71. package/build/components/global-styles/screen-layout.js.map +1 -1
  72. package/build/components/global-styles/screen-revisions/index.js +4 -4
  73. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  74. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +2 -2
  75. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  76. package/build/components/global-styles/screen-root.js +2 -2
  77. package/build/components/global-styles/screen-root.js.map +1 -1
  78. package/build/components/global-styles/screen-typography.js +2 -2
  79. package/build/components/global-styles/screen-typography.js.map +1 -1
  80. package/build/components/global-styles/style-variations-container.js +11 -3
  81. package/build/components/global-styles/style-variations-container.js.map +1 -1
  82. package/build/components/global-styles/typography-panel.js +2 -2
  83. package/build/components/global-styles/typography-panel.js.map +1 -1
  84. package/build/components/global-styles/typography-preview.js +2 -2
  85. package/build/components/global-styles/typography-preview.js.map +1 -1
  86. package/build/components/global-styles/ui.js +95 -36
  87. package/build/components/global-styles/ui.js.map +1 -1
  88. package/build/components/global-styles-renderer/index.js +2 -2
  89. package/build/components/global-styles-renderer/index.js.map +1 -1
  90. package/build/components/header-edit-mode/document-actions/index.js +55 -22
  91. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  92. package/build/components/header-edit-mode/index.js +41 -16
  93. package/build/components/header-edit-mode/index.js.map +1 -1
  94. package/build/components/header-edit-mode/more-menu/index.js +36 -2
  95. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  96. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +4 -7
  97. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
  98. package/build/components/header-edit-mode/undo-redo/redo.js +2 -6
  99. package/build/components/header-edit-mode/undo-redo/redo.js.map +1 -1
  100. package/build/components/header-edit-mode/undo-redo/undo.js +2 -6
  101. package/build/components/header-edit-mode/undo-redo/undo.js.map +1 -1
  102. package/build/components/keyboard-shortcut-help-modal/index.js +2 -1
  103. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  104. package/build/components/keyboard-shortcuts/edit-mode.js +39 -3
  105. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  106. package/build/components/keyboard-shortcuts/index.js +7 -2
  107. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  108. package/build/components/keyboard-shortcuts/register.js +10 -1
  109. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  110. package/build/components/layout/hooks.js +21 -0
  111. package/build/components/layout/hooks.js.map +1 -1
  112. package/build/components/layout/index.js +126 -34
  113. package/build/components/layout/index.js.map +1 -1
  114. package/build/components/list/index.js +2 -2
  115. package/build/components/list/index.js.map +1 -1
  116. package/build/components/page/header.js +41 -0
  117. package/build/components/page/header.js.map +1 -0
  118. package/build/components/page/index.js +49 -0
  119. package/build/components/page/index.js.map +1 -0
  120. package/build/components/page-content-focus-manager/back-to-page-notification.js +73 -0
  121. package/build/components/page-content-focus-manager/back-to-page-notification.js.map +1 -0
  122. package/build/components/page-content-focus-manager/constants.js +9 -0
  123. package/build/components/page-content-focus-manager/constants.js.map +1 -0
  124. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +60 -0
  125. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -0
  126. package/build/components/page-content-focus-manager/edit-template-notification.js +121 -0
  127. package/build/components/page-content-focus-manager/edit-template-notification.js.map +1 -0
  128. package/build/components/page-content-focus-manager/index.js +37 -0
  129. package/build/components/page-content-focus-manager/index.js.map +1 -0
  130. package/build/components/page-library/grid-item.js +169 -0
  131. package/build/components/page-library/grid-item.js.map +1 -0
  132. package/build/components/page-library/grid.js +49 -0
  133. package/build/components/page-library/grid.js.map +1 -0
  134. package/build/components/page-library/index.js +61 -0
  135. package/build/components/page-library/index.js.map +1 -0
  136. package/build/components/page-library/no-patterns.js +20 -0
  137. package/build/components/page-library/no-patterns.js.map +1 -0
  138. package/build/components/page-library/patterns-list.js +108 -0
  139. package/build/components/page-library/patterns-list.js.map +1 -0
  140. package/build/components/page-library/search-items.js +172 -0
  141. package/build/components/page-library/search-items.js.map +1 -0
  142. package/build/components/page-library/use-library-settings.js +53 -0
  143. package/build/components/page-library/use-library-settings.js.map +1 -0
  144. package/build/components/page-library/use-patterns.js +194 -0
  145. package/build/components/page-library/use-patterns.js.map +1 -0
  146. package/build/components/page-library/utils.js +30 -0
  147. package/build/components/page-library/utils.js.map +1 -0
  148. package/build/components/page-main/index.js +46 -0
  149. package/build/components/page-main/index.js.map +1 -0
  150. package/build/components/page-templates/index.js +101 -0
  151. package/build/components/page-templates/index.js.map +1 -0
  152. package/build/components/preferences-modal/enable-feature.js +9 -8
  153. package/build/components/preferences-modal/enable-feature.js.map +1 -1
  154. package/build/components/preferences-modal/index.js +30 -0
  155. package/build/components/preferences-modal/index.js.map +1 -1
  156. package/build/components/resizable-frame/index.js +6 -4
  157. package/build/components/resizable-frame/index.js.map +1 -1
  158. package/build/components/revisions/index.js +2 -2
  159. package/build/components/revisions/index.js.map +1 -1
  160. package/build/components/routes/link.js +7 -10
  161. package/build/components/routes/link.js.map +1 -1
  162. package/build/components/routes/use-title.js +2 -2
  163. package/build/components/routes/use-title.js.map +1 -1
  164. package/build/components/save-button/index.js +15 -11
  165. package/build/components/save-button/index.js.map +1 -1
  166. package/build/components/save-hub/index.js +2 -2
  167. package/build/components/save-hub/index.js.map +1 -1
  168. package/build/components/save-panel/index.js +5 -7
  169. package/build/components/save-panel/index.js.map +1 -1
  170. package/build/components/secondary-sidebar/inserter-sidebar.js +4 -8
  171. package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  172. package/build/components/secondary-sidebar/list-view-sidebar.js +47 -10
  173. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  174. package/build/components/sidebar/index.js +12 -8
  175. package/build/components/sidebar/index.js.map +1 -1
  176. package/build/components/sidebar-button/index.js +2 -4
  177. package/build/components/sidebar-button/index.js.map +1 -1
  178. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +22 -8
  179. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  180. package/build/components/sidebar-edit-mode/index.js +8 -6
  181. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  182. package/build/components/sidebar-edit-mode/page-panels/edit-template.js +84 -0
  183. package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -0
  184. package/build/components/sidebar-edit-mode/page-panels/index.js +51 -38
  185. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  186. package/build/components/sidebar-edit-mode/page-panels/page-content.js +35 -0
  187. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -0
  188. package/build/components/sidebar-edit-mode/page-panels/page-status.js +192 -0
  189. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -0
  190. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +45 -0
  191. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -0
  192. package/build/components/sidebar-edit-mode/page-panels/publish-date.js +98 -0
  193. package/build/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -0
  194. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -7
  195. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  196. package/build/components/sidebar-edit-mode/settings-header/index.js +19 -6
  197. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  198. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +2 -2
  199. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  200. package/build/components/sidebar-edit-mode/template-panel/index.js +10 -6
  201. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  202. package/build/components/sidebar-navigation-item/index.js +11 -7
  203. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  204. package/build/components/sidebar-navigation-screen/index.js +24 -9
  205. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  206. package/build/components/sidebar-navigation-screen-details-footer/index.js +36 -0
  207. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -0
  208. package/build/components/sidebar-navigation-screen-details-panel/index.js +58 -0
  209. package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -0
  210. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +22 -0
  211. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -0
  212. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +35 -0
  213. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -0
  214. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +22 -0
  215. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -0
  216. package/build/components/sidebar-navigation-screen-global-styles/index.js +28 -16
  217. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  218. package/build/components/sidebar-navigation-screen-library/category-item.js +48 -0
  219. package/build/components/sidebar-navigation-screen-library/category-item.js.map +1 -0
  220. package/build/components/sidebar-navigation-screen-library/index.js +112 -0
  221. package/build/components/sidebar-navigation-screen-library/index.js.map +1 -0
  222. package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +36 -0
  223. package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +1 -0
  224. package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js +76 -0
  225. package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +1 -0
  226. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js +41 -0
  227. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +1 -0
  228. package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js +40 -0
  229. package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +1 -0
  230. package/build/components/sidebar-navigation-screen-main/index.js +12 -13
  231. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  232. package/build/components/sidebar-navigation-screen-navigation-item/index.js +2 -2
  233. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  234. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +42 -0
  235. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -0
  236. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +41 -0
  237. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -0
  238. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +47 -92
  239. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  240. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +84 -0
  241. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -0
  242. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +71 -0
  243. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -0
  244. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +63 -0
  245. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -0
  246. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +49 -0
  247. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -0
  248. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +167 -0
  249. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -0
  250. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  251. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  252. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +58 -8
  253. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  254. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +57 -10
  255. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  256. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +21 -50
  257. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  258. package/build/components/sidebar-navigation-screen-page/index.js +14 -34
  259. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  260. package/build/components/sidebar-navigation-screen-page/page-details.js +29 -27
  261. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  262. package/build/components/sidebar-navigation-screen-page/status-label.js +8 -7
  263. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  264. package/build/components/sidebar-navigation-screen-pages/index.js +9 -8
  265. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  266. package/build/components/sidebar-navigation-screen-pattern/index.js +66 -0
  267. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -0
  268. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +41 -0
  269. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -0
  270. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +33 -0
  271. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -0
  272. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +40 -0
  273. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -0
  274. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +47 -0
  275. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -0
  276. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +82 -0
  277. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -0
  278. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +80 -0
  279. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -0
  280. package/build/components/sidebar-navigation-screen-template/home-template-details.js +212 -0
  281. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -0
  282. package/build/components/sidebar-navigation-screen-template/index.js +21 -7
  283. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  284. package/build/components/sidebar-navigation-screen-templates/index.js +11 -11
  285. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  286. package/build/components/site-hub/index.js +10 -12
  287. package/build/components/site-hub/index.js.map +1 -1
  288. package/build/components/style-book/index.js +10 -11
  289. package/build/components/style-book/index.js.map +1 -1
  290. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +14 -4
  291. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  292. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +4 -4
  293. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  294. package/build/components/sync-state-with-url/use-sync-path-with-url.js +12 -2
  295. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  296. package/build/components/table/index.js +29 -0
  297. package/build/components/table/index.js.map +1 -0
  298. package/build/components/template-part-converter/convert-to-template-part.js +3 -21
  299. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  300. package/build/components/welcome-guide/editor.js +1 -1
  301. package/build/components/welcome-guide/editor.js.map +1 -1
  302. package/build/components/welcome-guide/styles.js +4 -3
  303. package/build/components/welcome-guide/styles.js.map +1 -1
  304. package/build/hooks/commands/use-common-commands.js +212 -0
  305. package/build/hooks/commands/use-common-commands.js.map +1 -0
  306. package/build/hooks/commands/use-edit-mode-commands.js +196 -24
  307. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  308. package/build/hooks/index.js +2 -0
  309. package/build/hooks/index.js.map +1 -1
  310. package/build/hooks/navigation-menu-edit.js +95 -0
  311. package/build/hooks/navigation-menu-edit.js.map +1 -0
  312. package/build/hooks/push-changes-to-global-styles/index.js +5 -3
  313. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  314. package/build/hooks/template-part-edit.js +6 -9
  315. package/build/hooks/template-part-edit.js.map +1 -1
  316. package/build/index.js +1 -0
  317. package/build/index.js.map +1 -1
  318. package/build/{private-apis.js → lock-unlock.js} +1 -1
  319. package/build/lock-unlock.js.map +1 -0
  320. package/build/store/actions.js +45 -9
  321. package/build/store/actions.js.map +1 -1
  322. package/build/store/index.js +3 -3
  323. package/build/store/index.js.map +1 -1
  324. package/build/store/reducer.js +7 -6
  325. package/build/store/reducer.js.map +1 -1
  326. package/build/store/selectors.js +42 -17
  327. package/build/store/selectors.js.map +1 -1
  328. package/build/utils/get-is-list-page.js +12 -5
  329. package/build/utils/get-is-list-page.js.map +1 -1
  330. package/build/utils/is-previewing-theme.js +2 -2
  331. package/build/utils/is-previewing-theme.js.map +1 -1
  332. package/build/utils/use-activate-theme.js +3 -3
  333. package/build/utils/use-activate-theme.js.map +1 -1
  334. package/build/utils/use-debounced-input.js +26 -0
  335. package/build/utils/use-debounced-input.js.map +1 -0
  336. package/build-module/components/add-new-pattern/index.js +82 -0
  337. package/build-module/components/add-new-pattern/index.js.map +1 -0
  338. package/build-module/components/add-new-template/add-custom-template-modal-content.js +7 -20
  339. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  340. package/build-module/components/add-new-template/index.js +2 -8
  341. package/build-module/components/add-new-template/index.js.map +1 -1
  342. package/build-module/components/add-new-template/new-template.js +76 -22
  343. package/build-module/components/add-new-template/new-template.js.map +1 -1
  344. package/build-module/components/app/index.js +1 -1
  345. package/build-module/components/app/index.js.map +1 -1
  346. package/build-module/components/block-editor/back-button.js +4 -2
  347. package/build-module/components/block-editor/back-button.js.map +1 -1
  348. package/build-module/components/block-editor/constants.js +2 -0
  349. package/build-module/components/block-editor/constants.js.map +1 -0
  350. package/build-module/components/block-editor/editor-canvas.js +6 -5
  351. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  352. package/build-module/components/block-editor/get-block-editor-provider.js +31 -0
  353. package/build-module/components/block-editor/get-block-editor-provider.js.map +1 -0
  354. package/build-module/components/block-editor/index.js +9 -127
  355. package/build-module/components/block-editor/index.js.map +1 -1
  356. package/build-module/components/block-editor/providers/default-block-editor-provider.js +42 -0
  357. package/build-module/components/block-editor/providers/default-block-editor-provider.js.map +1 -0
  358. package/build-module/components/block-editor/providers/navigation-block-editor-provider.js +102 -0
  359. package/build-module/components/block-editor/providers/navigation-block-editor-provider.js.map +1 -0
  360. package/build-module/components/block-editor/site-editor-canvas.js +115 -0
  361. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -0
  362. package/build-module/components/block-editor/use-site-editor-settings.js +67 -0
  363. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -0
  364. package/build-module/components/canvas-spinner/index.js +15 -1
  365. package/build-module/components/canvas-spinner/index.js.map +1 -1
  366. package/build-module/components/create-pattern-modal/index.js +113 -0
  367. package/build-module/components/create-pattern-modal/index.js.map +1 -0
  368. package/build-module/components/create-template-part-modal/index.js +47 -7
  369. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  370. package/build-module/components/editor/index.js +24 -13
  371. package/build-module/components/editor/index.js.map +1 -1
  372. package/build-module/components/editor-canvas-container/index.js +19 -2
  373. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  374. package/build-module/components/global-styles/color-indicator-wrapper.js +4 -4
  375. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  376. package/build-module/components/global-styles/color-palette-panel.js +1 -1
  377. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  378. package/build-module/components/global-styles/dimensions-panel.js +1 -1
  379. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  380. package/build-module/components/global-styles/global-styles-provider.js +10 -15
  381. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  382. package/build-module/components/global-styles/gradients-palette-panel.js +1 -1
  383. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  384. package/build-module/components/global-styles/hooks.js +1 -1
  385. package/build-module/components/global-styles/hooks.js.map +1 -1
  386. package/build-module/components/global-styles/icon-with-current-color.js +4 -4
  387. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  388. package/build-module/components/global-styles/navigation-button.js +10 -8
  389. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  390. package/build-module/components/global-styles/palette.js +2 -2
  391. package/build-module/components/global-styles/palette.js.map +1 -1
  392. package/build-module/components/global-styles/preview.js +1 -1
  393. package/build-module/components/global-styles/preview.js.map +1 -1
  394. package/build-module/components/global-styles/root-menu.js +1 -1
  395. package/build-module/components/global-styles/root-menu.js.map +1 -1
  396. package/build-module/components/global-styles/screen-block-list.js +1 -1
  397. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  398. package/build-module/components/global-styles/screen-block.js +1 -1
  399. package/build-module/components/global-styles/screen-block.js.map +1 -1
  400. package/build-module/components/global-styles/screen-colors.js +1 -1
  401. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  402. package/build-module/components/global-styles/screen-css.js +1 -1
  403. package/build-module/components/global-styles/screen-css.js.map +1 -1
  404. package/build-module/components/global-styles/screen-layout.js +1 -1
  405. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  406. package/build-module/components/global-styles/screen-revisions/index.js +1 -1
  407. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  408. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -1
  409. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  410. package/build-module/components/global-styles/screen-root.js +1 -1
  411. package/build-module/components/global-styles/screen-root.js.map +1 -1
  412. package/build-module/components/global-styles/screen-typography.js +1 -1
  413. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  414. package/build-module/components/global-styles/style-variations-container.js +11 -3
  415. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  416. package/build-module/components/global-styles/typography-panel.js +1 -1
  417. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  418. package/build-module/components/global-styles/typography-preview.js +1 -1
  419. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  420. package/build-module/components/global-styles/ui.js +94 -35
  421. package/build-module/components/global-styles/ui.js.map +1 -1
  422. package/build-module/components/global-styles-renderer/index.js +1 -1
  423. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  424. package/build-module/components/header-edit-mode/document-actions/index.js +55 -22
  425. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  426. package/build-module/components/header-edit-mode/index.js +42 -17
  427. package/build-module/components/header-edit-mode/index.js.map +1 -1
  428. package/build-module/components/header-edit-mode/more-menu/index.js +35 -3
  429. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  430. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +4 -4
  431. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
  432. package/build-module/components/header-edit-mode/undo-redo/redo.js +2 -3
  433. package/build-module/components/header-edit-mode/undo-redo/redo.js.map +1 -1
  434. package/build-module/components/header-edit-mode/undo-redo/undo.js +2 -3
  435. package/build-module/components/header-edit-mode/undo-redo/undo.js.map +1 -1
  436. package/build-module/components/keyboard-shortcut-help-modal/index.js +2 -1
  437. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  438. package/build-module/components/keyboard-shortcuts/edit-mode.js +36 -3
  439. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  440. package/build-module/components/keyboard-shortcuts/index.js +7 -2
  441. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  442. package/build-module/components/keyboard-shortcuts/register.js +10 -1
  443. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  444. package/build-module/components/layout/hooks.js +21 -0
  445. package/build-module/components/layout/hooks.js.map +1 -1
  446. package/build-module/components/layout/index.js +119 -28
  447. package/build-module/components/layout/index.js.map +1 -1
  448. package/build-module/components/list/index.js +1 -1
  449. package/build-module/components/list/index.js.map +1 -1
  450. package/build-module/components/page/header.js +33 -0
  451. package/build-module/components/page/header.js.map +1 -0
  452. package/build-module/components/page/index.js +37 -0
  453. package/build-module/components/page/index.js.map +1 -0
  454. package/build-module/components/page-content-focus-manager/back-to-page-notification.js +59 -0
  455. package/build-module/components/page-content-focus-manager/back-to-page-notification.js.map +1 -0
  456. package/build-module/components/page-content-focus-manager/constants.js +2 -0
  457. package/build-module/components/page-content-focus-manager/constants.js.map +1 -0
  458. package/build-module/components/{page-content-lock/use-disable-non-content-blocks.js → page-content-focus-manager/disable-non-page-content-blocks.js} +18 -9
  459. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -0
  460. package/build-module/components/page-content-focus-manager/edit-template-notification.js +110 -0
  461. package/build-module/components/page-content-focus-manager/edit-template-notification.js.map +1 -0
  462. package/build-module/components/page-content-focus-manager/index.js +23 -0
  463. package/build-module/components/page-content-focus-manager/index.js.map +1 -0
  464. package/build-module/components/page-library/grid-item.js +149 -0
  465. package/build-module/components/page-library/grid-item.js.map +1 -0
  466. package/build-module/components/page-library/grid.js +38 -0
  467. package/build-module/components/page-library/grid.js.map +1 -0
  468. package/build-module/components/page-library/index.js +43 -0
  469. package/build-module/components/page-library/index.js.map +1 -0
  470. package/build-module/components/page-library/no-patterns.js +12 -0
  471. package/build-module/components/page-library/no-patterns.js.map +1 -0
  472. package/build-module/components/page-library/patterns-list.js +87 -0
  473. package/build-module/components/page-library/patterns-list.js.map +1 -0
  474. package/build-module/components/page-library/search-items.js +156 -0
  475. package/build-module/components/page-library/search-items.js.map +1 -0
  476. package/build-module/components/page-library/use-library-settings.js +40 -0
  477. package/build-module/components/page-library/use-library-settings.js.map +1 -0
  478. package/build-module/components/page-library/use-patterns.js +176 -0
  479. package/build-module/components/page-library/use-patterns.js.map +1 -0
  480. package/build-module/components/page-library/utils.js +13 -0
  481. package/build-module/components/page-library/utils.js.map +1 -0
  482. package/build-module/components/page-main/index.js +32 -0
  483. package/build-module/components/page-main/index.js.map +1 -0
  484. package/build-module/components/page-templates/index.js +80 -0
  485. package/build-module/components/page-templates/index.js.map +1 -0
  486. package/build-module/components/preferences-modal/enable-feature.js +9 -5
  487. package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
  488. package/build-module/components/preferences-modal/index.js +27 -0
  489. package/build-module/components/preferences-modal/index.js.map +1 -1
  490. package/build-module/components/resizable-frame/index.js +5 -3
  491. package/build-module/components/resizable-frame/index.js.map +1 -1
  492. package/build-module/components/revisions/index.js +1 -1
  493. package/build-module/components/revisions/index.js.map +1 -1
  494. package/build-module/components/routes/link.js +6 -6
  495. package/build-module/components/routes/link.js.map +1 -1
  496. package/build-module/components/routes/use-title.js +1 -1
  497. package/build-module/components/routes/use-title.js.map +1 -1
  498. package/build-module/components/save-button/index.js +15 -11
  499. package/build-module/components/save-button/index.js.map +1 -1
  500. package/build-module/components/save-hub/index.js +1 -1
  501. package/build-module/components/save-hub/index.js.map +1 -1
  502. package/build-module/components/save-panel/index.js +3 -4
  503. package/build-module/components/save-panel/index.js.map +1 -1
  504. package/build-module/components/secondary-sidebar/inserter-sidebar.js +4 -5
  505. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  506. package/build-module/components/secondary-sidebar/list-view-sidebar.js +44 -10
  507. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  508. package/build-module/components/sidebar/index.js +10 -7
  509. package/build-module/components/sidebar/index.js.map +1 -1
  510. package/build-module/components/sidebar-button/index.js +2 -3
  511. package/build-module/components/sidebar-button/index.js.map +1 -1
  512. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +19 -6
  513. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  514. package/build-module/components/sidebar-edit-mode/index.js +8 -6
  515. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  516. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +71 -0
  517. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -0
  518. package/build-module/components/sidebar-edit-mode/page-panels/index.js +51 -40
  519. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  520. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +23 -0
  521. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -0
  522. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +176 -0
  523. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -0
  524. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +33 -0
  525. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -0
  526. package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js +85 -0
  527. package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -0
  528. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -4
  529. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  530. package/build-module/components/sidebar-edit-mode/settings-header/index.js +20 -7
  531. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  532. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -1
  533. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  534. package/build-module/components/sidebar-edit-mode/template-panel/index.js +9 -6
  535. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  536. package/build-module/components/sidebar-navigation-item/index.js +11 -7
  537. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  538. package/build-module/components/sidebar-navigation-screen/index.js +24 -9
  539. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  540. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +27 -0
  541. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -0
  542. package/build-module/components/sidebar-navigation-screen-details-panel/index.js +30 -0
  543. package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -0
  544. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +14 -0
  545. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -0
  546. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +24 -0
  547. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -0
  548. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +14 -0
  549. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -0
  550. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +23 -11
  551. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  552. package/build-module/components/sidebar-navigation-screen-library/category-item.js +37 -0
  553. package/build-module/components/sidebar-navigation-screen-library/category-item.js.map +1 -0
  554. package/build-module/components/sidebar-navigation-screen-library/index.js +87 -0
  555. package/build-module/components/sidebar-navigation-screen-library/index.js.map +1 -0
  556. package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +25 -0
  557. package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +1 -0
  558. package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js +61 -0
  559. package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +1 -0
  560. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js +34 -0
  561. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +1 -0
  562. package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js +27 -0
  563. package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +1 -0
  564. package/build-module/components/sidebar-navigation-screen-main/index.js +13 -13
  565. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  566. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
  567. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  568. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +33 -0
  569. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -0
  570. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +26 -0
  571. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -0
  572. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +45 -90
  573. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  574. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +70 -0
  575. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -0
  576. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +58 -0
  577. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -0
  578. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +56 -0
  579. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -0
  580. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +35 -0
  581. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -0
  582. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +155 -0
  583. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -0
  584. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  585. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  586. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +57 -9
  587. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  588. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +55 -7
  589. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  590. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +22 -50
  591. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  592. package/build-module/components/sidebar-navigation-screen-page/index.js +14 -34
  593. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  594. package/build-module/components/sidebar-navigation-screen-page/page-details.js +28 -28
  595. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  596. package/build-module/components/sidebar-navigation-screen-page/status-label.js +9 -8
  597. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  598. package/build-module/components/sidebar-navigation-screen-pages/index.js +8 -6
  599. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  600. package/build-module/components/sidebar-navigation-screen-pattern/index.js +46 -0
  601. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -0
  602. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +28 -0
  603. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -0
  604. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +22 -0
  605. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -0
  606. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +27 -0
  607. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -0
  608. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +34 -0
  609. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -0
  610. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +71 -0
  611. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -0
  612. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +64 -0
  613. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -0
  614. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +192 -0
  615. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -0
  616. package/build-module/components/sidebar-navigation-screen-template/index.js +18 -6
  617. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  618. package/build-module/components/sidebar-navigation-screen-templates/index.js +11 -10
  619. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  620. package/build-module/components/site-hub/index.js +8 -9
  621. package/build-module/components/site-hub/index.js.map +1 -1
  622. package/build-module/components/style-book/index.js +9 -9
  623. package/build-module/components/style-book/index.js.map +1 -1
  624. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +13 -3
  625. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  626. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
  627. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  628. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +11 -1
  629. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  630. package/build-module/components/table/index.js +21 -0
  631. package/build-module/components/table/index.js.map +1 -0
  632. package/build-module/components/template-part-converter/convert-to-template-part.js +4 -20
  633. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  634. package/build-module/components/welcome-guide/editor.js +1 -1
  635. package/build-module/components/welcome-guide/editor.js.map +1 -1
  636. package/build-module/components/welcome-guide/styles.js +5 -3
  637. package/build-module/components/welcome-guide/styles.js.map +1 -1
  638. package/build-module/hooks/commands/use-common-commands.js +194 -0
  639. package/build-module/hooks/commands/use-common-commands.js.map +1 -0
  640. package/build-module/hooks/commands/use-edit-mode-commands.js +196 -26
  641. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  642. package/build-module/hooks/index.js +1 -0
  643. package/build-module/hooks/index.js.map +1 -1
  644. package/build-module/hooks/navigation-menu-edit.js +77 -0
  645. package/build-module/hooks/navigation-menu-edit.js.map +1 -0
  646. package/build-module/hooks/push-changes-to-global-styles/index.js +4 -2
  647. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  648. package/build-module/hooks/template-part-edit.js +5 -5
  649. package/build-module/hooks/template-part-edit.js.map +1 -1
  650. package/build-module/index.js +1 -0
  651. package/build-module/index.js.map +1 -1
  652. package/build-module/{private-apis.js → lock-unlock.js} +1 -1
  653. package/build-module/lock-unlock.js.map +1 -0
  654. package/build-module/store/actions.js +39 -7
  655. package/build-module/store/actions.js.map +1 -1
  656. package/build-module/store/index.js +1 -1
  657. package/build-module/store/index.js.map +1 -1
  658. package/build-module/store/reducer.js +6 -5
  659. package/build-module/store/reducer.js.map +1 -1
  660. package/build-module/store/selectors.js +37 -15
  661. package/build-module/store/selectors.js.map +1 -1
  662. package/build-module/utils/get-is-list-page.js +12 -5
  663. package/build-module/utils/get-is-list-page.js.map +1 -1
  664. package/build-module/utils/is-previewing-theme.js +2 -2
  665. package/build-module/utils/is-previewing-theme.js.map +1 -1
  666. package/build-module/utils/use-activate-theme.js +2 -2
  667. package/build-module/utils/use-activate-theme.js.map +1 -1
  668. package/build-module/utils/use-debounced-input.js +17 -0
  669. package/build-module/utils/use-debounced-input.js.map +1 -0
  670. package/build-style/style-rtl.css +424 -38
  671. package/build-style/style.css +424 -38
  672. package/package.json +44 -40
  673. package/src/components/add-new-pattern/index.js +92 -0
  674. package/src/components/add-new-template/add-custom-template-modal-content.js +1 -13
  675. package/src/components/add-new-template/index.js +0 -3
  676. package/src/components/add-new-template/new-template.js +121 -26
  677. package/src/components/add-new-template/style.scss +30 -2
  678. package/src/components/app/index.js +1 -1
  679. package/src/components/block-editor/back-button.js +5 -2
  680. package/src/components/block-editor/constants.js +1 -0
  681. package/src/components/block-editor/editor-canvas.js +1 -1
  682. package/src/components/block-editor/get-block-editor-provider.js +29 -0
  683. package/src/components/block-editor/index.js +15 -199
  684. package/src/components/block-editor/providers/default-block-editor-provider.js +44 -0
  685. package/src/components/block-editor/providers/navigation-block-editor-provider.js +114 -0
  686. package/src/components/block-editor/site-editor-canvas.js +155 -0
  687. package/src/components/block-editor/style.scss +6 -0
  688. package/src/components/block-editor/use-site-editor-settings.js +91 -0
  689. package/src/components/canvas-spinner/index.js +11 -1
  690. package/src/components/create-pattern-modal/index.js +134 -0
  691. package/src/components/create-pattern-modal/style.scss +3 -0
  692. package/src/components/create-template-part-modal/index.js +64 -4
  693. package/src/components/editor/index.js +25 -15
  694. package/src/components/editor/style.scss +4 -0
  695. package/src/components/editor-canvas-container/index.js +21 -4
  696. package/src/components/global-styles/color-palette-panel.js +1 -1
  697. package/src/components/global-styles/dimensions-panel.js +1 -1
  698. package/src/components/global-styles/global-styles-provider.js +10 -14
  699. package/src/components/global-styles/gradients-palette-panel.js +1 -1
  700. package/src/components/global-styles/hooks.js +1 -1
  701. package/src/components/global-styles/palette.js +2 -2
  702. package/src/components/global-styles/preview.js +1 -1
  703. package/src/components/global-styles/root-menu.js +1 -1
  704. package/src/components/global-styles/screen-block-list.js +1 -1
  705. package/src/components/global-styles/screen-block.js +1 -1
  706. package/src/components/global-styles/screen-colors.js +1 -1
  707. package/src/components/global-styles/screen-css.js +1 -1
  708. package/src/components/global-styles/screen-layout.js +1 -1
  709. package/src/components/global-styles/screen-revisions/index.js +1 -1
  710. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -1
  711. package/src/components/global-styles/screen-root.js +1 -1
  712. package/src/components/global-styles/screen-typography.js +1 -1
  713. package/src/components/global-styles/stories/index.js +1 -1
  714. package/src/components/global-styles/style-variations-container.js +13 -3
  715. package/src/components/global-styles/style.scss +11 -0
  716. package/src/components/global-styles/typography-panel.js +1 -1
  717. package/src/components/global-styles/typography-preview.js +1 -1
  718. package/src/components/global-styles/ui.js +115 -46
  719. package/src/components/global-styles-renderer/index.js +1 -1
  720. package/src/components/header-edit-mode/document-actions/index.js +51 -26
  721. package/src/components/header-edit-mode/document-actions/style.scss +9 -5
  722. package/src/components/header-edit-mode/index.js +100 -58
  723. package/src/components/header-edit-mode/more-menu/index.js +52 -7
  724. package/src/components/keyboard-shortcuts/edit-mode.js +40 -3
  725. package/src/components/keyboard-shortcuts/index.js +5 -1
  726. package/src/components/keyboard-shortcuts/register.js +11 -1
  727. package/src/components/layout/hooks.js +21 -0
  728. package/src/components/layout/index.js +207 -110
  729. package/src/components/layout/style.scss +65 -1
  730. package/src/components/list/index.js +1 -1
  731. package/src/components/page/header.js +38 -0
  732. package/src/components/page/index.js +38 -0
  733. package/src/components/page/style.scss +38 -0
  734. package/src/components/page-content-focus-manager/back-to-page-notification.js +70 -0
  735. package/src/components/{page-content-lock → page-content-focus-manager}/constants.js +1 -1
  736. package/src/components/{page-content-lock/use-disable-non-content-blocks.js → page-content-focus-manager/disable-non-page-content-blocks.js} +15 -7
  737. package/src/components/page-content-focus-manager/edit-template-notification.js +108 -0
  738. package/src/components/page-content-focus-manager/index.js +26 -0
  739. package/src/components/page-library/grid-item.js +179 -0
  740. package/src/components/page-library/grid.js +39 -0
  741. package/src/components/page-library/index.js +39 -0
  742. package/src/components/page-library/no-patterns.js +12 -0
  743. package/src/components/page-library/patterns-list.js +114 -0
  744. package/src/components/page-library/search-items.js +171 -0
  745. package/src/components/page-library/style.scss +105 -0
  746. package/src/components/page-library/use-library-settings.js +51 -0
  747. package/src/components/page-library/use-patterns.js +238 -0
  748. package/src/components/page-library/utils.js +21 -0
  749. package/src/components/page-main/index.js +27 -0
  750. package/src/components/page-templates/index.js +104 -0
  751. package/src/components/preferences-modal/enable-feature.js +5 -2
  752. package/src/components/preferences-modal/index.js +25 -0
  753. package/src/components/resizable-frame/index.js +3 -1
  754. package/src/components/revisions/index.js +1 -1
  755. package/src/components/routes/link.js +2 -2
  756. package/src/components/routes/use-title.js +1 -1
  757. package/src/components/save-button/index.js +14 -11
  758. package/src/components/save-hub/index.js +1 -1
  759. package/src/components/save-panel/index.js +1 -1
  760. package/src/components/secondary-sidebar/list-view-sidebar.js +53 -6
  761. package/src/components/sidebar/index.js +11 -7
  762. package/src/components/sidebar-button/style.scss +1 -1
  763. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +42 -29
  764. package/src/components/sidebar-edit-mode/index.js +8 -6
  765. package/src/components/sidebar-edit-mode/page-panels/edit-template.js +69 -0
  766. package/src/components/sidebar-edit-mode/page-panels/index.js +53 -53
  767. package/src/components/sidebar-edit-mode/page-panels/page-content.js +27 -0
  768. package/src/components/sidebar-edit-mode/page-panels/page-status.js +233 -0
  769. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +35 -0
  770. package/src/components/sidebar-edit-mode/page-panels/publish-date.js +94 -0
  771. package/src/components/sidebar-edit-mode/page-panels/style.scss +31 -0
  772. package/src/components/sidebar-edit-mode/settings-header/index.js +18 -9
  773. package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -1
  774. package/src/components/sidebar-edit-mode/template-panel/index.js +9 -6
  775. package/src/components/sidebar-navigation-item/index.js +6 -2
  776. package/src/components/sidebar-navigation-item/style.scss +8 -1
  777. package/src/components/sidebar-navigation-screen/index.js +22 -8
  778. package/src/components/sidebar-navigation-screen/style.scss +30 -9
  779. package/src/components/sidebar-navigation-screen-details-footer/index.js +45 -0
  780. package/src/components/sidebar-navigation-screen-details-footer/style.scss +5 -0
  781. package/src/components/sidebar-navigation-screen-details-panel/index.js +40 -0
  782. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +14 -0
  783. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +29 -0
  784. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +14 -0
  785. package/src/components/sidebar-navigation-screen-details-panel/style.scss +25 -0
  786. package/src/components/sidebar-navigation-screen-global-styles/index.js +24 -6
  787. package/src/components/sidebar-navigation-screen-global-styles/style.scss +0 -3
  788. package/src/components/sidebar-navigation-screen-library/category-item.js +43 -0
  789. package/src/components/sidebar-navigation-screen-library/index.js +136 -0
  790. package/src/components/sidebar-navigation-screen-library/style.scss +3 -0
  791. package/src/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +32 -0
  792. package/src/components/sidebar-navigation-screen-library/use-pattern-categories.js +64 -0
  793. package/src/components/sidebar-navigation-screen-library/use-template-part-areas.js +33 -0
  794. package/src/components/sidebar-navigation-screen-library/use-theme-patterns.js +44 -0
  795. package/src/components/sidebar-navigation-screen-main/index.js +11 -14
  796. package/src/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
  797. package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +45 -0
  798. package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +24 -0
  799. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +50 -96
  800. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +89 -0
  801. package/src/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +51 -0
  802. package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +62 -0
  803. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +39 -0
  804. package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +15 -0
  805. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +179 -0
  806. package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  807. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +73 -14
  808. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +61 -2
  809. package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +25 -47
  810. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +4 -0
  811. package/src/components/sidebar-navigation-screen-page/index.js +19 -58
  812. package/src/components/sidebar-navigation-screen-page/page-details.js +42 -39
  813. package/src/components/sidebar-navigation-screen-page/status-label.js +23 -19
  814. package/src/components/sidebar-navigation-screen-page/style.scss +1 -18
  815. package/src/components/sidebar-navigation-screen-pages/index.js +30 -29
  816. package/src/components/sidebar-navigation-screen-pattern/index.js +44 -0
  817. package/src/components/sidebar-navigation-screen-pattern/style.scss +25 -0
  818. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +28 -0
  819. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +21 -0
  820. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +30 -0
  821. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +33 -0
  822. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +71 -0
  823. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +86 -0
  824. package/src/components/sidebar-navigation-screen-template/home-template-details.js +230 -0
  825. package/src/components/sidebar-navigation-screen-template/index.js +19 -5
  826. package/src/components/sidebar-navigation-screen-template/style.scss +37 -14
  827. package/src/components/sidebar-navigation-screen-templates/index.js +18 -25
  828. package/src/components/site-hub/index.js +13 -9
  829. package/src/components/site-hub/style.scss +4 -3
  830. package/src/components/style-book/index.js +1 -1
  831. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +16 -3
  832. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
  833. package/src/components/sync-state-with-url/use-sync-path-with-url.js +11 -1
  834. package/src/components/table/index.js +33 -0
  835. package/src/components/table/style.scss +37 -0
  836. package/src/components/template-part-converter/convert-to-template-part.js +4 -27
  837. package/src/components/welcome-guide/editor.js +1 -1
  838. package/src/components/welcome-guide/styles.js +5 -3
  839. package/src/hooks/commands/use-common-commands.js +186 -0
  840. package/src/hooks/commands/use-edit-mode-commands.js +183 -28
  841. package/src/hooks/index.js +1 -0
  842. package/src/hooks/navigation-menu-edit.js +95 -0
  843. package/src/hooks/push-changes-to-global-styles/index.js +1 -1
  844. package/src/hooks/template-part-edit.js +1 -1
  845. package/src/index.js +1 -0
  846. package/src/store/actions.js +40 -8
  847. package/src/store/index.js +1 -1
  848. package/src/store/reducer.js +6 -5
  849. package/src/store/selectors.js +39 -9
  850. package/src/store/test/actions.js +8 -8
  851. package/src/store/test/reducer.js +11 -11
  852. package/src/store/test/selectors.js +10 -8
  853. package/src/style.scss +13 -2
  854. package/src/utils/get-is-list-page.js +16 -4
  855. package/src/utils/is-previewing-theme.js +4 -2
  856. package/src/utils/use-activate-theme.js +3 -2
  857. package/src/utils/use-debounced-input.js +17 -0
  858. package/build/components/add-new-template/new-template-part.js +0 -113
  859. package/build/components/add-new-template/new-template-part.js.map +0 -1
  860. package/build/components/page-content-lock/constants.js +0 -9
  861. package/build/components/page-content-lock/constants.js.map +0 -1
  862. package/build/components/page-content-lock/index.js +0 -29
  863. package/build/components/page-content-lock/index.js.map +0 -1
  864. package/build/components/page-content-lock/use-disable-non-content-blocks.js +0 -49
  865. package/build/components/page-content-lock/use-disable-non-content-blocks.js.map +0 -1
  866. package/build/components/page-content-lock/use-page-content-lock-notifications.js +0 -112
  867. package/build/components/page-content-lock/use-page-content-lock-notifications.js.map +0 -1
  868. package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js +0 -79
  869. package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +0 -1
  870. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -52
  871. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +0 -1
  872. package/build/components/sidebar-navigation-screen-template-part/index.js +0 -105
  873. package/build/components/sidebar-navigation-screen-template-part/index.js.map +0 -1
  874. package/build/components/sidebar-navigation-subtitle/index.js +0 -17
  875. package/build/components/sidebar-navigation-subtitle/index.js.map +0 -1
  876. package/build/private-apis.js.map +0 -1
  877. package/build-module/components/add-new-template/new-template-part.js +0 -93
  878. package/build-module/components/add-new-template/new-template-part.js.map +0 -1
  879. package/build-module/components/page-content-lock/constants.js +0 -2
  880. package/build-module/components/page-content-lock/constants.js.map +0 -1
  881. package/build-module/components/page-content-lock/index.js +0 -14
  882. package/build-module/components/page-content-lock/index.js.map +0 -1
  883. package/build-module/components/page-content-lock/use-disable-non-content-blocks.js.map +0 -1
  884. package/build-module/components/page-content-lock/use-page-content-lock-notifications.js +0 -98
  885. package/build-module/components/page-content-lock/use-page-content-lock-notifications.js.map +0 -1
  886. package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js +0 -67
  887. package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +0 -1
  888. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -39
  889. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +0 -1
  890. package/build-module/components/sidebar-navigation-screen-template-part/index.js +0 -86
  891. package/build-module/components/sidebar-navigation-screen-template-part/index.js.map +0 -1
  892. package/build-module/components/sidebar-navigation-subtitle/index.js +0 -9
  893. package/build-module/components/sidebar-navigation-subtitle/index.js.map +0 -1
  894. package/build-module/private-apis.js.map +0 -1
  895. package/src/components/add-new-template/new-template-part.js +0 -109
  896. package/src/components/page-content-lock/index.js +0 -14
  897. package/src/components/page-content-lock/use-page-content-lock-notifications.js +0 -128
  898. package/src/components/sidebar-edit-mode/page-panels/content-blocks-list.js +0 -77
  899. package/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -47
  900. package/src/components/sidebar-navigation-screen-template-part/index.js +0 -103
  901. package/src/components/sidebar-navigation-screen-templates/style.scss +0 -4
  902. package/src/components/sidebar-navigation-subtitle/index.js +0 -5
  903. package/src/components/sidebar-navigation-subtitle/style.scss +0 -7
  904. /package/src/{private-apis.js → lock-unlock.js} +0 -0
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.withEditBlockControls = void 0;
7
+
8
+ var _element = require("@wordpress/element");
9
+
10
+ var _i18n = require("@wordpress/i18n");
11
+
12
+ var _data = require("@wordpress/data");
13
+
14
+ var _blockEditor = require("@wordpress/block-editor");
15
+
16
+ var _coreData = require("@wordpress/core-data");
17
+
18
+ var _components = require("@wordpress/components");
19
+
20
+ var _hooks = require("@wordpress/hooks");
21
+
22
+ var _compose = require("@wordpress/compose");
23
+
24
+ var _router = require("@wordpress/router");
25
+
26
+ var _link = require("../components/routes/link");
27
+
28
+ var _lockUnlock = require("../lock-unlock");
29
+
30
+ /**
31
+ * WordPress dependencies
32
+ */
33
+
34
+ /**
35
+ * Internal dependencies
36
+ */
37
+ const {
38
+ useLocation
39
+ } = (0, _lockUnlock.unlock)(_router.privateApis);
40
+ const {
41
+ useBlockEditingMode
42
+ } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
43
+
44
+ function NavigationMenuEdit({
45
+ attributes
46
+ }) {
47
+ const {
48
+ ref
49
+ } = attributes;
50
+ const {
51
+ params
52
+ } = useLocation();
53
+ const blockEditingMode = useBlockEditingMode();
54
+ const navigationMenu = (0, _data.useSelect)(select => {
55
+ return select(_coreData.store).getEntityRecord('postType', 'wp_navigation', // Ideally this should be an official public API.
56
+ ref);
57
+ }, [ref]);
58
+ const linkProps = (0, _link.useLink)({
59
+ postId: navigationMenu?.id,
60
+ postType: navigationMenu?.type,
61
+ canvas: 'edit'
62
+ }, {
63
+ // this applies to Navigation Menus as well.
64
+ fromTemplateId: params.postId
65
+ }); // A non-default setting for block editing mode indicates that the
66
+ // editor should restrict "editing" actions. Therefore the `Edit` button
67
+ // should not be displayed.
68
+
69
+ if (!navigationMenu || blockEditingMode !== 'default') {
70
+ return null;
71
+ }
72
+
73
+ return (0, _element.createElement)(_blockEditor.BlockControls, {
74
+ group: "other"
75
+ }, (0, _element.createElement)(_components.ToolbarButton, { ...linkProps,
76
+ onClick: event => {
77
+ linkProps.onClick(event);
78
+ }
79
+ }, (0, _i18n.__)('Edit')));
80
+ }
81
+
82
+ const withEditBlockControls = (0, _compose.createHigherOrderComponent)(BlockEdit => props => {
83
+ const {
84
+ attributes,
85
+ name
86
+ } = props;
87
+ const isDisplayed = name === 'core/navigation' && attributes.ref;
88
+ return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(BlockEdit, { ...props
89
+ }), isDisplayed && (0, _element.createElement)(NavigationMenuEdit, {
90
+ attributes: attributes
91
+ }));
92
+ }, 'withEditBlockControls');
93
+ exports.withEditBlockControls = withEditBlockControls;
94
+ (0, _hooks.addFilter)('editor.BlockEdit', 'core/edit-site/navigation-edit-button', withEditBlockControls);
95
+ //# sourceMappingURL=navigation-menu-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/hooks/navigation-menu-edit.js"],"names":["useLocation","routerPrivateApis","useBlockEditingMode","blockEditorPrivateApis","NavigationMenuEdit","attributes","ref","params","blockEditingMode","navigationMenu","select","coreStore","getEntityRecord","linkProps","postId","id","postType","type","canvas","fromTemplateId","event","onClick","withEditBlockControls","BlockEdit","props","name","isDisplayed"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAnBA;AACA;AACA;;AAaA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAkB,wBAAQC,mBAAR,CAAxB;AACA,MAAM;AAAEC,EAAAA;AAAF,IAA0B,wBAAQC,wBAAR,CAAhC;;AAEA,SAASC,kBAAT,CAA6B;AAAEC,EAAAA;AAAF,CAA7B,EAA8C;AAC7C,QAAM;AAAEC,IAAAA;AAAF,MAAUD,UAAhB;AACA,QAAM;AAAEE,IAAAA;AAAF,MAAaP,WAAW,EAA9B;AACA,QAAMQ,gBAAgB,GAAGN,mBAAmB,EAA5C;AACA,QAAMO,cAAc,GAAG,qBACpBC,MAAF,IAAc;AACb,WAAOA,MAAM,CAAEC,eAAF,CAAN,CAAoBC,eAApB,CACN,UADM,EAEN,eAFM,EAGN;AACAN,IAAAA,GAJM,CAAP;AAMA,GARqB,EAStB,CAAEA,GAAF,CATsB,CAAvB;AAYA,QAAMO,SAAS,GAAG,mBACjB;AACCC,IAAAA,MAAM,EAAEL,cAAc,EAAEM,EADzB;AAECC,IAAAA,QAAQ,EAAEP,cAAc,EAAEQ,IAF3B;AAGCC,IAAAA,MAAM,EAAE;AAHT,GADiB,EAMjB;AACC;AACAC,IAAAA,cAAc,EAAEZ,MAAM,CAACO;AAFxB,GANiB,CAAlB,CAhB6C,CA4B7C;AACA;AACA;;AACA,MAAK,CAAEL,cAAF,IAAoBD,gBAAgB,KAAK,SAA9C,EAA0D;AACzD,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,0BAAD;AAAe,IAAA,KAAK,EAAC;AAArB,KACC,4BAAC,yBAAD,OACMK,SADN;AAEC,IAAA,OAAO,EAAKO,KAAF,IAAa;AACtBP,MAAAA,SAAS,CAACQ,OAAV,CAAmBD,KAAnB;AACA;AAJF,KAMG,cAAI,MAAJ,CANH,CADD,CADD;AAYA;;AAEM,MAAME,qBAAqB,GAAG,yCAClCC,SAAF,IAAmBC,KAAF,IAAa;AAC7B,QAAM;AAAEnB,IAAAA,UAAF;AAAcoB,IAAAA;AAAd,MAAuBD,KAA7B;AACA,QAAME,WAAW,GAAGD,IAAI,KAAK,iBAAT,IAA8BpB,UAAU,CAACC,GAA7D;AAEA,SACC,qDACC,4BAAC,SAAD,OAAgBkB;AAAhB,IADD,EAEGE,WAAW,IACZ,4BAAC,kBAAD;AAAoB,IAAA,UAAU,EAAGrB;AAAjC,IAHF,CADD;AAQA,CAbmC,EAcpC,uBAdoC,CAA9B;;AAiBP,sBACC,kBADD,EAEC,uCAFD,EAGCiB,qBAHD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tBlockControls,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { ToolbarButton } from '@wordpress/components';\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { useLink } from '../components/routes/link';\nimport { unlock } from '../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\nconst { useBlockEditingMode } = unlock( blockEditorPrivateApis );\n\nfunction NavigationMenuEdit( { attributes } ) {\n\tconst { ref } = attributes;\n\tconst { params } = useLocation();\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst navigationMenu = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_navigation',\n\t\t\t\t// Ideally this should be an official public API.\n\t\t\t\tref\n\t\t\t);\n\t\t},\n\t\t[ ref ]\n\t);\n\n\tconst linkProps = useLink(\n\t\t{\n\t\t\tpostId: navigationMenu?.id,\n\t\t\tpostType: navigationMenu?.type,\n\t\t\tcanvas: 'edit',\n\t\t},\n\t\t{\n\t\t\t// this applies to Navigation Menus as well.\n\t\t\tfromTemplateId: params.postId,\n\t\t}\n\t);\n\n\t// A non-default setting for block editing mode indicates that the\n\t// editor should restrict \"editing\" actions. Therefore the `Edit` button\n\t// should not be displayed.\n\tif ( ! navigationMenu || blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockControls group=\"other\">\n\t\t\t<ToolbarButton\n\t\t\t\t{ ...linkProps }\n\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\tlinkProps.onClick( event );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ __( 'Edit' ) }\n\t\t\t</ToolbarButton>\n\t\t</BlockControls>\n\t);\n}\n\nexport const withEditBlockControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { attributes, name } = props;\n\t\tconst isDisplayed = name === 'core/navigation' && attributes.ref;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ isDisplayed && (\n\t\t\t\t\t<NavigationMenuEdit attributes={ attributes } />\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\t'withEditBlockControls'\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-site/navigation-edit-button',\n\twithEditBlockControls\n);\n"]}
@@ -22,7 +22,7 @@ var _notices = require("@wordpress/notices");
22
22
 
23
23
  var _hooks2 = require("../../components/global-styles/hooks");
24
24
 
25
- var _privateApis = require("../../private-apis");
25
+ var _lockUnlock = require("../../lock-unlock");
26
26
 
27
27
  /**
28
28
  * External dependencies
@@ -38,7 +38,7 @@ var _privateApis = require("../../private-apis");
38
38
  const {
39
39
  GlobalStylesContext,
40
40
  useBlockEditingMode
41
- } = (0, _privateApis.unlock)(_blockEditor.privateApis); // TODO: Temporary duplication of constant in @wordpress/block-editor. Can be
41
+ } = (0, _lockUnlock.unlock)(_blockEditor.privateApis); // TODO: Temporary duplication of constant in @wordpress/block-editor. Can be
42
42
  // removed by moving PushChangesToGlobalStylesControl to
43
43
  // @wordpress/block-editor.
44
44
 
@@ -202,7 +202,9 @@ function PushChangesToGlobalStylesControl({
202
202
 
203
203
  const withPushChangesToGlobalStyles = (0, _compose.createHigherOrderComponent)(BlockEdit => props => {
204
204
  const blockEditingMode = useBlockEditingMode();
205
- return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(BlockEdit, props), blockEditingMode === 'default' && (0, _element.createElement)(_blockEditor.InspectorAdvancedControls, null, (0, _element.createElement)(PushChangesToGlobalStylesControl, props)));
205
+ return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(BlockEdit, { ...props
206
+ }), blockEditingMode === 'default' && (0, _element.createElement)(_blockEditor.InspectorAdvancedControls, null, (0, _element.createElement)(PushChangesToGlobalStylesControl, { ...props
207
+ })));
206
208
  });
207
209
  (0, _hooks.addFilter)('editor.BlockEdit', 'core/edit-site/push-changes-to-global-styles', withPushChangesToGlobalStyles);
208
210
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/hooks/push-changes-to-global-styles/index.js"],"names":["GlobalStylesContext","useBlockEditingMode","blockEditorPrivateApis","STYLE_PATH_TO_CSS_VAR_INFIX","STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE","useChangesToPush","name","attributes","supports","flatMap","key","STYLE_PROPERTY","value","path","presetAttributeKey","join","presetAttributeValue","style","cloneDeep","object","JSON","parse","stringify","PushChangesToGlobalStylesControl","setAttributes","changes","user","userConfig","setUserConfig","__unstableMarkNextChangeAsNotPersistent","blockEditorStore","createSuccessNotice","noticesStore","pushChanges","length","blockStyles","newBlockStyles","newUserConfig","undefined","undoIgnore","title","type","actions","label","onClick","withPushChangesToGlobalStyles","BlockEdit","props","blockEditingMode"],"mappings":";;AAqBA;;AAlBA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AAKA;;AACA;;AA7BA;AACA;AACA;;AAGA;AACA;AACA;;AAkBA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA,mBAAF;AAAuBC,EAAAA;AAAvB,IAA+C,yBACpDC,wBADoD,CAArD,C,CAIA;AACA;AACA;;AACA,MAAMC,2BAA2B,GAAG;AACnC,sBAAoB,OADe;AAEnC,gBAAc,OAFqB;AAGnC,8BAA4B,OAHO;AAInC,qCAAmC,OAJA;AAKnC,yCAAuC,aALJ;AAMnC,uCAAqC,WANF;AAOnC,gCAA8B,OAPK;AAQnC,sCAAoC,OARD;AASnC,2CAAyC,aATN;AAUnC,yCAAuC,WAVJ;AAWnC,iCAA+B,OAXI;AAYnC,4BAA0B,OAZS;AAanC,uCAAqC,OAbF;AAcnC,4CAA0C,aAdP;AAenC,+BAA6B,UAfM;AAgBnC,qCAAmC,UAhBA;AAiBnC,uBAAqB,OAjBc;AAkBnC,kCAAgC,OAlBG;AAmBnC,uCAAqC,aAnBF;AAoBnC,gCAA8B,UApBK;AAqBnC,uBAAqB,OArBc;AAsBnC,kCAAgC,OAtBG;AAuBnC,uCAAqC,aAvBF;AAwBnC,gCAA8B,UAxBK;AAyBnC,uBAAqB,OAzBc;AA0BnC,kCAAgC,OA1BG;AA2BnC,uCAAqC,aA3BF;AA4BnC,gCAA8B,UA5BK;AA6BnC,uBAAqB,OA7Bc;AA8BnC,kCAAgC,OA9BG;AA+BnC,uCAAqC,aA/BF;AAgCnC,gCAA8B,UAhCK;AAiCnC,uBAAqB,OAjCc;AAkCnC,kCAAgC,OAlCG;AAmCnC,uCAAqC,aAnCF;AAoCnC,gCAA8B,UApCK;AAqCnC,uBAAqB,OArCc;AAsCnC,kCAAgC,OAt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CF,6BAHD","sourcesContent":["/**\n * External dependencies\n */\nimport { get, set } from 'lodash';\n\n/**\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} from '@wordpress/block-editor';\nimport { BaseControl, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__EXPERIMENTAL_STYLE_PROPERTY as STYLE_PROPERTY,\n\tgetBlockType,\n} from '@wordpress/blocks';\nimport { useContext, useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { useSupportedStyles } from '../../components/global-styles/hooks';\nimport { unlock } from '../../private-apis';\n\nconst { GlobalStylesContext, useBlockEditingMode } = unlock(\n\tblockEditorPrivateApis\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'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\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'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\nfunction useChangesToPush( name, attributes ) {\n\tconst supports = useSupportedStyles( name );\n\n\treturn useMemo(\n\t\t() =>\n\t\t\tsupports.flatMap( ( key ) => {\n\t\t\t\tif ( ! STYLE_PROPERTY[ key ] ) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tconst { value: path } = STYLE_PROPERTY[ key ];\n\t\t\t\tconst presetAttributeKey = path.join( '.' );\n\t\t\t\tconst presetAttributeValue =\n\t\t\t\t\tattributes[\n\t\t\t\t\t\tSTYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE[\n\t\t\t\t\t\t\tpresetAttributeKey\n\t\t\t\t\t\t]\n\t\t\t\t\t];\n\t\t\t\tconst value = presetAttributeValue\n\t\t\t\t\t? `var:preset|${ STYLE_PATH_TO_CSS_VAR_INFIX[ presetAttributeKey ] }|${ presetAttributeValue }`\n\t\t\t\t\t: get( attributes.style, path );\n\t\t\t\treturn value ? [ { path, value } ] : [];\n\t\t\t} ),\n\t\t[ supports, name, attributes ]\n\t);\n}\n\nfunction cloneDeep( object ) {\n\treturn ! object ? {} : JSON.parse( JSON.stringify( object ) );\n}\n\nfunction PushChangesToGlobalStylesControl( {\n\tname,\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst changes = useChangesToPush( name, attributes );\n\n\tconst { user: userConfig, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\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\tconst { style: blockStyles } = attributes;\n\n\t\tconst newBlockStyles = cloneDeep( blockStyles );\n\t\tconst newUserConfig = cloneDeep( userConfig );\n\n\t\tfor ( const { path, value } of changes ) {\n\t\t\tset( newBlockStyles, path, undefined );\n\t\t\tset( newUserConfig, [ 'styles', 'blocks', name, ...path ], value );\n\t\t}\n\n\t\t// @wordpress/core-data doesn't support editing multiple entity types in\n\t\t// a single undo level. So for now, we disable @wordpress/core-data undo\n\t\t// tracking and implement our own Undo button in the snackbar\n\t\t// notification.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\tsetAttributes( { style: newBlockStyles } );\n\t\tsetUserConfig( () => newUserConfig, { undoIgnore: true } );\n\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t__( '%s styles applied.' ),\n\t\t\t\tgetBlockType( name ).title\n\t\t\t),\n\t\t\t{\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tactions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\tonClick() {\n\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\tsetAttributes( { style: blockStyles } );\n\t\t\t\t\t\t\tsetUserConfig( () => userConfig, {\n\t\t\t\t\t\t\t\tundoIgnore: true,\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}, [ changes, attributes, userConfig, name ] );\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\nconst withPushChangesToGlobalStyles = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst blockEditingMode = useBlockEditingMode();\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t\t<InspectorAdvancedControls>\n\t\t\t\t\t\t<PushChangesToGlobalStylesControl { ...props } />\n\t\t\t\t\t</InspectorAdvancedControls>\n\t\t\t\t) }\n\t\t\t</>\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"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/hooks/push-changes-to-global-styles/index.js"],"names":["GlobalStylesContext","useBlockEditingMode","blockEditorPrivateApis","STYLE_PATH_TO_CSS_VAR_INFIX","STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE","useChangesToPush","name","attributes","supports","flatMap","key","STYLE_PROPERTY","value","path","presetAttributeKey","join","presetAttributeValue","style","cloneDeep","object","JSON","parse","stringify","PushChangesToGlobalStylesControl","setAttributes","changes","user","userConfig","setUserConfig","__unstableMarkNextChangeAsNotPersistent","blockEditorStore","createSuccessNotice","noticesStore","pushChanges","length","blockStyles","newBlockStyles","newUserConfig","undefined","undoIgnore","title","type","actions","label","onClick","withPushChangesToGlobalStyles","BlockEdit","props","blockEditingMode"],"mappings":";;AAqBA;;AAlBA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AAKA;;AACA;;AA7BA;AACA;AACA;;AAGA;AACA;AACA;;AAkBA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA,mBAAF;AAAuBC,EAAAA;AAAvB,IAA+C,wBACpDC,wBADoD,CAArD,C,CAIA;AACA;AACA;;AACA,MAAMC,2BAA2B,GAAG;AACnC,sBAAoB,OADe;AAEnC,gBAAc,OAFqB;AAGnC,8BAA4B,OAHO;AAInC,qCAAmC,OAJA;AAKnC,yCAAuC,aALJ;AAMnC,uCAAqC,WANF;AAOnC,gCAA8B,OAPK;AAQnC,sCAAoC,OARD;AASnC,2CAAyC,aATN;AAUnC,yCAAuC,WAVJ;AAWnC,iCAA+B,OAXI;AAYnC,4BAA0B,OAZS;AAanC,uCAAqC,OAbF;AAcnC,4CAA0C,aAdP;AAenC,+BAA6B,UAfM;AAgBnC,qCAAmC,UAhBA;AAiBnC,uBAAqB,OAjBc;AAkBnC,kCAAgC,OAlBG;AAmBnC,uCAAqC,aAnBF;AAoBnC,gCAA8B,UApBK;AAqBnC,uBAAqB,OAr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MAAR,KAAmB,CAF/B;AAGC,IAAA,OAAO,EAAGD;AAHX,KAKG,cAAI,gBAAJ,CALH,CAbD,CADD;AAuBA;;AAED,MAAMY,6BAA6B,GAAG,yCACnCC,SAAF,IAAmBC,KAAF,IAAa;AAC7B,QAAMC,gBAAgB,GAAG/C,mBAAmB,EAA5C;AACA,SACC,qDACC,4BAAC,SAAD,OAAgB8C;AAAhB,IADD,EAEGC,gBAAgB,KAAK,SAArB,IACD,4BAAC,sCAAD,QACC,4BAAC,gCAAD,OAAuCD;AAAvC,IADD,CAHF,CADD;AAUA,CAboC,CAAtC;AAgBA,sBACC,kBADD,EAEC,8CAFD,EAGCF,6BAHD","sourcesContent":["/**\n * External dependencies\n */\nimport { get, set } from 'lodash';\n\n/**\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} from '@wordpress/block-editor';\nimport { BaseControl, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__EXPERIMENTAL_STYLE_PROPERTY as STYLE_PROPERTY,\n\tgetBlockType,\n} from '@wordpress/blocks';\nimport { useContext, useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { useSupportedStyles } from '../../components/global-styles/hooks';\nimport { unlock } from '../../lock-unlock';\n\nconst { GlobalStylesContext, useBlockEditingMode } = unlock(\n\tblockEditorPrivateApis\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'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\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'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\nfunction useChangesToPush( name, attributes ) {\n\tconst supports = useSupportedStyles( name );\n\n\treturn useMemo(\n\t\t() =>\n\t\t\tsupports.flatMap( ( key ) => {\n\t\t\t\tif ( ! STYLE_PROPERTY[ key ] ) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tconst { value: path } = STYLE_PROPERTY[ key ];\n\t\t\t\tconst presetAttributeKey = path.join( '.' );\n\t\t\t\tconst presetAttributeValue =\n\t\t\t\t\tattributes[\n\t\t\t\t\t\tSTYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE[\n\t\t\t\t\t\t\tpresetAttributeKey\n\t\t\t\t\t\t]\n\t\t\t\t\t];\n\t\t\t\tconst value = presetAttributeValue\n\t\t\t\t\t? `var:preset|${ STYLE_PATH_TO_CSS_VAR_INFIX[ presetAttributeKey ] }|${ presetAttributeValue }`\n\t\t\t\t\t: get( attributes.style, path );\n\t\t\t\treturn value ? [ { path, value } ] : [];\n\t\t\t} ),\n\t\t[ supports, name, attributes ]\n\t);\n}\n\nfunction cloneDeep( object ) {\n\treturn ! object ? {} : JSON.parse( JSON.stringify( object ) );\n}\n\nfunction PushChangesToGlobalStylesControl( {\n\tname,\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst changes = useChangesToPush( name, attributes );\n\n\tconst { user: userConfig, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\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\tconst { style: blockStyles } = attributes;\n\n\t\tconst newBlockStyles = cloneDeep( blockStyles );\n\t\tconst newUserConfig = cloneDeep( userConfig );\n\n\t\tfor ( const { path, value } of changes ) {\n\t\t\tset( newBlockStyles, path, undefined );\n\t\t\tset( newUserConfig, [ 'styles', 'blocks', name, ...path ], value );\n\t\t}\n\n\t\t// @wordpress/core-data doesn't support editing multiple entity types in\n\t\t// a single undo level. So for now, we disable @wordpress/core-data undo\n\t\t// tracking and implement our own Undo button in the snackbar\n\t\t// notification.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\tsetAttributes( { style: newBlockStyles } );\n\t\tsetUserConfig( () => newUserConfig, { undoIgnore: true } );\n\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t__( '%s styles applied.' ),\n\t\t\t\tgetBlockType( name ).title\n\t\t\t),\n\t\t\t{\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tactions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\tonClick() {\n\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\tsetAttributes( { style: blockStyles } );\n\t\t\t\t\t\t\tsetUserConfig( () => userConfig, {\n\t\t\t\t\t\t\t\tundoIgnore: true,\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}, [ changes, attributes, userConfig, name ] );\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\nconst withPushChangesToGlobalStyles = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst blockEditingMode = useBlockEditingMode();\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t\t<InspectorAdvancedControls>\n\t\t\t\t\t\t<PushChangesToGlobalStylesControl { ...props } />\n\t\t\t\t\t</InspectorAdvancedControls>\n\t\t\t\t) }\n\t\t\t</>\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"]}
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -9,8 +7,6 @@ exports.withEditBlockControls = void 0;
9
7
 
10
8
  var _element = require("@wordpress/element");
11
9
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
10
  var _i18n = require("@wordpress/i18n");
15
11
 
16
12
  var _data = require("@wordpress/data");
@@ -29,7 +25,7 @@ var _router = require("@wordpress/router");
29
25
 
30
26
  var _link = require("../components/routes/link");
31
27
 
32
- var _privateApis = require("../private-apis");
28
+ var _lockUnlock = require("../lock-unlock");
33
29
 
34
30
  /**
35
31
  * WordPress dependencies
@@ -40,7 +36,7 @@ var _privateApis = require("../private-apis");
40
36
  */
41
37
  const {
42
38
  useLocation
43
- } = (0, _privateApis.unlock)(_router.privateApis);
39
+ } = (0, _lockUnlock.unlock)(_router.privateApis);
44
40
 
45
41
  function EditTemplatePartMenuItem({
46
42
  attributes
@@ -70,11 +66,11 @@ function EditTemplatePartMenuItem({
70
66
 
71
67
  return (0, _element.createElement)(_blockEditor.BlockControls, {
72
68
  group: "other"
73
- }, (0, _element.createElement)(_components.ToolbarButton, (0, _extends2.default)({}, linkProps, {
69
+ }, (0, _element.createElement)(_components.ToolbarButton, { ...linkProps,
74
70
  onClick: event => {
75
71
  linkProps.onClick(event);
76
72
  }
77
- }), (0, _i18n.__)('Edit')));
73
+ }, (0, _i18n.__)('Edit')));
78
74
  }
79
75
 
80
76
  const withEditBlockControls = (0, _compose.createHigherOrderComponent)(BlockEdit => props => {
@@ -83,7 +79,8 @@ const withEditBlockControls = (0, _compose.createHigherOrderComponent)(BlockEdit
83
79
  name
84
80
  } = props;
85
81
  const isDisplayed = name === 'core/template-part' && attributes.slug;
86
- return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(BlockEdit, props), isDisplayed && (0, _element.createElement)(EditTemplatePartMenuItem, {
82
+ return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(BlockEdit, { ...props
83
+ }), isDisplayed && (0, _element.createElement)(EditTemplatePartMenuItem, {
87
84
  attributes: attributes
88
85
  }));
89
86
  }, 'withEditBlockControls');
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/hooks/template-part-edit.js"],"names":["useLocation","routerPrivateApis","EditTemplatePartMenuItem","attributes","theme","slug","params","templatePart","select","coreStore","getEntityRecord","linkProps","postId","id","postType","type","canvas","fromTemplateId","event","onClick","withEditBlockControls","BlockEdit","props","name","isDisplayed"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAkB,yBAAQC,mBAAR,CAAxB;;AAEA,SAASC,wBAAT,CAAmC;AAAEC,EAAAA;AAAF,CAAnC,EAAoD;AACnD,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAkBF,UAAxB;AACA,QAAM;AAAEG,IAAAA;AAAF,MAAaN,WAAW,EAA9B;AACA,QAAMO,YAAY,GAAG,qBAClBC,MAAF,IAAc;AACb,WAAOA,MAAM,CAAEC,eAAF,CAAN,CAAoBC,eAApB,CACN,UADM,EAEN,kBAFM,EAGN;AACC,OAAGN,KAAO,KAAKC,IAAM,EAJhB,CAAP;AAMA,GARmB,EASpB,CAAED,KAAF,EAASC,IAAT,CAToB,CAArB;AAYA,QAAMM,SAAS,GAAG,mBACjB;AACCC,IAAAA,MAAM,EAAEL,YAAY,EAAEM,EADvB;AAECC,IAAAA,QAAQ,EAAEP,YAAY,EAAEQ,IAFzB;AAGCC,IAAAA,MAAM,EAAE;AAHT,GADiB,EAMjB;AACCC,IAAAA,cAAc,EAAEX,MAAM,CAACM;AADxB,GANiB,CAAlB;;AAWA,MAAK,CAAEL,YAAP,EAAsB;AACrB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,0BAAD;AAAe,IAAA,KAAK,EAAC;AAArB,KACC,4BAAC,yBAAD,6BACMI,SADN;AAEC,IAAA,OAAO,EAAKO,KAAF,IAAa;AACtBP,MAAAA,SAAS,CAACQ,OAAV,CAAmBD,KAAnB;AACA;AAJF,MAMG,cAAI,MAAJ,CANH,CADD,CADD;AAYA;;AAEM,MAAME,qBAAqB,GAAG,yCAClCC,SAAF,IAAmBC,KAAF,IAAa;AAC7B,QAAM;AAAEnB,IAAAA,UAAF;AAAcoB,IAAAA;AAAd,MAAuBD,KAA7B;AACA,QAAME,WAAW,GAAGD,IAAI,KAAK,oBAAT,IAAiCpB,UAAU,CAACE,IAAhE;AAEA,SACC,qDACC,4BAAC,SAAD,EAAgBiB,KAAhB,CADD,EAEGE,WAAW,IACZ,4BAAC,wBAAD;AAA0B,IAAA,UAAU,EAAGrB;AAAvC,IAHF,CADD;AAQA,CAbmC,EAcpC,uBAdoC,CAA9B;;AAiBP,sBACC,kBADD,EAEC,0CAFD,EAGCiB,qBAHD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { BlockControls } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { ToolbarButton } from '@wordpress/components';\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { useLink } from '../components/routes/link';\nimport { unlock } from '../private-apis';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction EditTemplatePartMenuItem( { attributes } ) {\n\tconst { theme, slug } = attributes;\n\tconst { params } = useLocation();\n\tconst templatePart = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\t// Ideally this should be an official public API.\n\t\t\t\t`${ theme }//${ slug }`\n\t\t\t);\n\t\t},\n\t\t[ theme, slug ]\n\t);\n\n\tconst linkProps = useLink(\n\t\t{\n\t\t\tpostId: templatePart?.id,\n\t\t\tpostType: templatePart?.type,\n\t\t\tcanvas: 'edit',\n\t\t},\n\t\t{\n\t\t\tfromTemplateId: params.postId,\n\t\t}\n\t);\n\n\tif ( ! templatePart ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockControls group=\"other\">\n\t\t\t<ToolbarButton\n\t\t\t\t{ ...linkProps }\n\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\tlinkProps.onClick( event );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ __( 'Edit' ) }\n\t\t\t</ToolbarButton>\n\t\t</BlockControls>\n\t);\n}\n\nexport const withEditBlockControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { attributes, name } = props;\n\t\tconst isDisplayed = name === 'core/template-part' && attributes.slug;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ isDisplayed && (\n\t\t\t\t\t<EditTemplatePartMenuItem attributes={ attributes } />\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\t'withEditBlockControls'\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-site/template-part-edit-button',\n\twithEditBlockControls\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/hooks/template-part-edit.js"],"names":["useLocation","routerPrivateApis","EditTemplatePartMenuItem","attributes","theme","slug","params","templatePart","select","coreStore","getEntityRecord","linkProps","postId","id","postType","type","canvas","fromTemplateId","event","onClick","withEditBlockControls","BlockEdit","props","name","isDisplayed"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAkB,wBAAQC,mBAAR,CAAxB;;AAEA,SAASC,wBAAT,CAAmC;AAAEC,EAAAA;AAAF,CAAnC,EAAoD;AACnD,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAkBF,UAAxB;AACA,QAAM;AAAEG,IAAAA;AAAF,MAAaN,WAAW,EAA9B;AACA,QAAMO,YAAY,GAAG,qBAClBC,MAAF,IAAc;AACb,WAAOA,MAAM,CAAEC,eAAF,CAAN,CAAoBC,eAApB,CACN,UADM,EAEN,kBAFM,EAGN;AACC,OAAGN,KAAO,KAAKC,IAAM,EAJhB,CAAP;AAMA,GARmB,EASpB,CAAED,KAAF,EAASC,IAAT,CAToB,CAArB;AAYA,QAAMM,SAAS,GAAG,mBACjB;AACCC,IAAAA,MAAM,EAAEL,YAAY,EAAEM,EADvB;AAECC,IAAAA,QAAQ,EAAEP,YAAY,EAAEQ,IAFzB;AAGCC,IAAAA,MAAM,EAAE;AAHT,GADiB,EAMjB;AACCC,IAAAA,cAAc,EAAEX,MAAM,CAACM;AADxB,GANiB,CAAlB;;AAWA,MAAK,CAAEL,YAAP,EAAsB;AACrB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,0BAAD;AAAe,IAAA,KAAK,EAAC;AAArB,KACC,4BAAC,yBAAD,OACMI,SADN;AAEC,IAAA,OAAO,EAAKO,KAAF,IAAa;AACtBP,MAAAA,SAAS,CAACQ,OAAV,CAAmBD,KAAnB;AACA;AAJF,KAMG,cAAI,MAAJ,CANH,CADD,CADD;AAYA;;AAEM,MAAME,qBAAqB,GAAG,yCAClCC,SAAF,IAAmBC,KAAF,IAAa;AAC7B,QAAM;AAAEnB,IAAAA,UAAF;AAAcoB,IAAAA;AAAd,MAAuBD,KAA7B;AACA,QAAME,WAAW,GAAGD,IAAI,KAAK,oBAAT,IAAiCpB,UAAU,CAACE,IAAhE;AAEA,SACC,qDACC,4BAAC,SAAD,OAAgBiB;AAAhB,IADD,EAEGE,WAAW,IACZ,4BAAC,wBAAD;AAA0B,IAAA,UAAU,EAAGrB;AAAvC,IAHF,CADD;AAQA,CAbmC,EAcpC,uBAdoC,CAA9B;;AAiBP,sBACC,kBADD,EAEC,0CAFD,EAGCiB,qBAHD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { BlockControls } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { ToolbarButton } from '@wordpress/components';\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { useLink } from '../components/routes/link';\nimport { unlock } from '../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction EditTemplatePartMenuItem( { attributes } ) {\n\tconst { theme, slug } = attributes;\n\tconst { params } = useLocation();\n\tconst templatePart = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\t// Ideally this should be an official public API.\n\t\t\t\t`${ theme }//${ slug }`\n\t\t\t);\n\t\t},\n\t\t[ theme, slug ]\n\t);\n\n\tconst linkProps = useLink(\n\t\t{\n\t\t\tpostId: templatePart?.id,\n\t\t\tpostType: templatePart?.type,\n\t\t\tcanvas: 'edit',\n\t\t},\n\t\t{\n\t\t\tfromTemplateId: params.postId,\n\t\t}\n\t);\n\n\tif ( ! templatePart ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockControls group=\"other\">\n\t\t\t<ToolbarButton\n\t\t\t\t{ ...linkProps }\n\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\tlinkProps.onClick( event );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ __( 'Edit' ) }\n\t\t\t</ToolbarButton>\n\t\t</BlockControls>\n\t);\n}\n\nexport const withEditBlockControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { attributes, name } = props;\n\t\tconst isDisplayed = name === 'core/template-part' && attributes.slug;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ isDisplayed && (\n\t\t\t\t\t<EditTemplatePartMenuItem attributes={ attributes } />\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\t'withEditBlockControls'\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-site/template-part-edit-button',\n\twithEditBlockControls\n);\n"]}
package/build/index.js CHANGED
@@ -114,6 +114,7 @@ function initializeEditor(id, settings) {
114
114
  editorMode: 'visual',
115
115
  fixedToolbar: false,
116
116
  focusMode: false,
117
+ distractionFree: false,
117
118
  keepCaretInsideBlock: false,
118
119
  welcomeGuide: true,
119
120
  welcomeGuideStyles: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/index.js"],"names":["initializeEditor","id","settings","target","document","getElementById","root","__experimentalFetchLinkSuggestions","search","searchOptions","__experimentalFetchRichUrlData","fetchUrlData","blocksStore","__experimentalReapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","preferencesStore","setDefaults","editorMode","fixedToolbar","focusMode","keepCaretInsideBlock","welcomeGuide","welcomeGuideStyles","showListViewByDefault","showBlockBreadcrumbs","interfaceStore","setDefaultComplementaryArea","editSiteStore","updateSettings","editorStore","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","render","reinitializeEditor","since","version"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA;;AARA;;AACA;;AAKA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AA2EA;;AACA;;AACA;;AACA;;AA3GA;AACA;AACA;;AAsBA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gBAAT,CAA2BC,EAA3B,EAA+BC,QAA/B,EAA0C;AAChD,QAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAT,CAAyBJ,EAAzB,CAAf;AACA,QAAMK,IAAI,GAAG,yBAAYH,MAAZ,CAAb;;AAEAD,EAAAA,QAAQ,CAACK,kCAAT,GAA8C,CAAEC,MAAF,EAAUC,aAAV,KAC7C,kDAAsBD,MAAtB,EAA8BC,aAA9B,EAA6CP,QAA7C,CADD;;AAEAA,EAAAA,QAAQ,CAACQ,8BAAT,GAA0CC,oCAA1C;;AAEA,sBAAUC,aAAV,EAAwBC,qCAAxB;;AACA,QAAMC,UAAU,GAAG,iDAA8BC,MAA9B,CAClB,CAAE;AAAEC,IAAAA;AAAF,GAAF,KAAgBA,IAAI,KAAK,eADP,CAAnB;AAGA,wCAAoBF,UAApB;AACA,sBAAUF,aAAV,EAAwBK,4BAAxB,CAAsD,WAAtD;AACA,0CAA2B;AAAEC,IAAAA,QAAQ,EAAE;AAAZ,GAA3B;AACA,yCAA0B;AAAEA,IAAAA,QAAQ,EAAE;AAAZ,GAA1B;;AACA,MAAKC,OAAO,CAACC,GAAR,CAAYC,mBAAjB,EAAuC;AACtC,oEAA8C;AAC7CC,MAAAA,eAAe,EAAE;AAD4B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ocks,\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 {\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\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\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\n\tsettings.__experimentalFetchRichUrlData = fetchUrlData;\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\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\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tkeepCaretInsideBlock: false,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\tshowListViewByDefault: false,\n\t\tshowBlockBreadcrumbs: true,\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';\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/index.js"],"names":["initializeEditor","id","settings","target","document","getElementById","root","__experimentalFetchLinkSuggestions","search","searchOptions","__experimentalFetchRichUrlData","fetchUrlData","blocksStore","__experimentalReapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","preferencesStore","setDefaults","editorMode","fixedToolbar","focusMode","distractionFree","keepCaretInsideBlock","welcomeGuide","welcomeGuideStyles","showListViewByDefault","showBlockBreadcrumbs","interfaceStore","setDefaultComplementaryArea","editSiteStore","updateSettings","editorStore","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","render","reinitializeEditor","since","version"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA;;AARA;;AACA;;AAKA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AA4EA;;AACA;;AACA;;AACA;;AA5GA;AACA;AACA;;AAsBA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gBAAT,CAA2BC,EAA3B,EAA+BC,QAA/B,EAA0C;AAChD,QAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAT,CAAyBJ,EAAzB,CAAf;AACA,QAAMK,IAAI,GAAG,yBAAYH,MAAZ,CAAb;;AAEAD,EAAAA,QAAQ,CAACK,kCAAT,GAA8C,CAAEC,MAAF,EAAUC,aAAV,KAC7C,kDAAsBD,MAAtB,EAA8BC,aAA9B,EAA6CP,QAA7C,CADD;;AAEAA,EAAAA,QAAQ,CAACQ,8BAAT,GAA0CC,oCAA1C;;AAEA,sBAAUC,aAAV,EAAwBC,qCAAxB;;AACA,QAAMC,UAAU,GAAG,iDAA8BC,MAA9B,CAClB,CAAE;AAAEC,IAAAA;AAAF,GAAF,KAAgBA,IAAI,KAAK,eADP,CAAnB;AAGA,wCAAoBF,UAApB;AACA,sBAAUF,aAAV,EAAwBK,4BAAxB,CAAsD,WAAtD;AACA,0CAA2B;AAAEC,IAAAA,QAAQ,EAAE;AAAZ,GAA3B;AACA,yCAA0B;AAAEA,IAAAA,QAAQ,EAAE;AAAZ,GAA1B;;AACA,MAAKC,OAAO,CAACC,GAAR,CAAYC,mBAAjB,EAAuC;AACtC,oEAA8C;AAC7CC,MAAAA,eAAe,EAAE;AAD4B,KAA9C;AAGA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ks';\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 {\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\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\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\n\tsettings.__experimentalFetchRichUrlData = fetchUrlData;\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\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\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tdistractionFree: false,\n\t\tkeepCaretInsideBlock: false,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\tshowListViewByDefault: false,\n\t\tshowBlockBreadcrumbs: true,\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';\n"]}
@@ -16,4 +16,4 @@ const {
16
16
  } = (0, _privateApis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.', '@wordpress/edit-site');
17
17
  exports.unlock = unlock;
18
18
  exports.lock = lock;
19
- //# sourceMappingURL=private-apis.js.map
19
+ //# sourceMappingURL=lock-unlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/lock-unlock.js"],"names":["lock","unlock"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IACZ,mEACC,8GADD,EAEC,sBAFD,CADM","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 plugin or theme will inevitably break on the next WordPress release.',\n\t\t'@wordpress/edit-site'\n\t);\n"]}
@@ -9,13 +9,15 @@ exports.__experimentalSetPreviewDeviceType = __experimentalSetPreviewDeviceType;
9
9
  exports.openGeneralSidebar = exports.closeGeneralSidebar = exports.addTemplate = void 0;
10
10
  exports.openNavigationPanelToMenu = openNavigationPanelToMenu;
11
11
  exports.revertTemplate = exports.removeTemplate = void 0;
12
+ exports.setEditedEntity = setEditedEntity;
12
13
  exports.setEditedPostContext = setEditedPostContext;
13
- exports.setHasPageContentLock = void 0;
14
+ exports.setHasPageContentFocus = void 0;
14
15
  exports.setHomeTemplateId = setHomeTemplateId;
15
16
  exports.setIsInserterOpened = setIsInserterOpened;
16
17
  exports.setIsListViewOpened = setIsListViewOpened;
17
18
  exports.setIsNavigationPanelOpened = setIsNavigationPanelOpened;
18
19
  exports.setIsSaveViewOpened = setIsSaveViewOpened;
20
+ exports.setNavigationMenu = setNavigationMenu;
19
21
  exports.setNavigationPanelActiveMenu = setNavigationPanelActiveMenu;
20
22
  exports.setTemplate = exports.setPage = void 0;
21
23
  exports.setTemplatePart = setTemplatePart;
@@ -206,6 +208,39 @@ function setTemplatePart(templatePartId) {
206
208
  id: templatePartId
207
209
  };
208
210
  }
211
+ /**
212
+ * Action that sets a navigation menu.
213
+ *
214
+ * @param {string} navigationMenuId The Navigation Menu Post ID.
215
+ *
216
+ * @return {Object} Action object.
217
+ */
218
+
219
+
220
+ function setNavigationMenu(navigationMenuId) {
221
+ return {
222
+ type: 'SET_EDITED_POST',
223
+ postType: 'wp_navigation',
224
+ id: navigationMenuId
225
+ };
226
+ }
227
+ /**
228
+ * Action that sets an edited entity.
229
+ *
230
+ * @param {string} postType The entity's post type.
231
+ * @param {string} postId The entity's ID.
232
+ *
233
+ * @return {Object} Action object.
234
+ */
235
+
236
+
237
+ function setEditedEntity(postType, postId) {
238
+ return {
239
+ type: 'SET_EDITED_POST',
240
+ postType,
241
+ id: postId
242
+ };
243
+ }
209
244
  /**
210
245
  * @deprecated
211
246
  */
@@ -535,28 +570,29 @@ const switchEditorMode = mode => ({
535
570
  }
536
571
  };
537
572
  /**
538
- * Sets whether or not the editor is locked so that only page content can be
539
- * edited.
573
+ * Sets whether or not the editor allows only page content to be edited.
540
574
  *
541
- * @param {boolean} hasPageContentLock True to enable lock, false to disable.
575
+ * @param {boolean} hasPageContentFocus True to allow only page content to be
576
+ * edited, false to allow template to be
577
+ * edited.
542
578
  */
543
579
 
544
580
 
545
581
  exports.switchEditorMode = switchEditorMode;
546
582
 
547
- const setHasPageContentLock = hasPageContentLock => ({
583
+ const setHasPageContentFocus = hasPageContentFocus => ({
548
584
  dispatch,
549
585
  registry
550
586
  }) => {
551
- if (hasPageContentLock) {
587
+ if (hasPageContentFocus) {
552
588
  registry.dispatch(_blockEditor.store).clearSelectedBlock();
553
589
  }
554
590
 
555
591
  dispatch({
556
- type: 'SET_HAS_PAGE_CONTENT_LOCK',
557
- hasPageContentLock
592
+ type: 'SET_HAS_PAGE_CONTENT_FOCUS',
593
+ hasPageContentFocus
558
594
  });
559
595
  };
560
596
 
561
- exports.setHasPageContentLock = setHasPageContentLock;
597
+ exports.setHasPageContentFocus = setHasPageContentFocus;
562
598
  //# sourceMappingURL=actions.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/store/actions.js"],"names":["toggleFeature","featureName","registry","since","alternative","dispatch","preferencesStore","toggle","__experimentalSetPreviewDeviceType","deviceType","type","setTemplate","templateId","templateSlug","template","resolveSelect","coreStore","getEntityRecord","slug","error","postType","id","context","addTemplate","newTemplate","saveEntityRecord","content","editEntityRecord","blocks","undoIgnore","removeTemplate","deleteEntityRecord","force","lastError","select","getLastEntityDeleteError","noticesStore","createSuccessNotice","title","rendered","errorMessage","message","code","createErrorNotice","setTemplatePart","templatePartId","setHomeTemplateId","version","setEditedPostContext","setPage","page","path","postId","entity","link","__experimentalGetTemplateForLink","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","updateSettings","settings","setIsListViewOpened","isOpen","setIsSaveViewOpened","revertTemplate","allowUndo","noticeId","removeNotice","templateEntityConfig","getEntityConfig","fileTemplatePath","baseURL","source","fileTemplate","serializeBlocks","blocksForSerialization","edited","getEditedEntityRecord","raw","undoRevert","actions","label","onClick","openGeneralSidebar","name","interfaceStore","enableComplementaryArea","editSiteStoreName","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","set","blockEditorStore","clearSelectedBlock","setHasPageContentLock","hasPageContentLock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AApBA;AACA;AACA;;AAcA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,SAASA,aAAT,CAAwBC,WAAxB,EAAsC;AAC5C,SAAO,UAAW;AAAEC,IAAAA;AAAF,GAAX,EAA0B;AAChC,6BAAY,yDAAZ,EAAuE;AACtEC,MAAAA,KAAK,EAAE,KAD+D;AAEtEC,MAAAA,WAAW,EACV;AAHqE,KAAvE;AAMAF,IAAAA,QAAQ,CACNG,QADF,CACYC,kBADZ,EAEEC,MAFF,CAEU,gBAFV,EAE4BN,WAF5B;AAGA,GAVD;AAWA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAAS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,IAAAA,IAAI,EAAE,2BADG;AAETwF,IAAAA;AAFS,GAAF,CAAR;AAIA,CAVK","sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { addQueryArgs, getPathAndQueryString } from '@wordpress/url';\nimport { __, sprintf } 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 { speak } from '@wordpress/a11y';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME as editSiteStoreName } from './constants';\nimport isTemplateRevertable from '../utils/is-template-revertable';\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( \"select( 'core/edit-site' ).toggleFeature( featureName )\", {\n\t\t\tsince: '6.0',\n\t\t\talternative:\n\t\t\t\t\"select( 'core/preferences').toggle( 'core/edit-site', featureName )\",\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 * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function __experimentalSetPreviewDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_PREVIEW_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Action that sets a template, optionally fetching it from REST API.\n *\n * @param {number} templateId The template ID.\n * @param {string} templateSlug The template slug.\n * @return {Object} Action object.\n */\nexport const setTemplate =\n\t( templateId, templateSlug ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tif ( ! templateSlug ) {\n\t\t\ttry {\n\t\t\t\tconst template = await registry\n\t\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t\t.getEntityRecord( 'postType', 'wp_template', templateId );\n\t\t\t\ttemplateSlug = template?.slug;\n\t\t\t} catch ( error ) {}\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: templateId,\n\t\t\tcontext: { templateSlug },\n\t\t} );\n\t};\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 * @return {Object} Action object used to set the current template.\n */\nexport const addTemplate =\n\t( template ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tconst newTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', 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\t'wp_template',\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: 'wp_template',\n\t\t\tid: newTemplate.id,\n\t\t\tcontext: { templateSlug: newTemplate.slug },\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\tasync ( { registry } ) => {\n\t\ttry {\n\t\t\tawait registry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.deleteEntityRecord( 'postType', template.type, template.id, {\n\t\t\t\t\tforce: true,\n\t\t\t\t} );\n\n\t\t\tconst lastError = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getLastEntityDeleteError(\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\tif ( lastError ) {\n\t\t\t\tthrow lastError;\n\t\t\t}\n\n\t\t\tregistry.dispatch( noticesStore ).createSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t__( '\"%s\" deleted.' ),\n\t\t\t\t\tdecodeEntities( template.title.rendered )\n\t\t\t\t),\n\t\t\t\t{ type: 'snackbar', id: 'site-editor-template-deleted-success' }\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: __( 'An error occurred while deleting the template.' );\n\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/**\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: 'wp_template_part',\n\t\tid: templatePartId,\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 {number} The resolved template ID for the page route.\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 * @param {Object} page The page object.\n * @param {string} page.type The page type.\n * @param {string} page.slug The page slug.\n * @param {string} page.path The page path.\n * @param {Object} page.context The page context.\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport const setPage =\n\t( page ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tif ( ! page.path && page.context?.postId ) {\n\t\t\tconst entity = await registry\n\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t.getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpage.context.postType || 'post',\n\t\t\t\t\tpage.context.postId\n\t\t\t\t);\n\t\t\t// If the entity is undefined for some reason, path will resolve to \"/\"\n\t\t\tpage.path = getPathAndQueryString( entity?.link );\n\t\t}\n\n\t\tconst template = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.__experimentalGetTemplateForLink( page.path );\n\n\t\tif ( ! template ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: template.id,\n\t\t\tcontext: {\n\t\t\t\t...page.context,\n\t\t\t\ttemplateSlug: template.slug,\n\t\t\t},\n\t\t} );\n\n\t\treturn template.id;\n\t};\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 * Opens or closes the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\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 list view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the list view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport function setIsListViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\tisOpen,\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\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( 'core/preferences' )\n\t\t\t.set( 'core/edit-site', 'editorMode', mode );\n\n\t\t// Unselect blocks when we switch to a non visual mode.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tif ( mode === 'visual' ) {\n\t\t\tspeak( __( 'Visual editor selected' ), 'assertive' );\n\t\t} else if ( mode === 'text' ) {\n\t\t\tspeak( __( 'Code editor selected' ), 'assertive' );\n\t\t}\n\t};\n\n/**\n * Sets whether or not the editor is locked so that only page content can be\n * edited.\n *\n * @param {boolean} hasPageContentLock True to enable lock, false to disable.\n */\nexport const setHasPageContentLock =\n\t( hasPageContentLock ) =>\n\t( { dispatch, registry } ) => {\n\t\tif ( hasPageContentLock ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_HAS_PAGE_CONTENT_LOCK',\n\t\t\thasPageContentLock,\n\t\t} );\n\t};\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/store/actions.js"],"names":["toggleFeature","featureName","registry","since","alternative","dispatch","preferencesStore","toggle","__experimentalSetPreviewDeviceType","deviceType","type","setTemplate","templateId","templateSlug","template","resolveSelect","coreStore","getEntityRecord","slug","error","postType","id","context","addTemplate","newTemplate","saveEntityRecord","content","editEntityRecord","blocks","undoIgnore","removeTemplate","deleteEntityRecord","force","lastError","select","getLastEntityDeleteError","noticesStore","createSuccessNotice","title","rendered","errorMessage","message","code","createErrorNotice","setTemplatePart","templatePartId","setNavigationMenu","navigationMenuId","setEditedEntity","postId","setHomeTemplateId","version","setEditedPostContext","setPage","page","path","entity","link","__experimentalGetTemplateForLink","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","updateSettings","settings","setIsListViewOpened","isOpen","setIsSaveViewOpened","revertTemplate","allowUndo","noticeId","removeNotice","templateEntityConfig","getEntityConfig","fileTemplatePath","baseURL","source","fileTemplate","serializeBlocks","blocksForSerialization","edited","getEditedEntityRecord","raw","undoRevert","actions","label","onClick","openGeneralSidebar","name","interfaceStore","enableComplementaryArea","editSiteStoreName","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","set","blockEditorStore","clearSelectedBlock","setHasPageContentFocus","hasPageContentFocus"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AApBA;AACA;AACA;;AAcA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,SAASA,aAAT,CAAwBC,WAAxB,EAAsC;AAC5C,SAAO,UAAW;AAAEC,IAAAA;AAAF,GAAX,EAA0B;AAChC,6BAAY,yDAAZ,EAAuE;AACtEC,MAAAA,KAAK,EAAE,KAD+D;AAEtEC,MAAAA,WAAW,EACV;AAHqE,KAAvE;AAMAF,IAAAA,QAAQ,CACNG,QADF,CACYC,kBADZ,EAEEC,MAFF,CAEU,gBAFV,EAE4BN,WAF5B;AAGA,GAVD;AAWA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASO,kCAAT,CAA6CC,UAA7C,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AFD,MAEO,IAAKA,IAAI,KAAK,MAAd,EAAuB;AAC7B,qBAAO,cAAI,sBAAJ,CAAP,EAAqC,WAArC;AACA;AACD,CAjBK;AAmBP;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMI,sBAAsB,GAChCC,mBAAF,IACA,CAAE;AAAEhG,EAAAA,QAAF;AAAYH,EAAAA;AAAZ,CAAF,KAA8B;AAC7B,MAAKmG,mBAAL,EAA2B;AAC1BnG,IAAAA,QAAQ,CAACG,QAAT,CAAmB6F,kBAAnB,EAAsCC,kBAAtC;AACA;;AACD9F,EAAAA,QAAQ,CAAE;AACTK,IAAAA,IAAI,EAAE,4BADG;AAET2F,IAAAA;AAFS,GAAF,CAAR;AAIA,CAVK","sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { addQueryArgs, getPathAndQueryString } from '@wordpress/url';\nimport { __, sprintf } 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 { speak } from '@wordpress/a11y';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME as editSiteStoreName } from './constants';\nimport isTemplateRevertable from '../utils/is-template-revertable';\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( \"select( 'core/edit-site' ).toggleFeature( featureName )\", {\n\t\t\tsince: '6.0',\n\t\t\talternative:\n\t\t\t\t\"select( 'core/preferences').toggle( 'core/edit-site', featureName )\",\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 * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function __experimentalSetPreviewDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_PREVIEW_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Action that sets a template, optionally fetching it from REST API.\n *\n * @param {number} templateId The template ID.\n * @param {string} templateSlug The template slug.\n * @return {Object} Action object.\n */\nexport const setTemplate =\n\t( templateId, templateSlug ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tif ( ! templateSlug ) {\n\t\t\ttry {\n\t\t\t\tconst template = await registry\n\t\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t\t.getEntityRecord( 'postType', 'wp_template', templateId );\n\t\t\t\ttemplateSlug = template?.slug;\n\t\t\t} catch ( error ) {}\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: templateId,\n\t\t\tcontext: { templateSlug },\n\t\t} );\n\t};\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 * @return {Object} Action object used to set the current template.\n */\nexport const addTemplate =\n\t( template ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tconst newTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', 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\t'wp_template',\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: 'wp_template',\n\t\t\tid: newTemplate.id,\n\t\t\tcontext: { templateSlug: newTemplate.slug },\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\tasync ( { registry } ) => {\n\t\ttry {\n\t\t\tawait registry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.deleteEntityRecord( 'postType', template.type, template.id, {\n\t\t\t\t\tforce: true,\n\t\t\t\t} );\n\n\t\t\tconst lastError = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getLastEntityDeleteError(\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\tif ( lastError ) {\n\t\t\t\tthrow lastError;\n\t\t\t}\n\n\t\t\tregistry.dispatch( noticesStore ).createSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t__( '\"%s\" deleted.' ),\n\t\t\t\t\tdecodeEntities( template.title.rendered )\n\t\t\t\t),\n\t\t\t\t{ type: 'snackbar', id: 'site-editor-template-deleted-success' }\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: __( 'An error occurred while deleting the template.' );\n\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/**\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: 'wp_template_part',\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: 'wp_navigation',\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 *\n * @return {Object} Action object.\n */\nexport function setEditedEntity( postType, postId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tid: postId,\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 {number} The resolved template ID for the page route.\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 * @param {Object} page The page object.\n * @param {string} page.type The page type.\n * @param {string} page.slug The page slug.\n * @param {string} page.path The page path.\n * @param {Object} page.context The page context.\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport const setPage =\n\t( page ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tif ( ! page.path && page.context?.postId ) {\n\t\t\tconst entity = await registry\n\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t.getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpage.context.postType || 'post',\n\t\t\t\t\tpage.context.postId\n\t\t\t\t);\n\t\t\t// If the entity is undefined for some reason, path will resolve to \"/\"\n\t\t\tpage.path = getPathAndQueryString( entity?.link );\n\t\t}\n\n\t\tconst template = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.__experimentalGetTemplateForLink( page.path );\n\n\t\tif ( ! template ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: template.id,\n\t\t\tcontext: {\n\t\t\t\t...page.context,\n\t\t\t\ttemplateSlug: template.slug,\n\t\t\t},\n\t\t} );\n\n\t\treturn template.id;\n\t};\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 * Opens or closes the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\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 list view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the list view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport function setIsListViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\tisOpen,\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\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( 'core/preferences' )\n\t\t\t.set( 'core/edit-site', 'editorMode', mode );\n\n\t\t// Unselect blocks when we switch to a non visual mode.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tif ( mode === 'visual' ) {\n\t\t\tspeak( __( 'Visual editor selected' ), 'assertive' );\n\t\t} else if ( mode === 'text' ) {\n\t\t\tspeak( __( 'Code editor selected' ), 'assertive' );\n\t\t}\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\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"]}
@@ -21,7 +21,7 @@ var privateSelectors = _interopRequireWildcard(require("./private-selectors"));
21
21
 
22
22
  var _constants = require("./constants");
23
23
 
24
- var _privateApis = require("../private-apis");
24
+ var _lockUnlock = require("../lock-unlock");
25
25
 
26
26
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
27
 
@@ -43,6 +43,6 @@ exports.storeConfig = storeConfig;
43
43
  const store = (0, _data.createReduxStore)(_constants.STORE_NAME, storeConfig);
44
44
  exports.store = store;
45
45
  (0, _data.register)(store);
46
- (0, _privateApis.unlock)(store).registerPrivateSelectors(privateSelectors);
47
- (0, _privateApis.unlock)(store).registerPrivateActions(privateActions);
46
+ (0, _lockUnlock.unlock)(store).registerPrivateSelectors(privateSelectors);
47
+ (0, _lockUnlock.unlock)(store).registerPrivateActions(privateActions);
48
48
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/store/index.js"],"names":["storeConfig","reducer","actions","selectors","store","STORE_NAME","registerPrivateSelectors","privateSelectors","registerPrivateActions","privateActions"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAdA;AACA;AACA;;AAGA;AACA;AACA;AASO,MAAMA,WAAW,GAAG;AAC1BC,EAAAA,OAAO,EAAPA,gBAD0B;AAE1BC,EAAAA,OAF0B;AAG1BC,EAAAA;AAH0B,CAApB;;AAMA,MAAMC,KAAK,GAAG,4BAAkBC,qBAAlB,EAA8BL,WAA9B,CAAd;;AACP,oBAAUI,KAAV;AACA,yBAAQA,KAAR,EAAgBE,wBAAhB,CAA0CC,gBAA1C;AACA,yBAAQH,KAAR,EAAgBI,sBAAhB,CAAwCC,cAAxC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as privateActions from './private-actions';\nimport * as selectors from './selectors';\nimport * as privateSelectors from './private-selectors';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../private-apis';\n\nexport const storeConfig = {\n\treducer,\n\tactions,\n\tselectors,\n};\n\nexport const store = createReduxStore( STORE_NAME, storeConfig );\nregister( store );\nunlock( store ).registerPrivateSelectors( privateSelectors );\nunlock( store ).registerPrivateActions( privateActions );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/store/index.js"],"names":["storeConfig","reducer","actions","selectors","store","STORE_NAME","registerPrivateSelectors","privateSelectors","registerPrivateActions","privateActions"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAdA;AACA;AACA;;AAGA;AACA;AACA;AASO,MAAMA,WAAW,GAAG;AAC1BC,EAAAA,OAAO,EAAPA,gBAD0B;AAE1BC,EAAAA,OAF0B;AAG1BC,EAAAA;AAH0B,CAApB;;AAMA,MAAMC,KAAK,GAAG,4BAAkBC,qBAAlB,EAA8BL,WAA9B,CAAd;;AACP,oBAAUI,KAAV;AACA,wBAAQA,KAAR,EAAgBE,wBAAhB,CAA0CC,gBAA1C;AACA,wBAAQH,KAAR,EAAgBI,sBAAhB,CAAwCC,cAAxC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as privateActions from './private-actions';\nimport * as selectors from './selectors';\nimport * as privateSelectors from './private-selectors';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\n\nexport const storeConfig = {\n\treducer,\n\tactions,\n\tselectors,\n};\n\nexport const store = createReduxStore( STORE_NAME, storeConfig );\nregister( store );\nunlock( store ).registerPrivateSelectors( privateSelectors );\nunlock( store ).registerPrivateActions( privateActions );\n"]}