@wordpress/edit-site 5.31.0 → 5.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (906) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-page/index.js.map +1 -1
  3. package/build/components/add-new-pattern/index.js.map +1 -1
  4. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  5. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  6. package/build/components/add-new-template/index.js +282 -13
  7. package/build/components/add-new-template/index.js.map +1 -1
  8. package/build/components/add-new-template/utils.js +22 -11
  9. package/build/components/add-new-template/utils.js.map +1 -1
  10. package/build/components/app/index.js.map +1 -1
  11. package/build/components/async/index.js +51 -0
  12. package/build/components/async/index.js.map +1 -0
  13. package/build/components/block-editor/block-inspector-button.js +10 -9
  14. package/build/components/block-editor/block-inspector-button.js.map +1 -1
  15. package/build/components/block-editor/editor-canvas.js +23 -7
  16. package/build/components/block-editor/editor-canvas.js.map +1 -1
  17. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  18. package/build/components/block-editor/resizable-editor.js.map +1 -1
  19. package/build/components/block-editor/resize-handle.js.map +1 -1
  20. package/build/components/block-editor/site-editor-canvas.js +20 -5
  21. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  22. package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  23. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  24. package/build/components/canvas-loader/index.js.map +1 -1
  25. package/build/components/code-editor/index.js.map +1 -1
  26. package/build/components/create-template-part-modal/index.js.map +1 -1
  27. package/build/components/editor/index.js +47 -11
  28. package/build/components/editor/index.js.map +1 -1
  29. package/build/components/editor-canvas-container/index.js +1 -2
  30. package/build/components/editor-canvas-container/index.js.map +1 -1
  31. package/build/components/error-boundary/index.js.map +1 -1
  32. package/build/components/error-boundary/warning.js.map +1 -1
  33. package/build/components/global-styles/background-panel.js +50 -0
  34. package/build/components/global-styles/background-panel.js.map +1 -0
  35. package/build/components/global-styles/block-preview-panel.js +6 -1
  36. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  37. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  38. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  39. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  40. package/build/components/global-styles/font-families.js +2 -2
  41. package/build/components/global-styles/font-families.js.map +1 -1
  42. package/build/components/global-styles/font-family-item.js.map +1 -1
  43. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  44. package/build/components/global-styles/font-library-modal/context.js +88 -31
  45. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  46. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
  47. package/build/components/global-styles/font-library-modal/font-collection.js +11 -4
  48. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  49. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  50. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  51. package/build/components/global-styles/font-library-modal/index.js +1 -1
  52. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  53. package/build/components/global-styles/font-library-modal/installed-fonts.js +10 -9
  54. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  55. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  56. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  57. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  58. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  59. package/build/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
  60. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  61. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  62. package/build/components/global-styles/font-library-modal/utils/index.js +20 -2
  63. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  64. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  65. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  66. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  67. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
  68. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  69. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  70. package/build/components/global-styles/header.js.map +1 -1
  71. package/build/components/global-styles/highlighted-colors.js +1 -1
  72. package/build/components/global-styles/highlighted-colors.js.map +1 -1
  73. package/build/components/global-styles/hooks.js +11 -3
  74. package/build/components/global-styles/hooks.js.map +1 -1
  75. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  76. package/build/components/global-styles/index.js.map +1 -1
  77. package/build/components/global-styles/navigation-button.js.map +1 -1
  78. package/build/components/global-styles/palette.js +3 -1
  79. package/build/components/global-styles/palette.js.map +1 -1
  80. package/build/components/global-styles/preview-colors.js +2 -2
  81. package/build/components/global-styles/preview-colors.js.map +1 -1
  82. package/build/components/global-styles/preview-iframe.js.map +1 -1
  83. package/build/components/global-styles/preview-styles.js.map +1 -1
  84. package/build/components/global-styles/root-menu.js +8 -2
  85. package/build/components/global-styles/root-menu.js.map +1 -1
  86. package/build/components/global-styles/screen-background.js +34 -0
  87. package/build/components/global-styles/screen-background.js.map +1 -0
  88. package/build/components/global-styles/screen-block-list.js.map +1 -1
  89. package/build/components/global-styles/screen-block.js.map +1 -1
  90. package/build/components/global-styles/screen-color-palette.js +2 -2
  91. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  92. package/build/components/global-styles/screen-colors.js +6 -4
  93. package/build/components/global-styles/screen-colors.js.map +1 -1
  94. package/build/components/global-styles/screen-css.js.map +1 -1
  95. package/build/components/global-styles/screen-layout.js.map +1 -1
  96. package/build/components/global-styles/screen-revisions/index.js +1 -1
  97. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  98. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  99. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  100. package/build/components/global-styles/screen-root.js.map +1 -1
  101. package/build/components/global-styles/screen-style-variations.js +3 -37
  102. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  103. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  104. package/build/components/global-styles/screen-typography.js +6 -6
  105. package/build/components/global-styles/screen-typography.js.map +1 -1
  106. package/build/components/global-styles/style-variations-container.js +5 -2
  107. package/build/components/global-styles/style-variations-container.js.map +1 -1
  108. package/build/components/global-styles/subtitle.js.map +1 -1
  109. package/build/components/global-styles/typography-elements.js.map +1 -1
  110. package/build/components/global-styles/typography-example.js.map +1 -1
  111. package/build/components/global-styles/typography-panel.js.map +1 -1
  112. package/build/components/global-styles/typography-preview.js.map +1 -1
  113. package/build/components/global-styles/ui.js +5 -2
  114. package/build/components/global-styles/ui.js.map +1 -1
  115. package/build/components/global-styles/utils.js.map +1 -1
  116. package/build/components/global-styles/variations/variation.js.map +1 -1
  117. package/build/components/global-styles/variations/variations-color.js +10 -3
  118. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  119. package/build/components/global-styles/variations/variations-panel.js.map +1 -1
  120. package/build/components/global-styles/variations/variations-typography.js +9 -2
  121. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  122. package/build/components/global-styles-renderer/index.js.map +1 -1
  123. package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
  124. package/build/components/header-edit-mode/index.js +4 -4
  125. package/build/components/header-edit-mode/index.js.map +1 -1
  126. package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +1 -1
  127. package/build/components/header-edit-mode/more-menu/index.js +10 -12
  128. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  129. package/build/components/header-edit-mode/more-menu/site-export.js.map +1 -1
  130. package/build/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
  131. package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  132. package/build/components/keyboard-shortcuts/edit-mode.js +0 -23
  133. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  134. package/build/components/keyboard-shortcuts/global.js.map +1 -1
  135. package/build/components/keyboard-shortcuts/register.js +0 -18
  136. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  137. package/build/components/layout/animation.js +130 -0
  138. package/build/components/layout/animation.js.map +1 -0
  139. package/build/components/layout/hooks.js.map +1 -1
  140. package/build/components/layout/index.js +21 -64
  141. package/build/components/layout/index.js.map +1 -1
  142. package/build/components/layout/router.js +92 -23
  143. package/build/components/layout/router.js.map +1 -1
  144. package/build/components/media/index.js.map +1 -1
  145. package/build/components/page/header.js.map +1 -1
  146. package/build/components/page/index.js +5 -2
  147. package/build/components/page/index.js.map +1 -1
  148. package/build/components/page-pages/index.js +33 -33
  149. package/build/components/page-pages/index.js.map +1 -1
  150. package/build/components/page-patterns/dataviews-pattern-actions.js +5 -4
  151. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  152. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  153. package/build/components/page-patterns/header.js +2 -2
  154. package/build/components/page-patterns/header.js.map +1 -1
  155. package/build/components/page-patterns/index.js +136 -39
  156. package/build/components/page-patterns/index.js.map +1 -1
  157. package/build/components/page-patterns/rename-category-menu-item.js.map +1 -1
  158. package/build/components/page-patterns/search-items.js +18 -59
  159. package/build/components/page-patterns/search-items.js.map +1 -1
  160. package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
  161. package/build/components/page-patterns/use-patterns.js +5 -10
  162. package/build/components/page-patterns/use-patterns.js.map +1 -1
  163. package/build/components/page-patterns/utils.js.map +1 -1
  164. package/build/components/page-templates-template-parts/add-new-template-part.js +2 -1
  165. package/build/components/page-templates-template-parts/add-new-template-part.js.map +1 -1
  166. package/build/components/page-templates-template-parts/hooks.js.map +1 -1
  167. package/build/components/page-templates-template-parts/index.js +35 -80
  168. package/build/components/page-templates-template-parts/index.js.map +1 -1
  169. package/build/components/pagination/index.js.map +1 -1
  170. package/build/components/pattern-modal/duplicate.js +6 -3
  171. package/build/components/pattern-modal/duplicate.js.map +1 -1
  172. package/build/components/pattern-modal/index.js.map +1 -1
  173. package/build/components/pattern-modal/rename.js +6 -3
  174. package/build/components/pattern-modal/rename.js.map +1 -1
  175. package/build/components/plugin-template-setting-panel/index.js +12 -1
  176. package/build/components/plugin-template-setting-panel/index.js.map +1 -1
  177. package/build/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +18 -16
  178. package/build/components/rename-post-menu-item/index.js.map +1 -0
  179. package/build/components/resizable-frame/index.js +1 -5
  180. package/build/components/resizable-frame/index.js.map +1 -1
  181. package/build/components/revisions/index.js.map +1 -1
  182. package/build/components/routes/link.js.map +1 -1
  183. package/build/components/routes/use-title.js.map +1 -1
  184. package/build/components/save-button/index.js +45 -16
  185. package/build/components/save-button/index.js.map +1 -1
  186. package/build/components/save-hub/index.js +8 -112
  187. package/build/components/save-hub/index.js.map +1 -1
  188. package/build/components/save-panel/index.js +3 -3
  189. package/build/components/save-panel/index.js.map +1 -1
  190. package/build/components/sidebar/index.js +41 -79
  191. package/build/components/sidebar/index.js.map +1 -1
  192. package/build/components/sidebar-button/index.js.map +1 -1
  193. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  194. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  195. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  196. package/build/components/sidebar-dataviews/default-views.js +2 -2
  197. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  198. package/build/components/sidebar-dataviews/index.js +2 -2
  199. package/build/components/sidebar-dataviews/index.js.map +1 -1
  200. package/build/components/sidebar-edit-mode/default-sidebar.js +18 -7
  201. package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  202. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +5 -3
  203. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  204. package/build/components/sidebar-edit-mode/index.js +30 -56
  205. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  206. package/build/components/sidebar-edit-mode/page-panels/index.js +26 -15
  207. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  208. package/build/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
  209. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  210. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  211. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +2 -2
  212. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  213. package/build/components/sidebar-edit-mode/settings-header/index.js +4 -5
  214. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  215. package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
  216. package/build/components/sidebar-edit-mode/template-panel/index.js +11 -17
  217. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  218. package/build/components/sidebar-navigation-item/index.js +31 -0
  219. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  220. package/build/components/sidebar-navigation-screen/index.js +36 -9
  221. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  222. package/build/components/sidebar-navigation-screen-details-footer/index.js +5 -1
  223. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  224. package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  225. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
  226. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  227. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
  228. package/build/components/sidebar-navigation-screen-global-styles/index.js +11 -7
  229. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  230. package/build/components/sidebar-navigation-screen-main/index.js +6 -15
  231. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  232. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
  233. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  234. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +7 -2
  235. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  236. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  237. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  238. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  239. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  240. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  241. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -15
  242. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  243. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  244. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  245. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  246. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  247. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -5
  248. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  249. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  250. package/build/components/sidebar-navigation-screen-page/index.js +22 -12
  251. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  252. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  253. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  254. package/build/components/sidebar-navigation-screen-pattern/index.js +14 -5
  255. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  256. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  257. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
  258. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  259. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  260. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  261. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -1
  262. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  263. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  264. package/build/components/sidebar-navigation-screen-patterns/index.js +34 -32
  265. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  266. package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
  267. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  268. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  269. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  270. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  271. package/build/components/sidebar-navigation-screen-template/index.js +10 -7
  272. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  273. package/build/components/sidebar-navigation-screen-template/template-areas.js.map +1 -1
  274. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  275. package/build/components/sidebar-navigation-screen-templates-browse/index.js +6 -8
  276. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  277. package/build/components/site-hub/index.js +22 -21
  278. package/build/components/site-hub/index.js.map +1 -1
  279. package/build/components/site-icon/index.js.map +1 -1
  280. package/build/components/start-template-options/index.js.map +1 -1
  281. package/build/components/style-book/index.js +1 -1
  282. package/build/components/style-book/index.js.map +1 -1
  283. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +16 -7
  284. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  285. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  286. package/build/components/table/index.js.map +1 -1
  287. package/build/components/template-actions/index.js +7 -8
  288. package/build/components/template-actions/index.js.map +1 -1
  289. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  290. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  291. package/build/components/template-part-converter/index.js.map +1 -1
  292. package/build/components/use-edited-entity-record/index.js.map +1 -1
  293. package/build/components/welcome-guide/editor.js.map +1 -1
  294. package/build/components/welcome-guide/image.js.map +1 -1
  295. package/build/components/welcome-guide/index.js.map +1 -1
  296. package/build/components/welcome-guide/page.js.map +1 -1
  297. package/build/components/welcome-guide/styles.js +6 -3
  298. package/build/components/welcome-guide/styles.js.map +1 -1
  299. package/build/components/welcome-guide/template.js.map +1 -1
  300. package/build/hooks/commands/use-common-commands.js.map +1 -1
  301. package/build/hooks/commands/use-edit-mode-commands.js +10 -28
  302. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  303. package/build/hooks/components.js.map +1 -1
  304. package/build/hooks/index.js +0 -1
  305. package/build/hooks/index.js.map +1 -1
  306. package/build/hooks/push-changes-to-global-styles/index.js +3 -40
  307. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  308. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +1 -1
  309. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  310. package/build/index.js +3 -8
  311. package/build/index.js.map +1 -1
  312. package/build/lock-unlock.js.map +1 -1
  313. package/build/store/actions.js +21 -96
  314. package/build/store/actions.js.map +1 -1
  315. package/build/store/constants.js.map +1 -1
  316. package/build/store/index.js +1 -1
  317. package/build/store/index.js.map +1 -1
  318. package/build/store/private-actions.js +1 -85
  319. package/build/store/private-actions.js.map +1 -1
  320. package/build/store/private-selectors.js.map +1 -1
  321. package/build/store/reducer.js.map +1 -1
  322. package/build/store/selectors.js +1 -9
  323. package/build/store/selectors.js.map +1 -1
  324. package/build/utils/clone-deep.js.map +1 -1
  325. package/build/utils/constants.js +2 -1
  326. package/build/utils/constants.js.map +1 -1
  327. package/build/utils/get-is-list-page.js.map +1 -1
  328. package/build/utils/is-previewing-theme.js.map +1 -1
  329. package/build/utils/is-template-removable.js.map +1 -1
  330. package/build/utils/is-template-revertable.js.map +1 -1
  331. package/build/utils/math.js.map +1 -1
  332. package/build/utils/set-nested-value.js +44 -0
  333. package/build/utils/set-nested-value.js.map +1 -0
  334. package/build/utils/template-part-create.js.map +1 -1
  335. package/build/utils/use-activate-theme.js.map +1 -1
  336. package/build/utils/use-actual-current-theme.js.map +1 -1
  337. package/build-module/components/add-new-page/index.js.map +1 -1
  338. package/build-module/components/add-new-pattern/index.js.map +1 -1
  339. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  340. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  341. package/build-module/components/add-new-template/index.js +283 -14
  342. package/build-module/components/add-new-template/index.js.map +1 -1
  343. package/build-module/components/add-new-template/utils.js +21 -11
  344. package/build-module/components/add-new-template/utils.js.map +1 -1
  345. package/build-module/components/app/index.js.map +1 -1
  346. package/build-module/components/async/index.js +44 -0
  347. package/build-module/components/async/index.js.map +1 -0
  348. package/build-module/components/block-editor/block-inspector-button.js +9 -8
  349. package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
  350. package/build-module/components/block-editor/editor-canvas.js +24 -8
  351. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  352. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
  353. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  354. package/build-module/components/block-editor/resize-handle.js.map +1 -1
  355. package/build-module/components/block-editor/site-editor-canvas.js +20 -5
  356. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  357. package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  358. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  359. package/build-module/components/canvas-loader/index.js.map +1 -1
  360. package/build-module/components/code-editor/index.js.map +1 -1
  361. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  362. package/build-module/components/editor/index.js +48 -12
  363. package/build-module/components/editor/index.js.map +1 -1
  364. package/build-module/components/editor-canvas-container/index.js +1 -2
  365. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  366. package/build-module/components/error-boundary/index.js.map +1 -1
  367. package/build-module/components/error-boundary/warning.js.map +1 -1
  368. package/build-module/components/global-styles/background-panel.js +44 -0
  369. package/build-module/components/global-styles/background-panel.js.map +1 -0
  370. package/build-module/components/global-styles/block-preview-panel.js +6 -1
  371. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  372. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  373. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  374. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  375. package/build-module/components/global-styles/font-families.js +1 -1
  376. package/build-module/components/global-styles/font-families.js.map +1 -1
  377. package/build-module/components/global-styles/font-family-item.js.map +1 -1
  378. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  379. package/build-module/components/global-styles/font-library-modal/context.js +87 -31
  380. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  381. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
  382. package/build-module/components/global-styles/font-library-modal/font-collection.js +12 -5
  383. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  384. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  385. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  386. package/build-module/components/global-styles/font-library-modal/index.js +2 -2
  387. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  388. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +11 -10
  389. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  390. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  391. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  392. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  393. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  394. package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
  395. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  396. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  397. package/build-module/components/global-styles/font-library-modal/utils/index.js +20 -2
  398. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  399. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  400. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  401. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  402. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
  403. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  404. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  405. package/build-module/components/global-styles/header.js.map +1 -1
  406. package/build-module/components/global-styles/highlighted-colors.js +1 -1
  407. package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
  408. package/build-module/components/global-styles/hooks.js +11 -3
  409. package/build-module/components/global-styles/hooks.js.map +1 -1
  410. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  411. package/build-module/components/global-styles/index.js.map +1 -1
  412. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  413. package/build-module/components/global-styles/palette.js +3 -1
  414. package/build-module/components/global-styles/palette.js.map +1 -1
  415. package/build-module/components/global-styles/preview-colors.js +2 -2
  416. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  417. package/build-module/components/global-styles/preview-iframe.js.map +1 -1
  418. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  419. package/build-module/components/global-styles/root-menu.js +9 -3
  420. package/build-module/components/global-styles/root-menu.js.map +1 -1
  421. package/build-module/components/global-styles/screen-background.js +26 -0
  422. package/build-module/components/global-styles/screen-background.js.map +1 -0
  423. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  424. package/build-module/components/global-styles/screen-block.js.map +1 -1
  425. package/build-module/components/global-styles/screen-color-palette.js +2 -2
  426. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  427. package/build-module/components/global-styles/screen-colors.js +6 -4
  428. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  429. package/build-module/components/global-styles/screen-css.js.map +1 -1
  430. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  431. package/build-module/components/global-styles/screen-revisions/index.js +1 -1
  432. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  433. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  434. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  435. package/build-module/components/global-styles/screen-root.js.map +1 -1
  436. package/build-module/components/global-styles/screen-style-variations.js +4 -38
  437. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  438. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  439. package/build-module/components/global-styles/screen-typography.js +6 -6
  440. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  441. package/build-module/components/global-styles/style-variations-container.js +5 -2
  442. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  443. package/build-module/components/global-styles/subtitle.js.map +1 -1
  444. package/build-module/components/global-styles/typography-elements.js.map +1 -1
  445. package/build-module/components/global-styles/typography-example.js.map +1 -1
  446. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  447. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  448. package/build-module/components/global-styles/ui.js +4 -1
  449. package/build-module/components/global-styles/ui.js.map +1 -1
  450. package/build-module/components/global-styles/utils.js.map +1 -1
  451. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  452. package/build-module/components/global-styles/variations/variations-color.js +10 -3
  453. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  454. package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
  455. package/build-module/components/global-styles/variations/variations-typography.js +9 -2
  456. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  457. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  458. package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
  459. package/build-module/components/header-edit-mode/index.js +3 -3
  460. package/build-module/components/header-edit-mode/index.js.map +1 -1
  461. package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +1 -1
  462. package/build-module/components/header-edit-mode/more-menu/index.js +8 -8
  463. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  464. package/build-module/components/header-edit-mode/more-menu/site-export.js.map +1 -1
  465. package/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
  466. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  467. package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -23
  468. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  469. package/build-module/components/keyboard-shortcuts/global.js.map +1 -1
  470. package/build-module/components/keyboard-shortcuts/register.js +0 -18
  471. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  472. package/build-module/components/layout/animation.js +123 -0
  473. package/build-module/components/layout/animation.js.map +1 -0
  474. package/build-module/components/layout/hooks.js.map +1 -1
  475. package/build-module/components/layout/index.js +21 -64
  476. package/build-module/components/layout/index.js.map +1 -1
  477. package/build-module/components/layout/router.js +92 -23
  478. package/build-module/components/layout/router.js.map +1 -1
  479. package/build-module/components/media/index.js.map +1 -1
  480. package/build-module/components/page/header.js.map +1 -1
  481. package/build-module/components/page/index.js +5 -2
  482. package/build-module/components/page/index.js.map +1 -1
  483. package/build-module/components/page-pages/index.js +32 -32
  484. package/build-module/components/page-pages/index.js.map +1 -1
  485. package/build-module/components/page-patterns/dataviews-pattern-actions.js +5 -4
  486. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  487. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  488. package/build-module/components/page-patterns/header.js +2 -2
  489. package/build-module/components/page-patterns/header.js.map +1 -1
  490. package/build-module/components/page-patterns/index.js +139 -42
  491. package/build-module/components/page-patterns/index.js.map +1 -1
  492. package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
  493. package/build-module/components/page-patterns/search-items.js +17 -57
  494. package/build-module/components/page-patterns/search-items.js.map +1 -1
  495. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
  496. package/build-module/components/page-patterns/use-patterns.js +2 -6
  497. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  498. package/build-module/components/page-patterns/utils.js.map +1 -1
  499. package/build-module/components/page-templates-template-parts/add-new-template-part.js +3 -2
  500. package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +1 -1
  501. package/build-module/components/page-templates-template-parts/hooks.js.map +1 -1
  502. package/build-module/components/page-templates-template-parts/index.js +36 -81
  503. package/build-module/components/page-templates-template-parts/index.js.map +1 -1
  504. package/build-module/components/pagination/index.js.map +1 -1
  505. package/build-module/components/pattern-modal/duplicate.js +4 -1
  506. package/build-module/components/pattern-modal/duplicate.js.map +1 -1
  507. package/build-module/components/pattern-modal/index.js.map +1 -1
  508. package/build-module/components/pattern-modal/rename.js +4 -1
  509. package/build-module/components/pattern-modal/rename.js.map +1 -1
  510. package/build-module/components/plugin-template-setting-panel/index.js +12 -1
  511. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
  512. package/build-module/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +17 -15
  513. package/build-module/components/rename-post-menu-item/index.js.map +1 -0
  514. package/build-module/components/resizable-frame/index.js +1 -5
  515. package/build-module/components/resizable-frame/index.js.map +1 -1
  516. package/build-module/components/revisions/index.js.map +1 -1
  517. package/build-module/components/routes/link.js.map +1 -1
  518. package/build-module/components/routes/use-title.js.map +1 -1
  519. package/build-module/components/save-button/index.js +46 -17
  520. package/build-module/components/save-button/index.js.map +1 -1
  521. package/build-module/components/save-hub/index.js +10 -114
  522. package/build-module/components/save-hub/index.js.map +1 -1
  523. package/build-module/components/save-panel/index.js +2 -2
  524. package/build-module/components/save-panel/index.js.map +1 -1
  525. package/build-module/components/sidebar/index.js +42 -79
  526. package/build-module/components/sidebar/index.js.map +1 -1
  527. package/build-module/components/sidebar-button/index.js.map +1 -1
  528. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  529. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  530. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  531. package/build-module/components/sidebar-dataviews/default-views.js +2 -2
  532. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  533. package/build-module/components/sidebar-dataviews/index.js +2 -2
  534. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  535. package/build-module/components/sidebar-edit-mode/default-sidebar.js +16 -5
  536. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  537. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +5 -3
  538. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  539. package/build-module/components/sidebar-edit-mode/index.js +29 -55
  540. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  541. package/build-module/components/sidebar-edit-mode/page-panels/index.js +29 -18
  542. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  543. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
  544. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  545. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  546. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +4 -4
  547. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  548. package/build-module/components/sidebar-edit-mode/settings-header/index.js +4 -5
  549. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  550. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
  551. package/build-module/components/sidebar-edit-mode/template-panel/index.js +12 -18
  552. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  553. package/build-module/components/sidebar-navigation-item/index.js +31 -0
  554. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  555. package/build-module/components/sidebar-navigation-screen/index.js +37 -10
  556. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  557. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +5 -1
  558. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  559. package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  560. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
  561. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  562. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
  563. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +12 -8
  564. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  565. package/build-module/components/sidebar-navigation-screen-main/index.js +7 -16
  566. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  567. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
  568. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  569. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +8 -3
  570. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  571. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  572. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  573. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  574. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  575. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  576. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -15
  577. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  578. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  579. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  580. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  581. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  582. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -5
  583. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  584. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  585. package/build-module/components/sidebar-navigation-screen-page/index.js +24 -14
  586. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  587. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  588. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  589. package/build-module/components/sidebar-navigation-screen-pattern/index.js +14 -5
  590. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  591. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  592. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
  593. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  594. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  595. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  596. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -1
  597. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  598. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  599. package/build-module/components/sidebar-navigation-screen-patterns/index.js +35 -33
  600. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  601. package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
  602. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  603. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  604. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  605. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  606. package/build-module/components/sidebar-navigation-screen-template/index.js +12 -8
  607. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  608. package/build-module/components/sidebar-navigation-screen-template/template-areas.js.map +1 -1
  609. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  610. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +6 -8
  611. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  612. package/build-module/components/site-hub/index.js +22 -21
  613. package/build-module/components/site-hub/index.js.map +1 -1
  614. package/build-module/components/site-icon/index.js.map +1 -1
  615. package/build-module/components/start-template-options/index.js.map +1 -1
  616. package/build-module/components/style-book/index.js +1 -1
  617. package/build-module/components/style-book/index.js.map +1 -1
  618. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +16 -7
  619. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  620. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  621. package/build-module/components/table/index.js.map +1 -1
  622. package/build-module/components/template-actions/index.js +7 -8
  623. package/build-module/components/template-actions/index.js.map +1 -1
  624. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  625. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  626. package/build-module/components/template-part-converter/index.js.map +1 -1
  627. package/build-module/components/use-edited-entity-record/index.js.map +1 -1
  628. package/build-module/components/welcome-guide/editor.js.map +1 -1
  629. package/build-module/components/welcome-guide/image.js.map +1 -1
  630. package/build-module/components/welcome-guide/index.js.map +1 -1
  631. package/build-module/components/welcome-guide/page.js.map +1 -1
  632. package/build-module/components/welcome-guide/styles.js +6 -3
  633. package/build-module/components/welcome-guide/styles.js.map +1 -1
  634. package/build-module/components/welcome-guide/template.js.map +1 -1
  635. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  636. package/build-module/hooks/commands/use-edit-mode-commands.js +11 -29
  637. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  638. package/build-module/hooks/components.js.map +1 -1
  639. package/build-module/hooks/index.js +0 -1
  640. package/build-module/hooks/index.js.map +1 -1
  641. package/build-module/hooks/push-changes-to-global-styles/index.js +1 -38
  642. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  643. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +1 -1
  644. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  645. package/build-module/index.js +4 -6
  646. package/build-module/index.js.map +1 -1
  647. package/build-module/lock-unlock.js.map +1 -1
  648. package/build-module/store/actions.js +16 -92
  649. package/build-module/store/actions.js.map +1 -1
  650. package/build-module/store/constants.js.map +1 -1
  651. package/build-module/store/index.js.map +1 -1
  652. package/build-module/store/private-actions.js +0 -83
  653. package/build-module/store/private-actions.js.map +1 -1
  654. package/build-module/store/private-selectors.js.map +1 -1
  655. package/build-module/store/reducer.js.map +1 -1
  656. package/build-module/store/selectors.js +1 -9
  657. package/build-module/store/selectors.js.map +1 -1
  658. package/build-module/utils/clone-deep.js.map +1 -1
  659. package/build-module/utils/constants.js +1 -0
  660. package/build-module/utils/constants.js.map +1 -1
  661. package/build-module/utils/get-is-list-page.js.map +1 -1
  662. package/build-module/utils/is-previewing-theme.js.map +1 -1
  663. package/build-module/utils/is-template-removable.js.map +1 -1
  664. package/build-module/utils/is-template-revertable.js.map +1 -1
  665. package/build-module/utils/math.js.map +1 -1
  666. package/build-module/utils/set-nested-value.js +38 -0
  667. package/build-module/utils/set-nested-value.js.map +1 -0
  668. package/build-module/utils/template-part-create.js.map +1 -1
  669. package/build-module/utils/use-activate-theme.js.map +1 -1
  670. package/build-module/utils/use-actual-current-theme.js.map +1 -1
  671. package/build-style/style-rtl.css +287 -688
  672. package/build-style/style.css +287 -688
  673. package/package.json +44 -45
  674. package/src/components/add-new-template/index.js +412 -12
  675. package/src/components/add-new-template/style.scss +0 -22
  676. package/src/components/add-new-template/utils.js +44 -24
  677. package/src/components/async/index.js +43 -0
  678. package/src/components/block-editor/block-inspector-button.js +9 -11
  679. package/src/components/block-editor/editor-canvas.js +59 -23
  680. package/src/components/block-editor/site-editor-canvas.js +16 -8
  681. package/src/components/editor/index.js +61 -17
  682. package/src/components/editor-canvas-container/index.js +0 -1
  683. package/src/components/global-styles/background-panel.js +50 -0
  684. package/src/components/global-styles/block-preview-panel.js +6 -1
  685. package/src/components/global-styles/font-families.js +1 -1
  686. package/src/components/global-styles/font-library-modal/context.js +104 -50
  687. package/src/components/global-styles/font-library-modal/font-collection.js +247 -223
  688. package/src/components/global-styles/font-library-modal/index.js +2 -2
  689. package/src/components/global-styles/font-library-modal/installed-fonts.js +156 -147
  690. package/src/components/global-styles/font-library-modal/style.scss +32 -14
  691. package/src/components/global-styles/font-library-modal/utils/index.js +17 -4
  692. package/src/components/global-styles/highlighted-colors.js +1 -1
  693. package/src/components/global-styles/hooks.js +20 -3
  694. package/src/components/global-styles/palette.js +3 -1
  695. package/src/components/global-styles/preview-colors.js +2 -2
  696. package/src/components/global-styles/root-menu.js +12 -1
  697. package/src/components/global-styles/screen-background.js +29 -0
  698. package/src/components/global-styles/screen-color-palette.js +2 -2
  699. package/src/components/global-styles/screen-colors.js +4 -4
  700. package/src/components/global-styles/screen-revisions/index.js +1 -1
  701. package/src/components/global-styles/screen-style-variations.js +4 -36
  702. package/src/components/global-styles/screen-typography.js +6 -9
  703. package/src/components/global-styles/style-variations-container.js +2 -1
  704. package/src/components/global-styles/style.scss +14 -12
  705. package/src/components/global-styles/ui.js +5 -0
  706. package/src/components/global-styles/variations/style.scss +32 -17
  707. package/src/components/global-styles/variations/variations-color.js +4 -2
  708. package/src/components/global-styles/variations/variations-typography.js +4 -1
  709. package/src/components/header-edit-mode/index.js +3 -5
  710. package/src/components/header-edit-mode/more-menu/index.js +6 -17
  711. package/src/components/header-edit-mode/style.scss +29 -18
  712. package/src/components/keyboard-shortcuts/edit-mode.js +0 -29
  713. package/src/components/keyboard-shortcuts/register.js +0 -20
  714. package/src/components/layout/animation.js +125 -0
  715. package/src/components/layout/index.js +21 -74
  716. package/src/components/layout/router.js +99 -30
  717. package/src/components/layout/style.scss +17 -37
  718. package/src/components/page/index.js +7 -2
  719. package/src/components/page-pages/index.js +59 -65
  720. package/src/components/page-pages/style.scss +29 -22
  721. package/src/components/page-patterns/dataviews-pattern-actions.js +5 -6
  722. package/src/components/page-patterns/header.js +4 -2
  723. package/src/components/page-patterns/index.js +182 -78
  724. package/src/components/page-patterns/search-items.js +16 -58
  725. package/src/components/page-patterns/style.scss +7 -6
  726. package/src/components/page-patterns/use-patterns.js +2 -6
  727. package/src/components/page-templates-template-parts/add-new-template-part.js +4 -2
  728. package/src/components/page-templates-template-parts/index.js +44 -103
  729. package/src/components/page-templates-template-parts/style.scss +5 -0
  730. package/src/components/pattern-modal/duplicate.js +2 -1
  731. package/src/components/pattern-modal/rename.js +2 -1
  732. package/src/components/plugin-template-setting-panel/index.js +14 -1
  733. package/src/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +20 -24
  734. package/src/components/resizable-frame/index.js +2 -6
  735. package/src/components/save-button/index.js +55 -26
  736. package/src/components/save-hub/index.js +20 -164
  737. package/src/components/save-panel/index.js +2 -2
  738. package/src/components/sidebar/index.js +52 -105
  739. package/src/components/sidebar/style.scss +41 -6
  740. package/src/components/sidebar-dataviews/default-views.js +2 -2
  741. package/src/components/sidebar-dataviews/index.js +2 -2
  742. package/src/components/sidebar-edit-mode/default-sidebar.js +13 -6
  743. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +7 -3
  744. package/src/components/sidebar-edit-mode/index.js +39 -77
  745. package/src/components/sidebar-edit-mode/page-panels/index.js +52 -60
  746. package/src/components/sidebar-edit-mode/page-panels/page-content.js +10 -10
  747. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +20 -12
  748. package/src/components/sidebar-edit-mode/page-panels/style.scss +0 -6
  749. package/src/components/sidebar-edit-mode/settings-header/index.js +4 -5
  750. package/src/components/sidebar-edit-mode/style.scss +1 -1
  751. package/src/components/sidebar-edit-mode/template-panel/index.js +24 -34
  752. package/src/components/sidebar-edit-mode/template-panel/style.scss +1 -29
  753. package/src/components/sidebar-navigation-item/index.js +29 -0
  754. package/src/components/sidebar-navigation-screen/index.js +29 -12
  755. package/src/components/sidebar-navigation-screen/style.scss +13 -30
  756. package/src/components/sidebar-navigation-screen-details-footer/index.js +6 -2
  757. package/src/components/sidebar-navigation-screen-global-styles/index.js +9 -24
  758. package/src/components/sidebar-navigation-screen-main/index.js +11 -23
  759. package/src/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
  760. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +7 -6
  761. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  762. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +14 -14
  763. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  764. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +4 -5
  765. package/src/components/sidebar-navigation-screen-page/index.js +23 -13
  766. package/src/components/sidebar-navigation-screen-page/style.scss +8 -2
  767. package/src/components/sidebar-navigation-screen-pattern/index.js +9 -6
  768. package/src/components/sidebar-navigation-screen-patterns/index.js +70 -67
  769. package/src/components/sidebar-navigation-screen-patterns/style.scss +5 -0
  770. package/src/components/sidebar-navigation-screen-template/index.js +8 -12
  771. package/src/components/sidebar-navigation-screen-templates-browse/index.js +2 -7
  772. package/src/components/site-hub/index.js +80 -90
  773. package/src/components/site-hub/style.scss +14 -34
  774. package/src/components/style-book/index.js +1 -3
  775. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +52 -37
  776. package/src/components/template-actions/index.js +8 -11
  777. package/src/components/welcome-guide/style.scss +1 -1
  778. package/src/components/welcome-guide/styles.js +6 -5
  779. package/src/hooks/commands/use-edit-mode-commands.js +12 -33
  780. package/src/hooks/index.js +0 -1
  781. package/src/hooks/push-changes-to-global-styles/index.js +1 -40
  782. package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +4 -0
  783. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +5 -1
  784. package/src/index.js +9 -10
  785. package/src/store/actions.js +25 -141
  786. package/src/store/private-actions.js +0 -133
  787. package/src/store/selectors.js +3 -15
  788. package/src/store/test/actions.js +7 -2
  789. package/src/style.scss +0 -3
  790. package/src/utils/constants.js +1 -0
  791. package/src/utils/set-nested-value.js +39 -0
  792. package/build/components/actions/index.js +0 -319
  793. package/build/components/actions/index.js.map +0 -1
  794. package/build/components/add-new-template/new-template.js +0 -298
  795. package/build/components/add-new-template/new-template.js.map +0 -1
  796. package/build/components/add-new-template/template-actions-loading-screen.js +0 -27
  797. package/build/components/add-new-template/template-actions-loading-screen.js.map +0 -1
  798. package/build/components/header-edit-mode/plugin-more-menu-item/index.js +0 -78
  799. package/build/components/header-edit-mode/plugin-more-menu-item/index.js.map +0 -1
  800. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -71
  801. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +0 -1
  802. package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
  803. package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  804. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -48
  805. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  806. package/build/components/keyboard-shortcut-help-modal/index.js +0 -116
  807. package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  808. package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -54
  809. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  810. package/build/components/page-actions/index.js +0 -35
  811. package/build/components/page-actions/index.js.map +0 -1
  812. package/build/components/page-actions/trash-page-menu-item.js +0 -54
  813. package/build/components/page-actions/trash-page-menu-item.js.map +0 -1
  814. package/build/components/page-templates-template-parts/actions.js +0 -194
  815. package/build/components/page-templates-template-parts/actions.js.map +0 -1
  816. package/build/components/preferences-modal/index.js +0 -38
  817. package/build/components/preferences-modal/index.js.map +0 -1
  818. package/build/components/sidebar-edit-mode/constants.js +0 -9
  819. package/build/components/sidebar-edit-mode/constants.js.map +0 -1
  820. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -89
  821. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +0 -1
  822. package/build/components/sidebar-edit-mode/sidebar-card/index.js +0 -48
  823. package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
  824. package/build/components/sidebar-edit-mode/template-panel/template-areas.js +0 -70
  825. package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +0 -1
  826. package/build/components/sidebar-navigation-screen-navigation-item/index.js +0 -54
  827. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +0 -1
  828. package/build/components/sidebar-navigation-screen-pages/index.js +0 -175
  829. package/build/components/sidebar-navigation-screen-pages/index.js.map +0 -1
  830. package/build/components/sync-state-with-url/use-sync-path-with-url.js +0 -132
  831. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +0 -1
  832. package/build/components/template-actions/rename-menu-item.js.map +0 -1
  833. package/build/hooks/template-part-edit.js +0 -82
  834. package/build/hooks/template-part-edit.js.map +0 -1
  835. package/build/store/utils.js +0 -71
  836. package/build/store/utils.js.map +0 -1
  837. package/build-module/components/actions/index.js +0 -308
  838. package/build-module/components/actions/index.js.map +0 -1
  839. package/build-module/components/add-new-template/new-template.js +0 -290
  840. package/build-module/components/add-new-template/new-template.js.map +0 -1
  841. package/build-module/components/add-new-template/template-actions-loading-screen.js +0 -20
  842. package/build-module/components/add-new-template/template-actions-loading-screen.js.map +0 -1
  843. package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js +0 -73
  844. package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js.map +0 -1
  845. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -65
  846. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +0 -1
  847. package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
  848. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  849. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -40
  850. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  851. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -107
  852. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  853. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -47
  854. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  855. package/build-module/components/page-actions/index.js +0 -27
  856. package/build-module/components/page-actions/index.js.map +0 -1
  857. package/build-module/components/page-actions/trash-page-menu-item.js +0 -47
  858. package/build-module/components/page-actions/trash-page-menu-item.js.map +0 -1
  859. package/build-module/components/page-templates-template-parts/actions.js +0 -185
  860. package/build-module/components/page-templates-template-parts/actions.js.map +0 -1
  861. package/build-module/components/preferences-modal/index.js +0 -30
  862. package/build-module/components/preferences-modal/index.js.map +0 -1
  863. package/build-module/components/sidebar-edit-mode/constants.js +0 -3
  864. package/build-module/components/sidebar-edit-mode/constants.js.map +0 -1
  865. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -83
  866. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +0 -1
  867. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +0 -40
  868. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
  869. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js +0 -63
  870. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +0 -1
  871. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +0 -46
  872. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +0 -1
  873. package/build-module/components/sidebar-navigation-screen-pages/index.js +0 -167
  874. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +0 -1
  875. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +0 -124
  876. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +0 -1
  877. package/build-module/components/template-actions/rename-menu-item.js.map +0 -1
  878. package/build-module/hooks/template-part-edit.js +0 -75
  879. package/build-module/hooks/template-part-edit.js.map +0 -1
  880. package/build-module/store/utils.js +0 -64
  881. package/build-module/store/utils.js.map +0 -1
  882. package/src/components/actions/index.js +0 -409
  883. package/src/components/add-new-template/new-template.js +0 -429
  884. package/src/components/add-new-template/template-actions-loading-screen.js +0 -23
  885. package/src/components/header-edit-mode/plugin-more-menu-item/index.js +0 -73
  886. package/src/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -64
  887. package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
  888. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
  889. package/src/components/keyboard-shortcut-help-modal/index.js +0 -147
  890. package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -70
  891. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
  892. package/src/components/page-actions/index.js +0 -30
  893. package/src/components/page-actions/trash-page-menu-item.js +0 -63
  894. package/src/components/page-templates-template-parts/actions.js +0 -262
  895. package/src/components/preferences-modal/index.js +0 -29
  896. package/src/components/sidebar-edit-mode/constants.js +0 -2
  897. package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -80
  898. package/src/components/sidebar-edit-mode/sidebar-card/index.js +0 -53
  899. package/src/components/sidebar-edit-mode/sidebar-card/style.scss +0 -36
  900. package/src/components/sidebar-edit-mode/template-panel/template-areas.js +0 -86
  901. package/src/components/sidebar-navigation-screen-navigation-item/index.js +0 -59
  902. package/src/components/sidebar-navigation-screen-pages/index.js +0 -238
  903. package/src/components/sync-state-with-url/use-sync-path-with-url.js +0 -147
  904. package/src/hooks/template-part-edit.js +0 -89
  905. package/src/store/test/utils.js +0 -191
  906. package/src/store/utils.js +0 -69
@@ -14,7 +14,7 @@ var privateSelectors = _interopRequireWildcard(require("./private-selectors"));
14
14
  var _constants = require("./constants");
15
15
  var _lockUnlock = require("../lock-unlock");
16
16
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
17
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  /**
19
19
  * WordPress dependencies
20
20
  */
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_reducer","_interopRequireDefault","actions","_interopRequireWildcard","privateActions","selectors","privateSelectors","_constants","_lockUnlock","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","storeConfig","exports","reducer","store","createReduxStore","STORE_NAME","register","unlock","registerPrivateSelectors","registerPrivateActions"],"sources":["@wordpress/edit-site/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as privateActions from './private-actions';\nimport * as selectors from './selectors';\nimport * as privateSelectors from './private-selectors';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\n\nexport const storeConfig = {\n\treducer,\n\tactions,\n\tselectors,\n};\n\nexport const store = createReduxStore( STORE_NAME, storeConfig );\nregister( store );\nunlock( store ).registerPrivateSelectors( privateSelectors );\nunlock( store ).registerPrivateActions( privateActions );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAD,uBAAA,CAAAJ,OAAA;AACA,IAAAM,SAAA,GAAAF,uBAAA,CAAAJ,OAAA;AACA,IAAAO,gBAAA,GAAAH,uBAAA,CAAAJ,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAAwC,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAA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H,KAAM,CAAC;AACjB,IAAAI,kBAAM,EAAEJ,KAAM,CAAC,CAACK,wBAAwB,CAAEhC,gBAAiB,CAAC;AAC5D,IAAA+B,kBAAM,EAAEJ,KAAM,CAAC,CAACM,sBAAsB,CAAEnC,cAAe,CAAC"}
1
+ {"version":3,"names":["_data","require","_reducer","_interopRequireDefault","actions","_interopRequireWildcard","privateActions","selectors","privateSelectors","_constants","_lockUnlock","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","storeConfig","exports","reducer","store","createReduxStore","STORE_NAME","register","unlock","registerPrivateSelectors","registerPrivateActions"],"sources":["@wordpress/edit-site/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as privateActions from './private-actions';\nimport * as selectors from './selectors';\nimport * as privateSelectors from './private-selectors';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\n\nexport const storeConfig = {\n\treducer,\n\tactions,\n\tselectors,\n};\n\nexport const store = createReduxStore( STORE_NAME, storeConfig );\nregister( store );\nunlock( store ).registerPrivateSelectors( privateSelectors );\nunlock( store ).registerPrivateActions( privateActions );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAD,uBAAA,CAAAJ,OAAA;AACA,IAAAM,SAAA,GAAAF,uBAAA,CAAAJ,OAAA;AACA,IAAAO,gBAAA,GAAAH,uBAAA,CAAAJ,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAAwC,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,m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AC,sBAAgB,EAAEC,qBAAU,EAAEL,WAAY,CAAC;AAChE,IAAAM,cAAQ,EAAEH,KAAM,CAAC;AACjB,IAAAI,kBAAM,EAAEJ,KAAM,CAAC,CAACK,wBAAwB,CAAE/B,gBAAiB,CAAC;AAC5D,IAAA8B,kBAAM,EAAEJ,KAAM,CAAC,CAACM,sBAAsB,CAAElC,cAAe,CAAC","ignoreList":[]}
@@ -3,23 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.setEditorCanvasContainerView = exports.setCanvasMode = exports.removeTemplates = void 0;
6
+ exports.setEditorCanvasContainerView = exports.setCanvasMode = void 0;
7
7
  var _blockEditor = require("@wordpress/block-editor");
8
8
  var _preferences = require("@wordpress/preferences");
9
9
  var _editor = require("@wordpress/editor");
10
- var _coreData = require("@wordpress/core-data");
11
- var _notices = require("@wordpress/notices");
12
- var _i18n = require("@wordpress/i18n");
13
- var _htmlEntities = require("@wordpress/html-entities");
14
- var _constants = require("../utils/constants");
15
10
  /**
16
11
  * WordPress dependencies
17
12
  */
18
13
 
19
- /**
20
- * Internal dependencies
21
- */
22
-
23
14
  /**
24
15
  * Action that switches the canvas mode.
25
16
  *
@@ -60,80 +51,5 @@ const setEditorCanvasContainerView = view => ({
60
51
  view
61
52
  });
62
53
  };
63
-
64
- /**
65
- * Action that removes an array of templates.
66
- *
67
- * @param {Array} items An array of template or template part objects to remove.
68
- */
69
54
  exports.setEditorCanvasContainerView = setEditorCanvasContainerView;
70
- const removeTemplates = items => async ({
71
- registry
72
- }) => {
73
- const isTemplate = items[0].type === _constants.TEMPLATE_POST_TYPE;
74
- const promiseResult = await Promise.allSettled(items.map(item => {
75
- return registry.dispatch(_coreData.store).deleteEntityRecord('postType', item.type, item.id, {
76
- force: true
77
- }, {
78
- throwOnError: true
79
- });
80
- }));
81
-
82
- // If all the promises were fulfilled with sucess.
83
- if (promiseResult.every(({
84
- status
85
- }) => status === 'fulfilled')) {
86
- let successMessage;
87
- if (items.length === 1) {
88
- // Depending on how the entity was retrieved its title might be
89
- // an object or simple string.
90
- const title = typeof items[0].title === 'string' ? items[0].title : items[0].title?.rendered;
91
- successMessage = (0, _i18n.sprintf)( /* translators: The template/part's name. */
92
- (0, _i18n.__)('"%s" deleted.'), (0, _htmlEntities.decodeEntities)(title));
93
- } else {
94
- successMessage = isTemplate ? (0, _i18n.__)('Templates deleted.') : (0, _i18n.__)('Template parts deleted.');
95
- }
96
- registry.dispatch(_notices.store).createSuccessNotice(successMessage, {
97
- type: 'snackbar',
98
- id: 'site-editor-template-deleted-success'
99
- });
100
- } else {
101
- // If there was at lease one failure.
102
- let errorMessage;
103
- // If we were trying to delete a single template.
104
- if (promiseResult.length === 1) {
105
- if (promiseResult[0].reason?.message) {
106
- errorMessage = promiseResult[0].reason.message;
107
- } else {
108
- errorMessage = isTemplate ? (0, _i18n.__)('An error occurred while deleting the template.') : (0, _i18n.__)('An error occurred while deleting the template part.');
109
- }
110
- // If we were trying to delete a multiple templates
111
- } else {
112
- const errorMessages = new Set();
113
- const failedPromises = promiseResult.filter(({
114
- status
115
- }) => status === 'rejected');
116
- for (const failedPromise of failedPromises) {
117
- if (failedPromise.reason?.message) {
118
- errorMessages.add(failedPromise.reason.message);
119
- }
120
- }
121
- if (errorMessages.size === 0) {
122
- errorMessage = isTemplate ? (0, _i18n.__)('An error occurred while deleting the templates.') : (0, _i18n.__)('An error occurred while deleting the template parts.');
123
- } else if (errorMessages.size === 1) {
124
- errorMessage = isTemplate ? (0, _i18n.sprintf)( /* translators: %s: an error message */
125
- (0, _i18n.__)('An error occurred while deleting the templates: %s'), [...errorMessages][0]) : (0, _i18n.sprintf)( /* translators: %s: an error message */
126
- (0, _i18n.__)('An error occurred while deleting the template parts: %s'), [...errorMessages][0]);
127
- } else {
128
- errorMessage = isTemplate ? (0, _i18n.sprintf)( /* translators: %s: a list of comma separated error messages */
129
- (0, _i18n.__)('Some errors occurred while deleting the templates: %s'), [...errorMessages].join(',')) : (0, _i18n.sprintf)( /* translators: %s: a list of comma separated error messages */
130
- (0, _i18n.__)('Some errors occurred while deleting the template parts: %s'), [...errorMessages].join(','));
131
- }
132
- }
133
- registry.dispatch(_notices.store).createErrorNotice(errorMessage, {
134
- type: 'snackbar'
135
- });
136
- }
137
- };
138
- exports.removeTemplates = removeTemplates;
139
55
  //# sourceMappingURL=private-actions.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_preferences","_editor","_coreData","_notices","_i18n","_htmlEntities","_constants","setCanvasMode","mode","registry","dispatch","isMediumOrBigger","window","matchMedia","matches","blockEditorStore","__unstableSetEditorMode","type","select","preferencesStore","get","editorStore","setIsListViewOpened","setIsInserterOpened","exports","setEditorCanvasContainerView","view","removeTemplates","items","isTemplate","TEMPLATE_POST_TYPE","promiseResult","Promise","allSettled","map","item","coreStore","deleteEntityRecord","id","force","throwOnError","every","status","successMessage","length","title","rendered","sprintf","__","decodeEntities","noticesStore","createSuccessNotice","errorMessage","reason","message","errorMessages","Set","failedPromises","filter","failedPromise","add","size","join","createErrorNotice"],"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';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPE } from '../utils/constants';\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 } ) => {\n\t\tconst isMediumOrBigger =\n\t\t\twindow.matchMedia( '(min-width: 782px)' ).matches;\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\t// This behavior is disabled for small viewports.\n\t\tif (\n\t\t\tisMediumOrBigger &&\n\t\t\tmode === 'edit' &&\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'showListViewByDefault' ) &&\n\t\t\t! registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'distractionFree' )\n\t\t) {\n\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( true );\n\t\t} else {\n\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( false );\n\t\t}\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( false );\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 * Action that removes an array of templates.\n *\n * @param {Array} items An array of template or template part objects to remove.\n */\nexport const removeTemplates =\n\t( items ) =>\n\tasync ( { registry } ) => {\n\t\tconst isTemplate = items[ 0 ].type === TEMPLATE_POST_TYPE;\n\t\tconst promiseResult = await Promise.allSettled(\n\t\t\titems.map( ( item ) => {\n\t\t\t\treturn registry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.deleteEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\titem.type,\n\t\t\t\t\t\titem.id,\n\t\t\t\t\t\t{ force: true },\n\t\t\t\t\t\t{ throwOnError: true }\n\t\t\t\t\t);\n\t\t\t} )\n\t\t);\n\n\t\t// If all the promises were fulfilled with sucess.\n\t\tif ( promiseResult.every( ( { status } ) => status === 'fulfilled' ) ) {\n\t\t\tlet successMessage;\n\n\t\t\tif ( items.length === 1 ) {\n\t\t\t\t// Depending on how the entity was retrieved its title might be\n\t\t\t\t// an object or simple string.\n\t\t\t\tconst title =\n\t\t\t\t\ttypeof items[ 0 ].title === 'string'\n\t\t\t\t\t\t? items[ 0 ].title\n\t\t\t\t\t\t: items[ 0 ].title?.rendered;\n\t\t\t\tsuccessMessage = sprintf(\n\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t__( '\"%s\" deleted.' ),\n\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tsuccessMessage = isTemplate\n\t\t\t\t\t? __( 'Templates deleted.' )\n\t\t\t\t\t: __( 'Template parts deleted.' );\n\t\t\t}\n\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createSuccessNotice( successMessage, {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tid: 'site-editor-template-deleted-success',\n\t\t\t\t} );\n\t\t} else {\n\t\t\t// If there was at lease one failure.\n\t\t\tlet errorMessage;\n\t\t\t// If we were trying to delete a single template.\n\t\t\tif ( promiseResult.length === 1 ) {\n\t\t\t\tif ( promiseResult[ 0 ].reason?.message ) {\n\t\t\t\t\terrorMessage = promiseResult[ 0 ].reason.message;\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = isTemplate\n\t\t\t\t\t\t? __( 'An error occurred while deleting the template.' )\n\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t'An error occurred while deleting the template part.'\n\t\t\t\t\t\t );\n\t\t\t\t}\n\t\t\t\t// If we were trying to delete a multiple templates\n\t\t\t} else {\n\t\t\t\tconst errorMessages = new Set();\n\t\t\t\tconst failedPromises = promiseResult.filter(\n\t\t\t\t\t( { status } ) => status === 'rejected'\n\t\t\t\t);\n\t\t\t\tfor ( const failedPromise of failedPromises ) {\n\t\t\t\t\tif ( failedPromise.reason?.message ) {\n\t\t\t\t\t\terrorMessages.add( failedPromise.reason.message );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( errorMessages.size === 0 ) {\n\t\t\t\t\terrorMessage = isTemplate\n\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t'An error occurred while deleting the templates.'\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t'An error occurred while deleting the template parts.'\n\t\t\t\t\t\t );\n\t\t\t\t} else if ( errorMessages.size === 1 ) {\n\t\t\t\t\terrorMessage = isTemplate\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: an error message */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'An error occurred while deleting the templates: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ][ 0 ]\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: an error message */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'An error occurred while deleting the template parts: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ][ 0 ]\n\t\t\t\t\t\t );\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = isTemplate\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: a list of comma separated error messages */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Some errors occurred while deleting the templates: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ].join( ',' )\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: a list of comma separated error messages */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Some errors occurred while deleting the template parts: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ].join( ',' )\n\t\t\t\t\t\t );\n\t\t\t\t}\n\t\t\t}\n\t\t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AAC,MAAM,IAAKO,aAAa,CAACM,IAAI,KAAK,CAAC,EAAG;QACtCT,YAAY,GAAGvB,UAAU,GACtB,IAAAkB,aAAO,GACP;QACA,IAAAC,QAAE,EACD,oDACD,CAAC,EACD,CAAE,GAAGO,aAAa,CAAE,CAAE,CAAC,CACvB,CAAC,GACD,IAAAR,aAAO,GACP;QACA,IAAAC,QAAE,EACD,yDACD,CAAC,EACD,CAAE,GAAGO,aAAa,CAAE,CAAE,CAAC,CACvB,CAAC;MACL,CAAC,MAAM;QACNH,YAAY,GAAGvB,UAAU,GACtB,IAAAkB,aAAO,GACP;QACA,IAAAC,QAAE,EACD,uDACD,CAAC,EACD,CAAE,GAAGO,aAAa,CAAE,CAACO,IAAI,CAAE,GAAI,CAC/B,CAAC,GACD,IAAAf,aAAO,GACP;QACA,IAAAC,QAAE,EACD,4DACD,CAAC,EACD,CAAE,GAAGO,aAAa,CAAE,CAACO,IAAI,CAAE,GAAI,CAC/B,CAAC;MACL;IACD;IACArD,QAAQ,CACNC,QAAQ,CAAEwC,cAAa,CAAC,CACxBa,iBAAiB,CAAEX,YAAY,EAAE;MAAEnC,IAAI,EAAE;IAAW,CAAE,CAAC;EAC1D;AACD,CAAC;AAACO,OAAA,CAAAG,eAAA,GAAAA,eAAA"}
1
+ {"version":3,"names":["_blockEditor","require","_preferences","_editor","setCanvasMode","mode","registry","dispatch","isMediumOrBigger","window","matchMedia","matches","blockEditorStore","__unstableSetEditorMode","type","select","preferencesStore","get","editorStore","setIsListViewOpened","setIsInserterOpened","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';\nimport { store as editorStore } from '@wordpress/editor';\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 } ) => {\n\t\tconst isMediumOrBigger =\n\t\t\twindow.matchMedia( '(min-width: 782px)' ).matches;\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\t// This behavior is disabled for small viewports.\n\t\tif (\n\t\t\tisMediumOrBigger &&\n\t\t\tmode === 'edit' &&\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'showListViewByDefault' ) &&\n\t\t\t! registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'distractionFree' )\n\t\t) {\n\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( true );\n\t\t} else {\n\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( false );\n\t\t}\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( false );\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;AACA,IAAAE,OAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACO,MAAMG,aAAa,GACvBC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC7B,MAAMC,gBAAgB,GACrBC,MAAM,CAACC,UAAU,CAAE,oBAAqB,CAAC,CAACC,OAAO;EAClDL,QAAQ,CAACC,QAAQ,CAAEK,kBAAiB,CAAC,CAACC,uBAAuB,CAAE,MAAO,CAAC;EACvEN,QAAQ,CAAE;IACTO,IAAI,EAAE,iBAAiB;IACvBT;EACD,CAAE,CAAC;EACH;EACA;EACA;EACA,IACCG,gBAAgB,IAChBH,IAAI,KAAK,MAAM,IACfC,QAAQ,CACNS,MAAM,CAAEC,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,MAAM,EAAE,uBAAwB,CAAC,IACxC,CAAEX,QAAQ,CACRS,MAAM,CAAEC,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,MAAM,EAAE,iBAAkB,CAAC,EACjC;IACDX,QAAQ,CAACC,QAAQ,CAAEW,aAAY,CAAC,CAACC,mBAAmB,CAAE,IAAK,CAAC;EAC7D,CAAC,MAAM;IACNb,QAAQ,CAACC,QAAQ,CAAEW,aAAY,CAAC,CAACC,mBAAmB,CAAE,KAAM,CAAC;EAC9D;EACAb,QAAQ,CAACC,QAAQ,CAAEW,aAAY,CAAC,CAACE,mBAAmB,CAAE,KAAM,CAAC;AAC9D,CAAC;;AAEF;AACA;AACA;AACA;AACA;AAJAC,OAAA,CAAAjB,aAAA,GAAAA,aAAA;AAKO,MAAMkB,4BAA4B,GACtCC,IAAI,IACN,CAAE;EAAEhB;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTO,IAAI,EAAE,kCAAkC;IACxCS;EACD,CAAE,CAAC;AACJ,CAAC;AAACF,OAAA,CAAAC,4BAAA,GAAAA,4BAAA","ignoreList":[]}
@@ -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":["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","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","settings","state","action","type","editedPost","postType","id","context","saveViewPanel","isOpen","canvasMode","mode","editorCanvasContainerView","undefined","view","_default","exports","default","combineReducers"],"sources":["@wordpress/edit-site/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\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 save view panel open or closed.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function saveViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_SAVE_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas mode (edit or view).\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction canvasMode( state = 'init', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn action.mode;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas container view.\n * Default is `undefined`, denoting the default, visual block editor.\n * This could be, for example, `'style-book'` (the style book).\n *\n * @param {string|undefined} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction editorCanvasContainerView( state = undefined, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITOR_CANVAS_CONTAINER_VIEW':\n\t\t\treturn action.view;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tsettings,\n\teditedPost,\n\tsaveViewPanel,\n\tcanvasMode,\n\teditorCanvasContainerView,\n} );\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,QAAQA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAC9C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACN,GAAGF,KAAK;QACR,GAAGC,MAAM,CAACF;MACX,CAAC;EACH;EAEA,OAAOC,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,UAAUA,CAAEH,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAChD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACNE,QAAQ,EAAEH,MAAM,CAACG,QAAQ;QACzBC,EAAE,EAAEJ,MAAM,CAACI,EAAE;QACbC,OAAO,EAAEL,MAAM,CAACK;MACjB,CAAC;IACF,KAAK,yBAAyB;MAC7B,OAAO;QACN,GAAGN,KAAK;QACRM,OAAO,EAAEL,MAAM,CAACK;MACjB,CAAC;EACH;EAEA,OAAON,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASO,aAAaA,CAAEP,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EACtD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,yBAAyB;MAC7B,OAAOD,MAAM,CAACO,MAAM;IACrB,KAAK,iBAAiB;MACrB,OAAO,KAAK;EACd;EACA,OAAOR,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASS,UAAUA,CAAET,KAAK,GAAG,MAAM,EAAEC,MAAM,EAAG;EAC7C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAOD,MAAM,CAACS,IAAI;EACpB;EAEA,OAAOV,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASW,yBAAyBA,CAAEX,KAAK,GAAGY,SAAS,EAAEX,MAAM,EAAG;EAC/D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,kCAAkC;MACtC,OAAOD,MAAM,CAACY,IAAI;EACpB;EAEA,OAAOb,KAAK;AACb;AAAC,IAAAc,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,qBAAe,EAAE;EAC/BlB,QAAQ;EACRI,UAAU;EACVI,aAAa;EACbE,UAAU;EACVE;AACD,CAAE,CAAC"}
1
+ {"version":3,"names":["_data","require","settings","state","action","type","editedPost","postType","id","context","saveViewPanel","isOpen","canvasMode","mode","editorCanvasContainerView","undefined","view","_default","exports","default","combineReducers"],"sources":["@wordpress/edit-site/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\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 save view panel open or closed.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function saveViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_SAVE_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas mode (edit or view).\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction canvasMode( state = 'init', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn action.mode;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas container view.\n * Default is `undefined`, denoting the default, visual block editor.\n * This could be, for example, `'style-book'` (the style book).\n *\n * @param {string|undefined} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction editorCanvasContainerView( state = undefined, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITOR_CANVAS_CONTAINER_VIEW':\n\t\t\treturn action.view;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tsettings,\n\teditedPost,\n\tsaveViewPanel,\n\tcanvasMode,\n\teditorCanvasContainerView,\n} );\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,QAAQA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAC9C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACN,GAAGF,KAAK;QACR,GAAGC,MAAM,CAACF;MACX,CAAC;EACH;EAEA,OAAOC,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,UAAUA,CAAEH,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAChD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACNE,QAAQ,EAAEH,MAAM,CAACG,QAAQ;QACzBC,EAAE,EAAEJ,MAAM,CAACI,EAAE;QACbC,OAAO,EAAEL,MAAM,CAACK;MACjB,CAAC;IACF,KAAK,yBAAyB;MAC7B,OAAO;QACN,GAAGN,KAAK;QACRM,OAAO,EAAEL,MAAM,CAACK;MACjB,CAAC;EACH;EAEA,OAAON,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASO,aAAaA,CAAEP,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EACtD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,yBAAyB;MAC7B,OAAOD,MAAM,CAACO,MAAM;IACrB,KAAK,iBAAiB;MACrB,OAAO,KAAK;EACd;EACA,OAAOR,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASS,UAAUA,CAAET,KAAK,GAAG,MAAM,EAAEC,MAAM,EAAG;EAC7C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAOD,MAAM,CAACS,IAAI;EACpB;EAEA,OAAOV,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASW,yBAAyBA,CAAEX,KAAK,GAAGY,SAAS,EAAEX,MAAM,EAAG;EAC/D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,kCAAkC;MACtC,OAAOD,MAAM,CAACY,IAAI;EACpB;EAEA,OAAOb,KAAK;AACb;AAAC,IAAAc,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,qBAAe,EAAE;EAC/BlB,QAAQ;EACRI,UAAU;EACVI,aAAa;EACbE,UAAU;EACVE;AACD,CAAE,CAAC","ignoreList":[]}
@@ -26,10 +26,7 @@ var _data = require("@wordpress/data");
26
26
  var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
27
27
  var _element = require("@wordpress/element");
28
28
  var _preferences = require("@wordpress/preferences");
29
- var _blockEditor = require("@wordpress/block-editor");
30
29
  var _editor = require("@wordpress/editor");
31
- var _utils = require("./utils");
32
- var _constants = require("../utils/constants");
33
30
  var _lockUnlock = require("../lock-unlock");
34
31
  /**
35
32
  * WordPress dependencies
@@ -244,12 +241,7 @@ function isSaveViewOpened(state) {
244
241
  * @return {Array} Template parts and their blocks in an array.
245
242
  */
246
243
  const getCurrentTemplateTemplateParts = exports.getCurrentTemplateTemplateParts = (0, _data.createRegistrySelector)(select => () => {
247
- const templateParts = select(_coreData.store).getEntityRecords('postType', _constants.TEMPLATE_PART_POST_TYPE, {
248
- per_page: -1
249
- });
250
- const clientIds = select(_blockEditor.store).getBlocksByName('core/template-part');
251
- const blocks = select(_blockEditor.store).getBlocksByClientId(clientIds);
252
- return (0, _utils.getFilteredTemplatePartBlocks)(blocks, templateParts);
244
+ return (0, _lockUnlock.unlock)(select(_editor.store)).getCurrentTemplateTemplateParts();
253
245
  });
254
246
 
255
247
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["_coreData","require","_data","_deprecated","_interopRequireDefault","_element","_preferences","_blockEditor","_editor","_utils","_constants","_lockUnlock","isFeatureActive","exports","createRegistrySelector","select","_","featureName","deprecated","since","alternative","preferencesStore","get","__experimentalGetPreviewDeviceType","version","editorStore","getDeviceType","getCanUserCreateMedia","coreDataStore","canUser","getReusableBlocks","isWeb","Platform","OS","getEntityRecords","per_page","getSettings","state","settings","getHomeTemplateId","getEditedPostType","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","__experimentalGetInsertionPoint","unlock","getInsertionPoint","isListViewOpened","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateParts","TEMPLATE_PART_POST_TYPE","clientIds","blockEditorStore","getBlocksByName","blocks","getBlocksByClientId","getFilteredTemplatePartBlocks","getEditorMode","getCurrentTemplateNavigationPanelSubMenu","getNavigationPanelActiveMenu","isNavigationOpened","isPage","postId","hasPageContentFocus"],"sources":["@wordpress/edit-site/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { Platform } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { getFilteredTemplatePartBlocks } from './utils';\nimport { TEMPLATE_PART_POST_TYPE } from '../utils/constants';\nimport { unlock } from '../lock-unlock';\n\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\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 const isFeatureActive = createRegistrySelector(\n\t( select ) => ( _, featureName ) => {\n\t\tdeprecated( `select( 'core/edit-site' ).isFeatureActive`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `select( 'core/preferences' ).get`,\n\t\t} );\n\n\t\treturn !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\tfeatureName\n\t\t);\n\t}\n);\n\n/**\n * Returns the current editing canvas device type.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport const __experimentalGetPreviewDeviceType = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\talternative: `select( 'core/editor' ).getDeviceType`,\n\t\t\t}\n\t\t);\n\t\treturn select( editorStore ).getDeviceType();\n\t}\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\tdeprecated(\n\t\t\"select( 'core/core' ).getEntityRecords( 'postType', 'wp_block' )\",\n\t\t{\n\t\t\tsince: '6.5',\n\t\t\tversion: '6.8',\n\t\t}\n\t);\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 site editor settings.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Settings.\n */\nexport function getSettings( state ) {\n\t// It is important that we don't inject anything into these settings locally.\n\t// The reason for this is that we have an effect in place that calls setSettings based on the previous value of getSettings.\n\t// If we add computed settings here, we'll be adding these computed settings to the state which is very unexpected.\n\treturn state.settings;\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 true if the inserter is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport const isInserterOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-site' ).isInserterOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isInserterOpened`,\n\t} );\n\treturn select( editorStore ).isInserterOpened();\n} );\n\n/**\n * Get the insertion point for the inserter.\n *\n * @deprecated\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 ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetInsertionPoint`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t}\n\t\t);\n\t\treturn unlock( select( editorStore ) ).getInsertionPoint();\n\t}\n);\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport const isListViewOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-site' ).isListViewOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isListViewOpened`,\n\t} );\n\treturn select( editorStore ).isListViewOpened();\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 ) => () => {\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\tconst clientIds =\n\t\t\tselect( blockEditorStore ).getBlocksByName( 'core/template-part' );\n\t\tconst blocks =\n\t\t\tselect( blockEditorStore ).getBlocksByClientId( clientIds );\n\n\t\treturn getFilteredTemplatePartBlocks( 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 const getEditorMode = createRegistrySelector( ( select ) => () => {\n\treturn select( preferencesStore ).get( 'core', '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 * @deprecated\n *\n * @return {boolean} Whether or not focus is on editing page content.\n */\nexport function hasPageContentFocus() {\n\tdeprecated( `select( 'core/edit-site' ).hasPageContentFocus`, {\n\t\tsince: '6.5',\n\t} );\n\n\treturn false;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AAC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G;EAC/B,OAAO,CAAC,CAAEA,KAAK,CAACI,UAAU,CAACK,OAAO,EAAEuB,MAAM;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,mBAAmBA,CAAA,EAAG;EACrC,IAAApD,mBAAU,EAAG,gDAA+C,EAAE;IAC7DC,KAAK,EAAE;EACR,CAAE,CAAC;EAEH,OAAO,KAAK;AACb"}
1
+ {"version":3,"names":["_coreData","require","_data","_deprecated","_interopRequireDefault","_element","_preferences","_editor","_lockUnlock","isFeatureActive","exports","createRegistrySelector","select","_","featureName","deprecated","since","alternative","preferencesStore","get","__experimentalGetPreviewDeviceType","version","editorStore","getDeviceType","getCanUserCreateMedia","coreDataStore","canUser","getReusableBlocks","isWeb","Platform","OS","getEntityRecords","per_page","getSettings","state","settings","getHomeTemplateId","getEditedPostType","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","__experimentalGetInsertionPoint","unlock","getInsertionPoint","isListViewOpened","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","getEditorMode","getCurrentTemplateNavigationPanelSubMenu","getNavigationPanelActiveMenu","isNavigationOpened","isPage","postId","hasPageContentFocus"],"sources":["@wordpress/edit-site/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { Platform } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\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 const isFeatureActive = createRegistrySelector(\n\t( select ) => ( _, featureName ) => {\n\t\tdeprecated( `select( 'core/edit-site' ).isFeatureActive`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `select( 'core/preferences' ).get`,\n\t\t} );\n\n\t\treturn !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\tfeatureName\n\t\t);\n\t}\n);\n\n/**\n * Returns the current editing canvas device type.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport const __experimentalGetPreviewDeviceType = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\talternative: `select( 'core/editor' ).getDeviceType`,\n\t\t\t}\n\t\t);\n\t\treturn select( editorStore ).getDeviceType();\n\t}\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\tdeprecated(\n\t\t\"select( 'core/core' ).getEntityRecords( 'postType', 'wp_block' )\",\n\t\t{\n\t\t\tsince: '6.5',\n\t\t\tversion: '6.8',\n\t\t}\n\t);\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 site editor settings.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Settings.\n */\nexport function getSettings( state ) {\n\t// It is important that we don't inject anything into these settings locally.\n\t// The reason for this is that we have an effect in place that calls setSettings based on the previous value of getSettings.\n\t// If we add computed settings here, we'll be adding these computed settings to the state which is very unexpected.\n\treturn state.settings;\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 true if the inserter is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport const isInserterOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-site' ).isInserterOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isInserterOpened`,\n\t} );\n\treturn select( editorStore ).isInserterOpened();\n} );\n\n/**\n * Get the insertion point for the inserter.\n *\n * @deprecated\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 ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetInsertionPoint`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t}\n\t\t);\n\t\treturn unlock( select( editorStore ) ).getInsertionPoint();\n\t}\n);\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport const isListViewOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-site' ).isListViewOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isListViewOpened`,\n\t} );\n\treturn select( editorStore ).isListViewOpened();\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 ) => () => {\n\t\treturn unlock(\n\t\t\tselect( editorStore )\n\t\t).getCurrentTemplateTemplateParts();\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 const getEditorMode = createRegistrySelector( ( select ) => () => {\n\treturn select( preferencesStore ).get( 'core', '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 * @deprecated\n *\n * @return {boolean} Whether or not focus is on editing page content.\n */\nexport function hasPageContentFocus() {\n\tdeprecated( `select( 'core/edit-site' ).hasPageContentFocus`, {\n\t\tsince: '6.5',\n\t} );\n\n\treturn false;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AAbA;AACA;AACA;;AAQA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMQ,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,IAAAE,4BAAsB,EAClDC,MAAM,IAAM,CAAEC,CAAC,EAAEC,WAAW,KAAM;EACnC,IAAAC,mBAAU,EAAG,4CAA2C,EAAE;IACzDC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAG;EACf,CAAE,CAAC;EAEH,OAAO,CAAC,CAAEL,MAAM,CAAEM,kBAAiB,CAAC,CAACC,GAAG,CACvC,gBAAgB,EAChBL,WACD,CAAC;AACF,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMM,kCAAkC,GAAAV,OAAA,CAAAU,kCAAA,GAAG,IAAAT,4BAAsB,EACrEC,MAAM,IAAM,MAAM;EACnB,IAAAG,mBAAU,EACR,+DAA8D,EAC/D;IACCC,KAAK,EAAE,KAAK;IACZK,OAAO,EAAE,K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ACA;AACA;AACA;AACA;AACA;AACO,SAASoC,MAAMA,CAAEvB,KAAK,EAAG;EAC/B,OAAO,CAAC,CAAEA,KAAK,CAACI,UAAU,CAACK,OAAO,EAAEe,MAAM;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,mBAAmBA,CAAA,EAAG;EACrC,IAAA5C,mBAAU,EAAG,gDAA+C,EAAE;IAC7DC,KAAK,EAAE;EACR,CAAE,CAAC;EAEH,OAAO,KAAK;AACb","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["cloneDeep","object","JSON","parse","stringify"],"sources":["@wordpress/edit-site/src/utils/clone-deep.js"],"sourcesContent":["/**\n * Makes a copy of an object without storing any references to the original object.\n * @param {Object} object\n * @return {Object} The cloned object.\n */\nexport default function cloneDeep( object ) {\n\treturn ! object ? {} : JSON.parse( JSON.stringify( object ) );\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACe,SAASA,SAASA,CAAEC,MAAM,EAAG;EAC3C,OAAO,CAAEA,MAAM,GAAG,CAAC,CAAC,GAAGC,IAAI,CAACC,KAAK,CAAED,IAAI,CAACE,SAAS,CAAEH,MAAO,CAAE,CAAC;AAC9D"}
1
+ {"version":3,"names":["cloneDeep","object","JSON","parse","stringify"],"sources":["@wordpress/edit-site/src/utils/clone-deep.js"],"sourcesContent":["/**\n * Makes a copy of an object without storing any references to the original object.\n * @param {Object} object\n * @return {Object} The cloned object.\n */\nexport default function cloneDeep( object ) {\n\treturn ! object ? {} : JSON.parse( JSON.stringify( object ) );\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACe,SAASA,SAASA,CAAEC,MAAM,EAAG;EAC3C,OAAO,CAAEA,MAAM,GAAG,CAAC,CAAC,GAAGC,IAAI,CAACC,KAAK,CAAED,IAAI,CAACE,SAAS,CAAEH,MAAO,CAAE,CAAC;AAC9D","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
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.OPERATOR_IS_NOT = exports.OPERATOR_IS_NONE = exports.OPERATOR_IS_ANY = exports.OPERATOR_IS = exports.NAVIGATION_POST_TYPE = exports.LAYOUT_TABLE = exports.LAYOUT_LIST = exports.LAYOUT_GRID = exports.FOCUSABLE_ENTITIES = exports.EXCLUDED_PATTERN_SOURCES = exports.ENUMERATION_TYPE = void 0;
6
+ exports.TEMPLATE_POST_TYPE = exports.TEMPLATE_PART_POST_TYPE = exports.TEMPLATE_PART_AREA_DEFAULT_CATEGORY = exports.TEMPLATE_PART_ALL_AREAS_CATEGORY = exports.TEMPLATE_ORIGINS = exports.POST_TYPE_LABELS = exports.PATTERN_USER_CATEGORY = exports.PATTERN_TYPES = exports.PATTERN_SYNC_TYPES = exports.PATTERN_DEFAULT_CATEGORY = exports.OPERATOR_IS_NOT = exports.OPERATOR_IS_NONE = exports.OPERATOR_IS_ANY = exports.OPERATOR_IS = exports.NAVIGATION_POST_TYPE = exports.LAYOUT_TABLE = exports.LAYOUT_LIST = exports.LAYOUT_GRID = exports.FOCUSABLE_ENTITIES = exports.EXCLUDED_PATTERN_SOURCES = exports.ENUMERATION_TYPE = void 0;
7
7
  var _i18n = require("@wordpress/i18n");
8
8
  var _patterns = require("@wordpress/patterns");
9
9
  var _lockUnlock = require("../lock-unlock");
@@ -27,6 +27,7 @@ const TEMPLATE_ORIGINS = exports.TEMPLATE_ORIGINS = {
27
27
  plugin: 'plugin'
28
28
  };
29
29
  const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = exports.TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';
30
+ const TEMPLATE_PART_ALL_AREAS_CATEGORY = exports.TEMPLATE_PART_ALL_AREAS_CATEGORY = 'all-parts';
30
31
 
31
32
  // Patterns.
32
33
  const {
@@ -1 +1 @@
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","EXCLUDED_PATTERN_SOURCES","PATTERN_SYNC_TYPES","unlock","patternPrivateApis","FOCUSABLE_ENTITIES","user","POST_TYPE_LABELS","__","LAYOUT_GRID","LAYOUT_TABLE","LAYOUT_LIST","ENUMERATION_TYPE","OPERATOR_IS","OPERATOR_IS_NOT","OPERATOR_IS_ANY","OPERATOR_IS_NONE"],"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\tEXCLUDED_PATTERN_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\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};\n\n// DataViews constants\nexport const LAYOUT_GRID = 'grid';\nexport const LAYOUT_TABLE = 'table';\nexport const LAYOUT_LIST = 'list';\nexport const ENUMERATION_TYPE = 'enumeration';\nexport const OPERATOR_IS = 'is';\nexport const OPERATOR_IS_NOT = 'isNot';\nexport const OPERATOR_IS_ANY = 'isAny';\nexport const OPERATOR_IS_NONE = 'isNone';\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACO,MAAMG,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,eAAe;;AAEnD;AACO,MAAME,kBAAkB,GAAAD,OAAA,CAAAC,kBAAA,GAAG,aAAa;AACxC,MAAMC,uBAAuB,GAAAF,OAAA,CAAAE,uBAAA,GAAG,kBAAkB;AAClD,MAAMC,gBAAgB,GAAAH,OAAA,CAAAG,gBAAA,GAAG;EAC/BC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACT,CAAC;AACM,MAAMC,mCAAmC,GAAAP,OAAA,CAAAO,mCAAA,GAAG,eAAe;;AAElE;AACO,MAAM;EACZC,aAAa;EACbC,wBAAwB;EACxBC,qBAAqB;EACrBC,wBAAwB;EACxBC;AACD,CAAC,GAAG,IAAAC,kBAAM,EAAEC,qBAAmB,CAAC;;AAEhC;AAAAd,OAAA,CAAAY,kBAAA,GAAAA,kBAAA;AAAAZ,OAAA,CA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LATE_PART_AREA_DEFAULT_CATEGORY","TEMPLATE_PART_ALL_AREAS_CATEGORY","PATTERN_TYPES","PATTERN_DEFAULT_CATEGORY","PATTERN_USER_CATEGORY","EXCLUDED_PATTERN_SOURCES","PATTERN_SYNC_TYPES","unlock","patternPrivateApis","FOCUSABLE_ENTITIES","user","POST_TYPE_LABELS","__","LAYOUT_GRID","LAYOUT_TABLE","LAYOUT_LIST","ENUMERATION_TYPE","OPERATOR_IS","OPERATOR_IS_NOT","OPERATOR_IS_ANY","OPERATOR_IS_NONE"],"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';\nexport const TEMPLATE_PART_ALL_AREAS_CATEGORY = 'all-parts';\n\n// Patterns.\nexport const {\n\tPATTERN_TYPES,\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_USER_CATEGORY,\n\tEXCLUDED_PATTERN_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\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};\n\n// DataViews constants\nexport const LAYOUT_GRID = 'grid';\nexport const LAYOUT_TABLE = 'table';\nexport const LAYOUT_LIST = 'list';\nexport const ENUMERATION_TYPE = 'enumeration';\nexport const OPERATOR_IS = 'is';\nexport const OPERATOR_IS_NOT = 'isNot';\nexport const OPERATOR_IS_ANY = 'isAny';\nexport const OPERATOR_IS_NONE = 'isNone';\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACO,MAAMG,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,eAAe;;AAEnD;AACO,MAAME,kBAAkB,GAAAD,OAAA,CAAAC,kBAAA,GAAG,aAAa;AACxC,MAAMC,uBAAuB,GAAAF,OAAA,CAAAE,uBAAA,GAAG,kBAAkB;AAClD,MAAMC,gBAAgB,GAAAH,OAAA,CAAAG,gBAAA,GAAG;EAC/BC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACT,CAAC;AACM,MAAMC,mCAAmC,GAAAP,OAAA,CAAAO,mCAAA,GAAG,eAAe;AAC3D,MAAMC,gCAAgC,GAAAR,OAAA,CAAAQ,gCAAA,GAAG,WAAW;;AAE3D;AACO,MAAM;EACZC,aAAa;EACbC,wBAAwB;EACxBC,qBAAqB;EACrBC,wBAAwB;EACxBC;AACD,CAAC,GAAG,IAAAC,kBAAM,EAAEC,qBAAmB,CAAC;;AAEhC;AAAAf,OAAA,CAAAa,kBAAA,GAAAA,kBAAA;AAAAb,OAAA,CAAAY,wBAAA,GAAAA,wBAAA;AAAAZ,OAAA,CAAAW,qBAAA,GAAAA,qBAAA;AAAAX,OAAA,CAAAU,wBAAA,GAAAA,wBAAA;AAAAV,OAAA,CAAAS,aAAA,GAAAA,aAAA;AACO,MAAMO,kBAAkB,GAAAhB,OAAA,CAAAgB,kBAAA,GAAG,CACjCd,uBAAuB,EACvBH,oBAAoB,EACpBU,aAAa,CAACQ,IAAI,CAClB;AAEM,MAAMC,gBAAgB,GAAAlB,OAAA,CAAAkB,gBAAA,GAAG;EAC/B,CAAEjB,kBAAkB,GAAI,IAAAkB,QAAE,EAAE,UAAW,CAAC;EACxC,CAAEjB,uBAAuB,GAAI,IAAAiB,QAAE,EAAE,eAAgB,CAAC;EAClD,CAAEV,aAAa,CAACQ,IAAI,GAAI,IAAAE,QAAE,EAAE,SAAU,CAAC;EACvC,CAAEpB,oBAAoB,GAAI,IAAAoB,QAAE,EAAE,YAAa;AAC5C,CAAC;;AAED;AACO,MAAMC,WAAW,GAAApB,OAAA,CAAAoB,WAAA,GAAG,MAAM;AAC1B,MAAMC,YAAY,GAAArB,OAAA,CAAAqB,YAAA,GAAG,OAAO;AAC5B,MAAMC,WAAW,GAAAtB,OAAA,CAAAsB,WAAA,GAAG,MAAM;AAC1B,MAAMC,gBAAgB,GAAAvB,OAAA,CAAAuB,gBAAA,GAAG,aAAa;AACtC,MAAMC,WAAW,GAAAxB,OAAA,CAAAwB,WAAA,GAAG,IAAI;AACxB,MAAMC,eAAe,GAAAzB,OAAA,CAAAyB,eAAA,GAAG,OAAO;AAC/B,MAAMC,eAAe,GAAA1B,OAAA,CAAA0B,eAAA,GAAG,OAAO;AAC/B,MAAMC,gBAAgB,GAAA3B,OAAA,CAAA2B,gBAAA,GAAG,QAAQ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["getIsListPage","path","categoryType","categoryId","isMobileViewport","includes"],"sources":["@wordpress/edit-site/src/utils/get-is-list-page.js"],"sourcesContent":["/**\n * Returns if the params match the list page route.\n *\n * @param {Object} params The url params.\n * @param {string} params.path The current path.\n * @param {string} [params.categoryType] The current category type.\n * @param {string} [params.categoryId] The current category id.\n * @param {boolean} isMobileViewport Is mobile viewport.\n *\n * @return {boolean} Is list page or not.\n */\nexport default function getIsListPage(\n\t{ path, categoryType, categoryId },\n\tisMobileViewport\n) {\n\treturn (\n\t\t[ '/wp_template', '/wp_template_part/all', '/pages' ].includes(\n\t\t\tpath\n\t\t) ||\n\t\t( path === '/patterns' &&\n\t\t\t// Don't treat \"/patterns\" without categoryType and categoryId as a\n\t\t\t// list page in mobile because the sidebar covers the whole page.\n\t\t\t( ! isMobileViewport || ( !! categoryType && !! categoryId ) ) )\n\t);\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,aAAaA,CACpC;EAAEC,IAAI;EAAEC,YAAY;EAAEC;AAAW,CAAC,EAClCC,gBAAgB,EACf;EACD,OACC,CAAE,cAAc,EAAE,uBAAuB,EAAE,QAAQ,CAAE,CAACC,QAAQ,CAC7DJ,IACD,CAAC,IACCA,IAAI,KAAK,WAAW;EACrB;EACA;EACE,CAAEG,gBAAgB,IAAM,CAAC,CAAEF,YAAY,IAAI,CAAC,CAAEC,UAAY,CAAI;AAEnE"}
1
+ {"version":3,"names":["getIsListPage","path","categoryType","categoryId","isMobileViewport","includes"],"sources":["@wordpress/edit-site/src/utils/get-is-list-page.js"],"sourcesContent":["/**\n * Returns if the params match the list page route.\n *\n * @param {Object} params The url params.\n * @param {string} params.path The current path.\n * @param {string} [params.categoryType] The current category type.\n * @param {string} [params.categoryId] The current category id.\n * @param {boolean} isMobileViewport Is mobile viewport.\n *\n * @return {boolean} Is list page or not.\n */\nexport default function getIsListPage(\n\t{ path, categoryType, categoryId },\n\tisMobileViewport\n) {\n\treturn (\n\t\t[ '/wp_template', '/wp_template_part/all', '/pages' ].includes(\n\t\t\tpath\n\t\t) ||\n\t\t( path === '/patterns' &&\n\t\t\t// Don't treat \"/patterns\" without categoryType and categoryId as a\n\t\t\t// list page in mobile because the sidebar covers the whole page.\n\t\t\t( ! isMobileViewport || ( !! categoryType && !! categoryId ) ) )\n\t);\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,aAAaA,CACpC;EAAEC,IAAI;EAAEC,YAAY;EAAEC;AAAW,CAAC,EAClCC,gBAAgB,EACf;EACD,OACC,CAAE,cAAc,EAAE,uBAAuB,EAAE,QAAQ,CAAE,CAACC,QAAQ,CAC7DJ,IACD,CAAC,IACCA,IAAI,KAAK,WAAW;EACrB;EACA;EACE,CAAEG,gBAAgB,IAAM,CAAC,CAAEF,YAAY,IAAI,CAAC,CAAEC,UAAY,CAAI;AAEnE","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_url","require","isPreviewingTheme","getQueryArg","window","location","href","undefined","currentlyPreviewingTheme"],"sources":["@wordpress/edit-site/src/utils/is-previewing-theme.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getQueryArg } from '@wordpress/url';\n\nexport function isPreviewingTheme() {\n\treturn (\n\t\tgetQueryArg( window.location.href, 'wp_theme_preview' ) !== undefined\n\t);\n}\n\nexport function currentlyPreviewingTheme() {\n\tif ( isPreviewingTheme() ) {\n\t\treturn getQueryArg( window.location.href, 'wp_theme_preview' );\n\t}\n\treturn null;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,IAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,SAASC,iBAAiBA,CAAA,EAAG;EACnC,OACC,IAAAC,gBAAW,EAAEC,MAAM,CAACC,QAAQ,CAACC,IAAI,EAAE,kBAAmB,CAAC,KAAKC,SAAS;AAEvE;AAEO,SAASC,wBAAwBA,CAAA,EAAG;EAC1C,IAAKN,iBAAiB,CAAC,CAAC,EAAG;IAC1B,OAAO,IAAAC,gBAAW,EAAEC,MAAM,CAACC,QAAQ,CAACC,IAAI,EAAE,kBAAmB,CAAC;EAC/D;EACA,OAAO,IAAI;AACZ"}
1
+ {"version":3,"names":["_url","require","isPreviewingTheme","getQueryArg","window","location","href","undefined","currentlyPreviewingTheme"],"sources":["@wordpress/edit-site/src/utils/is-previewing-theme.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getQueryArg } from '@wordpress/url';\n\nexport function isPreviewingTheme() {\n\treturn (\n\t\tgetQueryArg( window.location.href, 'wp_theme_preview' ) !== undefined\n\t);\n}\n\nexport function currentlyPreviewingTheme() {\n\tif ( isPreviewingTheme() ) {\n\t\treturn getQueryArg( window.location.href, 'wp_theme_preview' );\n\t}\n\treturn null;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,IAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,SAASC,iBAAiBA,CAAA,EAAG;EACnC,OACC,IAAAC,gBAAW,EAAEC,MAAM,CAACC,QAAQ,CAACC,IAAI,EAAE,kBAAmB,CAAC,KAAKC,SAAS;AAEvE;AAEO,SAASC,wBAAwBA,CAAA,EAAG;EAC1C,IAAKN,iBAAiB,CAAC,CAAC,EAAG;IAC1B,OAAO,IAAAC,gBAAW,EAAEC,MAAM,CAACC,QAAQ,CAACC,IAAI,EAAE,kBAAmB,CAAC;EAC/D;EACA,OAAO,IAAI;AACZ","ignoreList":[]}
@@ -1 +1 @@
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"}
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","ignoreList":[]}
@@ -1 +1 @@
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"}
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","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["clamp","min","value","max","Math","twoPointLinearFn","p0","p1","x","y","clampedTwoPointLinearFn","computeIFrameScale","start","end","currentWidth","width","scale"],"sources":["@wordpress/edit-site/src/utils/math.js"],"sourcesContent":["/**\n * @typedef {Object} WPPoint\n * @property {number} x The horizontal coordinate.\n * @property {number} y The vertical coordinate.\n */\n\n/**\n * Clamps a value to a range. Uses the CSS `clamp()` ordering for arguments.\n *\n * @param {number} min Minimum range.\n * @param {number} value Value to clamp.\n * @param {number} max Maximum range.\n *\n * @return {number} Clamped value.\n */\nfunction clamp( min, value, max ) {\n\treturn Math.max( min, Math.min( value, max ) );\n}\n\n/**\n * Evaluates a linear function passing through two points at the given x value.\n *\n * Example:\n * f(x)\n * │ ╲\n * │ * (p0)\n * │ ╲\n * │ ╲\n * │ (p1) *\n * │ ╲\n * └──────────── x\n *\n * @param {WPPoint} p0 First point.\n * @param {WPPoint} p1 Second point.\n * @param {number} x Value to evaluate at.\n *\n * @return {number} Result of the two-point linear function at x.\n */\nfunction twoPointLinearFn( p0, p1, x ) {\n\treturn ( ( p1.y - p0.y ) / ( p1.x - p0.x ) ) * ( x - p0.x ) + p0.y;\n}\n\n/**\n * Evaluates a two-point linear function at a given x value, clamped to the range of the points.\n *\n * Example:\n * f(x)\n * │ ───* (p0)\n * │ ╲\n * │ ╲\n * │ (p1) *───\n * └──────────── x\n *\n * @param {WPPoint} p0 First point.\n * @param {WPPoint} p1 Second point.\n * @param {number} x Value to evaluate at.\n *\n * @return {number} Result of the two-point linear function clamped to the range of the points.\n */\nfunction clampedTwoPointLinearFn( p0, p1, x ) {\n\treturn clamp(\n\t\tMath.min( p0.y, p1.y ),\n\t\ttwoPointLinearFn( p0, p1, x ),\n\t\tMath.max( p0.y, p1.y )\n\t);\n}\n\n/**\n * Computes the iframe scale using a start and end width/scale pair and the current width.\n *\n * The scale is clamped outside the points and is linearly interpolated between.\n *\n * Example:\n * scale\n * │ ───* (start)\n * │ ╲\n * │ ╲\n * │ (end) *───\n * └──────────── width\n *\n * @param {Object} start First width and scale pair.\n * @param {Object} end Second width and scale pair.\n * @param {number} currentWidth Current width.\n *\n * @return {number} The scale of the current width between the two points.\n */\nexport function computeIFrameScale( start, end, currentWidth ) {\n\treturn clampedTwoPointLinearFn(\n\t\t{ x: start.width, y: start.scale },\n\t\t{ x: end.width, y: end.scale },\n\t\tcurrentWidth\n\t);\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,KAAKA,CAAEC,GAAG,EAAEC,KAAK,EAAEC,GAAG,EAAG;EACjC,OAAOC,IAAI,CAACD,GAAG,CAAEF,GAAG,EAAEG,IAAI,CAACH,GAAG,CAAEC,KAAK,EAAEC,GAAI,CAAE,CAAC;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,gBAAgBA,CAAEC,EAAE,EAAEC,EAAE,EAAEC,CAAC,EAAG;EACtC,OAAS,CAAED,EAAE,CAACE,CAAC,GAAGH,EAAE,CAACG,CAAC,KAAOF,EAAE,CAACC,CAAC,GAAGF,EAAE,CAACE,CAAC,CAAE,IAAOA,CAAC,GAAGF,EAAE,CAACE,CAAC,CAAE,GAAGF,EAAE,CAACG,CAAC;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,uBAAuBA,CAAEJ,EAAE,EAAEC,EAAE,EAAEC,CAAC,EAAG;EAC7C,OAAOR,KAAK,CACXI,IAAI,CAACH,GAAG,CAAEK,EAAE,CAACG,CAAC,EAAEF,EAAE,CAACE,CAAE,CAAC,EACtBJ,gBAAgB,CAAEC,EAAE,EAAEC,EAAE,EAAEC,CAAE,CAAC,EAC7BJ,IAAI,CAACD,GAAG,CAAEG,EAAE,CAACG,CAAC,EAAEF,EAAE,CAACE,CAAE,CACtB,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,kBAAkBA,CAAEC,KAAK,EAAEC,GAAG,EAAEC,YAAY,EAAG;EAC9D,OAAOJ,uBAAuB,CAC7B;IAAEF,CAAC,EAAEI,KAAK,CAACG,KAAK;IAAEN,CAAC,EAAEG,KAAK,CAACI;EAAM,CAAC,EAClC;IAAER,CAAC,EAAEK,GAAG,CAACE,KAAK;IAAEN,CAAC,EAAEI,GAAG,CAACG;EAAM,CAAC,EAC9BF,YACD,CAAC;AACF"}
1
+ {"version":3,"names":["clamp","min","value","max","Math","twoPointLinearFn","p0","p1","x","y","clampedTwoPointLinearFn","computeIFrameScale","start","end","currentWidth","width","scale"],"sources":["@wordpress/edit-site/src/utils/math.js"],"sourcesContent":["/**\n * @typedef {Object} WPPoint\n * @property {number} x The horizontal coordinate.\n * @property {number} y The vertical coordinate.\n */\n\n/**\n * Clamps a value to a range. Uses the CSS `clamp()` ordering for arguments.\n *\n * @param {number} min Minimum range.\n * @param {number} value Value to clamp.\n * @param {number} max Maximum range.\n *\n * @return {number} Clamped value.\n */\nfunction clamp( min, value, max ) {\n\treturn Math.max( min, Math.min( value, max ) );\n}\n\n/**\n * Evaluates a linear function passing through two points at the given x value.\n *\n * Example:\n * f(x)\n * │ ╲\n * │ * (p0)\n * │ ╲\n * │ ╲\n * │ (p1) *\n * │ ╲\n * └──────────── x\n *\n * @param {WPPoint} p0 First point.\n * @param {WPPoint} p1 Second point.\n * @param {number} x Value to evaluate at.\n *\n * @return {number} Result of the two-point linear function at x.\n */\nfunction twoPointLinearFn( p0, p1, x ) {\n\treturn ( ( p1.y - p0.y ) / ( p1.x - p0.x ) ) * ( x - p0.x ) + p0.y;\n}\n\n/**\n * Evaluates a two-point linear function at a given x value, clamped to the range of the points.\n *\n * Example:\n * f(x)\n * │ ───* (p0)\n * │ ╲\n * │ ╲\n * │ (p1) *───\n * └──────────── x\n *\n * @param {WPPoint} p0 First point.\n * @param {WPPoint} p1 Second point.\n * @param {number} x Value to evaluate at.\n *\n * @return {number} Result of the two-point linear function clamped to the range of the points.\n */\nfunction clampedTwoPointLinearFn( p0, p1, x ) {\n\treturn clamp(\n\t\tMath.min( p0.y, p1.y ),\n\t\ttwoPointLinearFn( p0, p1, x ),\n\t\tMath.max( p0.y, p1.y )\n\t);\n}\n\n/**\n * Computes the iframe scale using a start and end width/scale pair and the current width.\n *\n * The scale is clamped outside the points and is linearly interpolated between.\n *\n * Example:\n * scale\n * │ ───* (start)\n * │ ╲\n * │ ╲\n * │ (end) *───\n * └──────────── width\n *\n * @param {Object} start First width and scale pair.\n * @param {Object} end Second width and scale pair.\n * @param {number} currentWidth Current width.\n *\n * @return {number} The scale of the current width between the two points.\n */\nexport function computeIFrameScale( start, end, currentWidth ) {\n\treturn clampedTwoPointLinearFn(\n\t\t{ x: start.width, y: start.scale },\n\t\t{ x: end.width, y: end.scale },\n\t\tcurrentWidth\n\t);\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,KAAKA,CAAEC,GAAG,EAAEC,KAAK,EAAEC,GAAG,EAAG;EACjC,OAAOC,IAAI,CAACD,GAAG,CAAEF,GAAG,EAAEG,IAAI,CAACH,GAAG,CAAEC,KAAK,EAAEC,GAAI,CAAE,CAAC;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,gBAAgBA,CAAEC,EAAE,EAAEC,EAAE,EAAEC,CAAC,EAAG;EACtC,OAAS,CAAED,EAAE,CAACE,CAAC,GAAGH,EAAE,CAACG,CAAC,KAAOF,EAAE,CAACC,CAAC,GAAGF,EAAE,CAACE,CAAC,CAAE,IAAOA,CAAC,GAAGF,EAAE,CAACE,CAAC,CAAE,GAAGF,EAAE,CAACG,CAAC;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,uBAAuBA,CAAEJ,EAAE,EAAEC,EAAE,EAAEC,CAAC,EAAG;EAC7C,OAAOR,KAAK,CACXI,IAAI,CAACH,GAAG,CAAEK,EAAE,CAACG,CAAC,EAAEF,EAAE,CAACE,CAAE,CAAC,EACtBJ,gBAAgB,CAAEC,EAAE,EAAEC,EAAE,EAAEC,CAAE,CAAC,EAC7BJ,IAAI,CAACD,GAAG,CAAEG,EAAE,CAACG,CAAC,EAAEF,EAAE,CAACE,CAAE,CACtB,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,kBAAkBA,CAAEC,KAAK,EAAEC,GAAG,EAAEC,YAAY,EAAG;EAC9D,OAAOJ,uBAAuB,CAC7B;IAAEF,CAAC,EAAEI,KAAK,CAACG,KAAK;IAAEN,CAAC,EAAEG,KAAK,CAACI;EAAM,CAAC,EAClC;IAAER,CAAC,EAAEK,GAAG,CAACE,KAAK;IAAEN,CAAC,EAAEI,GAAG,CAACG;EAAM,CAAC,EAC9BF,YACD,CAAC;AACF","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = setNestedValue;
7
+ /**
8
+ * Sets the value at path of object.
9
+ * If a portion of path doesn’t exist, it’s created.
10
+ * Arrays are created for missing index properties while objects are created
11
+ * for all other missing properties.
12
+ *
13
+ * This function intentionally mutates the input object.
14
+ *
15
+ * Inspired by _.set().
16
+ *
17
+ * @see https://lodash.com/docs/4.17.15#set
18
+ *
19
+ * @todo Needs to be deduplicated with its copy in `@wordpress/core-data`.
20
+ *
21
+ * @param {Object} object Object to modify
22
+ * @param {Array} path Path of the property to set.
23
+ * @param {*} value Value to set.
24
+ */
25
+ function setNestedValue(object, path, value) {
26
+ if (!object || typeof object !== 'object') {
27
+ return object;
28
+ }
29
+ path.reduce((acc, key, idx) => {
30
+ if (acc[key] === undefined) {
31
+ if (Number.isInteger(path[idx + 1])) {
32
+ acc[key] = [];
33
+ } else {
34
+ acc[key] = {};
35
+ }
36
+ }
37
+ if (idx === path.length - 1) {
38
+ acc[key] = value;
39
+ }
40
+ return acc[key];
41
+ }, object);
42
+ return object;
43
+ }
44
+ //# sourceMappingURL=set-nested-value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["setNestedValue","object","path","value","reduce","acc","key","idx","undefined","Number","isInteger","length"],"sources":["@wordpress/edit-site/src/utils/set-nested-value.js"],"sourcesContent":["/**\n * Sets the value at path of object.\n * If a portion of path doesn’t exist, it’s created.\n * Arrays are created for missing index properties while objects are created\n * for all other missing properties.\n *\n * This function intentionally mutates the input object.\n *\n * Inspired by _.set().\n *\n * @see https://lodash.com/docs/4.17.15#set\n *\n * @todo Needs to be deduplicated with its copy in `@wordpress/core-data`.\n *\n * @param {Object} object Object to modify\n * @param {Array} path Path of the property to set.\n * @param {*} value Value to set.\n */\nexport default function setNestedValue( object, path, value ) {\n\tif ( ! object || typeof object !== 'object' ) {\n\t\treturn object;\n\t}\n\n\tpath.reduce( ( acc, key, idx ) => {\n\t\tif ( acc[ key ] === undefined ) {\n\t\t\tif ( Number.isInteger( path[ idx + 1 ] ) ) {\n\t\t\t\tacc[ key ] = [];\n\t\t\t} else {\n\t\t\t\tacc[ key ] = {};\n\t\t\t}\n\t\t}\n\t\tif ( idx === path.length - 1 ) {\n\t\t\tacc[ key ] = value;\n\t\t}\n\t\treturn acc[ key ];\n\t}, object );\n\n\treturn object;\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,cAAcA,CAAEC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAG;EAC7D,IAAK,CAAEF,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAG;IAC7C,OAAOA,MAAM;EACd;EAEAC,IAAI,CAACE,MAAM,CAAE,CAAEC,GAAG,EAAEC,GAAG,EAAEC,GAAG,KAAM;IACjC,IAAKF,GAAG,CAAEC,GAAG,CAAE,KAAKE,SAAS,EAAG;MAC/B,IAAKC,MAAM,CAACC,SAAS,CAAER,IAAI,CAAEK,GAAG,GAAG,CAAC,CAAG,CAAC,EAAG;QAC1CF,GAAG,CAAEC,GAAG,CAAE,GAAG,EAAE;MAChB,CAAC,MAAM;QACND,GAAG,CAAEC,GAAG,CAAE,GAAG,CAAC,CAAC;MAChB;IACD;IACA,IAAKC,GAAG,KAAKL,IAAI,CAACS,MAAM,GAAG,CAAC,EAAG;MAC9BN,GAAG,CAAEC,GAAG,CAAE,GAAGH,KAAK;IACnB;IACA,OAAOE,GAAG,CAAEC,GAAG,CAAE;EAClB,CAAC,EAAEL,MAAO,CAAC;EAEX,OAAOA,MAAM;AACd","ignoreList":[]}
@@ -1 +1 @@
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,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,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","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_coreData","require","_data","_router","_lockUnlock","_isPreviewingTheme","useHistory","useLocation","unlock","routerPrivateApis","useActivateTheme","history","location","startResolution","finishResolution","useDispatch","coreStore","isPreviewingTheme","activationURL","currentlyPreviewingTheme","window","WP_BLOCK_THEME_ACTIVATE_NONCE","fetch","wp_theme_preview","themePreview","params","replace"],"sources":["@wordpress/edit-site/src/utils/use-activate-theme.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useDispatch } from '@wordpress/data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from './is-previewing-theme';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\n/**\n * This should be refactored to use the REST API, once the REST API can activate themes.\n *\n * @return {Function} A function that activates the theme.\n */\nexport function useActivateTheme() {\n\tconst history = useHistory();\n\tconst location = useLocation();\n\tconst { startResolution, finishResolution } = useDispatch( coreStore );\n\n\treturn async () => {\n\t\tif ( isPreviewingTheme() ) {\n\t\t\tconst activationURL =\n\t\t\t\t'themes.php?action=activate&stylesheet=' +\n\t\t\t\tcurrentlyPreviewingTheme() +\n\t\t\t\t'&_wpnonce=' +\n\t\t\t\twindow.WP_BLOCK_THEME_ACTIVATE_NONCE;\n\t\t\tstartResolution( 'activateTheme' );\n\t\t\tawait window.fetch( activationURL );\n\t\t\tfinishResolution( 'activateTheme' );\n\t\t\tconst { wp_theme_preview: themePreview, ...params } =\n\t\t\t\tlocation.params;\n\t\t\thistory.replace( params );\n\t\t}\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAKA;AACA;AACA;;AAOA,MAAM;EAAEK,UAAU;EAAEC;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;;AAE/D;AACA;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAAA,EAAG;EAClC,MAAMC,OAAO,GAAGL,UAAU,CAAC,CAAC;EAC5B,MAAMM,QAAQ,GAAGL,WAAW,CAAC,CAAC;EAC9B,MAAM;IAAEM,eAAe;IAAEC;EAAiB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,eAAU,CAAC;EAEtE,OAAO,YAAY;IAClB,IAAK,IAAAC,oCAAiB,EAAC,CAAC,EAAG;MAC1B,MAAMC,aAAa,GAClB,wCAAwC,GACxC,IAAAC,2CAAwB,EAAC,CAAC,GAC1B,YAAY,GACZC,MAAM,CAACC,6BAA6B;MACrCR,eAAe,CAAE,eAAgB,CAAC;MAClC,MAAMO,MAAM,CAACE,KAAK,CAAEJ,aAAc,CAAC;MACnCJ,gBAAgB,CAAE,eAAgB,CAAC;MACnC,MAAM;QAAES,gBAAgB,EAAEC,YAAY;QAAE,GAAGC;MAAO,CAAC,GAClDb,QAAQ,CAACa,MAAM;MAChBd,OAAO,CAACe,OAAO,CAAED,MAAO,CAAC;IAC1B;EACD,CAAC;AACF"}
1
+ {"version":3,"names":["_coreData","require","_data","_router","_lockUnlock","_isPreviewingTheme","useHistory","useLocation","unlock","routerPrivateApis","useActivateTheme","history","location","startResolution","finishResolution","useDispatch","coreStore","isPreviewingTheme","activationURL","currentlyPreviewingTheme","window","WP_BLOCK_THEME_ACTIVATE_NONCE","fetch","wp_theme_preview","themePreview","params","replace"],"sources":["@wordpress/edit-site/src/utils/use-activate-theme.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useDispatch } from '@wordpress/data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from './is-previewing-theme';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\n/**\n * This should be refactored to use the REST API, once the REST API can activate themes.\n *\n * @return {Function} A function that activates the theme.\n */\nexport function useActivateTheme() {\n\tconst history = useHistory();\n\tconst location = useLocation();\n\tconst { startResolution, finishResolution } = useDispatch( coreStore );\n\n\treturn async () => {\n\t\tif ( isPreviewingTheme() ) {\n\t\t\tconst activationURL =\n\t\t\t\t'themes.php?action=activate&stylesheet=' +\n\t\t\t\tcurrentlyPreviewingTheme() +\n\t\t\t\t'&_wpnonce=' +\n\t\t\t\twindow.WP_BLOCK_THEME_ACTIVATE_NONCE;\n\t\t\tstartResolution( 'activateTheme' );\n\t\t\tawait window.fetch( activationURL );\n\t\t\tfinishResolution( 'activateTheme' );\n\t\t\tconst { wp_theme_preview: themePreview, ...params } =\n\t\t\t\tlocation.params;\n\t\t\thistory.replace( params );\n\t\t}\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAKA;AACA;AACA;;AAOA,MAAM;EAAEK,UAAU;EAAEC;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;;AAE/D;AACA;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAAA,EAAG;EAClC,MAAMC,OAAO,GAAGL,UAAU,CAAC,CAAC;EAC5B,MAAMM,QAAQ,GAAGL,WAAW,CAAC,CAAC;EAC9B,MAAM;IAAEM,eAAe;IAAEC;EAAiB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,eAAU,CAAC;EAEtE,OAAO,YAAY;IAClB,IAAK,IAAAC,oCAAiB,EAAC,CAAC,EAAG;MAC1B,MAAMC,aAAa,GAClB,wCAAwC,GACxC,IAAAC,2CAAwB,EAAC,CAAC,GAC1B,YAAY,GACZC,MAAM,CAACC,6BAA6B;MACrCR,eAAe,CAAE,eAAgB,CAAC;MAClC,MAAMO,MAAM,CAACE,KAAK,CAAEJ,aAAc,CAAC;MACnCJ,gBAAgB,CAAE,eAAgB,CAAC;MACnC,MAAM;QAAES,gBAAgB,EAAEC,YAAY;QAAE,GAAGC;MAAO,CAAC,GAClDb,QAAQ,CAACa,MAAM;MAChBd,OAAO,CAACe,OAAO,CAAED,MAAO,CAAC;IAC1B;EACD,CAAC;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_apiFetch","_interopRequireDefault","require","_element","_url","ACTIVE_THEMES_URL","useActualCurrentTheme","currentTheme","setCurrentTheme","useState","useEffect","path","addQueryArgs","context","wp_theme_preview","apiFetch","then","activeThemes","catch"],"sources":["@wordpress/edit-site/src/utils/use-actual-current-theme.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { useState, useEffect } from '@wordpress/element';\nimport { addQueryArgs } from '@wordpress/url';\n\nconst ACTIVE_THEMES_URL = '/wp/v2/themes?status=active';\n\nexport function useActualCurrentTheme() {\n\tconst [ currentTheme, setCurrentTheme ] = useState();\n\n\tuseEffect( () => {\n\t\t// Set the `wp_theme_preview` to empty string to bypass the createThemePreviewMiddleware.\n\t\tconst path = addQueryArgs( ACTIVE_THEMES_URL, {\n\t\t\tcontext: 'edit',\n\t\t\twp_theme_preview: '',\n\t\t} );\n\n\t\tapiFetch( { path } )\n\t\t\t.then( ( activeThemes ) => setCurrentTheme( activeThemes[ 0 ] ) )\n\t\t\t// Do nothing\n\t\t\t.catch( () => {} );\n\t}, [] );\n\n\treturn currentTheme;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA,MAAMG,iBAAiB,GAAG,6BAA6B;AAEhD,SAASC,qBAAqBA,CAAA,EAAG;EACvC,MAAM,CAAEC,YAAY,EAAEC,eAAe,CAAE,GAAG,IAAAC,iBAAQ,EAAC,CAAC;EAEpD,IAAAC,kBAAS,EAAE,MAAM;IAChB;IACA,MAAMC,IAAI,GAAG,IAAAC,iBAAY,EAAEP,iBAAiB,EAAE;MAC7CQ,OAAO,EAAE,MAAM;MACfC,gBAAgB,EAAE;IACnB,CAAE,CAAC;IAEH,IAAAC,iBAAQ,EAAE;MAAEJ;IAAK,CAAE,CAAC,CAClBK,IAAI,CAAIC,YAAY,IAAMT,eAAe,CAAES,YAAY,CAAE,CAAC,CAAG,CAAE;IAChE;IAAA,CACCC,KAAK,CAAE,MAAM,CAAC,CAAE,CAAC;EACpB,CAAC,EAAE,EAAG,CAAC;EAEP,OAAOX,YAAY;AACpB"}
1
+ {"version":3,"names":["_apiFetch","_interopRequireDefault","require","_element","_url","ACTIVE_THEMES_URL","useActualCurrentTheme","currentTheme","setCurrentTheme","useState","useEffect","path","addQueryArgs","context","wp_theme_preview","apiFetch","then","activeThemes","catch"],"sources":["@wordpress/edit-site/src/utils/use-actual-current-theme.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { useState, useEffect } from '@wordpress/element';\nimport { addQueryArgs } from '@wordpress/url';\n\nconst ACTIVE_THEMES_URL = '/wp/v2/themes?status=active';\n\nexport function useActualCurrentTheme() {\n\tconst [ currentTheme, setCurrentTheme ] = useState();\n\n\tuseEffect( () => {\n\t\t// Set the `wp_theme_preview` to empty string to bypass the createThemePreviewMiddleware.\n\t\tconst path = addQueryArgs( ACTIVE_THEMES_URL, {\n\t\t\tcontext: 'edit',\n\t\t\twp_theme_preview: '',\n\t\t} );\n\n\t\tapiFetch( { path } )\n\t\t\t.then( ( activeThemes ) => setCurrentTheme( activeThemes[ 0 ] ) )\n\t\t\t// Do nothing\n\t\t\t.catch( () => {} );\n\t}, [] );\n\n\treturn currentTheme;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA,MAAMG,iBAAiB,GAAG,6BAA6B;AAEhD,SAASC,qBAAqBA,CAAA,EAAG;EACvC,MAAM,CAAEC,YAAY,EAAEC,eAAe,CAAE,GAAG,IAAAC,iBAAQ,EAAC,CAAC;EAEpD,IAAAC,kBAAS,EAAE,MAAM;IAChB;IACA,MAAMC,IAAI,GAAG,IAAAC,iBAAY,EAAEP,iBAAiB,EAAE;MAC7CQ,OAAO,EAAE,MAAM;MACfC,gBAAgB,EAAE;IACnB,CAAE,CAAC;IAEH,IAAAC,iBAAQ,EAAE;MAAEJ;IAAK,CAAE,CAAC,CAClBK,IAAI,CAAIC,YAAY,IAAMT,eAAe,CAAES,YAAY,CAAE,CAAC,CAAG,CAAE;IAChE;IAAA,CACCC,KAAK,CAAE,MAAM,CAAC,CAAE,CAAC;EACpB,CAAC,EAAE,EAAG,CAAC;EAEP,OAAOX,YAAY;AACpB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Button","Modal","__experimentalHStack","HStack","__experimentalVStack","VStack","TextControl","__","sprintf","useDispatch","useState","store","coreStore","noticesStore","AddNewPageModal","onSave","onClose","isCreatingPage","setIsCreatingPage","title","setTitle","saveEntityRecord","createErrorNotice","createSuccessNotice","createPage","event","preventDefault","newPage","status","slug","throwOnError","rendered","type","error","errorMessage","message","code","createElement","onRequestClose","onSubmit","spacing","label","onChange","placeholder","value","justify","variant","onClick","isBusy"],"sources":["@wordpress/edit-site/src/components/add-new-page/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tModal,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tTextControl,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function AddNewPageModal( { onSave, onClose } ) {\n\tconst [ isCreatingPage, setIsCreatingPage ] = useState( false );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tasync function createPage( event ) {\n\t\tevent.preventDefault();\n\n\t\tif ( isCreatingPage ) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsCreatingPage( true );\n\t\ttry {\n\t\t\tconst newPage = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'page',\n\t\t\t\t{\n\t\t\t\t\tstatus: 'draft',\n\t\t\t\t\ttitle,\n\t\t\t\t\tslug: title || __( 'No title' ),\n\t\t\t\t},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\n\t\t\tonSave( newPage );\n\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the created template e.g: \"Category\".\n\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\tnewPage.title?.rendered || title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while creating the page.' );\n\n\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} finally {\n\t\t\tsetIsCreatingPage( false );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Modal title={ __( 'Draft a new page' ) } onRequestClose={ onClose }>\n\t\t\t<form onSubmit={ createPage }>\n\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tlabel={ __( 'Page title' ) }\n\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\tplaceholder={ __( 'No title' ) }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack spacing={ 2 } justify=\"end\">\n\t\t\t\t\t\t<Button variant=\"tertiary\" onClick={ onClose }>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t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CAAE,QAAS,CACR,CAAC,EACT8B,aAAA,CAACrC,MAAM;IACN8C,OAAO,EAAC,SAAS;IACjBd,IAAI,EAAC,QAAQ;IACbgB,MAAM,EAAG/B,cAAgB;IACzB,iBAAgBA;EAAgB,GAE9BV,EAAE,CAAE,cAAe,CACd,CACD,CACD,CACH,CACA,CAAC;AAEV"}
1
+ {"version":3,"names":["Button","Modal","__experimentalHStack","HStack","__experimentalVStack","VStack","TextControl","__","sprintf","useDispatch","useState","store","coreStore","noticesStore","AddNewPageModal","onSave","onClose","isCreatingPage","setIsCreatingPage","title","setTitle","saveEntityRecord","createErrorNotice","createSuccessNotice","createPage","event","preventDefault","newPage","status","slug","throwOnError","rendered","type","error","errorMessage","message","code","createElement","onRequestClose","onSubmit","spacing","label","onChange","placeholder","value","justify","variant","onClick","isBusy"],"sources":["@wordpress/edit-site/src/components/add-new-page/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tModal,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tTextControl,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function AddNewPageModal( { onSave, onClose } ) {\n\tconst [ isCreatingPage, setIsCreatingPage ] = useState( false );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tasync function createPage( event ) {\n\t\tevent.preventDefault();\n\n\t\tif ( isCreatingPage ) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsCreatingPage( true );\n\t\ttry {\n\t\t\tconst newPage = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'page',\n\t\t\t\t{\n\t\t\t\t\tstatus: 'draft',\n\t\t\t\t\ttitle,\n\t\t\t\t\tslug: title || __( 'No title' ),\n\t\t\t\t},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\n\t\t\tonSave( newPage );\n\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the created template e.g: \"Category\".\n\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\tnewPage.title?.rendered || title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while creating the page.' );\n\n\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} finally {\n\t\t\tsetIsCreatingPage( false );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Modal title={ __( 'Draft a new page' ) } onRequestClose={ onClose }>\n\t\t\t<form onSubmit={ createPage }>\n\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tlabel={ __( 'Page title' ) }\n\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\tplaceholder={ __( 'No title' ) }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack spacing={ 2 } justify=\"end\">\n\t\t\t\t\t\t<Button variant=\"tertiary\" onClick={ onClose }>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tisBusy={ isCreatingPage }\n\t\t\t\t\t\t\taria-disabled={ isCreatingPage }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create draft' ) }\n\t\t\t\t\t\t</Button>\n\t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