@wordpress/edit-site 5.11.0 → 5.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (587) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-page/index.js +105 -0
  3. package/build/components/add-new-page/index.js.map +1 -0
  4. package/build/components/add-new-template/add-custom-generic-template-modal-content.js +4 -5
  5. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  6. package/build/components/add-new-template/add-custom-template-modal-content.js +19 -22
  7. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  8. package/build/components/add-new-template/index.js +4 -5
  9. package/build/components/add-new-template/index.js.map +1 -1
  10. package/build/components/add-new-template/new-template-part.js +9 -12
  11. package/build/components/add-new-template/new-template-part.js.map +1 -1
  12. package/build/components/add-new-template/new-template.js +19 -26
  13. package/build/components/add-new-template/new-template.js.map +1 -1
  14. package/build/components/add-new-template/utils.js +71 -120
  15. package/build/components/add-new-template/utils.js.map +1 -1
  16. package/build/components/block-editor/back-button.js +1 -3
  17. package/build/components/block-editor/back-button.js.map +1 -1
  18. package/build/components/block-editor/block-inspector-button.js +3 -4
  19. package/build/components/block-editor/block-inspector-button.js.map +1 -1
  20. package/build/components/block-editor/editor-canvas.js +6 -7
  21. package/build/components/block-editor/editor-canvas.js.map +1 -1
  22. package/build/components/block-editor/index.js +13 -10
  23. package/build/components/block-editor/index.js.map +1 -1
  24. package/build/components/block-editor/inserter-media-categories.js +25 -42
  25. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  26. package/build/components/block-editor/resizable-editor.js +6 -7
  27. package/build/components/block-editor/resizable-editor.js.map +1 -1
  28. package/build/components/block-editor/resize-handle.js +5 -7
  29. package/build/components/block-editor/resize-handle.js.map +1 -1
  30. package/build/components/code-editor/code-editor-text-area.js +5 -6
  31. package/build/components/code-editor/code-editor-text-area.js.map +1 -1
  32. package/build/components/create-template-part-modal/index.js +25 -29
  33. package/build/components/create-template-part-modal/index.js.map +1 -1
  34. package/build/components/editor/index.js +26 -17
  35. package/build/components/editor/index.js.map +1 -1
  36. package/build/components/editor-canvas-container/index.js +7 -8
  37. package/build/components/editor-canvas-container/index.js.map +1 -1
  38. package/build/components/error-boundary/warning.js +8 -10
  39. package/build/components/error-boundary/warning.js.map +1 -1
  40. package/build/components/global-styles/block-preview-panel.js +7 -10
  41. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  42. package/build/components/global-styles/color-indicator-wrapper.js +4 -5
  43. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  44. package/build/components/global-styles/color-palette-panel.js +3 -4
  45. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  46. package/build/components/global-styles/dimensions-panel.js +1 -3
  47. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  48. package/build/components/global-styles/global-styles-provider.js +8 -10
  49. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  50. package/build/components/global-styles/gradients-palette-panel.js +3 -4
  51. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  52. package/build/components/global-styles/header.js +4 -5
  53. package/build/components/global-styles/header.js.map +1 -1
  54. package/build/components/global-styles/icon-with-current-color.js +4 -5
  55. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  56. package/build/components/global-styles/navigation-button.js +5 -6
  57. package/build/components/global-styles/navigation-button.js.map +1 -1
  58. package/build/components/global-styles/palette.js +10 -14
  59. package/build/components/global-styles/palette.js.map +1 -1
  60. package/build/components/global-styles/preview.js +41 -51
  61. package/build/components/global-styles/preview.js.map +1 -1
  62. package/build/components/global-styles/screen-block-list.js +4 -7
  63. package/build/components/global-styles/screen-block-list.js.map +1 -1
  64. package/build/components/global-styles/screen-block.js +9 -10
  65. package/build/components/global-styles/screen-block.js.map +1 -1
  66. package/build/components/global-styles/screen-color-palette.js +3 -4
  67. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  68. package/build/components/global-styles/screen-revisions/index.js +8 -8
  69. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  70. package/build/components/global-styles/screen-revisions/revisions-buttons.js +14 -19
  71. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  72. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +5 -11
  73. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  74. package/build/components/global-styles/screen-root.js +3 -3
  75. package/build/components/global-styles/screen-root.js.map +1 -1
  76. package/build/components/global-styles/screen-typography-element.js +3 -4
  77. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  78. package/build/components/global-styles/screen-typography.js +5 -6
  79. package/build/components/global-styles/screen-typography.js.map +1 -1
  80. package/build/components/global-styles/style-variations-container.js +5 -6
  81. package/build/components/global-styles/style-variations-container.js.map +1 -1
  82. package/build/components/global-styles/subtitle.js +4 -5
  83. package/build/components/global-styles/subtitle.js.map +1 -1
  84. package/build/components/global-styles/typography-panel.js +4 -5
  85. package/build/components/global-styles/typography-panel.js.map +1 -1
  86. package/build/components/global-styles/typography-preview.js +5 -6
  87. package/build/components/global-styles/typography-preview.js.map +1 -1
  88. package/build/components/global-styles/ui.js +40 -21
  89. package/build/components/global-styles/ui.js.map +1 -1
  90. package/build/components/global-styles/variations-panel.js +5 -6
  91. package/build/components/global-styles/variations-panel.js.map +1 -1
  92. package/build/components/header-edit-mode/document-actions/index.js +102 -23
  93. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  94. package/build/components/header-edit-mode/index.js +2 -6
  95. package/build/components/header-edit-mode/index.js.map +1 -1
  96. package/build/components/header-edit-mode/more-menu/index.js +49 -53
  97. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  98. package/build/components/header-edit-mode/tools-more-menu-group/index.js +5 -14
  99. package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  100. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  101. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  102. package/build/components/keyboard-shortcut-help-modal/index.js +41 -51
  103. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  104. package/build/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  105. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  106. package/build/components/layout/index.js +4 -12
  107. package/build/components/layout/index.js.map +1 -1
  108. package/build/components/list/added-by.js +13 -23
  109. package/build/components/list/added-by.js.map +1 -1
  110. package/build/components/list/header.js +4 -7
  111. package/build/components/list/header.js.map +1 -1
  112. package/build/components/list/index.js +2 -4
  113. package/build/components/list/index.js.map +1 -1
  114. package/build/components/list/table.js +35 -40
  115. package/build/components/list/table.js.map +1 -1
  116. package/build/components/page-actions/delete-page-menu-item.js +70 -0
  117. package/build/components/page-actions/delete-page-menu-item.js.map +1 -0
  118. package/build/components/page-actions/index.js +43 -0
  119. package/build/components/page-actions/index.js.map +1 -0
  120. package/build/components/page-content-lock/constants.js +9 -0
  121. package/build/components/page-content-lock/constants.js.map +1 -0
  122. package/build/components/page-content-lock/index.js +29 -0
  123. package/build/components/page-content-lock/index.js.map +1 -0
  124. package/build/components/page-content-lock/use-disable-non-content-blocks.js +49 -0
  125. package/build/components/page-content-lock/use-disable-non-content-blocks.js.map +1 -0
  126. package/build/components/page-content-lock/use-page-content-lock-notifications.js +112 -0
  127. package/build/components/page-content-lock/use-page-content-lock-notifications.js.map +1 -0
  128. package/build/components/preferences-modal/index.js +4 -5
  129. package/build/components/preferences-modal/index.js.map +1 -1
  130. package/build/components/resizable-frame/index.js +20 -12
  131. package/build/components/resizable-frame/index.js.map +1 -1
  132. package/build/components/revisions/index.js +11 -14
  133. package/build/components/revisions/index.js.map +1 -1
  134. package/build/components/routes/link.js +8 -12
  135. package/build/components/routes/link.js.map +1 -1
  136. package/build/components/routes/use-title.js +1 -5
  137. package/build/components/routes/use-title.js.map +1 -1
  138. package/build/components/save-button/index.js +13 -7
  139. package/build/components/save-button/index.js.map +1 -1
  140. package/build/components/save-hub/index.js +97 -5
  141. package/build/components/save-hub/index.js.map +1 -1
  142. package/build/components/save-panel/index.js +63 -17
  143. package/build/components/save-panel/index.js.map +1 -1
  144. package/build/components/secondary-sidebar/list-view-sidebar.js +8 -3
  145. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  146. package/build/components/sidebar/index.js +7 -5
  147. package/build/components/sidebar/index.js.map +1 -1
  148. package/build/components/sidebar-edit-mode/default-sidebar.js +11 -12
  149. package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  150. package/build/components/sidebar-edit-mode/index.js +13 -10
  151. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  152. package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js +79 -0
  153. package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +1 -0
  154. package/build/components/sidebar-edit-mode/page-panels/index.js +86 -0
  155. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -0
  156. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -5
  157. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  158. package/build/components/sidebar-edit-mode/settings-header/index.js +39 -21
  159. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  160. package/build/components/sidebar-edit-mode/sidebar-card/index.js +46 -0
  161. package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -0
  162. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +3 -4
  163. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  164. package/build/components/sidebar-edit-mode/{template-card → template-panel}/index.js +22 -18
  165. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -0
  166. package/build/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +7 -8
  167. package/{build-module/components/sidebar-edit-mode/template-revisions/index.js.map → build/components/sidebar-edit-mode/template-panel/last-revision.js.map} +1 -1
  168. package/build/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +12 -16
  169. package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -0
  170. package/build/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +15 -19
  171. package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -0
  172. package/build/components/sidebar-navigation-item/index.js +7 -8
  173. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  174. package/build/components/sidebar-navigation-screen/index.js +21 -14
  175. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  176. package/build/components/sidebar-navigation-screen-global-styles/index.js +103 -13
  177. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  178. package/build/components/sidebar-navigation-screen-navigation-item/index.js +3 -5
  179. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  180. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +7 -10
  181. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  182. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +17 -23
  183. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  184. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +20 -23
  185. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  186. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +4 -5
  187. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  188. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +8 -9
  189. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -1
  190. package/build/components/sidebar-navigation-screen-page/index.js +81 -10
  191. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  192. package/build/components/sidebar-navigation-screen-page/page-details.js +148 -0
  193. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -0
  194. package/build/components/sidebar-navigation-screen-page/status-label.js +110 -0
  195. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -0
  196. package/build/components/sidebar-navigation-screen-pages/index.js +128 -17
  197. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  198. package/build/components/sidebar-navigation-screen-template/index.js +22 -16
  199. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  200. package/build/components/sidebar-navigation-screen-template-part/index.js +105 -0
  201. package/build/components/sidebar-navigation-screen-template-part/index.js.map +1 -0
  202. package/build/components/sidebar-navigation-screen-templates/index.js +13 -18
  203. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  204. package/build/components/sidebar-navigation-subtitle/index.js +3 -4
  205. package/build/components/sidebar-navigation-subtitle/index.js.map +1 -1
  206. package/build/components/site-hub/index.js +20 -13
  207. package/build/components/site-hub/index.js.map +1 -1
  208. package/build/components/site-icon/index.js +4 -5
  209. package/build/components/site-icon/index.js.map +1 -1
  210. package/build/components/start-template-options/index.js +15 -21
  211. package/build/components/start-template-options/index.js.map +1 -1
  212. package/build/components/style-book/index.js +35 -39
  213. package/build/components/style-book/index.js.map +1 -1
  214. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +2 -2
  215. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  216. package/build/components/sync-state-with-url/use-sync-path-with-url.js +9 -10
  217. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  218. package/build/components/{list/actions → template-actions}/index.js +34 -31
  219. package/build/components/template-actions/index.js.map +1 -0
  220. package/build/components/{list/actions → template-actions}/rename-menu-item.js +4 -5
  221. package/build/components/template-actions/rename-menu-item.js.map +1 -0
  222. package/build/components/template-part-converter/convert-to-regular.js +4 -5
  223. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  224. package/build/components/template-part-converter/convert-to-template-part.js +8 -10
  225. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  226. package/build/components/template-part-converter/index.js +12 -18
  227. package/build/components/template-part-converter/index.js.map +1 -1
  228. package/build/components/welcome-guide/image.js +4 -5
  229. package/build/components/welcome-guide/image.js.map +1 -1
  230. package/build/hooks/commands/use-edit-mode-commands.js +6 -8
  231. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  232. package/build/hooks/push-changes-to-global-styles/index.js +11 -8
  233. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  234. package/build/hooks/template-part-edit.js +5 -6
  235. package/build/hooks/template-part-edit.js.map +1 -1
  236. package/build/index.js +3 -6
  237. package/build/index.js.map +1 -1
  238. package/build/store/actions.js +129 -125
  239. package/build/store/actions.js.map +1 -1
  240. package/build/store/private-actions.js +7 -10
  241. package/build/store/private-actions.js.map +1 -1
  242. package/build/store/reducer.js +32 -33
  243. package/build/store/reducer.js.map +1 -1
  244. package/build/store/selectors.js +35 -11
  245. package/build/store/selectors.js.map +1 -1
  246. package/build/store/utils.js +1 -3
  247. package/build/store/utils.js.map +1 -1
  248. package/build/utils/get-is-list-page.js +3 -4
  249. package/build/utils/get-is-list-page.js.map +1 -1
  250. package/build/utils/is-previewing-theme.js +1 -3
  251. package/build/utils/is-previewing-theme.js.map +1 -1
  252. package/build/utils/is-template-revertable.js +1 -1
  253. package/build/utils/is-template-revertable.js.map +1 -1
  254. package/build-module/components/add-new-page/index.js +93 -0
  255. package/build-module/components/add-new-page/index.js.map +1 -0
  256. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +4 -5
  257. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  258. package/build-module/components/add-new-template/add-custom-template-modal-content.js +19 -22
  259. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  260. package/build-module/components/add-new-template/index.js +4 -5
  261. package/build-module/components/add-new-template/index.js.map +1 -1
  262. package/build-module/components/add-new-template/new-template-part.js +9 -12
  263. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  264. package/build-module/components/add-new-template/new-template.js +18 -26
  265. package/build-module/components/add-new-template/new-template.js.map +1 -1
  266. package/build-module/components/add-new-template/utils.js +71 -120
  267. package/build-module/components/add-new-template/utils.js.map +1 -1
  268. package/build-module/components/block-editor/back-button.js +1 -3
  269. package/build-module/components/block-editor/back-button.js.map +1 -1
  270. package/build-module/components/block-editor/block-inspector-button.js +3 -4
  271. package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
  272. package/build-module/components/block-editor/editor-canvas.js +6 -7
  273. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  274. package/build-module/components/block-editor/index.js +12 -10
  275. package/build-module/components/block-editor/index.js.map +1 -1
  276. package/build-module/components/block-editor/inserter-media-categories.js +25 -42
  277. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
  278. package/build-module/components/block-editor/resizable-editor.js +6 -7
  279. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  280. package/build-module/components/block-editor/resize-handle.js +5 -7
  281. package/build-module/components/block-editor/resize-handle.js.map +1 -1
  282. package/build-module/components/code-editor/code-editor-text-area.js +5 -6
  283. package/build-module/components/code-editor/code-editor-text-area.js.map +1 -1
  284. package/build-module/components/create-template-part-modal/index.js +25 -29
  285. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  286. package/build-module/components/editor/index.js +26 -17
  287. package/build-module/components/editor/index.js.map +1 -1
  288. package/build-module/components/editor-canvas-container/index.js +7 -8
  289. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  290. package/build-module/components/error-boundary/warning.js +8 -10
  291. package/build-module/components/error-boundary/warning.js.map +1 -1
  292. package/build-module/components/global-styles/block-preview-panel.js +7 -10
  293. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  294. package/build-module/components/global-styles/color-indicator-wrapper.js +4 -5
  295. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  296. package/build-module/components/global-styles/color-palette-panel.js +3 -4
  297. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  298. package/build-module/components/global-styles/dimensions-panel.js +1 -3
  299. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  300. package/build-module/components/global-styles/global-styles-provider.js +8 -10
  301. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  302. package/build-module/components/global-styles/gradients-palette-panel.js +3 -4
  303. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  304. package/build-module/components/global-styles/header.js +4 -5
  305. package/build-module/components/global-styles/header.js.map +1 -1
  306. package/build-module/components/global-styles/icon-with-current-color.js +4 -5
  307. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  308. package/build-module/components/global-styles/navigation-button.js +5 -6
  309. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  310. package/build-module/components/global-styles/palette.js +10 -14
  311. package/build-module/components/global-styles/palette.js.map +1 -1
  312. package/build-module/components/global-styles/preview.js +41 -51
  313. package/build-module/components/global-styles/preview.js.map +1 -1
  314. package/build-module/components/global-styles/screen-block-list.js +4 -7
  315. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  316. package/build-module/components/global-styles/screen-block.js +9 -10
  317. package/build-module/components/global-styles/screen-block.js.map +1 -1
  318. package/build-module/components/global-styles/screen-color-palette.js +3 -4
  319. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  320. package/build-module/components/global-styles/screen-revisions/index.js +8 -8
  321. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  322. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +14 -19
  323. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  324. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +5 -10
  325. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  326. package/build-module/components/global-styles/screen-root.js +3 -3
  327. package/build-module/components/global-styles/screen-root.js.map +1 -1
  328. package/build-module/components/global-styles/screen-typography-element.js +3 -4
  329. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  330. package/build-module/components/global-styles/screen-typography.js +5 -6
  331. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  332. package/build-module/components/global-styles/style-variations-container.js +5 -6
  333. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  334. package/build-module/components/global-styles/subtitle.js +4 -5
  335. package/build-module/components/global-styles/subtitle.js.map +1 -1
  336. package/build-module/components/global-styles/typography-panel.js +4 -5
  337. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  338. package/build-module/components/global-styles/typography-preview.js +5 -6
  339. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  340. package/build-module/components/global-styles/ui.js +40 -21
  341. package/build-module/components/global-styles/ui.js.map +1 -1
  342. package/build-module/components/global-styles/variations-panel.js +5 -6
  343. package/build-module/components/global-styles/variations-panel.js.map +1 -1
  344. package/build-module/components/header-edit-mode/document-actions/index.js +102 -24
  345. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  346. package/build-module/components/header-edit-mode/index.js +2 -6
  347. package/build-module/components/header-edit-mode/index.js.map +1 -1
  348. package/build-module/components/header-edit-mode/more-menu/index.js +49 -53
  349. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  350. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +5 -13
  351. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  352. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  353. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  354. package/build-module/components/keyboard-shortcut-help-modal/index.js +39 -49
  355. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  356. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  357. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  358. package/build-module/components/layout/index.js +4 -12
  359. package/build-module/components/layout/index.js.map +1 -1
  360. package/build-module/components/list/added-by.js +13 -23
  361. package/build-module/components/list/added-by.js.map +1 -1
  362. package/build-module/components/list/header.js +4 -7
  363. package/build-module/components/list/header.js.map +1 -1
  364. package/build-module/components/list/index.js +2 -4
  365. package/build-module/components/list/index.js.map +1 -1
  366. package/build-module/components/list/table.js +34 -39
  367. package/build-module/components/list/table.js.map +1 -1
  368. package/build-module/components/page-actions/delete-page-menu-item.js +58 -0
  369. package/build-module/components/page-actions/delete-page-menu-item.js.map +1 -0
  370. package/build-module/components/page-actions/index.js +30 -0
  371. package/build-module/components/page-actions/index.js.map +1 -0
  372. package/build-module/components/page-content-lock/constants.js +2 -0
  373. package/build-module/components/page-content-lock/constants.js.map +1 -0
  374. package/build-module/components/page-content-lock/index.js +14 -0
  375. package/build-module/components/page-content-lock/index.js.map +1 -0
  376. package/build-module/components/page-content-lock/use-disable-non-content-blocks.js +36 -0
  377. package/build-module/components/page-content-lock/use-disable-non-content-blocks.js.map +1 -0
  378. package/build-module/components/page-content-lock/use-page-content-lock-notifications.js +98 -0
  379. package/build-module/components/page-content-lock/use-page-content-lock-notifications.js.map +1 -0
  380. package/build-module/components/preferences-modal/index.js +4 -5
  381. package/build-module/components/preferences-modal/index.js.map +1 -1
  382. package/build-module/components/resizable-frame/index.js +20 -12
  383. package/build-module/components/resizable-frame/index.js.map +1 -1
  384. package/build-module/components/revisions/index.js +11 -13
  385. package/build-module/components/revisions/index.js.map +1 -1
  386. package/build-module/components/routes/link.js +8 -12
  387. package/build-module/components/routes/link.js.map +1 -1
  388. package/build-module/components/routes/use-title.js +1 -5
  389. package/build-module/components/routes/use-title.js.map +1 -1
  390. package/build-module/components/save-button/index.js +13 -7
  391. package/build-module/components/save-button/index.js.map +1 -1
  392. package/build-module/components/save-hub/index.js +95 -8
  393. package/build-module/components/save-hub/index.js.map +1 -1
  394. package/build-module/components/save-panel/index.js +62 -19
  395. package/build-module/components/save-panel/index.js.map +1 -1
  396. package/build-module/components/secondary-sidebar/list-view-sidebar.js +9 -3
  397. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  398. package/build-module/components/sidebar/index.js +6 -5
  399. package/build-module/components/sidebar/index.js.map +1 -1
  400. package/build-module/components/sidebar-edit-mode/default-sidebar.js +11 -12
  401. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  402. package/build-module/components/sidebar-edit-mode/index.js +14 -11
  403. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  404. package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js +67 -0
  405. package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +1 -0
  406. package/build-module/components/sidebar-edit-mode/page-panels/index.js +67 -0
  407. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -0
  408. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -5
  409. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  410. package/build-module/components/sidebar-edit-mode/settings-header/index.js +36 -22
  411. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  412. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +35 -0
  413. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -0
  414. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +3 -4
  415. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  416. package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/index.js +20 -19
  417. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -0
  418. package/build-module/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +7 -8
  419. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -0
  420. package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +12 -16
  421. package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -0
  422. package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +15 -19
  423. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -0
  424. package/build-module/components/sidebar-navigation-item/index.js +7 -8
  425. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  426. package/build-module/components/sidebar-navigation-screen/index.js +22 -15
  427. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  428. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +104 -14
  429. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  430. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +3 -5
  431. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  432. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +7 -10
  433. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  434. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +17 -23
  435. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  436. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +20 -23
  437. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  438. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +4 -5
  439. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  440. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +8 -9
  441. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -1
  442. package/build-module/components/sidebar-navigation-screen-page/index.js +79 -14
  443. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  444. package/build-module/components/sidebar-navigation-screen-page/page-details.js +131 -0
  445. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -0
  446. package/build-module/components/sidebar-navigation-screen-page/status-label.js +97 -0
  447. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -0
  448. package/build-module/components/sidebar-navigation-screen-pages/index.js +125 -19
  449. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  450. package/build-module/components/sidebar-navigation-screen-template/index.js +22 -17
  451. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  452. package/build-module/components/sidebar-navigation-screen-template-part/index.js +86 -0
  453. package/build-module/components/sidebar-navigation-screen-template-part/index.js.map +1 -0
  454. package/build-module/components/sidebar-navigation-screen-templates/index.js +13 -18
  455. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  456. package/build-module/components/sidebar-navigation-subtitle/index.js +3 -4
  457. package/build-module/components/sidebar-navigation-subtitle/index.js.map +1 -1
  458. package/build-module/components/site-hub/index.js +21 -14
  459. package/build-module/components/site-hub/index.js.map +1 -1
  460. package/build-module/components/site-icon/index.js +4 -5
  461. package/build-module/components/site-icon/index.js.map +1 -1
  462. package/build-module/components/start-template-options/index.js +15 -21
  463. package/build-module/components/start-template-options/index.js.map +1 -1
  464. package/build-module/components/style-book/index.js +35 -39
  465. package/build-module/components/style-book/index.js.map +1 -1
  466. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +2 -2
  467. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  468. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +9 -10
  469. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  470. package/build-module/components/{list/actions → template-actions}/index.js +34 -31
  471. package/build-module/components/template-actions/index.js.map +1 -0
  472. package/build-module/components/{list/actions → template-actions}/rename-menu-item.js +4 -5
  473. package/build-module/components/template-actions/rename-menu-item.js.map +1 -0
  474. package/build-module/components/template-part-converter/convert-to-regular.js +4 -5
  475. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  476. package/build-module/components/template-part-converter/convert-to-template-part.js +8 -10
  477. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  478. package/build-module/components/template-part-converter/index.js +12 -18
  479. package/build-module/components/template-part-converter/index.js.map +1 -1
  480. package/build-module/components/welcome-guide/image.js +4 -5
  481. package/build-module/components/welcome-guide/image.js.map +1 -1
  482. package/build-module/hooks/commands/use-edit-mode-commands.js +6 -8
  483. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  484. package/build-module/hooks/push-changes-to-global-styles/index.js +11 -8
  485. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  486. package/build-module/hooks/template-part-edit.js +5 -6
  487. package/build-module/hooks/template-part-edit.js.map +1 -1
  488. package/build-module/index.js +3 -6
  489. package/build-module/index.js.map +1 -1
  490. package/build-module/store/actions.js +125 -126
  491. package/build-module/store/actions.js.map +1 -1
  492. package/build-module/store/private-actions.js +7 -10
  493. package/build-module/store/private-actions.js.map +1 -1
  494. package/build-module/store/reducer.js +30 -33
  495. package/build-module/store/reducer.js.map +1 -1
  496. package/build-module/store/selectors.js +31 -11
  497. package/build-module/store/selectors.js.map +1 -1
  498. package/build-module/store/utils.js +1 -3
  499. package/build-module/store/utils.js.map +1 -1
  500. package/build-module/utils/get-is-list-page.js +3 -4
  501. package/build-module/utils/get-is-list-page.js.map +1 -1
  502. package/build-module/utils/is-previewing-theme.js +1 -3
  503. package/build-module/utils/is-previewing-theme.js.map +1 -1
  504. package/build-module/utils/is-template-revertable.js +1 -1
  505. package/build-module/utils/is-template-revertable.js.map +1 -1
  506. package/build-style/style-rtl.css +281 -59
  507. package/build-style/style.css +281 -59
  508. package/package.json +39 -36
  509. package/src/components/add-new-page/index.js +105 -0
  510. package/src/components/add-new-template/new-template.js +2 -1
  511. package/src/components/block-editor/index.js +25 -14
  512. package/src/components/editor/index.js +14 -8
  513. package/src/components/editor/style.scss +6 -11
  514. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +7 -5
  515. package/src/components/global-styles/ui.js +28 -0
  516. package/src/components/header-edit-mode/document-actions/index.js +126 -32
  517. package/src/components/header-edit-mode/document-actions/style.scss +64 -9
  518. package/src/components/header-edit-mode/tools-more-menu-group/index.js +1 -6
  519. package/src/components/layout/index.js +3 -9
  520. package/src/components/list/table.js +6 -2
  521. package/src/components/page-actions/delete-page-menu-item.js +71 -0
  522. package/src/components/page-actions/index.js +36 -0
  523. package/src/components/page-content-lock/constants.js +5 -0
  524. package/src/components/page-content-lock/index.js +14 -0
  525. package/src/components/page-content-lock/use-disable-non-content-blocks.js +44 -0
  526. package/src/components/page-content-lock/use-page-content-lock-notifications.js +128 -0
  527. package/src/components/resizable-frame/index.js +15 -5
  528. package/src/components/resizable-frame/style.scss +20 -18
  529. package/src/components/revisions/index.js +6 -7
  530. package/src/components/save-button/index.js +6 -0
  531. package/src/components/save-hub/index.js +143 -38
  532. package/src/components/save-hub/style.scss +6 -0
  533. package/src/components/save-panel/index.js +62 -15
  534. package/src/components/secondary-sidebar/list-view-sidebar.js +8 -1
  535. package/src/components/sidebar/index.js +6 -4
  536. package/src/components/sidebar/style.scss +3 -4
  537. package/src/components/sidebar-edit-mode/index.js +16 -14
  538. package/src/components/sidebar-edit-mode/page-panels/content-blocks-list.js +77 -0
  539. package/src/components/sidebar-edit-mode/page-panels/index.js +89 -0
  540. package/src/components/sidebar-edit-mode/page-panels/style.scss +10 -0
  541. package/src/components/sidebar-edit-mode/settings-header/index.js +51 -28
  542. package/src/components/sidebar-edit-mode/sidebar-card/index.js +34 -0
  543. package/src/components/sidebar-edit-mode/sidebar-card/style.scss +34 -0
  544. package/src/components/sidebar-edit-mode/{template-card → template-panel}/index.js +22 -19
  545. package/src/components/sidebar-edit-mode/{template-card → template-panel}/style.scss +2 -32
  546. package/src/components/sidebar-navigation-screen/index.js +74 -50
  547. package/src/components/sidebar-navigation-screen/style.scss +45 -4
  548. package/src/components/sidebar-navigation-screen-global-styles/index.js +118 -12
  549. package/src/components/sidebar-navigation-screen-global-styles/style.scss +15 -0
  550. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +1 -1
  551. package/src/components/sidebar-navigation-screen-page/index.js +137 -24
  552. package/src/components/sidebar-navigation-screen-page/page-details.js +163 -0
  553. package/src/components/sidebar-navigation-screen-page/status-label.js +101 -0
  554. package/src/components/sidebar-navigation-screen-page/style.scss +80 -0
  555. package/src/components/sidebar-navigation-screen-pages/index.js +180 -44
  556. package/src/components/sidebar-navigation-screen-template/index.js +25 -22
  557. package/src/components/sidebar-navigation-screen-template-part/index.js +103 -0
  558. package/src/components/sidebar-navigation-screen-templates/index.js +1 -1
  559. package/src/components/sidebar-navigation-subtitle/style.scss +2 -2
  560. package/src/components/site-hub/index.js +21 -6
  561. package/src/components/site-hub/style.scss +26 -0
  562. package/src/components/{list/actions → template-actions}/index.js +19 -6
  563. package/src/hooks/push-changes-to-global-styles/index.js +13 -7
  564. package/src/store/actions.js +20 -1
  565. package/src/store/reducer.js +20 -0
  566. package/src/store/selectors.js +24 -0
  567. package/src/store/test/actions.js +31 -0
  568. package/src/store/test/reducer.js +44 -0
  569. package/src/store/test/selectors.js +57 -0
  570. package/src/style.scss +5 -2
  571. package/src/utils/is-previewing-theme.js +1 -4
  572. package/build/components/list/actions/index.js.map +0 -1
  573. package/build/components/list/actions/rename-menu-item.js.map +0 -1
  574. package/build/components/sidebar-edit-mode/template-card/index.js.map +0 -1
  575. package/build/components/sidebar-edit-mode/template-card/template-actions.js.map +0 -1
  576. package/build/components/sidebar-edit-mode/template-card/template-areas.js.map +0 -1
  577. package/build/components/sidebar-edit-mode/template-revisions/index.js.map +0 -1
  578. package/build-module/components/list/actions/index.js.map +0 -1
  579. package/build-module/components/list/actions/rename-menu-item.js.map +0 -1
  580. package/build-module/components/sidebar-edit-mode/template-card/index.js.map +0 -1
  581. package/build-module/components/sidebar-edit-mode/template-card/template-actions.js.map +0 -1
  582. package/build-module/components/sidebar-edit-mode/template-card/template-areas.js.map +0 -1
  583. package/src/components/sidebar-navigation-screen-pages/style.scss +0 -4
  584. /package/src/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +0 -0
  585. /package/src/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +0 -0
  586. /package/src/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +0 -0
  587. /package/src/components/{list/actions → template-actions}/rename-menu-item.js +0 -0
@@ -11,10 +11,7 @@ import { combineReducers } from '@wordpress/data';
11
11
  * @return {Object} Updated state.
12
12
  */
13
13
 
14
- export function deviceType() {
15
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Desktop';
16
- let action = arguments.length > 1 ? arguments[1] : undefined;
17
-
14
+ export function deviceType(state = 'Desktop', action) {
18
15
  switch (action.type) {
19
16
  case 'SET_PREVIEW_DEVICE_TYPE':
20
17
  return action.deviceType;
@@ -31,10 +28,7 @@ export function deviceType() {
31
28
  * @return {Object} Updated state.
32
29
  */
33
30
 
34
- export function settings() {
35
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
36
- let action = arguments.length > 1 ? arguments[1] : undefined;
37
-
31
+ export function settings(state = {}, action) {
38
32
  switch (action.type) {
39
33
  case 'UPDATE_SETTINGS':
40
34
  return { ...state,
@@ -54,10 +48,7 @@ export function settings() {
54
48
  * @return {Object} Updated state.
55
49
  */
56
50
 
57
- export function editedPost() {
58
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
59
- let action = arguments.length > 1 ? arguments[1] : undefined;
60
-
51
+ export function editedPost(state = {}, action) {
61
52
  switch (action.type) {
62
53
  case 'SET_EDITED_POST':
63
54
  return {
@@ -84,10 +75,7 @@ export function editedPost() {
84
75
  * @param {Object} action Dispatched action.
85
76
  */
86
77
 
87
- export function blockInserterPanel() {
88
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
89
- let action = arguments.length > 1 ? arguments[1] : undefined;
90
-
78
+ export function blockInserterPanel(state = false, action) {
91
79
  switch (action.type) {
92
80
  case 'SET_IS_LIST_VIEW_OPENED':
93
81
  return action.isOpen ? false : state;
@@ -111,10 +99,7 @@ export function blockInserterPanel() {
111
99
  * @param {Object} action Dispatched action.
112
100
  */
113
101
 
114
- export function listViewPanel() {
115
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
116
- let action = arguments.length > 1 ? arguments[1] : undefined;
117
-
102
+ export function listViewPanel(state = false, action) {
118
103
  switch (action.type) {
119
104
  case 'SET_IS_INSERTER_OPENED':
120
105
  return action.value ? false : state;
@@ -135,10 +120,7 @@ export function listViewPanel() {
135
120
  * @param {Object} action Dispatched action.
136
121
  */
137
122
 
138
- export function saveViewPanel() {
139
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
140
- let action = arguments.length > 1 ? arguments[1] : undefined;
141
-
123
+ export function saveViewPanel(state = false, action) {
142
124
  switch (action.type) {
143
125
  case 'SET_IS_SAVE_VIEW_OPENED':
144
126
  return action.isOpen;
@@ -156,10 +138,7 @@ export function saveViewPanel() {
156
138
  * @param {Object} action Dispatched action.
157
139
  */
158
140
 
159
- function canvasMode() {
160
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'init';
161
- let action = arguments.length > 1 ? arguments[1] : undefined;
162
-
141
+ function canvasMode(state = 'init', action) {
163
142
  switch (action.type) {
164
143
  case 'SET_CANVAS_MODE':
165
144
  return action.mode;
@@ -177,10 +156,7 @@ function canvasMode() {
177
156
  */
178
157
 
179
158
 
180
- function editorCanvasContainerView() {
181
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
182
- let action = arguments.length > 1 ? arguments[1] : undefined;
183
-
159
+ function editorCanvasContainerView(state = undefined, action) {
184
160
  switch (action.type) {
185
161
  case 'SET_EDITOR_CANVAS_CONTAINER_VIEW':
186
162
  return action.view;
@@ -188,7 +164,27 @@ function editorCanvasContainerView() {
188
164
 
189
165
  return state;
190
166
  }
167
+ /**
168
+ * Reducer used to track whether the page content is locked.
169
+ *
170
+ * @param {boolean} state Current state.
171
+ * @param {Object} action Dispatched action.
172
+ *
173
+ * @return {boolean} Updated state.
174
+ */
175
+
176
+
177
+ export function hasPageContentLock(state = false, action) {
178
+ switch (action.type) {
179
+ case 'SET_EDITED_POST':
180
+ return !!action.context?.postId;
181
+
182
+ case 'SET_HAS_PAGE_CONTENT_LOCK':
183
+ return action.hasPageContentLock;
184
+ }
191
185
 
186
+ return state;
187
+ }
192
188
  export default combineReducers({
193
189
  deviceType,
194
190
  settings,
@@ -197,6 +193,7 @@ export default combineReducers({
197
193
  listViewPanel,
198
194
  saveViewPanel,
199
195
  canvasMode,
200
- editorCanvasContainerView
196
+ editorCanvasContainerView,
197
+ hasPageContentLock
201
198
  });
202
199
  //# sourceMappingURL=reducer.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/store/reducer.js"],"names":["combineReducers","deviceType","state","action","type","settings","editedPost","postType","id","context","blockInserterPanel","isOpen","value","listViewPanel","saveViewPanel","canvasMode","mode","editorCanvasContainerView","undefined","view"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAT,QAAgC,iBAAhC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,UAAT,GAAiD;AAAA,MAA5BC,KAA4B,uEAApB,SAAoB;AAAA,MAATC,MAAS;;AACvD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,yBAAL;AACC,aAAOD,MAAM,CAACF,UAAd;AAFF;;AAKA,SAAOC,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,QAAT,GAAwC;AAAA,MAArBH,KAAqB,uEAAb,EAAa;AAAA,MAATC,MAAS;;AAC9C,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,iBAAL;AACC,aAAO,EACN,GAAGF,KADG;AAEN,WAAGC,MAAM,CAACE;AAFJ,OAAP;AAFF;;AAQA,SAAOH,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASI,UAAT,GAA0C;AAAA,MAArBJ,KAAqB,uEAAb,EAAa;AAAA,MAATC,MAAS;;AAChD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,iBAAL;AACC,aAAO;AACNG,QAAAA,QAAQ,EAAEJ,MAAM,CAACI,QADX;AAENC,QAAAA,EAAE,EAAEL,MAAM,CAACK,EAFL;AAGNC,QAAAA,OAAO,EAAEN,MAAM,CAACM;AAHV,OAAP;;AAKD,SAAK,yBAAL;AACC,aAAO,EACN,GAAGP,KADG;AAENO,QAAAA,OAAO,EAAEN,MAAM,CA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SAAOd,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASe,yBAAT,GAAgE;AAAA,MAA5Bf,KAA4B,uEAApBgB,SAAoB;AAAA,MAATf,MAAS;;AAC/D,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,kCAAL;AACC,aAAOD,MAAM,CAACgB,IAAd;AAFF;;AAKA,SAAOjB,KAAP;AACA;;AAED,eAAeF,eAAe,CAAE;AAC/BC,EAAAA,UAD+B;AAE/BI,EAAAA,QAF+B;AAG/BC,EAAAA,UAH+B;AAI/BI,EAAAA,kBAJ+B;AAK/BG,EAAAA,aAL+B;AAM/BC,EAAAA,aAN+B;AAO/BC,EAAAA,UAP+B;AAQ/BE,EAAAA;AAR+B,CAAF,CAA9B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning the editing canvas device type.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function deviceType( state = 'Desktop', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_PREVIEW_DEVICE_TYPE':\n\t\t\treturn action.deviceType;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the settings.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function settings( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the currently edited Post Type,\n * Post Id and the context provided to fill the content of the block editor.\n *\n * @param {Object} state Current edited post.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editedPost( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITED_POST':\n\t\t\treturn {\n\t\t\t\tpostType: action.postType,\n\t\t\t\tid: action.id,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t\tcase 'SET_EDITED_POST_CONTEXT':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the navigation and list view panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {boolean|Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the navigation and inserter panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the save view panel open or closed.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function saveViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_SAVE_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas mode (edit or view).\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction canvasMode( state = 'init', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn action.mode;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas container view.\n * Default is `undefined`, denoting the default, visual block editor.\n * This could be, for example, `'style-book'` (the style book).\n *\n * @param {string|undefined} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction editorCanvasContainerView( state = undefined, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITOR_CANVAS_CONTAINER_VIEW':\n\t\t\treturn action.view;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tdeviceType,\n\tsettings,\n\teditedPost,\n\tblockInserterPanel,\n\tlistViewPanel,\n\tsaveViewPanel,\n\tcanvasMode,\n\teditorCanvasContainerView,\n} );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/store/reducer.js"],"names":["combineReducers","deviceType","state","action","type","settings","editedPost","postType","id","context","blockInserterPanel","isOpen","value","listViewPanel","saveViewPanel","canvasMode","mode","editorCanvasContainerView","undefined","view","hasPageContentLock","postId"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAT,QAAgC,iBAAhC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,UAAT,CAAqBC,KAAK,GAAG,SAA7B,EAAwCC,MAAxC,EAAiD;AACvD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,yBAAL;AACC,aAAOD,MAAM,CAACF,UAAd;AAFF;;AAKA,SAAOC,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,QAAT,CAAmBH,KAAK,GAAG,EAA3B,EAA+BC,MAA/B,EAAwC;AAC9C,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,iBAAL;AACC,aAAO,EACN,GAAGF,KADG;AAEN,WAAGC,MAAM,CAACE;AAFJ,OAAP;AAFF;;AAQA,SAAOH,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;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C,SAAK,yBAAL;AACC,aAAOD,MAAM,CAACQ,MAAd;;AACD,SAAK,iBAAL;AACC,aAAO,KAAP;AAJF;;AAMA,SAAOT,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;AACA,SAASa,UAAT,CAAqBb,KAAK,GAAG,MAA7B,EAAqCC,MAArC,EAA8C;AAC7C,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,iBAAL;AACC,aAAOD,MAAM,CAACa,IAAd;AAFF;;AAKA,SAAOd,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASe,yBAAT,CAAoCf,KAAK,GAAGgB,SAA5C,EAAuDf,MAAvD,EAAgE;AAC/D,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,kCAAL;AACC,aAAOD,MAAM,CAACgB,IAAd;AAFF;;AAKA,SAAOjB,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,SAASkB,kBAAT,CAA6BlB,KAAK,GAAG,KAArC,EAA4CC,MAA5C,EAAqD;AAC3D,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,iBAAL;AACC,aAAO,CAAC,CAAED,MAAM,CAACM,OAAP,EAAgBY,MAA1B;;AACD,SAAK,2BAAL;AACC,aAAOlB,MAAM,CAACiB,kBAAd;AAJF;;AAOA,SAAOlB,KAAP;AACA;AAED,eAAeF,eAAe,CAAE;AAC/BC,EAAAA,UAD+B;AAE/BI,EAAAA,QAF+B;AAG/BC,EAAAA,UAH+B;AAI/BI,EAAAA,kBAJ+B;AAK/BG,EAAAA,aAL+B;AAM/BC,EAAAA,aAN+B;AAO/BC,EAAAA,UAP+B;AAQ/BE,EAAAA,yBAR+B;AAS/BG,EAAAA;AAT+B,CAAF,CAA9B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning the editing canvas device type.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function deviceType( state = 'Desktop', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_PREVIEW_DEVICE_TYPE':\n\t\t\treturn action.deviceType;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the settings.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function settings( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the currently edited Post Type,\n * Post Id and the context provided to fill the content of the block editor.\n *\n * @param {Object} state Current edited post.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editedPost( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITED_POST':\n\t\t\treturn {\n\t\t\t\tpostType: action.postType,\n\t\t\t\tid: action.id,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t\tcase 'SET_EDITED_POST_CONTEXT':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the navigation and list view panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {boolean|Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the navigation and inserter panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the save view panel open or closed.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function saveViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_SAVE_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas mode (edit or view).\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction canvasMode( state = 'init', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn action.mode;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas container view.\n * Default is `undefined`, denoting the default, visual block editor.\n * This could be, for example, `'style-book'` (the style book).\n *\n * @param {string|undefined} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction editorCanvasContainerView( state = undefined, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITOR_CANVAS_CONTAINER_VIEW':\n\t\t\treturn action.view;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track whether the page content is locked.\n *\n * @param {boolean} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {boolean} Updated state.\n */\nexport function hasPageContentLock( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITED_POST':\n\t\t\treturn !! action.context?.postId;\n\t\tcase 'SET_HAS_PAGE_CONTENT_LOCK':\n\t\t\treturn action.hasPageContentLock;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tdeviceType,\n\tsettings,\n\teditedPost,\n\tblockInserterPanel,\n\tlistViewPanel,\n\tsaveViewPanel,\n\tcanvasMode,\n\teditorCanvasContainerView,\n\thasPageContentLock,\n} );\n"]}
@@ -109,19 +109,15 @@ export const getSettings = createSelector((state, setIsInserterOpen) => {
109
109
  return settings;
110
110
  }
111
111
 
112
- settings.mediaUpload = _ref => {
113
- let {
114
- onError,
115
- ...rest
116
- } = _ref;
112
+ settings.mediaUpload = ({
113
+ onError,
114
+ ...rest
115
+ }) => {
117
116
  uploadMedia({
118
117
  wpAllowedMimeTypes: state.settings.allowedMimeTypes,
119
- onError: _ref2 => {
120
- let {
121
- message
122
- } = _ref2;
123
- return onError(message);
124
- },
118
+ onError: ({
119
+ message
120
+ }) => onError(message),
125
121
  ...rest
126
122
  });
127
123
  };
@@ -296,4 +292,28 @@ export function isNavigationOpened() {
296
292
  version: '6.4'
297
293
  });
298
294
  }
295
+ /**
296
+ * Whether or not the editor has a page loaded into it.
297
+ *
298
+ * @see setPage
299
+ *
300
+ * @param {Object} state Global application state.
301
+ *
302
+ * @return {boolean} Whether or not the editor has a page loaded into it.
303
+ */
304
+
305
+ export function isPage(state) {
306
+ return !!state.editedPost.context?.postId;
307
+ }
308
+ /**
309
+ * Whether or not the editor is locked so that only page content can be edited.
310
+ *
311
+ * @param {Object} state Global application state.
312
+ *
313
+ * @return {boolean} Whether or not the editor is locked.
314
+ */
315
+
316
+ export function hasPageContentLock(state) {
317
+ return isPage(state) ? state.hasPageContentLock : false;
318
+ }
299
319
  //# sourceMappingURL=selectors.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/store/selectors.js"],"names":["createSelector","store","coreDataStore","createRegistrySelector","deprecated","uploadMedia","Platform","preferencesStore","getFilteredTemplatePartBlocks","__unstableGetPreference","select","state","name","get","isFeatureActive","featureName","since","alternative","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","canUser","getReusableBlocks","isWeb","OS","getEntityRecords","per_page","getSettings","setIsInserterOpen","settings","outlineMode","focusMode","hasFixedToolbar","keepCaretInsideBlock","showIconLabels","__experimentalSetIsInserterOpened","__experimentalReusableBlocks","__experimentalPreferPatternsOnRoot","getEditedPostType","canUserCreateMedia","mediaUpload","onError","rest","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","version","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","isListViewOpened","listViewPanel","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateType","templateId","template","getEditedEntityRecord","templateParts","blocks","getEditorMode","getCurrentTemplateNavigationPanelSubMenu","getNavigationPanelActiveMenu","isNavigationOpened"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAP,MAA2B,QAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;AACA,SAASC,sBAAT,QAAuC,iBAAvC;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,WAAT,QAA4B,wBAA5B;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASL,KAAK,IAAIM,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,SAASC,6BAAT,QAA8C,SAA9C;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,uBAAuB,GAAGN,sBAAsB,CAC1DO,MAAF,IAAc,CAAEC,KAAF,EAASC,IAAT,KACbF,MAAM,CAAEH,gBAAF,CAAN,CAA2BM,GAA3B,CAAgC,gBAAhC,EAAkDD,IAAlD,CAF2D,CAAtD;AAKP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,eAAT,CAA0BH,KAA1B,EAAiCI,WAAjC,EAA+C;AACrDX,EAAAA,UAAU,CAAG,4CAAH,EA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AAF+D,GAA/D,CAAV;AAIA;AAED;AACA;AACA;;AACA,OAAO,SAAS4B,kBAAT,GAA8B;AACpCvE,EAAAA,UAAU,CAAE,iDAAF,EAAqD;AAC9DY,IAAAA,KAAK,EAAE,KADuD;AAE9D+B,IAAAA,OAAO,EAAE;AAFqD,GAArD,CAAV;AAIA","sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { Platform } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { getFilteredTemplatePartBlocks } from './utils';\n\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\n */\n\n/**\n * Helper for getting a preference from the preferences store.\n *\n * This is only present so that `getSettings` doesn't need to be made a\n * registry selector.\n *\n * It's unstable because the selector needs to be exported and so part of the\n * public API to work.\n */\nexport const __unstableGetPreference = createRegistrySelector(\n\t( select ) => ( state, name ) =>\n\t\tselect( preferencesStore ).get( 'core/edit-site', name )\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @deprecated\n * @param {Object} state Global application state.\n * @param {string} featureName Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport function isFeatureActive( state, featureName ) {\n\tdeprecated( `select( 'core/edit-site' ).isFeatureActive`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\treturn !! __unstableGetPreference( state, featureName );\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns whether the current user can create media or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Whether the current user can create media or not.\n */\nexport const getCanUserCreateMedia = createRegistrySelector(\n\t( select ) => () => select( coreDataStore ).canUser( 'create', 'media' )\n);\n\n/**\n * Returns any available Reusable blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} The available reusable blocks.\n */\nexport const getReusableBlocks = createRegistrySelector( ( select ) => () => {\n\tconst isWeb = Platform.OS === 'web';\n\treturn isWeb\n\t\t? select( coreDataStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\tper_page: -1,\n\t\t } )\n\t\t: [];\n} );\n\n/**\n * Returns the settings, taking into account active features and permissions.\n *\n * @param {Object} state Global application state.\n * @param {Function} setIsInserterOpen Setter for the open state of the global inserter.\n *\n * @return {Object} Settings.\n */\nexport const getSettings = createSelector(\n\t( state, setIsInserterOpen ) => {\n\t\tconst settings = {\n\t\t\t...state.settings,\n\t\t\toutlineMode: true,\n\t\t\tfocusMode: !! __unstableGetPreference( state, 'focusMode' ),\n\t\t\thasFixedToolbar: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tshowIconLabels: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpen,\n\t\t\t__experimentalReusableBlocks: getReusableBlocks( state ),\n\t\t\t__experimentalPreferPatternsOnRoot:\n\t\t\t\t'wp_template' === getEditedPostType( state ),\n\t\t};\n\n\t\tconst canUserCreateMedia = getCanUserCreateMedia( state );\n\t\tif ( ! canUserCreateMedia ) {\n\t\t\treturn settings;\n\t\t}\n\n\t\tsettings.mediaUpload = ( { onError, ...rest } ) => {\n\t\t\tuploadMedia( {\n\t\t\t\twpAllowedMimeTypes: state.settings.allowedMimeTypes,\n\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t};\n\t\treturn settings;\n\t},\n\t( state ) => [\n\t\tgetCanUserCreateMedia( state ),\n\t\tstate.settings,\n\t\t__unstableGetPreference( state, 'focusMode' ),\n\t\t__unstableGetPreference( state, 'fixedToolbar' ),\n\t\t__unstableGetPreference( state, 'keepCaretInsideBlock' ),\n\t\t__unstableGetPreference( state, 'showIconLabels' ),\n\t\tgetReusableBlocks( state ),\n\t\tgetEditedPostType( state ),\n\t]\n);\n\n/**\n * @deprecated\n */\nexport function getHomeTemplateId() {\n\tdeprecated( \"select( 'core/edit-site' ).getHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Returns the current edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getEditedPostType( state ) {\n\treturn state.editedPost.postType;\n}\n\n/**\n * Returns the ID of the currently edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn state.editedPost.id;\n}\n\n/**\n * Returns the edited post's context object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getEditedPostContext( state ) {\n\treturn state.editedPost.context;\n}\n\n/**\n * Returns the current page object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getPage( state ) {\n\treturn { context: state.editedPost.context };\n}\n\n/**\n * Returns the current opened/closed state of the inserter panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the inserter panel should be open; false if closed.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport function __experimentalGetInsertionPoint( state ) {\n\tconst { rootClientId, insertionIndex, filterValue } =\n\t\tstate.blockInserterPanel;\n\treturn { rootClientId, insertionIndex, filterValue };\n}\n\n/**\n * Returns the current opened/closed state of the list view panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the list view panel should be open; false if closed.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns the current opened/closed state of the save panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the save panel should be open; false if closed.\n */\nexport function isSaveViewOpened( state ) {\n\treturn state.saveViewPanel;\n}\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateType = getEditedPostType( state );\n\t\tconst templateId = getEditedPostId( state );\n\t\tconst template = select( coreDataStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\ttemplateType,\n\t\t\ttemplateId\n\t\t);\n\n\t\tconst templateParts = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\t'wp_template_part',\n\t\t\t{ per_page: -1 }\n\t\t);\n\n\t\treturn getFilteredTemplatePartBlocks( template.blocks, templateParts );\n\t}\n);\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport function getEditorMode( state ) {\n\treturn __unstableGetPreference( state, 'editorMode' );\n}\n\n/**\n * @deprecated\n */\nexport function getCurrentTemplateNavigationPanelSubMenu() {\n\tdeprecated(\n\t\t\"dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu\",\n\t\t{\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t}\n\t);\n}\n\n/**\n * @deprecated\n */\nexport function getNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * @deprecated\n */\nexport function isNavigationOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).isNavigationOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/store/selectors.js"],"names":["createSelector","store","coreDataStore","createRegistrySelector","deprecated","uploadMedia","Platform","preferencesStore","getFilteredTemplatePartBlocks","__unstableGetPreference","select","state","name","get","isFeatureActive","featureName","since","alternative","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","canUser","getReusableBlocks","isWeb","OS","getEntityRecords","per_page","getSettings","setIsInserterOpen","settings","outlineMode","focusMode","hasFixedToolbar","keepCaretInsideBlock","showIconLabels","__experimentalSetIsInserterOpened","__experimentalReusableBlocks","__experimentalPreferPatternsOnRoot","getEditedPostType","canUserCreateMedia","mediaUpload","onError","rest","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","version","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","isListViewOpened","listViewPanel","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateType","templateId","template","getEditedEntityRecord","templateParts","blocks","getEditorMode","getCurrentTemplateNavigationPanelSubMenu","getNavigationPanelActiveMenu","isNavigationOpened","isPage","postId","hasPageContentLock"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAP,MAA2B,QAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;AACA,SAASC,sBAAT,QAAuC,iBAAvC;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,WAAT,QAA4B,wBAA5B;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASL,KAAK,IAAIM,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,SAASC,6BAAT,QAA8C,SAA9C;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MA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AAoD;AAC1DrE,EAAAA,UAAU,CACT,uEADS,EAET;AACCY,IAAAA,KAAK,EAAE,KADR;AAEC+B,IAAAA,OAAO,EAAE;AAFV,GAFS,CAAV;AAOA;AAED;AACA;AACA;;AACA,OAAO,SAAS2B,4BAAT,GAAwC;AAC9CtE,EAAAA,UAAU,CAAE,2DAAF,EAA+D;AACxEY,IAAAA,KAAK,EAAE,KADiE;AAExE+B,IAAAA,OAAO,EAAE;AAF+D,GAA/D,CAAV;AAIA;AAED;AACA;AACA;;AACA,OAAO,SAAS4B,kBAAT,GAA8B;AACpCvE,EAAAA,UAAU,CAAE,iDAAF,EAAqD;AAC9DY,IAAAA,KAAK,EAAE,KADuD;AAE9D+B,IAAAA,OAAO,EAAE;AAFqD,GAArD,CAAV;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAAS6B,MAAT,CAAiBjE,KAAjB,EAAyB;AAC/B,SAAO,CAAC,CAAEA,KAAK,CAACqC,UAAN,CAAiBK,OAAjB,EAA0BwB,MAApC;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,kBAAT,CAA6BnE,KAA7B,EAAqC;AAC3C,SAAOiE,MAAM,CAAEjE,KAAF,CAAN,GAAkBA,KAAK,CAACmE,kBAAxB,GAA6C,KAApD;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { Platform } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { getFilteredTemplatePartBlocks } from './utils';\n\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\n */\n\n/**\n * Helper for getting a preference from the preferences store.\n *\n * This is only present so that `getSettings` doesn't need to be made a\n * registry selector.\n *\n * It's unstable because the selector needs to be exported and so part of the\n * public API to work.\n */\nexport const __unstableGetPreference = createRegistrySelector(\n\t( select ) => ( state, name ) =>\n\t\tselect( preferencesStore ).get( 'core/edit-site', name )\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @deprecated\n * @param {Object} state Global application state.\n * @param {string} featureName Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport function isFeatureActive( state, featureName ) {\n\tdeprecated( `select( 'core/edit-site' ).isFeatureActive`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\treturn !! __unstableGetPreference( state, featureName );\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns whether the current user can create media or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Whether the current user can create media or not.\n */\nexport const getCanUserCreateMedia = createRegistrySelector(\n\t( select ) => () => select( coreDataStore ).canUser( 'create', 'media' )\n);\n\n/**\n * Returns any available Reusable blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} The available reusable blocks.\n */\nexport const getReusableBlocks = createRegistrySelector( ( select ) => () => {\n\tconst isWeb = Platform.OS === 'web';\n\treturn isWeb\n\t\t? select( coreDataStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\tper_page: -1,\n\t\t } )\n\t\t: [];\n} );\n\n/**\n * Returns the settings, taking into account active features and permissions.\n *\n * @param {Object} state Global application state.\n * @param {Function} setIsInserterOpen Setter for the open state of the global inserter.\n *\n * @return {Object} Settings.\n */\nexport const getSettings = createSelector(\n\t( state, setIsInserterOpen ) => {\n\t\tconst settings = {\n\t\t\t...state.settings,\n\t\t\toutlineMode: true,\n\t\t\tfocusMode: !! __unstableGetPreference( state, 'focusMode' ),\n\t\t\thasFixedToolbar: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tshowIconLabels: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpen,\n\t\t\t__experimentalReusableBlocks: getReusableBlocks( state ),\n\t\t\t__experimentalPreferPatternsOnRoot:\n\t\t\t\t'wp_template' === getEditedPostType( state ),\n\t\t};\n\n\t\tconst canUserCreateMedia = getCanUserCreateMedia( state );\n\t\tif ( ! canUserCreateMedia ) {\n\t\t\treturn settings;\n\t\t}\n\n\t\tsettings.mediaUpload = ( { onError, ...rest } ) => {\n\t\t\tuploadMedia( {\n\t\t\t\twpAllowedMimeTypes: state.settings.allowedMimeTypes,\n\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t};\n\t\treturn settings;\n\t},\n\t( state ) => [\n\t\tgetCanUserCreateMedia( state ),\n\t\tstate.settings,\n\t\t__unstableGetPreference( state, 'focusMode' ),\n\t\t__unstableGetPreference( state, 'fixedToolbar' ),\n\t\t__unstableGetPreference( state, 'keepCaretInsideBlock' ),\n\t\t__unstableGetPreference( state, 'showIconLabels' ),\n\t\tgetReusableBlocks( state ),\n\t\tgetEditedPostType( state ),\n\t]\n);\n\n/**\n * @deprecated\n */\nexport function getHomeTemplateId() {\n\tdeprecated( \"select( 'core/edit-site' ).getHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Returns the current edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getEditedPostType( state ) {\n\treturn state.editedPost.postType;\n}\n\n/**\n * Returns the ID of the currently edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn state.editedPost.id;\n}\n\n/**\n * Returns the edited post's context object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getEditedPostContext( state ) {\n\treturn state.editedPost.context;\n}\n\n/**\n * Returns the current page object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getPage( state ) {\n\treturn { context: state.editedPost.context };\n}\n\n/**\n * Returns the current opened/closed state of the inserter panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the inserter panel should be open; false if closed.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport function __experimentalGetInsertionPoint( state ) {\n\tconst { rootClientId, insertionIndex, filterValue } =\n\t\tstate.blockInserterPanel;\n\treturn { rootClientId, insertionIndex, filterValue };\n}\n\n/**\n * Returns the current opened/closed state of the list view panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the list view panel should be open; false if closed.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns the current opened/closed state of the save panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the save panel should be open; false if closed.\n */\nexport function isSaveViewOpened( state ) {\n\treturn state.saveViewPanel;\n}\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateType = getEditedPostType( state );\n\t\tconst templateId = getEditedPostId( state );\n\t\tconst template = select( coreDataStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\ttemplateType,\n\t\t\ttemplateId\n\t\t);\n\n\t\tconst templateParts = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\t'wp_template_part',\n\t\t\t{ per_page: -1 }\n\t\t);\n\n\t\treturn getFilteredTemplatePartBlocks( template.blocks, templateParts );\n\t}\n);\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport function getEditorMode( state ) {\n\treturn __unstableGetPreference( state, 'editorMode' );\n}\n\n/**\n * @deprecated\n */\nexport function getCurrentTemplateNavigationPanelSubMenu() {\n\tdeprecated(\n\t\t\"dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu\",\n\t\t{\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t}\n\t);\n}\n\n/**\n * @deprecated\n */\nexport function getNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * @deprecated\n */\nexport function isNavigationOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).isNavigationOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Whether or not the editor has a page loaded into it.\n *\n * @see setPage\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not the editor has a page loaded into it.\n */\nexport function isPage( state ) {\n\treturn !! state.editedPost.context?.postId;\n}\n\n/**\n * Whether or not the editor is locked so that only page content can be edited.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not the editor is locked.\n */\nexport function hasPageContentLock( state ) {\n\treturn isPage( state ) ? state.hasPageContentLock : false;\n}\n"]}
@@ -19,9 +19,7 @@ const EMPTY_ARRAY = [];
19
19
  * @return {Array} An array of template parts and their blocks.
20
20
  */
21
21
 
22
- function getFilteredTemplatePartBlocks() {
23
- let blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : EMPTY_ARRAY;
24
- let templateParts = arguments.length > 1 ? arguments[1] : undefined;
22
+ function getFilteredTemplatePartBlocks(blocks = EMPTY_ARRAY, templateParts) {
25
23
  const templatePartsById = templateParts ? // Key template parts by their ID.
26
24
  templateParts.reduce((newTemplateParts, part) => ({ ...newTemplateParts,
27
25
  [part.id]: part
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/store/utils.js"],"names":["memoize","isTemplatePart","EMPTY_ARRAY","getFilteredTemplatePartBlocks","blocks","templateParts","templatePartsById","reduce","newTemplateParts","part","id","result","stack","length","innerBlocks","block","shift","unshift","attributes","theme","slug","templatePartId","templatePart","push","memoizedGetFilteredTemplatePartBlocks"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,OAAP,MAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,cAAT,QAA+B,mBAA/B;AAEA,MAAMC,WAAW,GAAG,EAApB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,6BAAT,GAA8E;AAAA,MAAtCC,MAAsC,uEAA7BF,WAA6B;AAAA,MAAhBG,aAAgB;AAC7E,QAAMC,iBAAiB,GAAGD,aAAa,GACpC;AACAA,EAAAA,aAAa,CAACE,MAAd,CACA,CAAEC,gBAAF,EAAoBC,IAApB,MAAgC,EAC/B,GAAGD,gBAD4B;AAE/B,KAAEC,IAAI,CAACC,EAAP,GAAaD;AAFkB,GAAhC,CADA,EAKA,EALA,CAFoC,GASpC,EATH;AAWA,QAAME,MAAM,GAAG,EAAf,CAZ6E,CAc7E;AACA;;AACA,QAAMC,KAAK,GAAG,CAAE,GAAGR,MAAL,CAAd;;AACA,SAAQQ,KAAK,CAACC,MAAd,EAAuB;AACtB,UAAM;AAAEC,MAAAA,WAAF;AAAe,SAAGC;AAAlB,QAA4BH,KAAK,CAACI,KAAN,EAAlC,CADsB,CAEtB;;AACAJ,IAAAA,KAAK,CAACK,OAAN,CAAe,GAAGH,WAAlB;;AAEA,QAAKb,cAAc,CAAEc,KAAF,CAAnB,EAA+B;AAC9B,YAAM;AACLG,QAAAA,UAAU,EAAE;AAAEC,UAAAA,KAAF;AAASC,UAAAA;AAAT;AADP,UAEFL,KAFJ;AAGA,YAAMM,cAAc,GAAI,GAAGF,KAAO,KAAKC,IAAM,EAA7C;AACA,YAAME,YAAY,GAAGhB,iBAAiB,CAAEe,cAAF,CAAtC,CAL8B,CAO9B;;AACA,UAAKC,YAAL,EAAoB;AACnBX,QAAAA,MAAM,CAACY,IAAP,CAAa;AACZD,UAAAA,YADY;AAEZP,UAAAA;AAFY,SAAb;AAIA;AACD;AACD;;AAED,SAAOJ,MAAP;AACA;;AAED,MAAMa,qCAAqC,GAAGxB,OAAO,CACpDG,6BADoD,CAArD;AAIA,SAASqB,qCAAqC,IAAIrB,6BAAlD","sourcesContent":["/**\n * External dependencies\n */\nimport memoize from 'memize';\n\n/**\n * WordPress dependencies\n */\nimport { isTemplatePart } from '@wordpress/blocks';\n\nconst EMPTY_ARRAY = [];\n\n/**\n * Get a flattened and filtered list of template parts and the matching block for that template part.\n *\n * Takes a list of blocks defined within a template, and a list of template parts, and returns a\n * flattened list of template parts and the matching block for that template part.\n *\n * @param {Array} blocks Blocks to flatten.\n * @param {?Array} templateParts Available template parts.\n * @return {Array} An array of template parts and their blocks.\n */\nfunction getFilteredTemplatePartBlocks( blocks = EMPTY_ARRAY, templateParts ) {\n\tconst templatePartsById = templateParts\n\t\t? // Key template parts by their ID.\n\t\t templateParts.reduce(\n\t\t\t\t( newTemplateParts, part ) => ( {\n\t\t\t\t\t...newTemplateParts,\n\t\t\t\t\t[ part.id ]: part,\n\t\t\t\t} ),\n\t\t\t\t{}\n\t\t )\n\t\t: {};\n\n\tconst result = [];\n\n\t// Iterate over all blocks, recursing into inner blocks.\n\t// Output will be based on a depth-first traversal.\n\tconst stack = [ ...blocks ];\n\twhile ( stack.length ) {\n\t\tconst { innerBlocks, ...block } = stack.shift();\n\t\t// Place inner blocks at the beginning of the stack to preserve order.\n\t\tstack.unshift( ...innerBlocks );\n\n\t\tif ( isTemplatePart( block ) ) {\n\t\t\tconst {\n\t\t\t\tattributes: { theme, slug },\n\t\t\t} = block;\n\t\t\tconst templatePartId = `${ theme }//${ slug }`;\n\t\t\tconst templatePart = templatePartsById[ templatePartId ];\n\n\t\t\t// Only add to output if the found template part block is in the list of available template parts.\n\t\t\tif ( templatePart ) {\n\t\t\t\tresult.push( {\n\t\t\t\t\ttemplatePart,\n\t\t\t\t\tblock,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result;\n}\n\nconst memoizedGetFilteredTemplatePartBlocks = memoize(\n\tgetFilteredTemplatePartBlocks\n);\n\nexport { memoizedGetFilteredTemplatePartBlocks as getFilteredTemplatePartBlocks };\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/store/utils.js"],"names":["memoize","isTemplatePart","EMPTY_ARRAY","getFilteredTemplatePartBlocks","blocks","templateParts","templatePartsById","reduce","newTemplateParts","part","id","result","stack","length","innerBlocks","block","shift","unshift","attributes","theme","slug","templatePartId","templatePart","push","memoizedGetFilteredTemplatePartBlocks"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,OAAP,MAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,cAAT,QAA+B,mBAA/B;AAEA,MAAMC,WAAW,GAAG,EAApB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,6BAAT,CAAwCC,MAAM,GAAGF,WAAjD,EAA8DG,aAA9D,EAA8E;AAC7E,QAAMC,iBAAiB,GAAGD,aAAa,GACpC;AACAA,EAAAA,aAAa,CAACE,MAAd,CACA,CAAEC,gBAAF,EAAoBC,IAApB,MAAgC,EAC/B,GAAGD,gBAD4B;AAE/B,KAAEC,IAAI,CAACC,EAAP,GAAaD;AAFkB,GAAhC,CADA,EAKA,EALA,CAFoC,GASpC,EATH;AAWA,QAAME,MAAM,GAAG,EAAf,CAZ6E,CAc7E;AACA;;AACA,QAAMC,KAAK,GAAG,CAAE,GAAGR,MAAL,CAAd;;AACA,SAAQQ,KAAK,CAACC,MAAd,EAAuB;AACtB,UAAM;AAAEC,MAAAA,WAAF;AAAe,SAAGC;AAAlB,QAA4BH,KAAK,CAACI,KAAN,EAAlC,CADsB,CAEtB;;AACAJ,IAAAA,KAAK,CAACK,OAAN,CAAe,GAAGH,WAAlB;;AAEA,QAAKb,cAAc,CAAEc,KAAF,CAAnB,EAA+B;AAC9B,YAAM;AACLG,QAAAA,UAAU,EAAE;AAAEC,UAAAA,KAAF;AAASC,UAAAA;AAAT;AADP,UAEFL,KAFJ;AAGA,YAAMM,cAAc,GAAI,GAAGF,KAAO,KAAKC,IAAM,EAA7C;AACA,YAAME,YAAY,GAAGhB,iBAAiB,CAAEe,cAAF,CAAtC,CAL8B,CAO9B;;AACA,UAAKC,YAAL,EAAoB;AACnBX,QAAAA,MAAM,CAACY,IAAP,CAAa;AACZD,UAAAA,YADY;AAEZP,UAAAA;AAFY,SAAb;AAIA;AACD;AACD;;AAED,SAAOJ,MAAP;AACA;;AAED,MAAMa,qCAAqC,GAAGxB,OAAO,CACpDG,6BADoD,CAArD;AAIA,SAASqB,qCAAqC,IAAIrB,6BAAlD","sourcesContent":["/**\n * External dependencies\n */\nimport memoize from 'memize';\n\n/**\n * WordPress dependencies\n */\nimport { isTemplatePart } from '@wordpress/blocks';\n\nconst EMPTY_ARRAY = [];\n\n/**\n * Get a flattened and filtered list of template parts and the matching block for that template part.\n *\n * Takes a list of blocks defined within a template, and a list of template parts, and returns a\n * flattened list of template parts and the matching block for that template part.\n *\n * @param {Array} blocks Blocks to flatten.\n * @param {?Array} templateParts Available template parts.\n * @return {Array} An array of template parts and their blocks.\n */\nfunction getFilteredTemplatePartBlocks( blocks = EMPTY_ARRAY, templateParts ) {\n\tconst templatePartsById = templateParts\n\t\t? // Key template parts by their ID.\n\t\t templateParts.reduce(\n\t\t\t\t( newTemplateParts, part ) => ( {\n\t\t\t\t\t...newTemplateParts,\n\t\t\t\t\t[ part.id ]: part,\n\t\t\t\t} ),\n\t\t\t\t{}\n\t\t )\n\t\t: {};\n\n\tconst result = [];\n\n\t// Iterate over all blocks, recursing into inner blocks.\n\t// Output will be based on a depth-first traversal.\n\tconst stack = [ ...blocks ];\n\twhile ( stack.length ) {\n\t\tconst { innerBlocks, ...block } = stack.shift();\n\t\t// Place inner blocks at the beginning of the stack to preserve order.\n\t\tstack.unshift( ...innerBlocks );\n\n\t\tif ( isTemplatePart( block ) ) {\n\t\t\tconst {\n\t\t\t\tattributes: { theme, slug },\n\t\t\t} = block;\n\t\t\tconst templatePartId = `${ theme }//${ slug }`;\n\t\t\tconst templatePart = templatePartsById[ templatePartId ];\n\n\t\t\t// Only add to output if the found template part block is in the list of available template parts.\n\t\t\tif ( templatePart ) {\n\t\t\t\tresult.push( {\n\t\t\t\t\ttemplatePart,\n\t\t\t\t\tblock,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result;\n}\n\nconst memoizedGetFilteredTemplatePartBlocks = memoize(\n\tgetFilteredTemplatePartBlocks\n);\n\nexport { memoizedGetFilteredTemplatePartBlocks as getFilteredTemplatePartBlocks };\n"]}
@@ -6,10 +6,9 @@
6
6
  *
7
7
  * @return {boolean} Is list page or not.
8
8
  */
9
- export default function getIsListPage(_ref) {
10
- let {
11
- path
12
- } = _ref;
9
+ export default function getIsListPage({
10
+ path
11
+ }) {
13
12
  return path === '/wp_template/all' || path === '/wp_template_part/all';
14
13
  }
15
14
  //# sourceMappingURL=get-is-list-page.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/utils/get-is-list-page.js"],"names":["getIsListPage","path"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,aAAT,OAAmC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACjD,SAAOA,IAAI,KAAK,kBAAT,IAA+BA,IAAI,KAAK,uBAA/C;AACA","sourcesContent":["/**\n * Returns if the params match the list page route.\n *\n * @param {Object} params The url params.\n * @param {string} params.path The current path.\n *\n * @return {boolean} Is list page or not.\n */\nexport default function getIsListPage( { path } ) {\n\treturn path === '/wp_template/all' || path === '/wp_template_part/all';\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/utils/get-is-list-page.js"],"names":["getIsListPage","path"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,aAAT,CAAwB;AAAEC,EAAAA;AAAF,CAAxB,EAAmC;AACjD,SAAOA,IAAI,KAAK,kBAAT,IAA+BA,IAAI,KAAK,uBAA/C;AACA","sourcesContent":["/**\n * Returns if the params match the list page route.\n *\n * @param {Object} params The url params.\n * @param {string} params.path The current path.\n *\n * @return {boolean} Is list page or not.\n */\nexport default function getIsListPage( { path } ) {\n\treturn path === '/wp_template/all' || path === '/wp_template_part/all';\n}\n"]}
@@ -3,9 +3,7 @@
3
3
  */
4
4
  import { getQueryArg } from '@wordpress/url';
5
5
  export function isPreviewingTheme() {
6
- var _window;
7
-
8
- return ((_window = window) === null || _window === void 0 ? void 0 : _window.__experimentalEnableThemePreviews) && getQueryArg(window.location.href, 'theme_preview') !== undefined;
6
+ return getQueryArg(window.location.href, 'theme_preview') !== undefined;
9
7
  }
10
8
  export function currentlyPreviewingTheme() {
11
9
  if (isPreviewingTheme()) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/utils/is-previewing-theme.js"],"names":["getQueryArg","isPreviewingTheme","window","__experimentalEnableThemePreviews","location","href","undefined","currentlyPreviewingTheme"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,gBAA5B;AAEA,OAAO,SAASC,iBAAT,GAA6B;AAAA;;AACnC,SACC,YAAAC,MAAM,UAAN,0CAAQC,iCAAR,KACAH,WAAW,CAAEE,MAAM,CAACE,QAAP,CAAgBC,IAAlB,EAAwB,eAAxB,CAAX,KAAyDC,SAF1D;AAIA;AAED,OAAO,SAASC,wBAAT,GAAoC;AAC1C,MAAKN,iBAAiB,EAAtB,EAA2B;AAC1B,WAAOD,WAAW,CAAEE,MAAM,CAACE,QAAP,CAAgBC,IAAlB,EAAwB,eAAxB,CAAlB;AACA;;AACD,SAAO,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getQueryArg } from '@wordpress/url';\n\nexport function isPreviewingTheme() {\n\treturn (\n\t\twindow?.__experimentalEnableThemePreviews &&\n\t\tgetQueryArg( window.location.href, 'theme_preview' ) !== undefined\n\t);\n}\n\nexport function currentlyPreviewingTheme() {\n\tif ( isPreviewingTheme() ) {\n\t\treturn getQueryArg( window.location.href, 'theme_preview' );\n\t}\n\treturn null;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/utils/is-previewing-theme.js"],"names":["getQueryArg","isPreviewingTheme","window","location","href","undefined","currentlyPreviewingTheme"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,gBAA5B;AAEA,OAAO,SAASC,iBAAT,GAA6B;AACnC,SAAOD,WAAW,CAAEE,MAAM,CAACC,QAAP,CAAgBC,IAAlB,EAAwB,eAAxB,CAAX,KAAyDC,SAAhE;AACA;AAED,OAAO,SAASC,wBAAT,GAAoC;AAC1C,MAAKL,iBAAiB,EAAtB,EAA2B;AAC1B,WAAOD,WAAW,CAAEE,MAAM,CAACC,QAAP,CAAgBC,IAAlB,EAAwB,eAAxB,CAAlB;AACA;;AACD,SAAO,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getQueryArg } from '@wordpress/url';\n\nexport function isPreviewingTheme() {\n\treturn getQueryArg( window.location.href, 'theme_preview' ) !== undefined;\n}\n\nexport function currentlyPreviewingTheme() {\n\tif ( isPreviewingTheme() ) {\n\t\treturn getQueryArg( window.location.href, 'theme_preview' );\n\t}\n\treturn null;\n}\n"]}
@@ -11,7 +11,7 @@ export default function isTemplateRevertable(template) {
11
11
  /* eslint-disable camelcase */
12
12
 
13
13
 
14
- return (template === null || template === void 0 ? void 0 : template.source) === 'custom' && (template === null || template === void 0 ? void 0 : template.has_theme_file);
14
+ return template?.source === 'custom' && template?.has_theme_file;
15
15
  /* eslint-enable camelcase */
16
16
  }
17
17
  //# sourceMappingURL=is-template-revertable.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/utils/is-template-revertable.js"],"names":["isTemplateRevertable","template","source","has_theme_file"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,oBAAT,CAA+BC,QAA/B,EAA0C;AACxD,MAAK,CAAEA,QAAP,EAAkB;AACjB,WAAO,KAAP;AACA;AACD;;;AACA,SAAO,CAAAA,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAEC,MAAV,MAAqB,QAArB,KAAiCD,QAAjC,aAAiCA,QAAjC,uBAAiCA,QAAQ,CAAEE,cAA3C,CAAP;AACA;AACA","sourcesContent":["/**\n * Check if a template is revertable to its original theme-provided template file.\n *\n * @param {Object} template The template entity to check.\n * @return {boolean} Whether the template is revertable.\n */\nexport default function isTemplateRevertable( template ) {\n\tif ( ! template ) {\n\t\treturn false;\n\t}\n\t/* eslint-disable camelcase */\n\treturn template?.source === 'custom' && template?.has_theme_file;\n\t/* eslint-enable camelcase */\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/utils/is-template-revertable.js"],"names":["isTemplateRevertable","template","source","has_theme_file"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,oBAAT,CAA+BC,QAA/B,EAA0C;AACxD,MAAK,CAAEA,QAAP,EAAkB;AACjB,WAAO,KAAP;AACA;AACD;;;AACA,SAAOA,QAAQ,EAAEC,MAAV,KAAqB,QAArB,IAAiCD,QAAQ,EAAEE,cAAlD;AACA;AACA","sourcesContent":["/**\n * Check if a template is revertable to its original theme-provided template file.\n *\n * @param {Object} template The template entity to check.\n * @return {boolean} Whether the template is revertable.\n */\nexport default function isTemplateRevertable( template ) {\n\tif ( ! template ) {\n\t\treturn false;\n\t}\n\t/* eslint-disable camelcase */\n\treturn template?.source === 'custom' && template?.has_theme_file;\n\t/* eslint-enable camelcase */\n}\n"]}