@wordpress/edit-site 5.18.1-next.5a1d1283.0 → 5.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (687) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-pattern/index.js +65 -4
  3. package/build/components/add-new-pattern/index.js.map +1 -1
  4. package/build/components/add-new-template/index.js +3 -2
  5. package/build/components/add-new-template/index.js.map +1 -1
  6. package/build/components/add-new-template/new-template.js +6 -1
  7. package/build/components/add-new-template/new-template.js.map +1 -1
  8. package/build/components/add-new-template/utils.js +6 -1
  9. package/build/components/add-new-template/utils.js.map +1 -1
  10. package/build/components/app/index.js +2 -7
  11. package/build/components/app/index.js.map +1 -1
  12. package/build/components/block-editor/back-button.js +3 -2
  13. package/build/components/block-editor/back-button.js.map +1 -1
  14. package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js +73 -0
  15. package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +1 -0
  16. package/build/components/block-editor/block-editor-provider/index.js +31 -0
  17. package/build/components/block-editor/block-editor-provider/index.js.map +1 -0
  18. package/build/components/block-editor/{providers → block-editor-provider}/navigation-block-editor-provider.js +2 -1
  19. package/build/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +1 -0
  20. package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js +76 -0
  21. package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +1 -0
  22. package/build/components/block-editor/editor-canvas.js +20 -16
  23. package/build/components/block-editor/editor-canvas.js.map +1 -1
  24. package/build/components/block-editor/index.js +2 -9
  25. package/build/components/block-editor/index.js.map +1 -1
  26. package/build/components/block-editor/site-editor-canvas.js +2 -4
  27. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  28. package/build/components/block-editor/use-site-editor-settings.js +8 -4
  29. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  30. package/build/components/canvas-loader/index.js +18 -1
  31. package/build/components/canvas-loader/index.js.map +1 -1
  32. package/build/components/create-template-part-modal/index.js +8 -12
  33. package/build/components/create-template-part-modal/index.js.map +1 -1
  34. package/build/components/editor/index.js +7 -9
  35. package/build/components/editor/index.js.map +1 -1
  36. package/build/components/global-styles/dimensions-panel.js +5 -4
  37. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  38. package/build/components/global-styles/font-families.js +68 -0
  39. package/build/components/global-styles/font-families.js.map +1 -0
  40. package/build/components/global-styles/font-family-item.js +47 -0
  41. package/build/components/global-styles/font-family-item.js.map +1 -0
  42. package/build/components/global-styles/font-library-modal/collection-font-details.js +49 -0
  43. package/build/components/global-styles/font-library-modal/collection-font-details.js.map +1 -0
  44. package/build/components/global-styles/font-library-modal/collection-font-variant.js +55 -0
  45. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -0
  46. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +31 -0
  47. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -0
  48. package/build/components/global-styles/font-library-modal/context.js +309 -0
  49. package/build/components/global-styles/font-library-modal/context.js.map +1 -0
  50. package/build/components/global-styles/font-library-modal/font-card.js +61 -0
  51. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -0
  52. package/build/components/global-styles/font-library-modal/font-collection.js +172 -0
  53. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -0
  54. package/build/components/global-styles/font-library-modal/font-demo.js +86 -0
  55. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -0
  56. package/build/components/global-styles/font-library-modal/font-variant.js +51 -0
  57. package/build/components/global-styles/font-library-modal/font-variant.js.map +1 -0
  58. package/build/components/global-styles/font-library-modal/fonts-grid.js +54 -0
  59. package/build/components/global-styles/font-library-modal/fonts-grid.js.map +1 -0
  60. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +41 -0
  61. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -0
  62. package/build/components/global-styles/font-library-modal/index.js +65 -0
  63. package/build/components/global-styles/font-library-modal/index.js.map +1 -0
  64. package/build/components/global-styles/font-library-modal/installed-fonts.js +128 -0
  65. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -0
  66. package/build/components/global-styles/font-library-modal/library-font-card.js +39 -0
  67. package/build/components/global-styles/font-library-modal/library-font-card.js.map +1 -0
  68. package/build/components/global-styles/font-library-modal/library-font-details.js +44 -0
  69. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -0
  70. package/build/components/global-styles/font-library-modal/library-font-variant.js +59 -0
  71. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -0
  72. package/build/components/global-styles/font-library-modal/local-fonts.js +143 -0
  73. package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -0
  74. package/build/components/global-styles/font-library-modal/resolvers.js +53 -0
  75. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -0
  76. package/build/components/global-styles/font-library-modal/tab-layout.js +45 -0
  77. package/build/components/global-styles/font-library-modal/tab-layout.js.map +1 -0
  78. package/build/components/global-styles/font-library-modal/utils/constants.js +31 -0
  79. package/build/components/global-styles/font-library-modal/utils/constants.js.map +1 -0
  80. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +21 -0
  81. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -0
  82. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +20 -0
  83. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -0
  84. package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +58 -0
  85. package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +1 -0
  86. package/build/components/global-styles/font-library-modal/utils/index.js +155 -0
  87. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -0
  88. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +22 -0
  89. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -0
  90. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +76 -0
  91. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -0
  92. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +36 -0
  93. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -0
  94. package/build/components/global-styles/font-library-modal/utils/toggleFont.js +92 -0
  95. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -0
  96. package/build/components/global-styles/global-styles-provider.js +7 -12
  97. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  98. package/build/components/global-styles/screen-block.js +34 -21
  99. package/build/components/global-styles/screen-block.js.map +1 -1
  100. package/build/components/global-styles/screen-revisions/index.js +1 -3
  101. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  102. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
  103. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  104. package/build/components/global-styles/screen-typography.js +4 -72
  105. package/build/components/global-styles/screen-typography.js.map +1 -1
  106. package/build/components/global-styles/style-variations-container.js +3 -5
  107. package/build/components/global-styles/style-variations-container.js.map +1 -1
  108. package/build/components/global-styles/typogrphy-elements.js +96 -0
  109. package/build/components/global-styles/typogrphy-elements.js.map +1 -0
  110. package/build/components/header-edit-mode/document-actions/index.js +9 -8
  111. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  112. package/build/components/header-edit-mode/index.js +4 -1
  113. package/build/components/header-edit-mode/index.js.map +1 -1
  114. package/build/components/layout/index.js +5 -1
  115. package/build/components/layout/index.js.map +1 -1
  116. package/build/components/list/added-by.js +13 -8
  117. package/build/components/list/added-by.js.map +1 -1
  118. package/build/components/list/index.js +2 -1
  119. package/build/components/list/index.js.map +1 -1
  120. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +2 -3
  121. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  122. package/build/components/page-patterns/duplicate-menu-item.js +56 -20
  123. package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
  124. package/build/components/page-patterns/grid-item.js +48 -22
  125. package/build/components/page-patterns/grid-item.js.map +1 -1
  126. package/build/components/page-patterns/header.js +3 -7
  127. package/build/components/page-patterns/header.js.map +1 -1
  128. package/build/components/page-patterns/index.js +3 -3
  129. package/build/components/page-patterns/index.js.map +1 -1
  130. package/build/components/page-patterns/patterns-list.js +7 -7
  131. package/build/components/page-patterns/patterns-list.js.map +1 -1
  132. package/build/components/page-patterns/rename-menu-item.js +6 -5
  133. package/build/components/page-patterns/rename-menu-item.js.map +1 -1
  134. package/build/components/page-patterns/search-items.js +8 -2
  135. package/build/components/page-patterns/search-items.js.map +1 -1
  136. package/build/components/page-patterns/use-patterns.js +71 -51
  137. package/build/components/page-patterns/use-patterns.js.map +1 -1
  138. package/build/components/page-patterns/utils.js +1 -20
  139. package/build/components/page-patterns/utils.js.map +1 -1
  140. package/build/components/page-template-parts/add-new-template-part.js +3 -2
  141. package/build/components/page-template-parts/add-new-template-part.js.map +1 -1
  142. package/build/components/page-template-parts/index.js +2 -1
  143. package/build/components/page-template-parts/index.js.map +1 -1
  144. package/build/components/page-templates/index.js +3 -2
  145. package/build/components/page-templates/index.js.map +1 -1
  146. package/build/components/save-hub/index.js +2 -1
  147. package/build/components/save-hub/index.js.map +1 -1
  148. package/build/components/secondary-sidebar/list-view-sidebar.js +24 -17
  149. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  150. package/build/components/sidebar-edit-mode/page-panels/edit-template.js +53 -26
  151. package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
  152. package/build/components/sidebar-edit-mode/page-panels/hooks.js +65 -0
  153. package/build/components/sidebar-edit-mode/page-panels/hooks.js.map +1 -0
  154. package/build/components/sidebar-edit-mode/page-panels/index.js +1 -4
  155. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  156. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +2 -1
  157. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  158. package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js +56 -0
  159. package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -0
  160. package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js +91 -0
  161. package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -0
  162. package/build/components/sidebar-edit-mode/settings-header/index.js +2 -6
  163. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  164. package/build/components/sidebar-edit-mode/template-panel/index.js +11 -9
  165. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  166. package/build/components/sidebar-edit-mode/template-panel/last-revision.js +6 -4
  167. package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -1
  168. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +218 -0
  169. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -0
  170. package/build/components/sidebar-navigation-screen/index.js +6 -4
  171. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  172. package/build/components/sidebar-navigation-screen-details-footer/index.js +32 -4
  173. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  174. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +4 -2
  175. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  176. package/build/components/sidebar-navigation-screen-global-styles/index.js +4 -31
  177. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  178. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +2 -1
  179. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  180. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -1
  181. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  182. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +3 -2
  183. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  184. package/build/components/sidebar-navigation-screen-page/index.js +3 -3
  185. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  186. package/build/components/sidebar-navigation-screen-page/page-details.js +2 -1
  187. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  188. package/build/components/sidebar-navigation-screen-pages/index.js +5 -4
  189. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  190. package/build/components/sidebar-navigation-screen-pattern/index.js +20 -9
  191. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  192. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +3 -2
  193. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  194. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +2 -1
  195. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  196. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +2 -1
  197. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  198. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +41 -11
  199. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  200. package/build/components/sidebar-navigation-screen-patterns/index.js +9 -37
  201. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  202. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +44 -5
  203. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  204. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +7 -2
  205. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  206. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -1
  207. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  208. package/build/components/sidebar-navigation-screen-template/home-template-details.js +2 -1
  209. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  210. package/build/components/sidebar-navigation-screen-template/index.js +2 -2
  211. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  212. package/build/components/sidebar-navigation-screen-templates/index.js +5 -4
  213. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  214. package/build/components/sidebar-navigation-screen-templates-browse/index.js +3 -2
  215. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  216. package/build/components/start-template-options/index.js +20 -2
  217. package/build/components/start-template-options/index.js.map +1 -1
  218. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -4
  219. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  220. package/build/components/sync-state-with-url/use-sync-path-with-url.js +4 -3
  221. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  222. package/build/components/template-actions/index.js +8 -4
  223. package/build/components/template-actions/index.js.map +1 -1
  224. package/build/components/template-actions/rename-menu-item.js +9 -3
  225. package/build/components/template-actions/rename-menu-item.js.map +1 -1
  226. package/build/components/welcome-guide/styles.js +2 -2
  227. package/build/components/welcome-guide/styles.js.map +1 -1
  228. package/build/hooks/commands/use-edit-mode-commands.js +4 -3
  229. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  230. package/build/hooks/navigation-menu-edit.js +2 -1
  231. package/build/hooks/navigation-menu-edit.js.map +1 -1
  232. package/build/hooks/push-changes-to-global-styles/index.js +5 -37
  233. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  234. package/build/hooks/template-part-edit.js +2 -1
  235. package/build/hooks/template-part-edit.js.map +1 -1
  236. package/build/store/actions.js +38 -14
  237. package/build/store/actions.js.map +1 -1
  238. package/build/store/constants.js +1 -9
  239. package/build/store/constants.js.map +1 -1
  240. package/build/store/private-actions.js +21 -1
  241. package/build/store/private-actions.js.map +1 -1
  242. package/build/store/private-selectors.js +23 -0
  243. package/build/store/private-selectors.js.map +1 -1
  244. package/build/store/reducer.js +19 -1
  245. package/build/store/reducer.js.map +1 -1
  246. package/build/store/selectors.js +3 -2
  247. package/build/store/selectors.js.map +1 -1
  248. package/build/utils/constants.js +64 -2
  249. package/build/utils/constants.js.map +1 -1
  250. package/build/utils/is-template-removable.js +6 -1
  251. package/build/utils/is-template-removable.js.map +1 -1
  252. package/build/utils/is-template-revertable.js +6 -1
  253. package/build/utils/is-template-revertable.js.map +1 -1
  254. package/build/utils/template-part-create.js +6 -1
  255. package/build/utils/template-part-create.js.map +1 -1
  256. package/build-module/components/add-new-pattern/index.js +69 -8
  257. package/build-module/components/add-new-pattern/index.js.map +1 -1
  258. package/build-module/components/add-new-template/index.js +3 -2
  259. package/build-module/components/add-new-template/index.js.map +1 -1
  260. package/build-module/components/add-new-template/new-template.js +6 -1
  261. package/build-module/components/add-new-template/new-template.js.map +1 -1
  262. package/build-module/components/add-new-template/utils.js +6 -1
  263. package/build-module/components/add-new-template/utils.js.map +1 -1
  264. package/build-module/components/app/index.js +2 -7
  265. package/build-module/components/app/index.js.map +1 -1
  266. package/build-module/components/block-editor/back-button.js +3 -2
  267. package/build-module/components/block-editor/back-button.js.map +1 -1
  268. package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js +65 -0
  269. package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +1 -0
  270. package/build-module/components/block-editor/block-editor-provider/index.js +23 -0
  271. package/build-module/components/block-editor/block-editor-provider/index.js.map +1 -0
  272. package/build-module/components/block-editor/{providers → block-editor-provider}/navigation-block-editor-provider.js +2 -1
  273. package/build-module/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +1 -0
  274. package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js +70 -0
  275. package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +1 -0
  276. package/build-module/components/block-editor/editor-canvas.js +21 -17
  277. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  278. package/build-module/components/block-editor/index.js +1 -8
  279. package/build-module/components/block-editor/index.js.map +1 -1
  280. package/build-module/components/block-editor/site-editor-canvas.js +5 -7
  281. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  282. package/build-module/components/block-editor/use-site-editor-settings.js +8 -4
  283. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  284. package/build-module/components/canvas-loader/index.js +18 -1
  285. package/build-module/components/canvas-loader/index.js.map +1 -1
  286. package/build-module/components/create-template-part-modal/index.js +8 -12
  287. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  288. package/build-module/components/editor/index.js +7 -9
  289. package/build-module/components/editor/index.js.map +1 -1
  290. package/build-module/components/global-styles/dimensions-panel.js +5 -4
  291. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  292. package/build-module/components/global-styles/font-families.js +58 -0
  293. package/build-module/components/global-styles/font-families.js.map +1 -0
  294. package/build-module/components/global-styles/font-family-item.js +40 -0
  295. package/build-module/components/global-styles/font-family-item.js.map +1 -0
  296. package/build-module/components/global-styles/font-library-modal/collection-font-details.js +40 -0
  297. package/build-module/components/global-styles/font-library-modal/collection-font-details.js.map +1 -0
  298. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +45 -0
  299. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -0
  300. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +23 -0
  301. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -0
  302. package/build-module/components/global-styles/font-library-modal/context.js +300 -0
  303. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -0
  304. package/build-module/components/global-styles/font-library-modal/font-card.js +52 -0
  305. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -0
  306. package/build-module/components/global-styles/font-library-modal/font-collection.js +164 -0
  307. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -0
  308. package/build-module/components/global-styles/font-library-modal/font-demo.js +79 -0
  309. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -0
  310. package/build-module/components/global-styles/font-library-modal/font-variant.js +42 -0
  311. package/build-module/components/global-styles/font-library-modal/font-variant.js.map +1 -0
  312. package/build-module/components/global-styles/font-library-modal/fonts-grid.js +47 -0
  313. package/build-module/components/global-styles/font-library-modal/fonts-grid.js.map +1 -0
  314. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +33 -0
  315. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -0
  316. package/build-module/components/global-styles/font-library-modal/index.js +57 -0
  317. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -0
  318. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +120 -0
  319. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -0
  320. package/build-module/components/global-styles/font-library-modal/library-font-card.js +31 -0
  321. package/build-module/components/global-styles/font-library-modal/library-font-card.js.map +1 -0
  322. package/build-module/components/global-styles/font-library-modal/library-font-details.js +35 -0
  323. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -0
  324. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +50 -0
  325. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -0
  326. package/build-module/components/global-styles/font-library-modal/local-fonts.js +135 -0
  327. package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -0
  328. package/build-module/components/global-styles/font-library-modal/resolvers.js +42 -0
  329. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -0
  330. package/build-module/components/global-styles/font-library-modal/tab-layout.js +37 -0
  331. package/build-module/components/global-styles/font-library-modal/tab-layout.js.map +1 -0
  332. package/build-module/components/global-styles/font-library-modal/utils/constants.js +21 -0
  333. package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +1 -0
  334. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +15 -0
  335. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -0
  336. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +13 -0
  337. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -0
  338. package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +52 -0
  339. package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +1 -0
  340. package/build-module/components/global-styles/font-library-modal/utils/index.js +141 -0
  341. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -0
  342. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +16 -0
  343. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -0
  344. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +68 -0
  345. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -0
  346. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +30 -0
  347. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -0
  348. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +86 -0
  349. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -0
  350. package/build-module/components/global-styles/global-styles-provider.js +7 -12
  351. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  352. package/build-module/components/global-styles/screen-block.js +34 -21
  353. package/build-module/components/global-styles/screen-block.js.map +1 -1
  354. package/build-module/components/global-styles/screen-revisions/index.js +1 -3
  355. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  356. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
  357. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  358. package/build-module/components/global-styles/screen-typography.js +6 -74
  359. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  360. package/build-module/components/global-styles/style-variations-container.js +3 -5
  361. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  362. package/build-module/components/global-styles/typogrphy-elements.js +87 -0
  363. package/build-module/components/global-styles/typogrphy-elements.js.map +1 -0
  364. package/build-module/components/header-edit-mode/document-actions/index.js +9 -8
  365. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  366. package/build-module/components/header-edit-mode/index.js +4 -1
  367. package/build-module/components/header-edit-mode/index.js.map +1 -1
  368. package/build-module/components/layout/index.js +5 -1
  369. package/build-module/components/layout/index.js.map +1 -1
  370. package/build-module/components/list/added-by.js +13 -8
  371. package/build-module/components/list/added-by.js.map +1 -1
  372. package/build-module/components/list/index.js +2 -1
  373. package/build-module/components/list/index.js.map +1 -1
  374. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +2 -3
  375. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  376. package/build-module/components/page-patterns/duplicate-menu-item.js +55 -20
  377. package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -1
  378. package/build-module/components/page-patterns/grid-item.js +49 -23
  379. package/build-module/components/page-patterns/grid-item.js.map +1 -1
  380. package/build-module/components/page-patterns/header.js +3 -7
  381. package/build-module/components/page-patterns/header.js.map +1 -1
  382. package/build-module/components/page-patterns/index.js +3 -3
  383. package/build-module/components/page-patterns/index.js.map +1 -1
  384. package/build-module/components/page-patterns/patterns-list.js +7 -7
  385. package/build-module/components/page-patterns/patterns-list.js.map +1 -1
  386. package/build-module/components/page-patterns/rename-menu-item.js +6 -5
  387. package/build-module/components/page-patterns/rename-menu-item.js.map +1 -1
  388. package/build-module/components/page-patterns/search-items.js +8 -2
  389. package/build-module/components/page-patterns/search-items.js.map +1 -1
  390. package/build-module/components/page-patterns/use-patterns.js +71 -52
  391. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  392. package/build-module/components/page-patterns/utils.js +0 -11
  393. package/build-module/components/page-patterns/utils.js.map +1 -1
  394. package/build-module/components/page-template-parts/add-new-template-part.js +3 -2
  395. package/build-module/components/page-template-parts/add-new-template-part.js.map +1 -1
  396. package/build-module/components/page-template-parts/index.js +2 -1
  397. package/build-module/components/page-template-parts/index.js.map +1 -1
  398. package/build-module/components/page-templates/index.js +3 -2
  399. package/build-module/components/page-templates/index.js.map +1 -1
  400. package/build-module/components/save-hub/index.js +2 -1
  401. package/build-module/components/save-hub/index.js.map +1 -1
  402. package/build-module/components/secondary-sidebar/list-view-sidebar.js +26 -19
  403. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  404. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +54 -29
  405. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
  406. package/build-module/components/sidebar-edit-mode/page-panels/hooks.js +55 -0
  407. package/build-module/components/sidebar-edit-mode/page-panels/hooks.js.map +1 -0
  408. package/build-module/components/sidebar-edit-mode/page-panels/index.js +1 -4
  409. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  410. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +2 -1
  411. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  412. package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js +49 -0
  413. package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -0
  414. package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js +85 -0
  415. package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -0
  416. package/build-module/components/sidebar-edit-mode/settings-header/index.js +2 -6
  417. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  418. package/build-module/components/sidebar-edit-mode/template-panel/index.js +12 -10
  419. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  420. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +8 -6
  421. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -1
  422. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +209 -0
  423. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -0
  424. package/build-module/components/sidebar-navigation-screen/index.js +6 -4
  425. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  426. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +32 -5
  427. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  428. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +4 -2
  429. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  430. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +6 -33
  431. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  432. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +2 -1
  433. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  434. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +3 -1
  435. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  436. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +3 -2
  437. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  438. package/build-module/components/sidebar-navigation-screen-page/index.js +3 -3
  439. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  440. package/build-module/components/sidebar-navigation-screen-page/page-details.js +2 -1
  441. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  442. package/build-module/components/sidebar-navigation-screen-pages/index.js +5 -4
  443. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  444. package/build-module/components/sidebar-navigation-screen-pattern/index.js +21 -10
  445. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  446. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +3 -2
  447. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  448. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +2 -1
  449. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  450. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +2 -1
  451. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  452. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +41 -11
  453. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  454. package/build-module/components/sidebar-navigation-screen-patterns/index.js +12 -40
  455. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  456. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +44 -5
  457. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  458. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +7 -2
  459. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  460. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +3 -2
  461. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  462. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +2 -1
  463. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  464. package/build-module/components/sidebar-navigation-screen-template/index.js +2 -2
  465. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  466. package/build-module/components/sidebar-navigation-screen-templates/index.js +5 -4
  467. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  468. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +3 -2
  469. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  470. package/build-module/components/start-template-options/index.js +20 -2
  471. package/build-module/components/start-template-options/index.js.map +1 -1
  472. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -4
  473. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  474. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +4 -3
  475. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  476. package/build-module/components/template-actions/index.js +8 -4
  477. package/build-module/components/template-actions/index.js.map +1 -1
  478. package/build-module/components/template-actions/rename-menu-item.js +9 -3
  479. package/build-module/components/template-actions/rename-menu-item.js.map +1 -1
  480. package/build-module/components/welcome-guide/styles.js +2 -2
  481. package/build-module/components/welcome-guide/styles.js.map +1 -1
  482. package/build-module/hooks/commands/use-edit-mode-commands.js +4 -3
  483. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  484. package/build-module/hooks/navigation-menu-edit.js +2 -1
  485. package/build-module/hooks/navigation-menu-edit.js.map +1 -1
  486. package/build-module/hooks/push-changes-to-global-styles/index.js +5 -37
  487. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  488. package/build-module/hooks/template-part-edit.js +2 -1
  489. package/build-module/hooks/template-part-edit.js.map +1 -1
  490. package/build-module/store/actions.js +39 -16
  491. package/build-module/store/actions.js.map +1 -1
  492. package/build-module/store/constants.js +0 -4
  493. package/build-module/store/constants.js.map +1 -1
  494. package/build-module/store/private-actions.js +19 -0
  495. package/build-module/store/private-actions.js.map +1 -1
  496. package/build-module/store/private-selectors.js +22 -0
  497. package/build-module/store/private-selectors.js.map +1 -1
  498. package/build-module/store/reducer.js +18 -1
  499. package/build-module/store/reducer.js.map +1 -1
  500. package/build-module/store/selectors.js +3 -3
  501. package/build-module/store/selectors.js.map +1 -1
  502. package/build-module/utils/constants.js +51 -1
  503. package/build-module/utils/constants.js.map +1 -1
  504. package/build-module/utils/is-template-removable.js +6 -1
  505. package/build-module/utils/is-template-removable.js.map +1 -1
  506. package/build-module/utils/is-template-revertable.js +6 -1
  507. package/build-module/utils/is-template-revertable.js.map +1 -1
  508. package/build-module/utils/template-part-create.js +6 -1
  509. package/build-module/utils/template-part-create.js.map +1 -1
  510. package/build-style/style-rtl.css +267 -37
  511. package/build-style/style.css +267 -37
  512. package/lib/inflate.js +4082 -0
  513. package/lib/lib-font.browser.js +3831 -0
  514. package/lib/unbrotli.js +2679 -0
  515. package/package.json +40 -40
  516. package/src/components/add-new-pattern/index.js +86 -8
  517. package/src/components/add-new-template/index.js +3 -2
  518. package/src/components/add-new-template/new-template.js +6 -1
  519. package/src/components/add-new-template/utils.js +12 -3
  520. package/src/components/app/index.js +9 -12
  521. package/src/components/block-editor/back-button.js +6 -2
  522. package/src/components/block-editor/block-editor-provider/default-block-editor-provider.js +70 -0
  523. package/src/components/block-editor/block-editor-provider/index.js +29 -0
  524. package/src/components/block-editor/{providers → block-editor-provider}/navigation-block-editor-provider.js +2 -1
  525. package/src/components/block-editor/block-editor-provider/test/use-page-content-blocks.js +87 -0
  526. package/src/components/block-editor/block-editor-provider/use-page-content-blocks.js +77 -0
  527. package/src/components/block-editor/editor-canvas.js +31 -19
  528. package/src/components/block-editor/index.js +1 -14
  529. package/src/components/block-editor/site-editor-canvas.js +7 -12
  530. package/src/components/block-editor/style.scss +88 -1
  531. package/src/components/block-editor/use-site-editor-settings.js +26 -19
  532. package/src/components/canvas-loader/index.js +12 -1
  533. package/src/components/canvas-loader/style.scss +1 -1
  534. package/src/components/create-template-part-modal/index.js +11 -12
  535. package/src/components/editor/index.js +9 -10
  536. package/src/components/global-styles/dimensions-panel.js +8 -4
  537. package/src/components/global-styles/font-families.js +71 -0
  538. package/src/components/global-styles/font-family-item.js +44 -0
  539. package/src/components/global-styles/font-library-modal/collection-font-details.js +56 -0
  540. package/src/components/global-styles/font-library-modal/collection-font-variant.js +45 -0
  541. package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +33 -0
  542. package/src/components/global-styles/font-library-modal/context.js +378 -0
  543. package/src/components/global-styles/font-library-modal/font-card.js +75 -0
  544. package/src/components/global-styles/font-library-modal/font-collection.js +257 -0
  545. package/src/components/global-styles/font-library-modal/font-demo.js +83 -0
  546. package/src/components/global-styles/font-library-modal/font-variant.js +53 -0
  547. package/src/components/global-styles/font-library-modal/fonts-grid.js +55 -0
  548. package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +50 -0
  549. package/src/components/global-styles/font-library-modal/index.js +67 -0
  550. package/src/components/global-styles/font-library-modal/installed-fonts.js +174 -0
  551. package/src/components/global-styles/font-library-modal/library-font-card.js +33 -0
  552. package/src/components/global-styles/font-library-modal/library-font-details.js +45 -0
  553. package/src/components/global-styles/font-library-modal/library-font-variant.js +54 -0
  554. package/src/components/global-styles/font-library-modal/local-fonts.js +160 -0
  555. package/src/components/global-styles/font-library-modal/resolvers.js +45 -0
  556. package/src/components/global-styles/font-library-modal/style.scss +139 -0
  557. package/src/components/global-styles/font-library-modal/tab-layout.js +50 -0
  558. package/src/components/global-styles/font-library-modal/utils/constants.js +23 -0
  559. package/src/components/global-styles/font-library-modal/utils/filter-fonts.js +18 -0
  560. package/src/components/global-styles/font-library-modal/utils/fonts-outline.js +21 -0
  561. package/src/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +58 -0
  562. package/src/components/global-styles/font-library-modal/utils/index.js +153 -0
  563. package/src/components/global-styles/font-library-modal/utils/make-families-from-faces.js +15 -0
  564. package/src/components/global-styles/font-library-modal/utils/preview-styles.js +86 -0
  565. package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +33 -0
  566. package/src/components/global-styles/font-library-modal/utils/test/filter-fonts.spec.js +69 -0
  567. package/src/components/global-styles/font-library-modal/utils/test/fonts-outline.spec.js +109 -0
  568. package/src/components/global-styles/font-library-modal/utils/test/getDisplaySrcFromFontFace.spec.js +53 -0
  569. package/src/components/global-styles/font-library-modal/utils/test/getFontFaceVariantName.spec.js +30 -0
  570. package/src/components/global-styles/font-library-modal/utils/test/getIntersectingFontFaces.spec.js +240 -0
  571. package/src/components/global-styles/font-library-modal/utils/test/isUrlEncoded.spec.js +31 -0
  572. package/src/components/global-styles/font-library-modal/utils/test/makeFamiliesFromFaces.spec.js +57 -0
  573. package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +62 -0
  574. package/src/components/global-styles/font-library-modal/utils/test/mergeFontFaces.spec.js +56 -0
  575. package/src/components/global-styles/font-library-modal/utils/test/mergeFontFamilies.spec.js +108 -0
  576. package/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js +161 -0
  577. package/src/components/global-styles/font-library-modal/utils/test/setUIValuesNeeded.spec.js +41 -0
  578. package/src/components/global-styles/font-library-modal/utils/test/sort-font-faces.js +74 -0
  579. package/src/components/global-styles/font-library-modal/utils/test/toggleFont.spec.js +141 -0
  580. package/src/components/global-styles/font-library-modal/utils/toggleFont.js +90 -0
  581. package/src/components/global-styles/global-styles-provider.js +2 -7
  582. package/src/components/global-styles/screen-block.js +42 -20
  583. package/src/components/global-styles/screen-revisions/index.js +0 -2
  584. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
  585. package/src/components/global-styles/screen-typography.js +9 -95
  586. package/src/components/global-styles/style-variations-container.js +0 -2
  587. package/src/components/global-styles/typogrphy-elements.js +110 -0
  588. package/src/components/header-edit-mode/document-actions/index.js +17 -8
  589. package/src/components/header-edit-mode/index.js +2 -1
  590. package/src/components/layout/index.js +10 -1
  591. package/src/components/list/added-by.js +29 -11
  592. package/src/components/list/index.js +7 -1
  593. package/src/components/list/style.scss +2 -0
  594. package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +2 -8
  595. package/src/components/page-patterns/duplicate-menu-item.js +67 -24
  596. package/src/components/page-patterns/grid-item.js +80 -33
  597. package/src/components/page-patterns/header.js +3 -12
  598. package/src/components/page-patterns/index.js +3 -3
  599. package/src/components/page-patterns/patterns-list.js +7 -7
  600. package/src/components/page-patterns/rename-menu-item.js +18 -7
  601. package/src/components/page-patterns/search-items.js +20 -2
  602. package/src/components/page-patterns/style.scss +1 -5
  603. package/src/components/page-patterns/use-patterns.js +217 -127
  604. package/src/components/page-patterns/utils.js +0 -19
  605. package/src/components/page-template-parts/add-new-template-part.js +5 -2
  606. package/src/components/page-template-parts/index.js +2 -1
  607. package/src/components/page-templates/index.js +3 -2
  608. package/src/components/save-hub/index.js +2 -1
  609. package/src/components/secondary-sidebar/list-view-sidebar.js +31 -26
  610. package/src/components/sidebar-edit-mode/page-panels/edit-template.js +94 -52
  611. package/src/components/sidebar-edit-mode/page-panels/hooks.js +88 -0
  612. package/src/components/sidebar-edit-mode/page-panels/index.js +0 -4
  613. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +2 -0
  614. package/src/components/sidebar-edit-mode/page-panels/reset-default-template.js +44 -0
  615. package/src/components/sidebar-edit-mode/page-panels/style.scss +46 -9
  616. package/src/components/sidebar-edit-mode/page-panels/swap-template-button.js +82 -0
  617. package/src/components/sidebar-edit-mode/settings-header/index.js +4 -7
  618. package/src/components/sidebar-edit-mode/template-panel/index.js +28 -24
  619. package/src/components/sidebar-edit-mode/template-panel/last-revision.js +19 -15
  620. package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +277 -0
  621. package/src/components/sidebar-navigation-screen/index.js +4 -9
  622. package/src/components/sidebar-navigation-screen/style.scss +7 -1
  623. package/src/components/sidebar-navigation-screen-details-footer/index.js +38 -10
  624. package/src/components/sidebar-navigation-screen-details-footer/style.scss +10 -3
  625. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -0
  626. package/src/components/sidebar-navigation-screen-global-styles/index.js +6 -44
  627. package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +2 -1
  628. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +3 -1
  629. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +3 -2
  630. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +0 -4
  631. package/src/components/sidebar-navigation-screen-page/index.js +3 -3
  632. package/src/components/sidebar-navigation-screen-page/page-details.js +2 -1
  633. package/src/components/sidebar-navigation-screen-pages/index.js +5 -4
  634. package/src/components/sidebar-navigation-screen-pattern/index.js +22 -8
  635. package/src/components/sidebar-navigation-screen-pattern/style.scss +0 -3
  636. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +8 -2
  637. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +7 -1
  638. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +2 -1
  639. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +63 -20
  640. package/src/components/sidebar-navigation-screen-patterns/index.js +20 -51
  641. package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +61 -6
  642. package/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +12 -2
  643. package/src/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +3 -5
  644. package/src/components/sidebar-navigation-screen-template/home-template-details.js +2 -1
  645. package/src/components/sidebar-navigation-screen-template/index.js +2 -4
  646. package/src/components/sidebar-navigation-screen-templates/index.js +5 -4
  647. package/src/components/sidebar-navigation-screen-templates-browse/index.js +6 -2
  648. package/src/components/start-template-options/index.js +39 -2
  649. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -4
  650. package/src/components/sync-state-with-url/use-sync-path-with-url.js +8 -3
  651. package/src/components/template-actions/index.js +15 -8
  652. package/src/components/template-actions/rename-menu-item.js +21 -5
  653. package/src/components/welcome-guide/styles.js +2 -2
  654. package/src/hooks/commands/use-edit-mode-commands.js +4 -3
  655. package/src/hooks/navigation-menu-edit.js +2 -1
  656. package/src/hooks/push-changes-to-global-styles/index.js +6 -49
  657. package/src/hooks/template-part-edit.js +2 -1
  658. package/src/store/actions.js +56 -22
  659. package/src/store/constants.js +0 -5
  660. package/src/store/private-actions.js +19 -0
  661. package/src/store/private-selectors.js +22 -0
  662. package/src/store/reducer.js +18 -0
  663. package/src/store/selectors.js +6 -3
  664. package/src/store/test/reducer.js +18 -0
  665. package/src/style.scss +1 -1
  666. package/src/utils/constants.js +54 -3
  667. package/src/utils/is-template-removable.js +8 -1
  668. package/src/utils/is-template-revertable.js +8 -1
  669. package/src/utils/template-part-create.js +6 -1
  670. package/build/components/block-editor/get-block-editor-provider.js +0 -35
  671. package/build/components/block-editor/get-block-editor-provider.js.map +0 -1
  672. package/build/components/block-editor/providers/default-block-editor-provider.js +0 -49
  673. package/build/components/block-editor/providers/default-block-editor-provider.js.map +0 -1
  674. package/build/components/block-editor/providers/navigation-block-editor-provider.js.map +0 -1
  675. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -30
  676. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +0 -1
  677. package/build-module/components/block-editor/get-block-editor-provider.js +0 -28
  678. package/build-module/components/block-editor/get-block-editor-provider.js.map +0 -1
  679. package/build-module/components/block-editor/providers/default-block-editor-provider.js +0 -41
  680. package/build-module/components/block-editor/providers/default-block-editor-provider.js.map +0 -1
  681. package/build-module/components/block-editor/providers/navigation-block-editor-provider.js.map +0 -1
  682. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -23
  683. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +0 -1
  684. package/src/components/block-editor/get-block-editor-provider.js +0 -29
  685. package/src/components/block-editor/providers/default-block-editor-provider.js +0 -44
  686. package/src/components/sidebar-navigation-screen-global-styles/style.scss +0 -12
  687. package/src/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -24
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.TEMPLATE_PART_AREA_SIDEBAR = exports.TEMPLATE_PART_AREA_HEADER = exports.TEMPLATE_PART_AREA_GENERAL = exports.TEMPLATE_PART_AREA_FOOTER = exports.STORE_NAME = void 0;
6
+ exports.STORE_NAME = void 0;
7
7
  /**
8
8
  * The identifier for the data store.
9
9
  *
@@ -11,12 +11,4 @@ exports.TEMPLATE_PART_AREA_SIDEBAR = exports.TEMPLATE_PART_AREA_HEADER = exports
11
11
  */
12
12
  const STORE_NAME = 'core/edit-site';
13
13
  exports.STORE_NAME = STORE_NAME;
14
- const TEMPLATE_PART_AREA_HEADER = 'header';
15
- exports.TEMPLATE_PART_AREA_HEADER = TEMPLATE_PART_AREA_HEADER;
16
- const TEMPLATE_PART_AREA_FOOTER = 'footer';
17
- exports.TEMPLATE_PART_AREA_FOOTER = TEMPLATE_PART_AREA_FOOTER;
18
- const TEMPLATE_PART_AREA_SIDEBAR = 'sidebar';
19
- exports.TEMPLATE_PART_AREA_SIDEBAR = TEMPLATE_PART_AREA_SIDEBAR;
20
- const TEMPLATE_PART_AREA_GENERAL = 'uncategorized';
21
- exports.TEMPLATE_PART_AREA_GENERAL = TEMPLATE_PART_AREA_GENERAL;
22
14
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["STORE_NAME","exports","TEMPLATE_PART_AREA_HEADER","TEMPLATE_PART_AREA_FOOTER","TEMPLATE_PART_AREA_SIDEBAR","TEMPLATE_PART_AREA_GENERAL"],"sources":["@wordpress/edit-site/src/store/constants.js"],"sourcesContent":["/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/edit-site';\n\nexport const TEMPLATE_PART_AREA_HEADER = 'header';\nexport const TEMPLATE_PART_AREA_FOOTER = 'footer';\nexport const TEMPLATE_PART_AREA_SIDEBAR = 'sidebar';\nexport const TEMPLATE_PART_AREA_GENERAL = 'uncategorized';\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACO,MAAMA,UAAU,GAAG,gBAAgB;AAACC,OAAA,CAAAD,UAAA,GAAAA,UAAA;AAEpC,MAAME,yBAAyB,GAAG,QAAQ;AAACD,OAAA,CAAAC,yBAAA,GAAAA,yBAAA;AAC3C,MAAMC,yBAAyB,GAAG,QAAQ;AAACF,OAAA,CAAAE,yBAAA,GAAAA,yBAAA;AAC3C,MAAMC,0BAA0B,GAAG,SAAS;AAACH,OAAA,CAAAG,0BAAA,GAAAA,0BAAA;AAC7C,MAAMC,0BAA0B,GAAG,eAAe;AAACJ,OAAA,CAAAI,0BAAA,GAAAA,0BAAA"}
1
+ {"version":3,"names":["STORE_NAME","exports"],"sources":["@wordpress/edit-site/src/store/constants.js"],"sourcesContent":["/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/edit-site';\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACO,MAAMA,UAAU,GAAG,gBAAgB;AAACC,OAAA,CAAAD,UAAA,GAAAA,UAAA"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.setEditorCanvasContainerView = exports.setCanvasMode = void 0;
6
+ exports.setPageContentFocusType = exports.setEditorCanvasContainerView = exports.setCanvasMode = void 0;
7
7
  var _blockEditor = require("@wordpress/block-editor");
8
8
  var _preferences = require("@wordpress/preferences");
9
9
  /**
@@ -50,5 +50,25 @@ const setEditorCanvasContainerView = view => ({
50
50
  view
51
51
  });
52
52
  };
53
+
54
+ /**
55
+ * Sets the type of page content focus. Can be one of:
56
+ *
57
+ * - `'disableTemplate'`: Disable the blocks belonging to the page's template.
58
+ * - `'hideTemplate'`: Hide the blocks belonging to the page's template.
59
+ *
60
+ * @param {'disableTemplate'|'hideTemplate'} pageContentFocusType The type of page content focus.
61
+ *
62
+ * @return {Object} Action object.
63
+ */
53
64
  exports.setEditorCanvasContainerView = setEditorCanvasContainerView;
65
+ const setPageContentFocusType = pageContentFocusType => ({
66
+ dispatch
67
+ }) => {
68
+ dispatch({
69
+ type: 'SET_PAGE_CONTENT_FOCUS_TYPE',
70
+ pageContentFocusType
71
+ });
72
+ };
73
+ exports.setPageContentFocusType = setPageContentFocusType;
54
74
  //# sourceMappingURL=private-actions.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_preferences","setCanvasMode","mode","registry","dispatch","select","blockEditorStore","__unstableSetEditorMode","type","preferencesStore","get","setIsListViewOpened","isPage","setHasPageContentFocus","exports","setEditorCanvasContainerView","view"],"sources":["@wordpress/edit-site/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Action that switches the canvas mode.\n *\n * @param {?string} mode Canvas mode.\n */\nexport const setCanvasMode =\n\t( mode ) =>\n\t( { registry, dispatch, select } ) => {\n\t\tregistry.dispatch( blockEditorStore ).__unstableSetEditorMode( 'edit' );\n\t\tdispatch( {\n\t\t\ttype: 'SET_CANVAS_MODE',\n\t\t\tmode,\n\t\t} );\n\t\t// Check if the block list view should be open by default.\n\t\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t\tif (\n\t\t\tmode === 'edit' &&\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'showListViewByDefault' ) &&\n\t\t\t! registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'distractionFree' )\n\t\t) {\n\t\t\tdispatch.setIsListViewOpened( true );\n\t\t}\n\t\t// Switch focus away from editing the template when switching to view mode.\n\t\tif ( mode === 'view' && select.isPage() ) {\n\t\t\tdispatch.setHasPageContentFocus( true );\n\t\t}\n\t};\n\n/**\n * Action that switches the editor canvas container view.\n *\n * @param {?string} view Editor canvas container view.\n */\nexport const setEditorCanvasContainerView =\n\t( view ) =>\n\t( { dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITOR_CANVAS_CONTAINER_VIEW',\n\t\t\tview,\n\t\t} );\n\t};\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAME,aAAa,GACvBC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC;AAAO,CAAC,KAAM;EACrCF,QAAQ,CAACC,QAAQ,CAAEE,kBAAiB,CAAC,CAACC,uBAAuB,CAAE,MAAO,CAAC;EACvEH,QAAQ,CAAE;IACTI,IAAI,EAAE,iBAAiB;IACvBN;EACD,CAAE,CAAC;EACH;EACA;EACA,IACCA,IAAI,KAAK,MAAM,IACfC,QAAQ,CACNE,MAAM,CAAEI,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,gBAAgB,EAAE,uBAAwB,CAAC,IAClD,CAAEP,QAAQ,CACRE,MAAM,CAAEI,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,gBAAgB,EAAE,iBAAkB,CAAC,EAC3C;IACDN,QAAQ,CAACO,mBAAmB,CAAE,IAAK,CAAC;EACrC;EACA;EACA,IAAKT,IAAI,KAAK,MAAM,IAAIG,MAAM,CAACO,MAAM,CAAC,CAAC,EAAG;IACzCR,QAAQ,CAACS,sBAAsB,CAAE,IAAK,CAAC;EACxC;AACD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AAJAC,OAAA,CAAAb,aAAA,GAAAA,aAAA;AAKO,MAAMc,4BAA4B,GACtCC,IAAI,IACN,CAAE;EAAEZ;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTI,IAAI,EAAE,kCAAkC;IACxCQ;EACD,CAAE,CAAC;AACJ,CAAC;AAACF,OAAA,CAAAC,4BAAA,GAAAA,4BAAA"}
1
+ {"version":3,"names":["_blockEditor","require","_preferences","setCanvasMode","mode","registry","dispatch","select","blockEditorStore","__unstableSetEditorMode","type","preferencesStore","get","setIsListViewOpened","isPage","setHasPageContentFocus","exports","setEditorCanvasContainerView","view","setPageContentFocusType","pageContentFocusType"],"sources":["@wordpress/edit-site/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Action that switches the canvas mode.\n *\n * @param {?string} mode Canvas mode.\n */\nexport const setCanvasMode =\n\t( mode ) =>\n\t( { registry, dispatch, select } ) => {\n\t\tregistry.dispatch( blockEditorStore ).__unstableSetEditorMode( 'edit' );\n\t\tdispatch( {\n\t\t\ttype: 'SET_CANVAS_MODE',\n\t\t\tmode,\n\t\t} );\n\t\t// Check if the block list view should be open by default.\n\t\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t\tif (\n\t\t\tmode === 'edit' &&\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'showListViewByDefault' ) &&\n\t\t\t! registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'distractionFree' )\n\t\t) {\n\t\t\tdispatch.setIsListViewOpened( true );\n\t\t}\n\t\t// Switch focus away from editing the template when switching to view mode.\n\t\tif ( mode === 'view' && select.isPage() ) {\n\t\t\tdispatch.setHasPageContentFocus( true );\n\t\t}\n\t};\n\n/**\n * Action that switches the editor canvas container view.\n *\n * @param {?string} view Editor canvas container view.\n */\nexport const setEditorCanvasContainerView =\n\t( view ) =>\n\t( { dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITOR_CANVAS_CONTAINER_VIEW',\n\t\t\tview,\n\t\t} );\n\t};\n\n/**\n * Sets the type of page content focus. Can be one of:\n *\n * - `'disableTemplate'`: Disable the blocks belonging to the page's template.\n * - `'hideTemplate'`: Hide the blocks belonging to the page's template.\n *\n * @param {'disableTemplate'|'hideTemplate'} pageContentFocusType The type of page content focus.\n *\n * @return {Object} Action object.\n */\nexport const setPageContentFocusType =\n\t( pageContentFocusType ) =>\n\t( { dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'SET_PAGE_CONTENT_FOCUS_TYPE',\n\t\t\tpageContentFocusType,\n\t\t} );\n\t};\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAME,aAAa,GACvBC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC;AAAO,CAAC,KAAM;EACrCF,QAAQ,CAACC,QAAQ,CAAEE,kBAAiB,CAAC,CAACC,uBAAuB,CAAE,MAAO,CAAC;EACvEH,QAAQ,CAAE;IACTI,IAAI,EAAE,iBAAiB;IACvBN;EACD,CAAE,CAAC;EACH;EACA;EACA,IACCA,IAAI,KAAK,MAAM,IACfC,QAAQ,CACNE,MAAM,CAAEI,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,gBAAgB,EAAE,uBAAwB,CAAC,IAClD,CAAEP,QAAQ,CACRE,MAAM,CAAEI,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,gBAAgB,EAAE,iBAAkB,CAAC,EAC3C;IACDN,QAAQ,CAACO,mBAAmB,CAAE,IAAK,CAAC;EACrC;EACA;EACA,IAAKT,IAAI,KAAK,MAAM,IAAIG,MAAM,CAACO,MAAM,CAAC,CAAC,EAAG;IACzCR,QAAQ,CAACS,sBAAsB,CAAE,IAAK,CAAC;EACxC;AACD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AAJAC,OAAA,CAAAb,aAAA,GAAAA,aAAA;AAKO,MAAMc,4BAA4B,GACtCC,IAAI,IACN,CAAE;EAAEZ;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTI,IAAI,EAAE,kCAAkC;IACxCQ;EACD,CAAE,CAAC;AACJ,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATAF,OAAA,CAAAC,4BAAA,GAAAA,4BAAA;AAUO,MAAME,uBAAuB,GACjCC,oBAAoB,IACtB,CAAE;EAAEd;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTI,IAAI,EAAE,6BAA6B;IACnCU;EACD,CAAE,CAAC;AACJ,CAAC;AAACJ,OAAA,CAAAG,uBAAA,GAAAA,uBAAA"}
@@ -5,6 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getCanvasMode = getCanvasMode;
7
7
  exports.getEditorCanvasContainerView = getEditorCanvasContainerView;
8
+ exports.getPageContentFocusType = getPageContentFocusType;
9
+ var _selectors = require("./selectors");
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+
8
14
  /**
9
15
  * Returns the current canvas mode.
10
16
  *
@@ -26,4 +32,21 @@ function getCanvasMode(state) {
26
32
  function getEditorCanvasContainerView(state) {
27
33
  return state.editorCanvasContainerView;
28
34
  }
35
+
36
+ /**
37
+ * Returns the type of the current page content focus, or null if there is no
38
+ * page content focus.
39
+ *
40
+ * Possible values are:
41
+ *
42
+ * - `'disableTemplate'`: Disable the blocks belonging to the page's template.
43
+ * - `'hideTemplate'`: Hide the blocks belonging to the page's template.
44
+ *
45
+ * @param {Object} state Global application state.
46
+ *
47
+ * @return {'disableTemplate'|'hideTemplate'|null} Type of the current page content focus.
48
+ */
49
+ function getPageContentFocusType(state) {
50
+ return (0, _selectors.hasPageContentFocus)(state) ? state.pageContentFocusType : null;
51
+ }
29
52
  //# sourceMappingURL=private-selectors.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getCanvasMode","state","canvasMode","getEditorCanvasContainerView","editorCanvasContainerView"],"sources":["@wordpress/edit-site/src/store/private-selectors.js"],"sourcesContent":["/**\n * Returns the current canvas mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Canvas mode.\n */\nexport function getCanvasMode( state ) {\n\treturn state.canvasMode;\n}\n\n/**\n * Returns the editor canvas container view.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editor canvas container view.\n */\nexport function getEditorCanvasContainerView( state ) {\n\treturn state.editorCanvasContainerView;\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,aAAaA,CAAEC,KAAK,EAAG;EACtC,OAAOA,KAAK,CAACC,UAAU;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,4BAA4BA,CAAEF,KAAK,EAAG;EACrD,OAAOA,KAAK,CAACG,yBAAyB;AACvC"}
1
+ {"version":3,"names":["_selectors","require","getCanvasMode","state","canvasMode","getEditorCanvasContainerView","editorCanvasContainerView","getPageContentFocusType","hasPageContentFocus","pageContentFocusType"],"sources":["@wordpress/edit-site/src/store/private-selectors.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { hasPageContentFocus } from './selectors';\n\n/**\n * Returns the current canvas mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Canvas mode.\n */\nexport function getCanvasMode( state ) {\n\treturn state.canvasMode;\n}\n\n/**\n * Returns the editor canvas container view.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editor canvas container view.\n */\nexport function getEditorCanvasContainerView( state ) {\n\treturn state.editorCanvasContainerView;\n}\n\n/**\n * Returns the type of the current page content focus, or null if there is no\n * page content focus.\n *\n * Possible values are:\n *\n * - `'disableTemplate'`: Disable the blocks belonging to the page's template.\n * - `'hideTemplate'`: Hide the blocks belonging to the page's template.\n *\n * @param {Object} state Global application state.\n *\n * @return {'disableTemplate'|'hideTemplate'|null} Type of the current page content focus.\n */\nexport function getPageContentFocusType( state ) {\n\treturn hasPageContentFocus( state ) ? state.pageContentFocusType : null;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,aAAaA,CAAEC,KAAK,EAAG;EACtC,OAAOA,KAAK,CAACC,UAAU;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,4BAA4BA,CAAEF,KAAK,EAAG;EACrD,OAAOA,KAAK,CAACG,yBAAyB;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,uBAAuBA,CAAEJ,KAAK,EAAG;EAChD,OAAO,IAAAK,8BAAmB,EAAEL,KAAM,CAAC,GAAGA,KAAK,CAACM,oBAAoB,GAAG,IAAI;AACxE"}
@@ -9,6 +9,7 @@ exports.deviceType = deviceType;
9
9
  exports.editedPost = editedPost;
10
10
  exports.hasPageContentFocus = hasPageContentFocus;
11
11
  exports.listViewPanel = listViewPanel;
12
+ exports.pageContentFocusType = pageContentFocusType;
12
13
  exports.saveViewPanel = saveViewPanel;
13
14
  exports.settings = settings;
14
15
  var _data = require("@wordpress/data");
@@ -183,6 +184,22 @@ function hasPageContentFocus(state = false, action) {
183
184
  }
184
185
  return state;
185
186
  }
187
+
188
+ /**
189
+ * Reducer used to track the type of page content focus.
190
+ *
191
+ * @param {string} state Current state.
192
+ * @param {Object} action Dispatched action.
193
+ *
194
+ * @return {string} Updated state.
195
+ */
196
+ function pageContentFocusType(state = 'disableTemplate', action) {
197
+ switch (action.type) {
198
+ case 'SET_PAGE_CONTENT_FOCUS_TYPE':
199
+ return action.pageContentFocusType;
200
+ }
201
+ return state;
202
+ }
186
203
  var _default = (0, _data.combineReducers)({
187
204
  deviceType,
188
205
  settings,
@@ -192,7 +209,8 @@ var _default = (0, _data.combineReducers)({
192
209
  saveViewPanel,
193
210
  canvasMode,
194
211
  editorCanvasContainerView,
195
- hasPageContentFocus
212
+ hasPageContentFocus,
213
+ pageContentFocusType
196
214
  });
197
215
  exports.default = _default;
198
216
  //# sourceMappingURL=reducer.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","deviceType","state","action","type","settings","editedPost","postType","id","context","blockInserterPanel","isOpen","value","listViewPanel","saveViewPanel","canvasMode","mode","editorCanvasContainerView","undefined","view","hasPageContentFocus","postId","_default","combineReducers","exports","default"],"sources":["@wordpress/edit-site/src/store/reducer.js"],"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 editor allows only page content to be\n * edited.\n *\n * @param {boolean} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {boolean} Updated state.\n */\nexport function hasPageContentFocus( 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_FOCUS':\n\t\t\treturn action.hasPageContentFocus;\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\thasPageContentFocus,\n} );\n"],"mappings":";;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAAEC,KAAK,GAAG,SAAS,EAAEC,MAAM,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,IAAAoB,QAAA,GAEc,IAAAC,qBAAe,EAAE;EAC/BtB,UAAU;EACVI,QAAQ;EACRC,UAAU;EACVI,kBAAkB;EAClBG,aAAa;EACbC,aAAa;EACbC,UAAU;EACVE,yBAAyB;EACzBG;AACD,CAAE,CAAC;AAAAI,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
1
+ {"version":3,"names":["_data","require","deviceType","state","action","type","settings","editedPost","postType","id","context","blockInserterPanel","isOpen","value","listViewPanel","saveViewPanel","canvasMode","mode","editorCanvasContainerView","undefined","view","hasPageContentFocus","postId","pageContentFocusType","_default","combineReducers","exports","default"],"sources":["@wordpress/edit-site/src/store/reducer.js"],"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 editor allows only page content to be\n * edited.\n *\n * @param {boolean} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {boolean} Updated state.\n */\nexport function hasPageContentFocus( 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_FOCUS':\n\t\t\treturn action.hasPageContentFocus;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track the type of page content focus.\n *\n * @param {string} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {string} Updated state.\n */\nexport function pageContentFocusType( state = 'disableTemplate', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_PAGE_CONTENT_FOCUS_TYPE':\n\t\t\treturn action.pageContentFocusType;\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\thasPageContentFocus,\n\tpageContentFocusType,\n} );\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAAEC,KAAK,GAAG,SAAS,EAAEC,MAAM,EAAG;EACvD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,yBAAyB;MAC7B,OAAOD,MAAM,CAACF,UAAU;EAC1B;EAEA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AAG;EACzE,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,6BAA6B;MACjC,OAAOD,MAAM,CAACmB,oBAAoB;EACpC;EAEA,OAAOpB,KAAK;AACb;AAAC,IAAAqB,QAAA,GAEc,IAAAC,qBAAe,EAAE;EAC/BvB,UAAU;EACVI,QAAQ;EACRC,UAAU;EACVI,kBAAkB;EAClBG,aAAa;EACbC,aAAa;EACbC,UAAU;EACVE,yBAAyB;EACzBG,mBAAmB;EACnBE;AACD,CAAE,CAAC;AAAAG,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
@@ -33,6 +33,7 @@ var _element = require("@wordpress/element");
33
33
  var _preferences = require("@wordpress/preferences");
34
34
  var _blockEditor = require("@wordpress/block-editor");
35
35
  var _utils = require("./utils");
36
+ var _constants = require("../utils/constants");
36
37
  /**
37
38
  * External dependencies
38
39
  */
@@ -133,7 +134,7 @@ const getSettings = (0, _rememo.default)((state, setIsInserterOpen) => {
133
134
  showIconLabels: !!__unstableGetPreference(state, 'showIconLabels'),
134
135
  __experimentalSetIsInserterOpened: setIsInserterOpen,
135
136
  __experimentalReusableBlocks: getReusableBlocks(state),
136
- __experimentalPreferPatternsOnRoot: 'wp_template' === getEditedPostType(state)
137
+ __experimentalPreferPatternsOnRoot: _constants.TEMPLATE_POST_TYPE === getEditedPostType(state)
137
138
  };
138
139
  const canUserCreateMedia = getCanUserCreateMedia(state);
139
140
  if (!canUserCreateMedia) {
@@ -294,7 +295,7 @@ const getCurrentTemplateTemplateParts = (0, _data.createRegistrySelector)(select
294
295
  const templateType = getEditedPostType(state);
295
296
  const templateId = getEditedPostId(state);
296
297
  const template = select(_coreData.store).getEditedEntityRecord('postType', templateType, templateId);
297
- const templateParts = select(_coreData.store).getEntityRecords('postType', 'wp_template_part', {
298
+ const templateParts = select(_coreData.store).getEntityRecords('postType', _constants.TEMPLATE_PART_POST_TYPE, {
298
299
  per_page: -1
299
300
  });
300
301
  return (0, _utils.getFilteredTemplatePartBlocks)(template.blocks, templateParts);
@@ -1 +1 @@
1
- {"version":3,"names":["_rememo","_interopRequireDefault","require","_coreData","_data","_deprecated","_mediaUtils","_element","_preferences","_blockEditor","_utils","__unstableGetPreference","createRegistrySelector","select","state","name","preferencesStore","get","exports","isFeatureActive","featureName","deprecated","since","alternative","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","coreDataStore","canUser","getReusableBlocks","isWeb","Platform","OS","getEntityRecords","per_page","getSettings","createSelector","setIsInserterOpen","settings","outlineMode","focusMode","isDistractionFree","hasFixedToolbar","keepCaretInsideBlock","showIconLabels","__experimentalSetIsInserterOpened","__experimentalReusableBlocks","__experimentalPreferPatternsOnRoot","getEditedPostType","canUserCreateMedia","mediaUpload","onError","rest","uploadMedia","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","version","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","hasPageContentFocus","postContentClientId","blockEditorStore","__experimentalGetGlobalBlocksByName","undefined","isListViewOpened","listViewPanel","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateType","templateId","template","getEditedEntityRecord","templateParts","getFilteredTemplatePartBlocks","blocks","getEditorMode","getCurrentTemplateNavigationPanelSubMenu","getNavigationPanelActiveMenu","isNavigationOpened","isPage","postId"],"sources":["@wordpress/edit-site/src/store/selectors.js"],"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';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\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\tisDistractionFree: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'distractionFree'\n\t\t\t),\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, 'distractionFree' ),\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 const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\tconst { rootClientId, insertionIndex, filterValue } =\n\t\t\t\tstate.blockInserterPanel;\n\t\t\treturn { rootClientId, insertionIndex, filterValue };\n\t\t}\n\n\t\tif ( hasPageContentFocus( state ) ) {\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t\t'core/post-content'\n\t\t\t\t);\n\t\t\tif ( postContentClientId ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\tinsertionIndex: undefined,\n\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trootClientId: undefined,\n\t\t\tinsertionIndex: undefined,\n\t\t\tfilterValue: undefined,\n\t\t};\n\t}\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 allows only page content to be edited.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not focus is on editing page content.\n */\nexport function hasPageContentFocus( state ) {\n\treturn isPage( state ) ? state.hasPageContentFocus : false;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMS,uBAAuB,GAAG,IAAAC,4BAAsB,EAC1DC,MAAM,IAAM,CAAEC,KAAK,EAAEC,IAAI,KAC1BF,MAAM,CAAEG,kBAAiB,CAAC,CAACC,GAAG,CAAE,gBAAgB,EAAEF,IAAK,CACzD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARAG,OAAA,CAAAP,uBAAA,GAAAA,uBAAA;AASO,SAASQ,eAAeA,CAAEL,KAAK,EAAEM,WAAW,EAAG;EACrD,IAAA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AED;AACA;AACA;AACA;AACA;AACA;AACA;AANApE,OAAA,CAAA+D,+BAAA,GAAAA,+BAAA;AAOO,SAASQ,aAAaA,CAAE3E,KAAK,EAAG;EACtC,OAAOH,uBAAuB,CAAEG,KAAK,EAAE,YAAa,CAAC;AACtD;;AAEA;AACA;AACA;AACO,SAAS4E,wCAAwCA,CAAA,EAAG;EAC1D,IAAArE,mBAAU,EACT,uEAAuE,EACvE;IACCC,KAAK,EAAE,KAAK;IACZoC,OAAO,EAAE;EACV,CACD,CAAC;AACF;;AAEA;AACA;AACA;AACO,SAASiC,4BAA4BA,CAAA,EAAG;EAC9C,IAAAtE,mBAAU,EAAE,2DAA2D,EAAE;IACxEC,KAAK,EAAE,KAAK;IACZoC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACO,SAASkC,kBAAkBA,CAAA,EAAG;EACpC,IAAAvE,mBAAU,EAAE,iDAAiD,EAAE;IAC9DC,KAAK,EAAE,KAAK;IACZoC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASmC,MAAMA,CAAE/E,KAAK,EAAG;EAC/B,OAAO,CAAC,CAAEA,KAAK,CAAC6C,UAAU,CAACK,OAAO,EAAE8B,MAAM;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAStB,mBAAmBA,CAAE1D,KAAK,EAAG;EAC5C,OAAO+E,MAAM,CAAE/E,KAAM,CAAC,GAAGA,KAAK,CAAC0D,mBAAmB,GAAG,KAAK;AAC3D"}
1
+ {"version":3,"names":["_rememo","_interopRequireDefault","require","_coreData","_data","_deprecated","_mediaUtils","_element","_preferences","_blockEditor","_utils","_constants","__unstableGetPreference","createRegistrySelector","select","state","name","preferencesStore","get","exports","isFeatureActive","featureName","deprecated","since","alternative","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","coreDataStore","canUser","getReusableBlocks","isWeb","Platform","OS","getEntityRecords","per_page","getSettings","createSelector","setIsInserterOpen","settings","outlineMode","focusMode","isDistractionFree","hasFixedToolbar","keepCaretInsideBlock","showIconLabels","__experimentalSetIsInserterOpened","__experimentalReusableBlocks","__experimentalPreferPatternsOnRoot","TEMPLATE_POST_TYPE","getEditedPostType","canUserCreateMedia","mediaUpload","onError","rest","uploadMedia","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","version","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","hasPageContentFocus","postContentClientId","blockEditorStore","__experimentalGetGlobalBlocksByName","undefined","isListViewOpened","listViewPanel","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateType","templateId","template","getEditedEntityRecord","templateParts","TEMPLATE_PART_POST_TYPE","getFilteredTemplatePartBlocks","blocks","getEditorMode","getCurrentTemplateNavigationPanelSubMenu","getNavigationPanelActiveMenu","isNavigationOpened","isPage","postId"],"sources":["@wordpress/edit-site/src/store/selectors.js"],"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';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { getFilteredTemplatePartBlocks } from './utils';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../utils/constants';\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\tisDistractionFree: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'distractionFree'\n\t\t\t),\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\tTEMPLATE_POST_TYPE === 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, 'distractionFree' ),\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 const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\tconst { rootClientId, insertionIndex, filterValue } =\n\t\t\t\tstate.blockInserterPanel;\n\t\t\treturn { rootClientId, insertionIndex, filterValue };\n\t\t}\n\n\t\tif ( hasPageContentFocus( state ) ) {\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t\t'core/post-content'\n\t\t\t\t);\n\t\t\tif ( postContentClientId ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\tinsertionIndex: undefined,\n\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trootClientId: undefined,\n\t\t\tinsertionIndex: undefined,\n\t\t\tfilterValue: undefined,\n\t\t};\n\t}\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\tTEMPLATE_PART_POST_TYPE,\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 allows only page content to be edited.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not focus is on editing page content.\n */\nexport function hasPageContentFocus( state ) {\n\treturn isPage( state ) ? state.hasPageContentFocus : false;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAMA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMU,uBAAuB,GAAG,IAAAC,4BAAsB,EAC1DC,MAAM,IAAM,CAAEC,KAAK,EAAEC,IAAI,KAC1BF,MAAM,CAAEG,kBAAiB,CAAC,CAACC,GAAG,CAAE,gBAAgB,EAAEF,IAAK,CACzD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARAG,OAAA,CAAAP,uBAAA,GAAAA,uBAAA;AASO,SAASQ,eAAeA,CAAEL,KAAK,EAAEM,WAAW,EAAG;EACrD,IAAAC,mBAAU,EAAG,4CAA2C,EAAE;IACzDC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAG;EACf,CAAE,CAAC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AOO,SAASS,aAAaA,CAAE7E,KAAK,EAAG;EACtC,OAAOH,uBAAuB,CAAEG,KAAK,EAAE,YAAa,CAAC;AACtD;;AAEA;AACA;AACA;AACO,SAAS8E,wCAAwCA,CAAA,EAAG;EAC1D,IAAAvE,mBAAU,EACT,uEAAuE,EACvE;IACCC,KAAK,EAAE,KAAK;IACZqC,OAAO,EAAE;EACV,CACD,CAAC;AACF;;AAEA;AACA;AACA;AACO,SAASkC,4BAA4BA,CAAA,EAAG;EAC9C,IAAAxE,mBAAU,EAAE,2DAA2D,EAAE;IACxEC,KAAK,EAAE,KAAK;IACZqC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACO,SAASmC,kBAAkBA,CAAA,EAAG;EACpC,IAAAzE,mBAAU,EAAE,iDAAiD,EAAE;IAC9DC,KAAK,EAAE,KAAK;IACZqC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASoC,MAAMA,CAAEjF,KAAK,EAAG;EAC/B,OAAO,CAAC,CAAEA,KAAK,CAAC8C,UAAU,CAACK,OAAO,EAAE+B,MAAM;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASvB,mBAAmBA,CAAE3D,KAAK,EAAG;EAC5C,OAAOiF,MAAM,CAAEjF,KAAM,CAAC,GAAGA,KAAK,CAAC2D,mBAAmB,GAAG,KAAK;AAC3D"}
@@ -3,7 +3,69 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.FOCUSABLE_ENTITIES = void 0;
7
- const FOCUSABLE_ENTITIES = ['wp_template_part', 'wp_navigation', 'wp_block'];
6
+ exports.TEMPLATE_POST_TYPE = exports.TEMPLATE_PART_POST_TYPE = exports.TEMPLATE_PART_AREA_DEFAULT_CATEGORY = exports.TEMPLATE_ORIGINS = exports.POST_TYPE_LABELS = exports.PATTERN_USER_CATEGORY = exports.PATTERN_TYPES = exports.PATTERN_SYNC_TYPES = exports.PATTERN_DEFAULT_CATEGORY = exports.PATTERN_CORE_SOURCES = exports.PAGE_CONTENT_BLOCK_TYPES = exports.NAVIGATION_POST_TYPE = exports.FOCUSABLE_ENTITIES = void 0;
7
+ var _i18n = require("@wordpress/i18n");
8
+ var _patterns = require("@wordpress/patterns");
9
+ var _lockUnlock = require("../lock-unlock");
10
+ /**
11
+ * WordPress dependencies
12
+ */
13
+
14
+ /**
15
+ * Internal dependencies
16
+ */
17
+
18
+ // Navigation
19
+ const NAVIGATION_POST_TYPE = 'wp_navigation';
20
+
21
+ // Templates.
22
+ exports.NAVIGATION_POST_TYPE = NAVIGATION_POST_TYPE;
23
+ const TEMPLATE_POST_TYPE = 'wp_template';
24
+ exports.TEMPLATE_POST_TYPE = TEMPLATE_POST_TYPE;
25
+ const TEMPLATE_PART_POST_TYPE = 'wp_template_part';
26
+ exports.TEMPLATE_PART_POST_TYPE = TEMPLATE_PART_POST_TYPE;
27
+ const TEMPLATE_ORIGINS = {
28
+ custom: 'custom',
29
+ theme: 'theme',
30
+ plugin: 'plugin'
31
+ };
32
+ exports.TEMPLATE_ORIGINS = TEMPLATE_ORIGINS;
33
+ const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';
34
+
35
+ // Patterns.
36
+ exports.TEMPLATE_PART_AREA_DEFAULT_CATEGORY = TEMPLATE_PART_AREA_DEFAULT_CATEGORY;
37
+ const {
38
+ PATTERN_TYPES,
39
+ PATTERN_DEFAULT_CATEGORY,
40
+ PATTERN_USER_CATEGORY,
41
+ PATTERN_CORE_SOURCES,
42
+ PATTERN_SYNC_TYPES
43
+ } = (0, _lockUnlock.unlock)(_patterns.privateApis);
44
+
45
+ // Entities that are editable in focus mode.
46
+ exports.PATTERN_SYNC_TYPES = PATTERN_SYNC_TYPES;
47
+ exports.PATTERN_CORE_SOURCES = PATTERN_CORE_SOURCES;
48
+ exports.PATTERN_USER_CATEGORY = PATTERN_USER_CATEGORY;
49
+ exports.PATTERN_DEFAULT_CATEGORY = PATTERN_DEFAULT_CATEGORY;
50
+ exports.PATTERN_TYPES = PATTERN_TYPES;
51
+ const FOCUSABLE_ENTITIES = [TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE, PATTERN_TYPES.user];
52
+
53
+ /**
54
+ * Block types that are considered to be page content. These are the only blocks
55
+ * editable when hasPageContentFocus() is true.
56
+ */
8
57
  exports.FOCUSABLE_ENTITIES = FOCUSABLE_ENTITIES;
58
+ const PAGE_CONTENT_BLOCK_TYPES = {
59
+ 'core/post-title': true,
60
+ 'core/post-featured-image': true,
61
+ 'core/post-content': true
62
+ };
63
+ exports.PAGE_CONTENT_BLOCK_TYPES = PAGE_CONTENT_BLOCK_TYPES;
64
+ const POST_TYPE_LABELS = {
65
+ [TEMPLATE_POST_TYPE]: (0, _i18n.__)('Template'),
66
+ [TEMPLATE_PART_POST_TYPE]: (0, _i18n.__)('Template Part'),
67
+ [PATTERN_TYPES.user]: (0, _i18n.__)('Pattern'),
68
+ [NAVIGATION_POST_TYPE]: (0, _i18n.__)('Navigation')
69
+ };
70
+ exports.POST_TYPE_LABELS = POST_TYPE_LABELS;
9
71
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["FOCUSABLE_ENTITIES","exports"],"sources":["@wordpress/edit-site/src/utils/constants.js"],"sourcesContent":["export const FOCUSABLE_ENTITIES = [\n\t'wp_template_part',\n\t'wp_navigation',\n\t'wp_block',\n];\n"],"mappings":";;;;;;AAAO,MAAMA,kBAAkB,GAAG,CACjC,kBAAkB,EAClB,eAAe,EACf,UAAU,CACV;AAACC,OAAA,CAAAD,kBAAA,GAAAA,kBAAA"}
1
+ {"version":3,"names":["_i18n","require","_patterns","_lockUnlock","NAVIGATION_POST_TYPE","exports","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_ORIGINS","custom","theme","plugin","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","PATTERN_TYPES","PATTERN_DEFAULT_CATEGORY","PATTERN_USER_CATEGORY","PATTERN_CORE_SOURCES","PATTERN_SYNC_TYPES","unlock","patternPrivateApis","FOCUSABLE_ENTITIES","user","PAGE_CONTENT_BLOCK_TYPES","POST_TYPE_LABELS","__"],"sources":["@wordpress/edit-site/src/utils/constants.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as patternPrivateApis } from '@wordpress/patterns';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\n// Navigation\nexport const NAVIGATION_POST_TYPE = 'wp_navigation';\n\n// Templates.\nexport const TEMPLATE_POST_TYPE = 'wp_template';\nexport const TEMPLATE_PART_POST_TYPE = 'wp_template_part';\nexport const TEMPLATE_ORIGINS = {\n\tcustom: 'custom',\n\ttheme: 'theme',\n\tplugin: 'plugin',\n};\nexport const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';\n\n// Patterns.\nexport const {\n\tPATTERN_TYPES,\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_USER_CATEGORY,\n\tPATTERN_CORE_SOURCES,\n\tPATTERN_SYNC_TYPES,\n} = unlock( patternPrivateApis );\n\n// Entities that are editable in focus mode.\nexport const FOCUSABLE_ENTITIES = [\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n];\n\n/**\n * Block types that are considered to be page content. These are the only blocks\n * editable when hasPageContentFocus() is true.\n */\nexport const PAGE_CONTENT_BLOCK_TYPES = {\n\t'core/post-title': true,\n\t'core/post-featured-image': true,\n\t'core/post-content': true,\n};\n\nexport const POST_TYPE_LABELS = {\n\t[ TEMPLATE_POST_TYPE ]: __( 'Template' ),\n\t[ TEMPLATE_PART_POST_TYPE ]: __( 'Template Part' ),\n\t[ PATTERN_TYPES.user ]: __( 'Pattern' ),\n\t[ NAVIGATION_POST_TYPE ]: __( 'Navigation' ),\n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AAACjB,OAAA,CAAAiB,wBAAA,GAAAA,wBAAA;AAEK,MAAMC,gBAAgB,GAAG;EAC/B,CAAEjB,kBAAkB,GAAI,IAAAkB,QAAE,EAAE,UAAW,CAAC;EACxC,CAAEjB,uBAAuB,GAAI,IAAAiB,QAAE,EAAE,eAAgB,CAAC;EAClD,CAAEX,aAAa,CAACQ,IAAI,GAAI,IAAAG,QAAE,EAAE,SAAU,CAAC;EACvC,CAAEpB,oBAAoB,GAAI,IAAAoB,QAAE,EAAE,YAAa;AAC5C,CAAC;AAACnB,OAAA,CAAAkB,gBAAA,GAAAA,gBAAA"}
@@ -4,6 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = isTemplateRemovable;
7
+ var _constants = require("./constants");
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+
7
12
  /**
8
13
  * Check if a template is removable.
9
14
  *
@@ -14,6 +19,6 @@ function isTemplateRemovable(template) {
14
19
  if (!template) {
15
20
  return false;
16
21
  }
17
- return template.source === 'custom' && !template.has_theme_file;
22
+ return template.source === _constants.TEMPLATE_ORIGINS.custom && !template.has_theme_file;
18
23
  }
19
24
  //# sourceMappingURL=is-template-removable.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["isTemplateRemovable","template","source","has_theme_file"],"sources":["@wordpress/edit-site/src/utils/is-template-removable.js"],"sourcesContent":["/**\n * Check if a template is removable.\n *\n * @param {Object} template The template entity to check.\n * @return {boolean} Whether the template is revertable.\n */\nexport default function isTemplateRemovable( template ) {\n\tif ( ! template ) {\n\t\treturn false;\n\t}\n\n\treturn template.source === 'custom' && ! template.has_theme_file;\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,mBAAmBA,CAAEC,QAAQ,EAAG;EACvD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EAEA,OAAOA,QAAQ,CAACC,MAAM,KAAK,QAAQ,IAAI,CAAED,QAAQ,CAACE,cAAc;AACjE"}
1
+ {"version":3,"names":["_constants","require","isTemplateRemovable","template","source","TEMPLATE_ORIGINS","custom","has_theme_file"],"sources":["@wordpress/edit-site/src/utils/is-template-removable.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { TEMPLATE_ORIGINS } from './constants';\n\n/**\n * Check if a template is removable.\n *\n * @param {Object} template The template entity to check.\n * @return {boolean} Whether the template is revertable.\n */\nexport default function isTemplateRemovable( template ) {\n\tif ( ! template ) {\n\t\treturn false;\n\t}\n\n\treturn (\n\t\ttemplate.source === TEMPLATE_ORIGINS.custom && ! template.has_theme_file\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,mBAAmBA,CAAEC,QAAQ,EAAG;EACvD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EAEA,OACCA,QAAQ,CAACC,MAAM,KAAKC,2BAAgB,CAACC,MAAM,IAAI,CAAEH,QAAQ,CAACI,cAAc;AAE1E"}
@@ -4,6 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = isTemplateRevertable;
7
+ var _constants = require("./constants");
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+
7
12
  /**
8
13
  * Check if a template is revertable to its original theme-provided template file.
9
14
  *
@@ -15,7 +20,7 @@ function isTemplateRevertable(template) {
15
20
  return false;
16
21
  }
17
22
  /* eslint-disable camelcase */
18
- return template?.source === 'custom' && template?.has_theme_file;
23
+ return template?.source === _constants.TEMPLATE_ORIGINS.custom && template?.has_theme_file;
19
24
  /* eslint-enable camelcase */
20
25
  }
21
26
  //# sourceMappingURL=is-template-revertable.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["isTemplateRevertable","template","source","has_theme_file"],"sources":["@wordpress/edit-site/src/utils/is-template-revertable.js"],"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"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,oBAAoBA,CAAEC,QAAQ,EAAG;EACxD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EACA;EACA,OAAOA,QAAQ,EAAEC,MAAM,KAAK,QAAQ,IAAID,QAAQ,EAAEE,cAAc;EAChE;AACD"}
1
+ {"version":3,"names":["_constants","require","isTemplateRevertable","template","source","TEMPLATE_ORIGINS","custom","has_theme_file"],"sources":["@wordpress/edit-site/src/utils/is-template-revertable.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { TEMPLATE_ORIGINS } from './constants';\n\n/**\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 (\n\t\ttemplate?.source === TEMPLATE_ORIGINS.custom && template?.has_theme_file\n\t);\n\t/* eslint-enable camelcase */\n}\n"],"mappings":";;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,oBAAoBA,CAAEC,QAAQ,EAAG;EACxD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EACA;EACA,OACCA,QAAQ,EAAEC,MAAM,KAAKC,2BAAgB,CAACC,MAAM,IAAIH,QAAQ,EAAEI,cAAc;EAEzE;AACD"}
@@ -7,6 +7,7 @@ exports.useExistingTemplateParts = exports.getUniqueTemplatePartTitle = exports.
7
7
  var _changeCase = require("change-case");
8
8
  var _data = require("@wordpress/data");
9
9
  var _coreData = require("@wordpress/core-data");
10
+ var _constants = require("./constants");
10
11
  /**
11
12
  * External dependencies
12
13
  */
@@ -15,8 +16,12 @@ var _coreData = require("@wordpress/core-data");
15
16
  * WordPress dependencies
16
17
  */
17
18
 
19
+ /**
20
+ * Internal dependencies
21
+ */
22
+
18
23
  const useExistingTemplateParts = () => {
19
- return (0, _data.useSelect)(select => select(_coreData.store).getEntityRecords('postType', 'wp_template_part', {
24
+ return (0, _data.useSelect)(select => select(_coreData.store).getEntityRecords('postType', _constants.TEMPLATE_PART_POST_TYPE, {
20
25
  per_page: -1
21
26
  }), []);
22
27
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_changeCase","require","_data","_coreData","useExistingTemplateParts","useSelect","select","coreStore","getEntityRecords","per_page","exports","getUniqueTemplatePartTitle","title","templateParts","lowercaseTitle","toLowerCase","existingTitles","map","templatePart","rendered","includes","suffix","getCleanTemplatePartSlug","kebabCase","replace"],"sources":["@wordpress/edit-site/src/utils/template-part-create.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { paramCase as kebabCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport const useExistingTemplateParts = () => {\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\t{\n\t\t\t\t\tper_page: -1,\n\t\t\t\t}\n\t\t\t),\n\t\t[]\n\t);\n};\n\n/**\n * Return a unique template part title based on\n * the given title and existing template parts.\n *\n * @param {string} title The original template part title.\n * @param {Object} templateParts The array of template part entities.\n * @return {string} A unique template part title.\n */\nexport const getUniqueTemplatePartTitle = ( title, templateParts ) => {\n\tconst lowercaseTitle = title.toLowerCase();\n\tconst existingTitles = templateParts.map( ( templatePart ) =>\n\t\ttemplatePart.title.rendered.toLowerCase()\n\t);\n\n\tif ( ! existingTitles.includes( lowercaseTitle ) ) {\n\t\treturn title;\n\t}\n\n\tlet suffix = 2;\n\twhile ( existingTitles.includes( `${ lowercaseTitle } ${ suffix }` ) ) {\n\t\tsuffix++;\n\t}\n\n\treturn `${ title } ${ suffix }`;\n};\n\n/**\n * Get a valid slug for a template part.\n * Currently template parts only allow latin chars.\n * The fallback slug will receive suffix by default.\n *\n * @param {string} title The template part title.\n * @return {string} A valid template part slug.\n */\nexport const getCleanTemplatePartSlug = ( title ) => {\n\treturn kebabCase( title ).replace( /[^\\w-]+/g, '' ) || 'wp-custom-part';\n};\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIO,MAAMG,wBAAwB,GAAGA,CAAA,KAAM;EAC7C,OAAO,IAAAC,eAAS,EACbC,MAAM,IACPA,MAAM,CAAEC,eAAU,CAAC,CAACC,gBAAgB,CACnC,UAAU,EACV,kBAAkB,EAClB;IACCC,QAAQ,EAAE,CAAC;EACZ,CACD,CAAC,EACF,EACD,CAAC;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPAC,OAAA,CAAAN,wBAAA,GAAAA,wBAAA;AAQO,MAAMO,0BAA0B,GAAGA,CAAEC,KAAK,EAAEC,aAAa,KAAM;EACrE,MAAMC,cAAc,GAAGF,KAAK,CAACG,WAAW,CAAC,CAAC;EAC1C,MAAMC,cAAc,GAAGH,aAAa,CAACI,GAAG,CAAIC,YAAY,IACvDA,YAAY,CAACN,KAAK,CAACO,QAAQ,CAACJ,WAAW,CAAC,CACzC,CAAC;EAED,IAAK,CAAEC,cAAc,CAACI,QAAQ,CAAEN,cAAe,CAAC,EAAG;IAClD,OAAOF,KAAK;EACb;EAEA,IAAIS,MAAM,GAAG,CAAC;EACd,OAAQL,cAAc,CAACI,QAAQ,CAAG,GAAGN,cAAgB,IAAIO,MAAQ,EAAE,CAAC,EAAG;IACtEA,MAAM,EAAE;EACT;EAEA,OAAQ,GAAGT,KAAO,IAAIS,MAAQ,EAAC;AAChC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPAX,OAAA,CAAAC,0BAAA,GAAAA,0BAAA;AAQO,MAAMW,wBAAwB,GAAKV,KAAK,IAAM;EACpD,OAAO,IAAAW,qBAAS,EAAEX,KAAM,CAAC,CAACY,OAAO,CAAE,UAAU,EAAE,EAAG,CAAC,IAAI,gBAAgB;AACxE,CAAC;AAACd,OAAA,CAAAY,wBAAA,GAAAA,wBAAA"}
1
+ {"version":3,"names":["_changeCase","require","_data","_coreData","_constants","useExistingTemplateParts","useSelect","select","coreStore","getEntityRecords","TEMPLATE_PART_POST_TYPE","per_page","exports","getUniqueTemplatePartTitle","title","templateParts","lowercaseTitle","toLowerCase","existingTitles","map","templatePart","rendered","includes","suffix","getCleanTemplatePartSlug","kebabCase","replace"],"sources":["@wordpress/edit-site/src/utils/template-part-create.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { paramCase as kebabCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_PART_POST_TYPE } from './constants';\n\nexport const useExistingTemplateParts = () => {\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t{\n\t\t\t\t\tper_page: -1,\n\t\t\t\t}\n\t\t\t),\n\t\t[]\n\t);\n};\n\n/**\n * Return a unique template part title based on\n * the given title and existing template parts.\n *\n * @param {string} title The original template part title.\n * @param {Object} templateParts The array of template part entities.\n * @return {string} A unique template part title.\n */\nexport const getUniqueTemplatePartTitle = ( title, templateParts ) => {\n\tconst lowercaseTitle = title.toLowerCase();\n\tconst existingTitles = templateParts.map( ( templatePart ) =>\n\t\ttemplatePart.title.rendered.toLowerCase()\n\t);\n\n\tif ( ! existingTitles.includes( lowercaseTitle ) ) {\n\t\treturn title;\n\t}\n\n\tlet suffix = 2;\n\twhile ( existingTitles.includes( `${ lowercaseTitle } ${ suffix }` ) ) {\n\t\tsuffix++;\n\t}\n\n\treturn `${ title } ${ suffix }`;\n};\n\n/**\n * Get a valid slug for a template part.\n * Currently template parts only allow latin chars.\n * The fallback slug will receive suffix by default.\n *\n * @param {string} title The template part title.\n * @return {string} A valid template part slug.\n */\nexport const getCleanTemplatePartSlug = ( title ) => {\n\treturn kebabCase( title ).replace( /[^\\w-]+/g, '' ) || 'wp-custom-part';\n};\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,UAAA,GAAAH,OAAA;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAGO,MAAMI,wBAAwB,GAAGA,CAAA,KAAM;EAC7C,OAAO,IAAAC,eAAS,EACbC,MAAM,IACPA,MAAM,CAAEC,eAAU,CAAC,CAACC,gBAAgB,CACnC,UAAU,EACVC,kCAAuB,EACvB;IACCC,QAAQ,EAAE,CAAC;EACZ,CACD,CAAC,EACF,EACD,CAAC;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPAC,OAAA,CAAAP,wBAAA,GAAAA,wBAAA;AAQO,MAAMQ,0BAA0B,GAAGA,CAAEC,KAAK,EAAEC,aAAa,KAAM;EACrE,MAAMC,cAAc,GAAGF,KAAK,CAACG,WAAW,CAAC,CAAC;EAC1C,MAAMC,cAAc,GAAGH,aAAa,CAACI,GAAG,CAAIC,YAAY,IACvDA,YAAY,CAACN,KAAK,CAACO,QAAQ,CAACJ,WAAW,CAAC,CACzC,CAAC;EAED,IAAK,CAAEC,cAAc,C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