@wordpress/edit-site 5.31.0 → 5.32.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 (280) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-editor/editor-canvas.js +8 -1
  3. package/build/components/block-editor/editor-canvas.js.map +1 -1
  4. package/build/components/block-editor/site-editor-canvas.js +15 -4
  5. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  6. package/build/components/editor/index.js +12 -3
  7. package/build/components/editor/index.js.map +1 -1
  8. package/build/components/editor-canvas-container/index.js +1 -2
  9. package/build/components/editor-canvas-container/index.js.map +1 -1
  10. package/build/components/global-styles/background-panel.js +38 -0
  11. package/build/components/global-styles/background-panel.js.map +1 -0
  12. package/build/components/global-styles/font-families.js +1 -1
  13. package/build/components/global-styles/font-families.js.map +1 -1
  14. package/build/components/global-styles/font-library-modal/context.js +38 -9
  15. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  16. package/build/components/global-styles/font-library-modal/utils/index.js +20 -2
  17. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  18. package/build/components/global-styles/palette.js +3 -1
  19. package/build/components/global-styles/palette.js.map +1 -1
  20. package/build/components/global-styles/preview-colors.js +2 -2
  21. package/build/components/global-styles/preview-colors.js.map +1 -1
  22. package/build/components/global-styles/root-menu.js +8 -2
  23. package/build/components/global-styles/root-menu.js.map +1 -1
  24. package/build/components/global-styles/screen-background.js +34 -0
  25. package/build/components/global-styles/screen-background.js.map +1 -0
  26. package/build/components/global-styles/screen-color-palette.js +2 -2
  27. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  28. package/build/components/global-styles/screen-colors.js +6 -4
  29. package/build/components/global-styles/screen-colors.js.map +1 -1
  30. package/build/components/global-styles/screen-style-variations.js +3 -37
  31. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  32. package/build/components/global-styles/screen-typography.js +6 -6
  33. package/build/components/global-styles/screen-typography.js.map +1 -1
  34. package/build/components/global-styles/style-variations-container.js +5 -2
  35. package/build/components/global-styles/style-variations-container.js.map +1 -1
  36. package/build/components/global-styles/ui.js +4 -1
  37. package/build/components/global-styles/ui.js.map +1 -1
  38. package/build/components/global-styles/variations/variations-color.js +10 -3
  39. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  40. package/build/components/global-styles/variations/variations-typography.js +9 -2
  41. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  42. package/build/components/keyboard-shortcut-help-modal/index.js +3 -0
  43. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  44. package/build/components/layout/animation.js +129 -0
  45. package/build/components/layout/animation.js.map +1 -0
  46. package/build/components/layout/index.js +9 -17
  47. package/build/components/layout/index.js.map +1 -1
  48. package/build/components/layout/router.js +21 -18
  49. package/build/components/layout/router.js.map +1 -1
  50. package/build/components/page-pages/index.js +19 -17
  51. package/build/components/page-pages/index.js.map +1 -1
  52. package/build/components/page-patterns/index.js +18 -28
  53. package/build/components/page-patterns/index.js.map +1 -1
  54. package/build/components/page-patterns/search-items.js +16 -58
  55. package/build/components/page-patterns/search-items.js.map +1 -1
  56. package/build/components/page-templates-template-parts/actions.js +54 -41
  57. package/build/components/page-templates-template-parts/actions.js.map +1 -1
  58. package/build/components/page-templates-template-parts/index.js +26 -59
  59. package/build/components/page-templates-template-parts/index.js.map +1 -1
  60. package/build/components/plugin-template-setting-panel/index.js +12 -1
  61. package/build/components/plugin-template-setting-panel/index.js.map +1 -1
  62. package/build/components/save-button/index.js +45 -16
  63. package/build/components/save-button/index.js.map +1 -1
  64. package/build/components/save-hub/index.js +8 -112
  65. package/build/components/save-hub/index.js.map +1 -1
  66. package/build/components/sidebar/index.js +1 -5
  67. package/build/components/sidebar/index.js.map +1 -1
  68. package/build/components/sidebar-dataviews/default-views.js +1 -1
  69. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  70. package/build/components/sidebar-dataviews/index.js +1 -1
  71. package/build/components/sidebar-dataviews/index.js.map +1 -1
  72. package/build/components/sidebar-edit-mode/index.js +1 -2
  73. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  74. package/build/components/sidebar-edit-mode/page-panels/index.js +5 -15
  75. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  76. package/build/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
  77. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  78. package/build/components/sidebar-edit-mode/template-panel/index.js +10 -16
  79. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  80. package/build/components/sidebar-navigation-screen-details-footer/index.js +5 -1
  81. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  82. package/build/components/sidebar-navigation-screen-global-styles/index.js +10 -5
  83. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  84. package/build/components/sidebar-navigation-screen-patterns/index.js +1 -5
  85. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  86. package/build/components/style-book/index.js +1 -1
  87. package/build/components/style-book/index.js.map +1 -1
  88. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +2 -2
  89. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  90. package/build/components/sync-state-with-url/use-sync-path-with-url.js +1 -1
  91. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  92. package/build/hooks/index.js +0 -1
  93. package/build/hooks/index.js.map +1 -1
  94. package/build/store/selectors.js +1 -9
  95. package/build/store/selectors.js.map +1 -1
  96. package/build-module/components/block-editor/editor-canvas.js +8 -1
  97. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  98. package/build-module/components/block-editor/site-editor-canvas.js +15 -4
  99. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  100. package/build-module/components/editor/index.js +13 -4
  101. package/build-module/components/editor/index.js.map +1 -1
  102. package/build-module/components/editor-canvas-container/index.js +1 -2
  103. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  104. package/build-module/components/global-styles/background-panel.js +31 -0
  105. package/build-module/components/global-styles/background-panel.js.map +1 -0
  106. package/build-module/components/global-styles/font-families.js +1 -1
  107. package/build-module/components/global-styles/font-families.js.map +1 -1
  108. package/build-module/components/global-styles/font-library-modal/context.js +38 -9
  109. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  110. package/build-module/components/global-styles/font-library-modal/utils/index.js +20 -2
  111. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  112. package/build-module/components/global-styles/palette.js +3 -1
  113. package/build-module/components/global-styles/palette.js.map +1 -1
  114. package/build-module/components/global-styles/preview-colors.js +2 -2
  115. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  116. package/build-module/components/global-styles/root-menu.js +9 -3
  117. package/build-module/components/global-styles/root-menu.js.map +1 -1
  118. package/build-module/components/global-styles/screen-background.js +26 -0
  119. package/build-module/components/global-styles/screen-background.js.map +1 -0
  120. package/build-module/components/global-styles/screen-color-palette.js +2 -2
  121. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  122. package/build-module/components/global-styles/screen-colors.js +6 -4
  123. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  124. package/build-module/components/global-styles/screen-style-variations.js +4 -38
  125. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  126. package/build-module/components/global-styles/screen-typography.js +6 -6
  127. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  128. package/build-module/components/global-styles/style-variations-container.js +5 -2
  129. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  130. package/build-module/components/global-styles/ui.js +4 -1
  131. package/build-module/components/global-styles/ui.js.map +1 -1
  132. package/build-module/components/global-styles/variations/variations-color.js +10 -3
  133. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  134. package/build-module/components/global-styles/variations/variations-typography.js +9 -2
  135. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  136. package/build-module/components/keyboard-shortcut-help-modal/index.js +3 -0
  137. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  138. package/build-module/components/layout/animation.js +122 -0
  139. package/build-module/components/layout/animation.js.map +1 -0
  140. package/build-module/components/layout/index.js +9 -17
  141. package/build-module/components/layout/index.js.map +1 -1
  142. package/build-module/components/layout/router.js +21 -18
  143. package/build-module/components/layout/router.js.map +1 -1
  144. package/build-module/components/page-pages/index.js +19 -17
  145. package/build-module/components/page-pages/index.js.map +1 -1
  146. package/build-module/components/page-patterns/index.js +20 -30
  147. package/build-module/components/page-patterns/index.js.map +1 -1
  148. package/build-module/components/page-patterns/search-items.js +14 -55
  149. package/build-module/components/page-patterns/search-items.js.map +1 -1
  150. package/build-module/components/page-templates-template-parts/actions.js +54 -40
  151. package/build-module/components/page-templates-template-parts/actions.js.map +1 -1
  152. package/build-module/components/page-templates-template-parts/index.js +29 -62
  153. package/build-module/components/page-templates-template-parts/index.js.map +1 -1
  154. package/build-module/components/plugin-template-setting-panel/index.js +12 -1
  155. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
  156. package/build-module/components/save-button/index.js +46 -17
  157. package/build-module/components/save-button/index.js.map +1 -1
  158. package/build-module/components/save-hub/index.js +10 -114
  159. package/build-module/components/save-hub/index.js.map +1 -1
  160. package/build-module/components/sidebar/index.js +1 -5
  161. package/build-module/components/sidebar/index.js.map +1 -1
  162. package/build-module/components/sidebar-dataviews/default-views.js +1 -1
  163. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  164. package/build-module/components/sidebar-dataviews/index.js +1 -1
  165. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  166. package/build-module/components/sidebar-edit-mode/index.js +1 -2
  167. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  168. package/build-module/components/sidebar-edit-mode/page-panels/index.js +8 -18
  169. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  170. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
  171. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  172. package/build-module/components/sidebar-edit-mode/template-panel/index.js +11 -17
  173. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  174. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +5 -1
  175. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  176. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +10 -5
  177. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  178. package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -5
  179. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  180. package/build-module/components/style-book/index.js +1 -1
  181. package/build-module/components/style-book/index.js.map +1 -1
  182. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +2 -2
  183. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  184. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +1 -1
  185. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  186. package/build-module/hooks/index.js +0 -1
  187. package/build-module/hooks/index.js.map +1 -1
  188. package/build-module/store/selectors.js +1 -9
  189. package/build-module/store/selectors.js.map +1 -1
  190. package/build-style/style-rtl.css +116 -104
  191. package/build-style/style.css +116 -104
  192. package/package.json +44 -44
  193. package/src/components/block-editor/editor-canvas.js +14 -2
  194. package/src/components/block-editor/site-editor-canvas.js +10 -7
  195. package/src/components/editor/index.js +11 -4
  196. package/src/components/editor-canvas-container/index.js +0 -1
  197. package/src/components/global-styles/background-panel.js +34 -0
  198. package/src/components/global-styles/font-families.js +1 -1
  199. package/src/components/global-styles/font-library-modal/context.js +43 -14
  200. package/src/components/global-styles/font-library-modal/style.scss +1 -1
  201. package/src/components/global-styles/font-library-modal/utils/index.js +17 -4
  202. package/src/components/global-styles/palette.js +3 -1
  203. package/src/components/global-styles/preview-colors.js +2 -2
  204. package/src/components/global-styles/root-menu.js +12 -1
  205. package/src/components/global-styles/screen-background.js +29 -0
  206. package/src/components/global-styles/screen-color-palette.js +2 -2
  207. package/src/components/global-styles/screen-colors.js +4 -4
  208. package/src/components/global-styles/screen-style-variations.js +4 -36
  209. package/src/components/global-styles/screen-typography.js +6 -9
  210. package/src/components/global-styles/style-variations-container.js +2 -1
  211. package/src/components/global-styles/style.scss +14 -12
  212. package/src/components/global-styles/ui.js +5 -0
  213. package/src/components/global-styles/variations/style.scss +32 -17
  214. package/src/components/global-styles/variations/variations-color.js +4 -2
  215. package/src/components/global-styles/variations/variations-typography.js +4 -1
  216. package/src/components/header-edit-mode/style.scss +28 -17
  217. package/src/components/keyboard-shortcut-help-modal/index.js +4 -0
  218. package/src/components/layout/animation.js +122 -0
  219. package/src/components/layout/index.js +12 -27
  220. package/src/components/layout/router.js +25 -19
  221. package/src/components/layout/style.scss +2 -0
  222. package/src/components/page-pages/index.js +27 -43
  223. package/src/components/page-patterns/index.js +20 -28
  224. package/src/components/page-patterns/search-items.js +13 -58
  225. package/src/components/page-templates-template-parts/actions.js +106 -91
  226. package/src/components/page-templates-template-parts/index.js +34 -78
  227. package/src/components/page-templates-template-parts/style.scss +5 -0
  228. package/src/components/plugin-template-setting-panel/index.js +14 -1
  229. package/src/components/save-button/index.js +55 -26
  230. package/src/components/save-hub/index.js +20 -164
  231. package/src/components/sidebar/index.js +0 -5
  232. package/src/components/sidebar-dataviews/default-views.js +1 -1
  233. package/src/components/sidebar-dataviews/index.js +1 -1
  234. package/src/components/sidebar-edit-mode/index.js +0 -2
  235. package/src/components/sidebar-edit-mode/page-panels/index.js +29 -60
  236. package/src/components/sidebar-edit-mode/page-panels/page-content.js +10 -10
  237. package/src/components/sidebar-edit-mode/template-panel/index.js +23 -33
  238. package/src/components/sidebar-edit-mode/template-panel/style.scss +1 -29
  239. package/src/components/sidebar-navigation-screen/style.scss +12 -9
  240. package/src/components/sidebar-navigation-screen-details-footer/index.js +6 -2
  241. package/src/components/sidebar-navigation-screen-global-styles/index.js +7 -13
  242. package/src/components/sidebar-navigation-screen-patterns/index.js +0 -7
  243. package/src/components/style-book/index.js +1 -3
  244. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +2 -2
  245. package/src/components/sync-state-with-url/use-sync-path-with-url.js +1 -1
  246. package/src/hooks/index.js +0 -1
  247. package/src/store/selectors.js +3 -15
  248. package/src/style.scss +0 -1
  249. package/build/components/actions/index.js +0 -319
  250. package/build/components/actions/index.js.map +0 -1
  251. package/build/components/sidebar-edit-mode/sidebar-card/index.js +0 -48
  252. package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
  253. package/build/components/sidebar-edit-mode/template-panel/template-areas.js +0 -70
  254. package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +0 -1
  255. package/build/components/sidebar-navigation-screen-pages/index.js +0 -175
  256. package/build/components/sidebar-navigation-screen-pages/index.js.map +0 -1
  257. package/build/hooks/template-part-edit.js +0 -82
  258. package/build/hooks/template-part-edit.js.map +0 -1
  259. package/build/store/utils.js +0 -71
  260. package/build/store/utils.js.map +0 -1
  261. package/build-module/components/actions/index.js +0 -308
  262. package/build-module/components/actions/index.js.map +0 -1
  263. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +0 -40
  264. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
  265. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js +0 -63
  266. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +0 -1
  267. package/build-module/components/sidebar-navigation-screen-pages/index.js +0 -167
  268. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +0 -1
  269. package/build-module/hooks/template-part-edit.js +0 -75
  270. package/build-module/hooks/template-part-edit.js.map +0 -1
  271. package/build-module/store/utils.js +0 -64
  272. package/build-module/store/utils.js.map +0 -1
  273. package/src/components/actions/index.js +0 -409
  274. package/src/components/sidebar-edit-mode/sidebar-card/index.js +0 -53
  275. package/src/components/sidebar-edit-mode/sidebar-card/style.scss +0 -36
  276. package/src/components/sidebar-edit-mode/template-panel/template-areas.js +0 -86
  277. package/src/components/sidebar-navigation-screen-pages/index.js +0 -238
  278. package/src/hooks/template-part-edit.js +0 -89
  279. package/src/store/test/utils.js +0 -191
  280. package/src/store/utils.js +0 -69
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","Disabled","privateApis","componentsPrivateApis","__","sprintf","getCategories","getBlockTypes","getBlockFromExample","createBlock","BlockList","blockEditorPrivateApis","store","blockEditorStore","__unstableEditorStyles","EditorStyles","__unstableIframe","Iframe","useSelect","useResizeObserver","useMemo","useState","memo","useContext","ENTER","SPACE","unlock","EditorCanvasContainer","mergeBaseAndUserConfigs","ExperimentalBlockEditorProvider","useGlobalStyle","GlobalStylesContext","useGlobalStylesOutputWithConfig","CompositeV2","Composite","CompositeItemV2","CompositeItem","useCompositeStoreV2","useCompositeStore","Tabs","STYLE_BOOK_IFRAME_STYLES","isObjectEmpty","object","Object","keys","length","getExamples","headingsExample","name","title","category","blocks","content","level","otherExamples","filter","blockType","example","supports","inserter","map","StyleBook","enableResizing","isSelected","onClick","onSelect","showCloseButton","onClose","showTabs","userConfig","resizeObserver","sizes","textColor","backgroundColor","examples","tabs","some","slug","icon","base","baseConfig","mergedConfig","originalSettings","select","getSettings","settings","__unstableIsPreviewMode","globalStyles","styles","createElement","closeButtonLabel","className","width","style","color","background","TabList","tab","Tab","tabId","key","TabPanel","focusable","StyleBookBody","isFocused","setIsFocused","buttonModeProps","role","onFocus","onBlur","onKeyDown","event","defaultPrevented","keyCode","preventDefault","readonly","buttonModeStyles","tabIndex","Examples","label","compositeStore","orientation","Example","id","focusMode","renderedBlocks","Array","isArray","render","value","renderAppender"],"sources":["@wordpress/edit-site/src/components/style-book/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tDisabled,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tgetCategories,\n\tgetBlockTypes,\n\tgetBlockFromExample,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useResizeObserver } from '@wordpress/compose';\nimport { useMemo, useState, memo, useContext } from '@wordpress/element';\nimport { ENTER, SPACE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport EditorCanvasContainer from '../editor-canvas-container';\nimport { mergeBaseAndUserConfigs } from '../global-styles/global-styles-provider';\n\nconst {\n\tExperimentalBlockEditorProvider,\n\tuseGlobalStyle,\n\tGlobalStylesContext,\n\tuseGlobalStylesOutputWithConfig,\n} = unlock( blockEditorPrivateApis );\n\nconst {\n\tCompositeV2: Composite,\n\tCompositeItemV2: CompositeItem,\n\tuseCompositeStoreV2: useCompositeStore,\n\tTabs,\n} = unlock( componentsPrivateApis );\n\n// The content area of the Style Book is rendered within an iframe so that global styles\n// are applied to elements within the entire content area. To support elements that are\n// not part of the block previews, such as headings and layout for the block previews,\n// additional CSS rules need to be passed into the iframe. These are hard-coded below.\n// Note that button styles are unset, and then focus rules from the `Button` component are\n// applied to the `button` element, targeted via `.edit-site-style-book__example`.\n// This is to ensure that browser default styles for buttons are not applied to the previews.\nconst STYLE_BOOK_IFRAME_STYLES = `\n\t.edit-site-style-book__examples {\n\t\tmax-width: 900px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.edit-site-style-book__example {\n\t\tborder-radius: 2px;\n\t\tcursor: pointer;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 40px;\n\t\tmargin-bottom: 40px;\n\t\tpadding: 16px;\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t\tscroll-margin-top: 32px;\n\t\tscroll-margin-bottom: 32px;\n\t}\n\n\t.edit-site-style-book__example.is-selected {\n\t\tbox-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t}\n\n\t.edit-site-style-book__example:focus:not(:disabled) {\n\t\tbox-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t\toutline: 3px solid transparent;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example {\n\t\tflex-direction: row;\n\t}\n\n\t.edit-site-style-book__example-title {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\tfont-size: 11px;\n\t\tfont-weight: 500;\n\t\tline-height: normal;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\ttext-transform: uppercase;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example-title {\n\t\ttext-align: right;\n\t\twidth: 120px;\n\t}\n\n\t.edit-site-style-book__example-preview {\n\t\twidth: 100%;\n\t}\n\n\t.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,\n\t.edit-site-style-book__example-preview .block-list-appender {\n\t\tdisplay: none;\n\t}\n\n\t.edit-site-style-book__example-preview .is-root-container > .wp-block:first-child {\n\t\tmargin-top: 0;\n\t}\n\t.edit-site-style-book__example-preview .is-root-container > .wp-block:last-child {\n\t\tmargin-bottom: 0;\n\t}\n`;\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\nfunction getExamples() {\n\t// Use our own example for the Heading block so that we can show multiple\n\t// heading levels.\n\tconst headingsExample = {\n\t\tname: 'core/heading',\n\t\ttitle: __( 'Headings' ),\n\t\tcategory: 'text',\n\t\tblocks: [\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 1,\n\t\t\t} ),\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 2,\n\t\t\t} ),\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 3,\n\t\t\t} ),\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 4,\n\t\t\t} ),\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 5,\n\t\t\t} ),\n\t\t],\n\t};\n\n\tconst otherExamples = getBlockTypes()\n\t\t.filter( ( blockType ) => {\n\t\t\tconst { name, example, supports } = blockType;\n\t\t\treturn (\n\t\t\t\tname !== 'core/heading' &&\n\t\t\t\t!! example &&\n\t\t\t\tsupports.inserter !== false\n\t\t\t);\n\t\t} )\n\t\t.map( ( blockType ) => ( {\n\t\t\tname: blockType.name,\n\t\t\ttitle: blockType.title,\n\t\t\tcategory: blockType.category,\n\t\t\tblocks: getBlockFromExample( blockType.name, blockType.example ),\n\t\t} ) );\n\n\treturn [ headingsExample, ...otherExamples ];\n}\n\nfunction StyleBook( {\n\tenableResizing = true,\n\tisSelected,\n\tonClick,\n\tonSelect,\n\tshowCloseButton = true,\n\tonClose,\n\tshowTabs = true,\n\tuserConfig = {},\n} ) {\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst [ textColor ] = useGlobalStyle( 'color.text' );\n\tconst [ backgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst examples = useMemo( getExamples, [] );\n\tconst tabs = useMemo(\n\t\t() =>\n\t\t\tgetCategories()\n\t\t\t\t.filter( ( category ) =>\n\t\t\t\t\texamples.some(\n\t\t\t\t\t\t( example ) => example.category === category.slug\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t.map( ( category ) => ( {\n\t\t\t\t\tname: category.slug,\n\t\t\t\t\ttitle: category.title,\n\t\t\t\t\ticon: category.icon,\n\t\t\t\t} ) ),\n\t\t[ examples ]\n\t);\n\tconst { base: baseConfig } = useContext( GlobalStylesContext );\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\t// Copied from packages/edit-site/src/components/revisions/index.js\n\t// could we create a shared hook?\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\n\tconst settings = useMemo(\n\t\t() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),\n\t\t[ originalSettings ]\n\t);\n\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tsettings.styles =\n\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )\n\t\t\t? globalStyles\n\t\t\t: settings.styles;\n\n\treturn (\n\t\t<EditorCanvasContainer\n\t\t\tonClose={ onClose }\n\t\t\tenableResizing={ enableResizing }\n\t\t\tcloseButtonLabel={\n\t\t\t\tshowCloseButton ? __( 'Close Style Book' ) : null\n\t\t\t}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ classnames( 'edit-site-style-book', {\n\t\t\t\t\t'is-wide': sizes.width > 600,\n\t\t\t\t\t'is-button': !! onClick,\n\t\t\t\t} ) }\n\t\t\t\tstyle={ {\n\t\t\t\t\tcolor: textColor,\n\t\t\t\t\tbackground: backgroundColor,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ resizeObserver }\n\t\t\t\t{ showTabs ? (\n\t\t\t\t\t<div className=\"edit-site-style-book__tabs\">\n\t\t\t\t\t\t<Tabs>\n\t\t\t\t\t\t\t<Tabs.TabList>\n\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\t\t\t\ttabId={ tab.name }\n\t\t\t\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</Tabs.TabList>\n\t\t\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\t\t\ttabId={ tab.name }\n\t\t\t\t\t\t\t\t\tfocusable={ false }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<StyleBookBody\n\t\t\t\t\t\t\t\t\t\tcategory={ tab.name }\n\t\t\t\t\t\t\t\t\t\texamples={ examples }\n\t\t\t\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t\t\t\tsizes={ sizes }\n\t\t\t\t\t\t\t\t\t\ttitle={ tab.title }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</Tabs>\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<StyleBookBody\n\t\t\t\t\t\texamples={ examples }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\tsizes={ sizes }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</EditorCanvasContainer>\n\t);\n}\n\nconst StyleBookBody = ( {\n\tcategory,\n\texamples,\n\tisSelected,\n\tonClick,\n\tonSelect,\n\tsettings,\n\tsizes,\n\ttitle,\n} ) => {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\n\t// The presence of an `onClick` prop indicates that the Style Book is being used as a button.\n\t// In this case, add additional props to the iframe to make it behave like a button.\n\tconst buttonModeProps = {\n\t\trole: 'button',\n\t\tonFocus: () => setIsFocused( true ),\n\t\tonBlur: () => setIsFocused( false ),\n\t\tonKeyDown: ( event ) => {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { keyCode } = event;\n\t\t\tif ( onClick && ( keyCode === ENTER || keyCode === SPACE ) ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonClick( event );\n\t\t\t}\n\t\t},\n\t\tonClick: ( event ) => {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( onClick ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonClick( event );\n\t\t\t}\n\t\t},\n\t\treadonly: true,\n\t};\n\n\tconst buttonModeStyles = onClick\n\t\t? 'body { cursor: pointer; } body * { pointer-events: none; }'\n\t\t: '';\n\n\treturn (\n\t\t<Iframe\n\t\t\tclassName={ classnames( 'edit-site-style-book__iframe', {\n\t\t\t\t'is-focused': isFocused && !! onClick,\n\t\t\t\t'is-button': !! onClick,\n\t\t\t} ) }\n\t\t\tname=\"style-book-canvas\"\n\t\t\ttabIndex={ 0 }\n\t\t\t{ ...( onClick ? buttonModeProps : {} ) }\n\t\t>\n\t\t\t<EditorStyles styles={ settings.styles } />\n\t\t\t<style>\n\t\t\t\t{\n\t\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\t\t`.is-root-container { display: flow-root; }\n\t\t\t\t\t\tbody { position: relative; padding: 32px !important; }` +\n\t\t\t\t\t\tSTYLE_BOOK_IFRAME_STYLES +\n\t\t\t\t\t\tbuttonModeStyles\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<Examples\n\t\t\t\tclassName={ classnames( 'edit-site-style-book__examples', {\n\t\t\t\t\t'is-wide': sizes.width > 600,\n\t\t\t\t} ) }\n\t\t\t\texamples={ examples }\n\t\t\t\tcategory={ category }\n\t\t\t\tlabel={\n\t\t\t\t\ttitle\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Category of blocks, e.g. Text.\n\t\t\t\t\t\t\t\t__( 'Examples of blocks in the %s category' ),\n\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Examples of blocks' )\n\t\t\t\t}\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tonSelect={ onSelect }\n\t\t\t\tkey={ category }\n\t\t\t/>\n\t\t</Iframe>\n\t);\n};\n\nconst Examples = memo(\n\t( { className, examples, category, label, isSelected, onSelect } ) => {\n\t\tconst compositeStore = useCompositeStore( { orientation: 'vertical' } );\n\n\t\treturn (\n\t\t\t<Composite\n\t\t\t\tstore={ compositeStore }\n\t\t\t\tclassName={ className }\n\t\t\t\taria-label={ label }\n\t\t\t\trole=\"grid\"\n\t\t\t>\n\t\t\t\t{ examples\n\t\t\t\t\t.filter( ( example ) =>\n\t\t\t\t\t\tcategory ? example.category === category : true\n\t\t\t\t\t)\n\t\t\t\t\t.map( ( example ) => (\n\t\t\t\t\t\t<Example\n\t\t\t\t\t\t\tkey={ example.name }\n\t\t\t\t\t\t\tid={ `example-${ example.name }` }\n\t\t\t\t\t\t\ttitle={ example.title }\n\t\t\t\t\t\t\tblocks={ example.blocks }\n\t\t\t\t\t\t\tisSelected={ isSelected( example.name ) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonSelect?.( example.name );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t</Composite>\n\t\t);\n\t}\n);\n\nconst Example = ( { id, title, blocks, isSelected, onClick } ) => {\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tfocusMode: false, // Disable \"Spotlight mode\".\n\t\t\t__unstableIsPreviewMode: true,\n\t\t} ),\n\t\t[ originalSettings ]\n\t);\n\n\t// Cache the list of blocks to avoid additional processing when the component is re-rendered.\n\tconst renderedBlocks = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\treturn (\n\t\t<div role=\"row\">\n\t\t\t<div role=\"gridcell\">\n\t\t\t\t<CompositeItem\n\t\t\t\t\tclassName={ classnames( 'edit-site-style-book__example', {\n\t\t\t\t\t\t'is-selected': isSelected,\n\t\t\t\t\t} ) }\n\t\t\t\t\tid={ id }\n\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t// translators: %s: Title of a block, e.g. Heading.\n\t\t\t\t\t\t__( 'Open %s styles in Styles panel' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t\t) }\n\t\t\t\t\trender={ <div /> }\n\t\t\t\t\trole=\"button\"\n\t\t\t\t\tonClick={ onClick }\n\t\t\t\t>\n\t\t\t\t\t<span className=\"edit-site-style-book__example-title\">\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</span>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"edit-site-style-book__example-preview\"\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t>\n\t\t\t\t\t\t<Disabled className=\"edit-site-style-book__example-preview__content\">\n\t\t\t\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\t\t\t\tvalue={ renderedBlocks }\n\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<BlockList renderAppender={ false } />\n\t\t\t\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t\t\t\t</Disabled>\n\t\t\t\t\t</div>\n\t\t\t\t</CompositeItem>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default StyleBook;\n"],"mappings":";AAAA;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,GAClD1C,KACG,CAAC,EACPwC,aAAA;IACCE,SAAS,EAAC,uCAAuC;IACjD;EAAW,GAEXF,aAAA,CAACxF,QAAQ;IAAC0F,SAAS,EAAC;EAAgD,GACnEF,aAAA,CAAC5D,+BAA+B;IAC/BoG,KAAK,EAAGJ,cAAgB;IACxBxC,QAAQ,EAAGA;EAAU,GAErBI,aAAA,CAAC/E,SAAS;IAACwH,cAAc,EAAG;EAAO,CAAE,CACL,CACxB,CACN,CACS,CACX,CACD,CAAC;AAER,CAAC;AAED,eAAerE,SAAS"}
1
+ {"version":3,"names":["classnames","Disabled","privateApis","componentsPrivateApis","__","sprintf","getCategories","getBlockTypes","getBlockFromExample","createBlock","BlockList","blockEditorPrivateApis","store","blockEditorStore","__unstableEditorStyles","EditorStyles","__unstableIframe","Iframe","useSelect","useResizeObserver","useMemo","useState","memo","useContext","ENTER","SPACE","unlock","EditorCanvasContainer","mergeBaseAndUserConfigs","ExperimentalBlockEditorProvider","useGlobalStyle","GlobalStylesContext","useGlobalStylesOutputWithConfig","CompositeV2","Composite","CompositeItemV2","CompositeItem","useCompositeStoreV2","useCompositeStore","Tabs","STYLE_BOOK_IFRAME_STYLES","isObjectEmpty","object","Object","keys","length","getExamples","headingsExample","name","title","category","blocks","content","level","otherExamples","filter","blockType","example","supports","inserter","map","StyleBook","enableResizing","isSelected","onClick","onSelect","showCloseButton","onClose","showTabs","userConfig","resizeObserver","sizes","textColor","backgroundColor","examples","tabs","some","slug","icon","base","baseConfig","mergedConfig","originalSettings","select","getSettings","settings","__unstableIsPreviewMode","globalStyles","styles","createElement","closeButtonLabel","className","width","style","color","background","TabList","tab","Tab","tabId","key","TabPanel","focusable","StyleBookBody","isFocused","setIsFocused","buttonModeProps","role","onFocus","onBlur","onKeyDown","event","defaultPrevented","keyCode","preventDefault","readonly","buttonModeStyles","tabIndex","Examples","label","compositeStore","orientation","Example","id","focusMode","renderedBlocks","Array","isArray","render","value","renderAppender"],"sources":["@wordpress/edit-site/src/components/style-book/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tDisabled,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tgetCategories,\n\tgetBlockTypes,\n\tgetBlockFromExample,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useResizeObserver } from '@wordpress/compose';\nimport { useMemo, useState, memo, useContext } from '@wordpress/element';\nimport { ENTER, SPACE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport EditorCanvasContainer from '../editor-canvas-container';\nimport { mergeBaseAndUserConfigs } from '../global-styles/global-styles-provider';\n\nconst {\n\tExperimentalBlockEditorProvider,\n\tuseGlobalStyle,\n\tGlobalStylesContext,\n\tuseGlobalStylesOutputWithConfig,\n} = unlock( blockEditorPrivateApis );\n\nconst {\n\tCompositeV2: Composite,\n\tCompositeItemV2: CompositeItem,\n\tuseCompositeStoreV2: useCompositeStore,\n\tTabs,\n} = unlock( componentsPrivateApis );\n\n// The content area of the Style Book is rendered within an iframe so that global styles\n// are applied to elements within the entire content area. To support elements that are\n// not part of the block previews, such as headings and layout for the block previews,\n// additional CSS rules need to be passed into the iframe. These are hard-coded below.\n// Note that button styles are unset, and then focus rules from the `Button` component are\n// applied to the `button` element, targeted via `.edit-site-style-book__example`.\n// This is to ensure that browser default styles for buttons are not applied to the previews.\nconst STYLE_BOOK_IFRAME_STYLES = `\n\t.edit-site-style-book__examples {\n\t\tmax-width: 900px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.edit-site-style-book__example {\n\t\tborder-radius: 2px;\n\t\tcursor: pointer;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 40px;\n\t\tmargin-bottom: 40px;\n\t\tpadding: 16px;\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t\tscroll-margin-top: 32px;\n\t\tscroll-margin-bottom: 32px;\n\t}\n\n\t.edit-site-style-book__example.is-selected {\n\t\tbox-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t}\n\n\t.edit-site-style-book__example:focus:not(:disabled) {\n\t\tbox-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t\toutline: 3px solid transparent;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example {\n\t\tflex-direction: row;\n\t}\n\n\t.edit-site-style-book__example-title {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\tfont-size: 11px;\n\t\tfont-weight: 500;\n\t\tline-height: normal;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\ttext-transform: uppercase;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example-title {\n\t\ttext-align: right;\n\t\twidth: 120px;\n\t}\n\n\t.edit-site-style-book__example-preview {\n\t\twidth: 100%;\n\t}\n\n\t.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,\n\t.edit-site-style-book__example-preview .block-list-appender {\n\t\tdisplay: none;\n\t}\n\n\t.edit-site-style-book__example-preview .is-root-container > .wp-block:first-child {\n\t\tmargin-top: 0;\n\t}\n\t.edit-site-style-book__example-preview .is-root-container > .wp-block:last-child {\n\t\tmargin-bottom: 0;\n\t}\n`;\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\nfunction getExamples() {\n\t// Use our own example for the Heading block so that we can show multiple\n\t// heading levels.\n\tconst headingsExample = {\n\t\tname: 'core/heading',\n\t\ttitle: __( 'Headings' ),\n\t\tcategory: 'text',\n\t\tblocks: [\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 1,\n\t\t\t} ),\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 2,\n\t\t\t} ),\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 3,\n\t\t\t} ),\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 4,\n\t\t\t} ),\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 5,\n\t\t\t} ),\n\t\t],\n\t};\n\n\tconst otherExamples = getBlockTypes()\n\t\t.filter( ( blockType ) => {\n\t\t\tconst { name, example, supports } = blockType;\n\t\t\treturn (\n\t\t\t\tname !== 'core/heading' &&\n\t\t\t\t!! example &&\n\t\t\t\tsupports.inserter !== false\n\t\t\t);\n\t\t} )\n\t\t.map( ( blockType ) => ( {\n\t\t\tname: blockType.name,\n\t\t\ttitle: blockType.title,\n\t\t\tcategory: blockType.category,\n\t\t\tblocks: getBlockFromExample( blockType.name, blockType.example ),\n\t\t} ) );\n\n\treturn [ headingsExample, ...otherExamples ];\n}\n\nfunction StyleBook( {\n\tenableResizing = true,\n\tisSelected,\n\tonClick,\n\tonSelect,\n\tshowCloseButton = true,\n\tonClose,\n\tshowTabs = true,\n\tuserConfig = {},\n} ) {\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst [ textColor ] = useGlobalStyle( 'color.text' );\n\tconst [ backgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst examples = useMemo( getExamples, [] );\n\tconst tabs = useMemo(\n\t\t() =>\n\t\t\tgetCategories()\n\t\t\t\t.filter( ( category ) =>\n\t\t\t\t\texamples.some(\n\t\t\t\t\t\t( example ) => example.category === category.slug\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t.map( ( category ) => ( {\n\t\t\t\t\tname: category.slug,\n\t\t\t\t\ttitle: category.title,\n\t\t\t\t\ticon: category.icon,\n\t\t\t\t} ) ),\n\t\t[ examples ]\n\t);\n\tconst { base: baseConfig } = useContext( GlobalStylesContext );\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\t// Copied from packages/edit-site/src/components/revisions/index.js\n\t// could we create a shared hook?\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\n\tconst settings = useMemo(\n\t\t() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),\n\t\t[ originalSettings ]\n\t);\n\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tsettings.styles =\n\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )\n\t\t\t? globalStyles\n\t\t\t: settings.styles;\n\n\treturn (\n\t\t<EditorCanvasContainer\n\t\t\tonClose={ onClose }\n\t\t\tenableResizing={ enableResizing }\n\t\t\tcloseButtonLabel={ showCloseButton ? __( 'Close' ) : null }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ classnames( 'edit-site-style-book', {\n\t\t\t\t\t'is-wide': sizes.width > 600,\n\t\t\t\t\t'is-button': !! onClick,\n\t\t\t\t} ) }\n\t\t\t\tstyle={ {\n\t\t\t\t\tcolor: textColor,\n\t\t\t\t\tbackground: backgroundColor,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ resizeObserver }\n\t\t\t\t{ showTabs ? (\n\t\t\t\t\t<div className=\"edit-site-style-book__tabs\">\n\t\t\t\t\t\t<Tabs>\n\t\t\t\t\t\t\t<Tabs.TabList>\n\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\t\t\t\ttabId={ tab.name }\n\t\t\t\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</Tabs.TabList>\n\t\t\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\t\t\ttabId={ tab.name }\n\t\t\t\t\t\t\t\t\tfocusable={ false }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<StyleBookBody\n\t\t\t\t\t\t\t\t\t\tcategory={ tab.name }\n\t\t\t\t\t\t\t\t\t\texamples={ examples }\n\t\t\t\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t\t\t\tsizes={ sizes }\n\t\t\t\t\t\t\t\t\t\ttitle={ tab.title }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</Tabs>\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<StyleBookBody\n\t\t\t\t\t\texamples={ examples }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\tsizes={ sizes }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</EditorCanvasContainer>\n\t);\n}\n\nconst StyleBookBody = ( {\n\tcategory,\n\texamples,\n\tisSelected,\n\tonClick,\n\tonSelect,\n\tsettings,\n\tsizes,\n\ttitle,\n} ) => {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\n\t// The presence of an `onClick` prop indicates that the Style Book is being used as a button.\n\t// In this case, add additional props to the iframe to make it behave like a button.\n\tconst buttonModeProps = {\n\t\trole: 'button',\n\t\tonFocus: () => setIsFocused( true ),\n\t\tonBlur: () => setIsFocused( false ),\n\t\tonKeyDown: ( event ) => {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { keyCode } = event;\n\t\t\tif ( onClick && ( keyCode === ENTER || keyCode === SPACE ) ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonClick( event );\n\t\t\t}\n\t\t},\n\t\tonClick: ( event ) => {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( onClick ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonClick( event );\n\t\t\t}\n\t\t},\n\t\treadonly: true,\n\t};\n\n\tconst buttonModeStyles = onClick\n\t\t? 'body { cursor: pointer; } body * { pointer-events: none; }'\n\t\t: '';\n\n\treturn (\n\t\t<Iframe\n\t\t\tclassName={ classnames( 'edit-site-style-book__iframe', {\n\t\t\t\t'is-focused': isFocused && !! onClick,\n\t\t\t\t'is-button': !! onClick,\n\t\t\t} ) }\n\t\t\tname=\"style-book-canvas\"\n\t\t\ttabIndex={ 0 }\n\t\t\t{ ...( onClick ? buttonModeProps : {} ) }\n\t\t>\n\t\t\t<EditorStyles styles={ settings.styles } />\n\t\t\t<style>\n\t\t\t\t{\n\t\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\t\t`.is-root-container { display: flow-root; }\n\t\t\t\t\t\tbody { position: relative; padding: 32px !important; }` +\n\t\t\t\t\t\tSTYLE_BOOK_IFRAME_STYLES +\n\t\t\t\t\t\tbuttonModeStyles\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<Examples\n\t\t\t\tclassName={ classnames( 'edit-site-style-book__examples', {\n\t\t\t\t\t'is-wide': sizes.width > 600,\n\t\t\t\t} ) }\n\t\t\t\texamples={ examples }\n\t\t\t\tcategory={ category }\n\t\t\t\tlabel={\n\t\t\t\t\ttitle\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Category of blocks, e.g. Text.\n\t\t\t\t\t\t\t\t__( 'Examples of blocks in the %s category' ),\n\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Examples of blocks' )\n\t\t\t\t}\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tonSelect={ onSelect }\n\t\t\t\tkey={ category }\n\t\t\t/>\n\t\t</Iframe>\n\t);\n};\n\nconst Examples = memo(\n\t( { className, examples, category, label, isSelected, onSelect } ) => {\n\t\tconst compositeStore = useCompositeStore( { orientation: 'vertical' } );\n\n\t\treturn (\n\t\t\t<Composite\n\t\t\t\tstore={ compositeStore }\n\t\t\t\tclassName={ className }\n\t\t\t\taria-label={ label }\n\t\t\t\trole=\"grid\"\n\t\t\t>\n\t\t\t\t{ examples\n\t\t\t\t\t.filter( ( example ) =>\n\t\t\t\t\t\tcategory ? example.category === category : true\n\t\t\t\t\t)\n\t\t\t\t\t.map( ( example ) => (\n\t\t\t\t\t\t<Example\n\t\t\t\t\t\t\tkey={ example.name }\n\t\t\t\t\t\t\tid={ `example-${ example.name }` }\n\t\t\t\t\t\t\ttitle={ example.title }\n\t\t\t\t\t\t\tblocks={ example.blocks }\n\t\t\t\t\t\t\tisSelected={ isSelected( example.name ) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonSelect?.( example.name );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t</Composite>\n\t\t);\n\t}\n);\n\nconst Example = ( { id, title, blocks, isSelected, onClick } ) => {\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tfocusMode: false, // Disable \"Spotlight mode\".\n\t\t\t__unstableIsPreviewMode: true,\n\t\t} ),\n\t\t[ originalSettings ]\n\t);\n\n\t// Cache the list of blocks to avoid additional processing when the component is re-rendered.\n\tconst renderedBlocks = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\treturn (\n\t\t<div role=\"row\">\n\t\t\t<div role=\"gridcell\">\n\t\t\t\t<CompositeItem\n\t\t\t\t\tclassName={ classnames( 'edit-site-style-book__example', {\n\t\t\t\t\t\t'is-selected': isSelected,\n\t\t\t\t\t} ) }\n\t\t\t\t\tid={ id }\n\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t// translators: %s: Title of a block, e.g. Heading.\n\t\t\t\t\t\t__( 'Open %s styles in Styles panel' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t\t) }\n\t\t\t\t\trender={ <div /> }\n\t\t\t\t\trole=\"button\"\n\t\t\t\t\tonClick={ onClick }\n\t\t\t\t>\n\t\t\t\t\t<span className=\"edit-site-style-book__example-title\">\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</span>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"edit-site-style-book__example-preview\"\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t>\n\t\t\t\t\t\t<Disabled className=\"edit-site-style-book__example-preview__content\">\n\t\t\t\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\t\t\t\tvalue={ renderedBlocks }\n\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<BlockList renderAppender={ false } />\n\t\t\t\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t\t\t\t</Disabled>\n\t\t\t\t\t</div>\n\t\t\t\t</CompositeItem>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default StyleBook;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,QAAQ,EACRC,WAAW,IAAIC,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,aAAa,EACbC,aAAa,EACbC,mBAAmB,EACnBC,WAAW,QACL,mBAAmB;AAC1B,SACCC,SAAS,EACTR,WAAW,IAAIS,sBAAsB,EACrCC,KAAK,IAAIC,gBAAgB,EACzBC,sBAAsB,IAAIC,YAAY,EACtCC,gBAAgB,IAAIC,MAAM,QACpB,yBAAyB;AAChC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,OAAO,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,UAAU,QAAQ,oBAAoB;AACxE,SAASC,KAAK,EAAEC,KAAK,QAAQ,qBAAqB;;AAElD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,SAASC,uBAAuB,QAAQ,yCAAyC;AAEjF,MAAM;EACLC,+BAA+B;EAC/BC,cAAc;EACdC,mBAAmB;EACnBC;AACD,CAAC,GAAGN,MAAM,CAAEf,sBAAuB,CAAC;AAEpC,MAAM;EACLsB,WAAW,EAAEC,SAAS;EACtBC,eAAe,EAAEC,aAAa;EAC9BC,mBAAmB,EAAEC,iBAAiB;EACtCC;AACD,CAAC,GAAGb,MAAM,CAAEvB,qBAAsB,CAAC;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMqC,wBAAwB,G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T,cAAatH,OAAO;IACnB;IACAD,EAAE,CAAE,gCAAiC,CAAC,EACtC6C,KACD,CAAG;IACH+E,MAAM,EAAGvC,aAAA,YAAM,CAAG;IAClBkB,IAAI,EAAC,QAAQ;IACb3C,OAAO,EAAGA;EAAS,GAEnByB,aAAA;IAAME,SAAS,EAAC;EAAqC,GAClD1C,KACG,CAAC,EACPwC,aAAA;IACCE,SAAS,EAAC,uCAAuC;IACjD;EAAW,GAEXF,aAAA,CAACxF,QAAQ;IAAC0F,SAAS,EAAC;EAAgD,GACnEF,aAAA,CAAC5D,+BAA+B;IAC/BoG,KAAK,EAAGJ,cAAgB;IACxBxC,QAAQ,EAAGA;EAAU,GAErBI,aAAA,CAAC/E,SAAS;IAACwH,cAAc,EAAG;EAAO,CAAE,CACL,CACxB,CACN,CACS,CACX,CACD,CAAC;AAER,CAAC;AAED,eAAerE,SAAS"}
@@ -121,7 +121,7 @@ function useResolveEditedEntityAndContext({
121
121
  }
122
122
 
123
123
  // Some URLs in list views are different
124
- if (path === '/pages' && postId) {
124
+ if (path === '/page' && postId) {
125
125
  return resolveTemplateForPostTypeAndId('page', postId);
126
126
  }
127
127
 
@@ -148,7 +148,7 @@ function useResolveEditedEntityAndContext({
148
148
  }
149
149
 
150
150
  // Some URLs in list views are different
151
- if (path === '/pages' && postId) {
151
+ if (path === '/page' && postId) {
152
152
  return {
153
153
  postType: 'page',
154
154
  postId
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useMemo","useSelect","useDispatch","store","coreDataStore","privateApis","routerPrivateApis","editSiteStore","unlock","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","PATTERN_TYPES","useLocation","postTypesWithoutParentTemplate","user","useResolveEditedEntityAndContext","path","postId","postType","hasLoadedAllDependencies","homepageId","url","frontPageTemplateId","select","getSite","getUnstableBase","getEntityRecords","siteData","base","templates","per_page","_frontPateTemplateId","frontPageTemplate","find","t","slug","id","show_on_front","includes","page_on_front","toString","home","resolvedTemplateId","undefined","getEditedEntityRecord","getDefaultTemplateId","__experimentalGetTemplateForLink","resolveTemplateForPostTypeAndId","postTypeToResolve","postIdToResolve","editedEntity","currentTemplateSlug","template","currentTemplate","slugToCheck","context","isReady","useInitEditedEntityFromURL","params","setEditedEntity"],"sources":["@wordpress/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst postTypesWithoutParentTemplate = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n];\n\nfunction useResolveEditedEntityAndContext( { path, postId, postType } ) {\n\tconst { hasLoadedAllDependencies, homepageId, url, frontPageTemplateId } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getSite, getUnstableBase, getEntityRecords } =\n\t\t\t\tselect( coreDataStore );\n\t\t\tconst siteData = getSite();\n\t\t\tconst base = getUnstableBase();\n\t\t\tconst templates = getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_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\tlet _frontPateTemplateId;\n\t\t\tif ( templates ) {\n\t\t\t\tconst frontPageTemplate = templates.find(\n\t\t\t\t\t( t ) => t.slug === 'front-page'\n\t\t\t\t);\n\t\t\t\t_frontPateTemplateId = frontPageTemplate\n\t\t\t\t\t? frontPageTemplate.id\n\t\t\t\t\t: false;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\thasLoadedAllDependencies: !! base && !! siteData,\n\t\t\t\thomepageId:\n\t\t\t\t\tsiteData?.show_on_front === 'page' &&\n\t\t\t\t\t[ 'number', 'string' ].includes(\n\t\t\t\t\t\ttypeof siteData.page_on_front\n\t\t\t\t\t)\n\t\t\t\t\t\t? siteData.page_on_front.toString()\n\t\t\t\t\t\t: null,\n\t\t\t\turl: base?.home,\n\t\t\t\tfrontPageTemplateId: _frontPateTemplateId,\n\t\t\t};\n\t\t}, [] );\n\n\t/**\n\t * This is a hook that recreates the logic to resolve a template for a given WordPress postID postTypeId\n\t * in order to match the frontend as closely as possible in the site editor.\n\t *\n\t * It is not possible to rely on the server logic because there maybe unsaved changes that impact the template resolution.\n\t */\n\tconst resolvedTemplateId = useSelect(\n\t\t( select ) => {\n\t\t\t// If we're rendering a post type that doesn't have a template\n\t\t\t// no need to resolve its template.\n\t\t\tif ( postTypesWithoutParentTemplate.includes( postType ) ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetEditedEntityRecord,\n\t\t\t\tgetEntityRecords,\n\t\t\t\tgetDefaultTemplateId,\n\t\t\t\t__experimentalGetTemplateForLink,\n\t\t\t} = select( coreDataStore );\n\n\t\t\tfunction resolveTemplateForPostTypeAndId(\n\t\t\t\tpostTypeToResolve,\n\t\t\t\tpostIdToResolve\n\t\t\t) {\n\t\t\t\t// For the front page, we always use the front page template if existing.\n\t\t\t\tif (\n\t\t\t\t\tpostTypeToResolve === 'page' &&\n\t\t\t\t\thomepageId === postIdToResolve\n\t\t\t\t) {\n\t\t\t\t\t// We're still checking whether the front page template exists.\n\t\t\t\t\t// Don't resolve the template yet.\n\t\t\t\t\tif ( frontPageTemplateId === undefined ) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !! frontPageTemplateId ) {\n\t\t\t\t\t\treturn frontPageTemplateId;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst editedEntity = getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostTypeToResolve,\n\t\t\t\t\tpostIdToResolve\n\t\t\t\t);\n\t\t\t\tif ( ! editedEntity ) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\t// First see if the post/page has an assigned template and fetch it.\n\t\t\t\tconst currentTemplateSlug = editedEntity.template;\n\t\t\t\tif ( currentTemplateSlug ) {\n\t\t\t\t\tconst currentTemplate = getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tper_page: -1,\n\t\t\t\t\t\t}\n\t\t\t\t\t)?.find( ( { slug } ) => slug === currentTemplateSlug );\n\t\t\t\t\tif ( currentTemplate ) {\n\t\t\t\t\t\treturn currentTemplate.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If no template is assigned, use the default template.\n\t\t\t\tlet slugToCheck;\n\t\t\t\t// In `draft` status we might not have a slug available, so we use the `single`\n\t\t\t\t// post type templates slug(ex page, single-post, single-product etc..).\n\t\t\t\t// Pages do not need the `single` prefix in the slug to be prioritized\n\t\t\t\t// through template hierarchy.\n\t\t\t\tif ( editedEntity.slug ) {\n\t\t\t\t\tslugToCheck =\n\t\t\t\t\t\tpostTypeToResolve === 'page'\n\t\t\t\t\t\t\t? `${ postTypeToResolve }-${ editedEntity.slug }`\n\t\t\t\t\t\t\t: `single-${ postTypeToResolve }-${ editedEntity.slug }`;\n\t\t\t\t} else {\n\t\t\t\t\tslugToCheck =\n\t\t\t\t\t\tpostTypeToResolve === 'page'\n\t\t\t\t\t\t\t? 'page'\n\t\t\t\t\t\t\t: `single-${ postTypeToResolve }`;\n\t\t\t\t}\n\t\t\t\treturn getDefaultTemplateId( {\n\t\t\t\t\tslug: slugToCheck,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tif ( ! hasLoadedAllDependencies ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// If we're rendering a specific page, post... we need to resolve its template.\n\t\t\tif ( postType && postId ) {\n\t\t\t\treturn resolveTemplateForPostTypeAndId( postType, postId );\n\t\t\t}\n\n\t\t\t// Some URLs in list views are different\n\t\t\tif ( path === '/pages' && postId ) {\n\t\t\t\treturn resolveTemplateForPostTypeAndId( 'page', postId );\n\t\t\t}\n\n\t\t\t// If we're rendering the home page, and we have a static home page, resolve its template.\n\t\t\tif ( homepageId ) {\n\t\t\t\treturn resolveTemplateForPostTypeAndId( 'page', homepageId );\n\t\t\t}\n\n\t\t\t// If we're not rendering a specific page, use the front page template.\n\t\t\tif ( url ) {\n\t\t\t\tconst template = __experimentalGetTemplateForLink( url );\n\t\t\t\treturn template?.id;\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\thomepageId,\n\t\t\thasLoadedAllDependencies,\n\t\t\turl,\n\t\t\tpostId,\n\t\t\tpostType,\n\t\t\tpath,\n\t\t\tfrontPageTemplateId,\n\t\t]\n\t);\n\n\tconst context = useMemo( () => {\n\t\tif ( postTypesWithoutParentTemplate.includes( postType ) ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif ( postType && postId ) {\n\t\t\treturn { postType, postId };\n\t\t}\n\n\t\t// Some URLs in list views are different\n\t\tif ( path === '/pages' && postId ) {\n\t\t\treturn { postType: 'page', postId };\n\t\t}\n\n\t\tif ( homepageId ) {\n\t\t\treturn { postType: 'page', postId: homepageId };\n\t\t}\n\n\t\treturn {};\n\t}, [ homepageId, postType, postId, path ] );\n\n\tif ( path === '/wp_template' && postId ) {\n\t\treturn { isReady: true, postType: 'wp_template', postId, context };\n\t}\n\n\tif ( path === '/wp_template_part/all' && postId ) {\n\t\treturn { isReady: true, postType: 'wp_template_part', postId, context };\n\t}\n\n\tif ( postTypesWithoutParentTemplate.includes( postType ) ) {\n\t\treturn { isReady: true, postType, postId, context };\n\t}\n\n\tif ( hasLoadedAllDependencies ) {\n\t\treturn {\n\t\t\tisReady: resolvedTemplateId !== undefined,\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tpostId: resolvedTemplateId,\n\t\t\tcontext,\n\t\t};\n\t}\n\n\treturn { isReady: false };\n}\n\nexport default function useInitEditedEntityFromURL() {\n\tconst { params = {} } = useLocation();\n\tconst { postType, postId, context, isReady } =\n\t\tuseResolveEditedEntityAndContext( params );\n\n\tconst { setEditedEntity } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif ( isReady ) {\n\t\t\tsetEditedEntity( postType, postId, context );\n\t\t}\n\t}, [ isReady, postType, postId, context, setEditedEntity ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,OAAO,QAAQ,oBAAoB;AACvD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,aAAa,QAAQ,sBAAsB;AAC7D,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASH,KAAK,IAAII,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SACCC,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,EACpBC,aAAa,QACP,uBAAuB;AAE9B,MAAM;EAAEC;AAAY,CAAC,GAAGL,MAAM,CAAEF,iBAAkB,CAAC;AAEnD,MAAMQ,8BAA8B,GAAG,CACtCL,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,EACpBC,aAAa,CAACG,IAAI,CAClB;AAED,SAASC,gCAAgCA,CAAE;EAAEC,IAAI;EAAEC,MAAM;EAAEC;AAAS,CAAC,EAAG;EACvE,MAAM;IAAEC,wBAAwB;IAAEC,UAAU;IAAEC,GAAG;IAAEC;EAAoB,CAAC,GACvEtB,SAAS,CAAIuB,MAAM,IAAM;IACxB,MAAM;M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,CAAC;EACnE;EAEA,IAAKvC,IAAI,KAAK,uBAAuB,IAAIC,MAAM,EAAG;IACjD,OAAO;MAAEuC,OAAO,EAAE,IAAI;MAAEtC,QAAQ,EAAE,kBAAkB;MAAED,MAAM;MAAEsC;IAAQ,CAAC;EACxE;EAEA,IAAK1C,8BAA8B,CAACyB,QAAQ,CAAEpB,QAAS,CAAC,EAAG;IAC1D,OAAO;MAAEsC,OAAO,EAAE,IAAI;MAAEtC,QAAQ;MAAED,MAAM;MAAEsC;IAAQ,CAAC;EACpD;EAEA,IAAKpC,wBAAwB,EAAG;IAC/B,OAAO;MACNqC,OAAO,EAAEd,kBAAkB,KAAKC,SAAS;MACzCzB,QAAQ,EAAEV,kBAAkB;MAC5BS,MAAM,EAAEyB,kBAAkB;MAC1Ba;IACD,CAAC;EACF;EAEA,OAAO;IAAEC,OAAO,EAAE;EAAM,CAAC;AAC1B;AAEA,eAAe,SAASC,0BAA0BA,CAAA,EAAG;EACpD,MAAM;IAAEC,MAAM,GAAG,CAAC;EAAE,CAAC,GAAG9C,WAAW,CAAC,CAAC;EACrC,MAAM;IAAEM,QAAQ;IAAED,MAAM;IAAEsC,OAAO;IAAEC;EAAQ,CAAC,GAC3CzC,gCAAgC,CAAE2C,MAAO,CAAC;EAE3C,MAAM;IAAEC;EAAgB,CAAC,GAAG1D,WAAW,CAAEK,aAAc,CAAC;EAExDR,SAAS,CAAE,MAAM;IAChB,IAAK0D,OAAO,EAAG;MACdG,eAAe,CAAEzC,QAAQ,EAAED,MAAM,EAAEsC,OAAQ,CAAC;IAC7C;EACD,CAAC,EAAE,CAAEC,OAAO,EAAEtC,QAAQ,EAAED,MAAM,EAAEsC,OAAO,EAAEI,eAAe,CAAG,CAAC;AAC7D"}
1
+ {"version":3,"names":["useEffect","useMemo","useSelect","useDispatch","store","coreDataStore","privateApis","routerPrivateApis","editSiteStore","unlock","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","PATTERN_TYPES","useLocation","postTypesWithoutParentTemplate","user","useResolveEditedEntityAndContext","path","postId","postType","hasLoadedAllDependencies","homepageId","url","frontPageTemplateId","select","getSite","getUnstableBase","getEntityRecords","siteData","base","templates","per_page","_frontPateTemplateId","frontPageTemplate","find","t","slug","id","show_on_front","includes","page_on_front","toString","home","resolvedTemplateId","undefined","getEditedEntityRecord","getDefaultTemplateId","__experimentalGetTemplateForLink","resolveTemplateForPostTypeAndId","postTypeToResolve","postIdToResolve","editedEntity","currentTemplateSlug","template","currentTemplate","slugToCheck","context","isReady","useInitEditedEntityFromURL","params","setEditedEntity"],"sources":["@wordpress/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst postTypesWithoutParentTemplate = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n];\n\nfunction useResolveEditedEntityAndContext( { path, postId, postType } ) {\n\tconst { hasLoadedAllDependencies, homepageId, url, frontPageTemplateId } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getSite, getUnstableBase, getEntityRecords } =\n\t\t\t\tselect( coreDataStore );\n\t\t\tconst siteData = getSite();\n\t\t\tconst base = getUnstableBase();\n\t\t\tconst templates = getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_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\tlet _frontPateTemplateId;\n\t\t\tif ( templates ) {\n\t\t\t\tconst frontPageTemplate = templates.find(\n\t\t\t\t\t( t ) => t.slug === 'front-page'\n\t\t\t\t);\n\t\t\t\t_frontPateTemplateId = frontPageTemplate\n\t\t\t\t\t? frontPageTemplate.id\n\t\t\t\t\t: false;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\thasLoadedAllDependencies: !! base && !! siteData,\n\t\t\t\thomepageId:\n\t\t\t\t\tsiteData?.show_on_front === 'page' &&\n\t\t\t\t\t[ 'number', 'string' ].includes(\n\t\t\t\t\t\ttypeof siteData.page_on_front\n\t\t\t\t\t)\n\t\t\t\t\t\t? siteData.page_on_front.toString()\n\t\t\t\t\t\t: null,\n\t\t\t\turl: base?.home,\n\t\t\t\tfrontPageTemplateId: _frontPateTemplateId,\n\t\t\t};\n\t\t}, [] );\n\n\t/**\n\t * This is a hook that recreates the logic to resolve a template for a given WordPress postID postTypeId\n\t * in order to match the frontend as closely as possible in the site editor.\n\t *\n\t * It is not possible to rely on the server logic because there maybe unsaved changes that impact the template resolution.\n\t */\n\tconst resolvedTemplateId = useSelect(\n\t\t( select ) => {\n\t\t\t// If we're rendering a post type that doesn't have a template\n\t\t\t// no need to resolve its template.\n\t\t\tif ( postTypesWithoutParentTemplate.includes( postType ) ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetEditedEntityRecord,\n\t\t\t\tgetEntityRecords,\n\t\t\t\tgetDefaultTemplateId,\n\t\t\t\t__experimentalGetTemplateForLink,\n\t\t\t} = select( coreDataStore );\n\n\t\t\tfunction resolveTemplateForPostTypeAndId(\n\t\t\t\tpostTypeToResolve,\n\t\t\t\tpostIdToResolve\n\t\t\t) {\n\t\t\t\t// For the front page, we always use the front page template if existing.\n\t\t\t\tif (\n\t\t\t\t\tpostTypeToResolve === 'page' &&\n\t\t\t\t\thomepageId === postIdToResolve\n\t\t\t\t) {\n\t\t\t\t\t// We're still checking whether the front page template exists.\n\t\t\t\t\t// Don't resolve the template yet.\n\t\t\t\t\tif ( frontPageTemplateId === undefined ) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !! frontPageTemplateId ) {\n\t\t\t\t\t\treturn frontPageTemplateId;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst editedEntity = getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostTypeToResolve,\n\t\t\t\t\tpostIdToResolve\n\t\t\t\t);\n\t\t\t\tif ( ! editedEntity ) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\t// First see if the post/page has an assigned template and fetch it.\n\t\t\t\tconst currentTemplateSlug = editedEntity.template;\n\t\t\t\tif ( currentTemplateSlug ) {\n\t\t\t\t\tconst currentTemplate = getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tper_page: -1,\n\t\t\t\t\t\t}\n\t\t\t\t\t)?.find( ( { slug } ) => slug === currentTemplateSlug );\n\t\t\t\t\tif ( currentTemplate ) {\n\t\t\t\t\t\treturn currentTemplate.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If no template is assigned, use the default template.\n\t\t\t\tlet slugToCheck;\n\t\t\t\t// In `draft` status we might not have a slug available, so we use the `single`\n\t\t\t\t// post type templates slug(ex page, single-post, single-product etc..).\n\t\t\t\t// Pages do not need the `single` prefix in the slug to be prioritized\n\t\t\t\t// through template hierarchy.\n\t\t\t\tif ( editedEntity.slug ) {\n\t\t\t\t\tslugToCheck =\n\t\t\t\t\t\tpostTypeToResolve === 'page'\n\t\t\t\t\t\t\t? `${ postTypeToResolve }-${ editedEntity.slug }`\n\t\t\t\t\t\t\t: `single-${ postTypeToResolve }-${ editedEntity.slug }`;\n\t\t\t\t} else {\n\t\t\t\t\tslugToCheck =\n\t\t\t\t\t\tpostTypeToResolve === 'page'\n\t\t\t\t\t\t\t? 'page'\n\t\t\t\t\t\t\t: `single-${ postTypeToResolve }`;\n\t\t\t\t}\n\t\t\t\treturn getDefaultTemplateId( {\n\t\t\t\t\tslug: slugToCheck,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tif ( ! hasLoadedAllDependencies ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// If we're rendering a specific page, post... we need to resolve its template.\n\t\t\tif ( postType && postId ) {\n\t\t\t\treturn resolveTemplateForPostTypeAndId( postType, postId );\n\t\t\t}\n\n\t\t\t// Some URLs in list views are different\n\t\t\tif ( path === '/page' && postId ) {\n\t\t\t\treturn resolveTemplateForPostTypeAndId( 'page', postId );\n\t\t\t}\n\n\t\t\t// If we're rendering the home page, and we have a static home page, resolve its template.\n\t\t\tif ( homepageId ) {\n\t\t\t\treturn resolveTemplateForPostTypeAndId( 'page', homepageId );\n\t\t\t}\n\n\t\t\t// If we're not rendering a specific page, use the front page template.\n\t\t\tif ( url ) {\n\t\t\t\tconst template = __experimentalGetTemplateForLink( url );\n\t\t\t\treturn template?.id;\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\thomepageId,\n\t\t\thasLoadedAllDependencies,\n\t\t\turl,\n\t\t\tpostId,\n\t\t\tpostType,\n\t\t\tpath,\n\t\t\tfrontPageTemplateId,\n\t\t]\n\t);\n\n\tconst context = useMemo( () => {\n\t\tif ( postTypesWithoutParentTemplate.includes( postType ) ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif ( postType && postId ) {\n\t\t\treturn { postType, postId };\n\t\t}\n\n\t\t// Some URLs in list views are different\n\t\tif ( path === '/page' && postId ) {\n\t\t\treturn { postType: 'page', postId };\n\t\t}\n\n\t\tif ( homepageId ) {\n\t\t\treturn { postType: 'page', postId: homepageId };\n\t\t}\n\n\t\treturn {};\n\t}, [ homepageId, postType, postId, path ] );\n\n\tif ( path === '/wp_template' && postId ) {\n\t\treturn { isReady: true, postType: 'wp_template', postId, context };\n\t}\n\n\tif ( path === '/wp_template_part/all' && postId ) {\n\t\treturn { isReady: true, postType: 'wp_template_part', postId, context };\n\t}\n\n\tif ( postTypesWithoutParentTemplate.includes( postType ) ) {\n\t\treturn { isReady: true, postType, postId, context };\n\t}\n\n\tif ( hasLoadedAllDependencies ) {\n\t\treturn {\n\t\t\tisReady: resolvedTemplateId !== undefined,\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tpostId: resolvedTemplateId,\n\t\t\tcontext,\n\t\t};\n\t}\n\n\treturn { isReady: false };\n}\n\nexport default function useInitEditedEntityFromURL() {\n\tconst { params = {} } = useLocation();\n\tconst { postType, postId, context, isReady } =\n\t\tuseResolveEditedEntityAndContext( params );\n\n\tconst { setEditedEntity } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif ( isReady ) {\n\t\t\tsetEditedEntity( postType, postId, context );\n\t\t}\n\t}, [ isReady, postType, postId, context, setEditedEntity ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,OAAO,QAAQ,oBAAoB;AACvD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,aAAa,QAAQ,sBAAsB;AAC7D,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASH,KAAK,IAAII,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SACCC,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,EACpBC,aAAa,QACP,uBAAuB;AAE9B,MAAM;EAAEC;AAAY,CAAC,GAAGL,MAAM,CAAEF,iBAAkB,CAAC;AAEnD,MAAMQ,8BAA8B,GAAG,CACtCL,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,EACpBC,aAAa,CAACG,IAAI,CAClB;AAED,SAASC,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EAAEI,eAAe,CAAG,CAAC;AAC7D"}
@@ -90,7 +90,7 @@ export default function useSyncPathWithURL() {
90
90
  } else if (
91
91
  // These sidebar paths are special in the sense that the url in these pages may or may not have a postId and we need to retain it if it has.
92
92
  // The "type" property should be kept as well.
93
- navigatorLocation.path === '/pages' || navigatorLocation.path === '/wp_template' || navigatorLocation.path === '/wp_template_part/all') {
93
+ navigatorLocation.path === '/page' || navigatorLocation.path === '/wp_template' || navigatorLocation.path === '/wp_template_part/all') {
94
94
  updateUrlParams({
95
95
  postType: undefined,
96
96
  categoryType: undefined,
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalUseNavigator","useNavigator","useEffect","useRef","privateApis","routerPrivateApis","unlock","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","PATTERN_TYPES","useLocation","useHistory","getPathFromURL","urlParams","_urlParams$path","path","postType","postId","user","encodeURIComponent","isSubset","subset","superset","Object","entries","every","key","value","useSyncPathWithURL","history","params","location","navigatorLocation","navigatorParams","goTo","isMounting","current","updateUrlParams","newUrlParams","updatedParams","push","undefined","layout","startsWith","canvas","categoryType","categoryId"],"sources":["@wordpress/edit-site/src/components/sync-state-with-url/use-sync-path-with-url.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport function getPathFromURL( urlParams ) {\n\tlet path = urlParams?.path ?? '/';\n\n\t// Compute the navigator path based on the URL params.\n\tif ( urlParams?.postType && urlParams?.postId ) {\n\t\tswitch ( urlParams.postType ) {\n\t\t\tcase PATTERN_TYPES.user:\n\t\t\tcase TEMPLATE_POST_TYPE:\n\t\t\tcase TEMPLATE_PART_POST_TYPE:\n\t\t\tcase 'page':\n\t\t\t\tpath = `/${ encodeURIComponent(\n\t\t\t\t\turlParams.postType\n\t\t\t\t) }/${ encodeURIComponent( urlParams.postId ) }`;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tpath = `/navigation/${ encodeURIComponent(\n\t\t\t\t\turlParams.postType\n\t\t\t\t) }/${ encodeURIComponent( urlParams.postId ) }`;\n\t\t}\n\t}\n\n\treturn path;\n}\n\nfunction isSubset( subset, superset ) {\n\treturn Object.entries( subset ).every( ( [ key, value ] ) => {\n\t\treturn superset[ key ] === value;\n\t} );\n}\n\nexport default function useSyncPathWithURL() {\n\tconst history = useHistory();\n\tconst { params: urlParams } = useLocation();\n\tconst {\n\t\tlocation: navigatorLocation,\n\t\tparams: navigatorParams,\n\t\tgoTo,\n\t} = useNavigator();\n\tconst isMounting = useRef( true );\n\n\tuseEffect(\n\t\t() => {\n\t\t\t// The navigatorParams are only initially filled properly when the\n\t\t\t// navigator screens mount. so we ignore the first synchronisation.\n\t\t\tif ( isMounting.current ) {\n\t\t\t\tisMounting.current = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfunction updateUrlParams( newUrlParams ) {\n\t\t\t\tif ( isSubset( newUrlParams, urlParams ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst updatedParams = {\n\t\t\t\t\t...urlParams,\n\t\t\t\t\t...newUrlParams,\n\t\t\t\t};\n\t\t\t\thistory.push( updatedParams );\n\t\t\t}\n\n\t\t\tif ( navigatorParams?.postType && navigatorParams?.postId ) {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: navigatorParams?.postType,\n\t\t\t\t\tpostId: navigatorParams?.postId,\n\t\t\t\t\tpath: undefined,\n\t\t\t\t\tlayout: undefined,\n\t\t\t\t} );\n\t\t\t} else if (\n\t\t\t\tnavigatorLocation.path.startsWith( '/page/' ) &&\n\t\t\t\tnavigatorParams?.postId\n\t\t\t) {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: 'page',\n\t\t\t\t\tpostId: navigatorParams?.postId,\n\t\t\t\t\tpath: undefined,\n\t\t\t\t\tlayout: undefined,\n\t\t\t\t} );\n\t\t\t} else if ( navigatorLocation.path === '/patterns' ) {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: undefined,\n\t\t\t\t\tpostId: undefined,\n\t\t\t\t\tcanvas: undefined,\n\t\t\t\t\tpath: navigatorLocation.path,\n\t\t\t\t} );\n\t\t\t} else if (\n\t\t\t\t// These sidebar paths are special in the sense that the url in these pages may or may not have a postId and we need to retain it if it has.\n\t\t\t\t// The \"type\" property should be kept as well.\n\t\t\t\tnavigatorLocation.path === '/pages' ||\n\t\t\t\tnavigatorLocation.path === '/wp_template' ||\n\t\t\t\tnavigatorLocation.path === '/wp_template_part/all'\n\t\t\t) {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: undefined,\n\t\t\t\t\tcategoryType: undefined,\n\t\t\t\t\tcategoryId: undefined,\n\t\t\t\t\tpath: navigatorLocation.path,\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: undefined,\n\t\t\t\t\tpostId: undefined,\n\t\t\t\t\tcategoryType: undefined,\n\t\t\t\t\tcategoryId: undefined,\n\t\t\t\t\tlayout: undefined,\n\t\t\t\t\tpath:\n\t\t\t\t\t\tnavigatorLocation.path === '/'\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: navigatorLocation.path,\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t// Trigger only when navigator changes to prevent infinite loops.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[ navigatorLocation?.path, navigatorParams ]\n\t);\n\n\tuseEffect(\n\t\t() => {\n\t\t\tconst path = getPathFromURL( urlParams );\n\t\t\tif ( navigatorLocation.path !== path ) {\n\t\t\t\tgoTo( path );\n\t\t\t}\n\t\t},\n\t\t// Trigger only when URL changes to prevent infinite loops.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[ urlParams ]\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,0BAA0B,IAAIC,YAAY,QAAQ,uBAAuB;AAClF,SAASC,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AACtD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SACCC,kBAAkB,EAClBC,uBAAuB,EACvBC,aAAa,QACP,uBAAuB;AAE9B,MAAM;EAAEC,WAAW;EAAEC;AAAW,CAAC,GAAGL,MAAM,CAAED,iBAAkB,CAAC;AAE/D,OAAO,SAASO,cAAcA,CAAEC,SAAS,EAAG;EAAA,IAAAC,eAAA;EAC3C,IAAIC,IAAI,IAAAD,eAAA,GAAGD,SAAS,EAAEE,IAAI,cAAAD,eAAA,cAAAA,eAAA,GAAI,GAAG;;EAEjC;EACA,IAAKD,SAAS,EAAEG,QAAQ,IAAIH,SAAS,EAAEI,MAAM,EAAG;IAC/C,QAASJ,SAAS,CAACG,QAAQ;MAC1B,KAAKP,aAAa,CAACS,IAAI;MACvB,KAAKX,kBAAkB;MACvB,KAAKC,uBAAuB;MAC5B,KAAK,MAAM;QACVO,IAAI,GAAI,IAAII,kBAAkB,CAC7BN,SAAS,CAACG,QACX,CAAG,IAAIG,kBAAkB,CAAEN,SAAS,CAACI,MAAO,CAAG,EAAC;QAChD;MACD;QACCF,IAAI,GAAI,eAAeI,kBAAkB,CACxCN,SAAS,CAACG,QACX,CAAG,IAAIG,kBAAkB,CAAEN,SAAS,CAACI,MAAO,CAAG,EAAC;IAClD;EACD;EAEA,OAAOF,IAAI;AACZ;AAEA,SAASK,QAAQA,CAAEC,MAAM,EAAEC,QAAQ,EAAG;EACrC,OAAOC,MAAM,CAACC,OAAO,CA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ACA;EACA,CAAEF,SAAS,CACZ,CAAC;AACF"}
1
+ {"version":3,"names":["__experimentalUseNavigator","useNavigator","useEffect","useRef","privateApis","routerPrivateApis","unlock","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","PATTERN_TYPES","useLocation","useHistory","getPathFromURL","urlParams","_urlParams$path","path","postType","postId","user","encodeURIComponent","isSubset","subset","superset","Object","entries","every","key","value","useSyncPathWithURL","history","params","location","navigatorLocation","navigatorParams","goTo","isMounting","current","updateUrlParams","newUrlParams","updatedParams","push","undefined","layout","startsWith","canvas","categoryType","categoryId"],"sources":["@wordpress/edit-site/src/components/sync-state-with-url/use-sync-path-with-url.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport function getPathFromURL( urlParams ) {\n\tlet path = urlParams?.path ?? '/';\n\n\t// Compute the navigator path based on the URL params.\n\tif ( urlParams?.postType && urlParams?.postId ) {\n\t\tswitch ( urlParams.postType ) {\n\t\t\tcase PATTERN_TYPES.user:\n\t\t\tcase TEMPLATE_POST_TYPE:\n\t\t\tcase TEMPLATE_PART_POST_TYPE:\n\t\t\tcase 'page':\n\t\t\t\tpath = `/${ encodeURIComponent(\n\t\t\t\t\turlParams.postType\n\t\t\t\t) }/${ encodeURIComponent( urlParams.postId ) }`;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tpath = `/navigation/${ encodeURIComponent(\n\t\t\t\t\turlParams.postType\n\t\t\t\t) }/${ encodeURIComponent( urlParams.postId ) }`;\n\t\t}\n\t}\n\n\treturn path;\n}\n\nfunction isSubset( subset, superset ) {\n\treturn Object.entries( subset ).every( ( [ key, value ] ) => {\n\t\treturn superset[ key ] === value;\n\t} );\n}\n\nexport default function useSyncPathWithURL() {\n\tconst history = useHistory();\n\tconst { params: urlParams } = useLocation();\n\tconst {\n\t\tlocation: navigatorLocation,\n\t\tparams: navigatorParams,\n\t\tgoTo,\n\t} = useNavigator();\n\tconst isMounting = useRef( true );\n\n\tuseEffect(\n\t\t() => {\n\t\t\t// The navigatorParams are only initially filled properly when the\n\t\t\t// navigator screens mount. so we ignore the first synchronisation.\n\t\t\tif ( isMounting.current ) {\n\t\t\t\tisMounting.current = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfunction updateUrlParams( newUrlParams ) {\n\t\t\t\tif ( isSubset( newUrlParams, urlParams ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst updatedParams = {\n\t\t\t\t\t...urlParams,\n\t\t\t\t\t...newUrlParams,\n\t\t\t\t};\n\t\t\t\thistory.push( updatedParams );\n\t\t\t}\n\n\t\t\tif ( navigatorParams?.postType && navigatorParams?.postId ) {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: navigatorParams?.postType,\n\t\t\t\t\tpostId: navigatorParams?.postId,\n\t\t\t\t\tpath: undefined,\n\t\t\t\t\tlayout: undefined,\n\t\t\t\t} );\n\t\t\t} else if (\n\t\t\t\tnavigatorLocation.path.startsWith( '/page/' ) &&\n\t\t\t\tnavigatorParams?.postId\n\t\t\t) {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: 'page',\n\t\t\t\t\tpostId: navigatorParams?.postId,\n\t\t\t\t\tpath: undefined,\n\t\t\t\t\tlayout: undefined,\n\t\t\t\t} );\n\t\t\t} else if ( navigatorLocation.path === '/patterns' ) {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: undefined,\n\t\t\t\t\tpostId: undefined,\n\t\t\t\t\tcanvas: undefined,\n\t\t\t\t\tpath: navigatorLocation.path,\n\t\t\t\t} );\n\t\t\t} else if (\n\t\t\t\t// These sidebar paths are special in the sense that the url in these pages may or may not have a postId and we need to retain it if it has.\n\t\t\t\t// The \"type\" property should be kept as well.\n\t\t\t\tnavigatorLocation.path === '/page' ||\n\t\t\t\tnavigatorLocation.path === '/wp_template' ||\n\t\t\t\tnavigatorLocation.path === '/wp_template_part/all'\n\t\t\t) {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: undefined,\n\t\t\t\t\tcategoryType: undefined,\n\t\t\t\t\tcategoryId: undefined,\n\t\t\t\t\tpath: navigatorLocation.path,\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: undefined,\n\t\t\t\t\tpostId: undefined,\n\t\t\t\t\tcategoryType: undefined,\n\t\t\t\t\tcategoryId: undefined,\n\t\t\t\t\tlayout: undefined,\n\t\t\t\t\tpath:\n\t\t\t\t\t\tnavigatorLocation.path === '/'\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: navigatorLocation.path,\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t// Trigger only when navigator changes to prevent infinite loops.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[ navigatorLocation?.path, navigatorParams ]\n\t);\n\n\tuseEffect(\n\t\t() => {\n\t\t\tconst path = getPathFromURL( urlParams );\n\t\t\tif ( navigatorLocation.path !== path ) {\n\t\t\t\tgoTo( path );\n\t\t\t}\n\t\t},\n\t\t// Trigger only when URL changes to prevent infinite loops.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[ urlParams ]\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,0BAA0B,IAAIC,YAAY,QAAQ,uBAAuB;AAClF,SAASC,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AACtD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAAS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B,CAAE,CAAC;IACJ,CAAC,MAAM;IACN;IACA;IACAiB,iBAAiB,CAACjB,IAAI,KAAK,OAAO,IAClCiB,iBAAiB,CAACjB,IAAI,KAAK,cAAc,IACzCiB,iBAAiB,CAACjB,IAAI,KAAK,uBAAuB,EACjD;MACDsB,eAAe,CAAE;QAChBrB,QAAQ,EAAEyB,SAAS;QACnBI,YAAY,EAAEJ,SAAS;QACvBK,UAAU,EAAEL,SAAS;QACrB1B,IAAI,EAAEiB,iBAAiB,CAACjB;MACzB,CAAE,CAAC;IACJ,CAAC,MAAM;MACNsB,eAAe,CAAE;QAChBrB,QAAQ,EAAEyB,SAAS;QACnBxB,MAAM,EAAEwB,SAAS;QACjBI,YAAY,EAAEJ,SAAS;QACvBK,UAAU,EAAEL,SAAS;QACrBC,MAAM,EAAED,SAAS;QACjB1B,IAAI,EACHiB,iBAAiB,CAACjB,IAAI,KAAK,GAAG,GAC3B0B,SAAS,GACTT,iBAAiB,CAACjB;MACvB,CAAE,CAAC;IACJ;EACD,CAAC;EACD;EACA;EACA,CAAEiB,iBAAiB,EAAEjB,IAAI,EAAEkB,eAAe,CAC3C,CAAC;EAED/B,SAAS,CACR,MAAM;IACL,MAAMa,IAAI,GAAGH,cAAc,CAAEC,SAAU,CAAC;IACxC,IAAKmB,iBAAiB,CAACjB,IAAI,KAAKA,IAAI,EAAG;MACtCmB,IAAI,CAAEnB,IAAK,CAAC;IACb;EACD,CAAC;EACD;EACA;EACA,CAAEF,SAAS,CACZ,CAAC;AACF"}
@@ -3,5 +3,4 @@
3
3
  */
4
4
  import './components';
5
5
  import './push-changes-to-global-styles';
6
- import './template-part-edit';
7
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/edit-site/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './components';\nimport './push-changes-to-global-styles';\nimport './template-part-edit';\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,cAAc;AACrB,OAAO,iCAAiC;AACxC,OAAO,sBAAsB"}
1
+ {"version":3,"names":[],"sources":["@wordpress/edit-site/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './components';\nimport './push-changes-to-global-styles';\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,cAAc;AACrB,OAAO,iCAAiC"}
@@ -6,14 +6,11 @@ import { createRegistrySelector } from '@wordpress/data';
6
6
  import deprecated from '@wordpress/deprecated';
7
7
  import { Platform } from '@wordpress/element';
8
8
  import { store as preferencesStore } from '@wordpress/preferences';
9
- import { store as blockEditorStore } from '@wordpress/block-editor';
10
9
  import { store as editorStore } from '@wordpress/editor';
11
10
 
12
11
  /**
13
12
  * Internal dependencies
14
13
  */
15
- import { getFilteredTemplatePartBlocks } from './utils';
16
- import { TEMPLATE_PART_POST_TYPE } from '../utils/constants';
17
14
  import { unlock } from '../lock-unlock';
18
15
 
19
16
  /**
@@ -221,12 +218,7 @@ export function isSaveViewOpened(state) {
221
218
  * @return {Array} Template parts and their blocks in an array.
222
219
  */
223
220
  export const getCurrentTemplateTemplateParts = createRegistrySelector(select => () => {
224
- const templateParts = select(coreDataStore).getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, {
225
- per_page: -1
226
- });
227
- const clientIds = select(blockEditorStore).getBlocksByName('core/template-part');
228
- const blocks = select(blockEditorStore).getBlocksByClientId(clientIds);
229
- return getFilteredTemplatePartBlocks(blocks, templateParts);
221
+ return unlock(select(editorStore)).getCurrentTemplateTemplateParts();
230
222
  });
231
223
 
232
224
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["store","coreDataStore","createRegistrySelector","deprecated","Platform","preferencesStore","blockEditorStore","editorStore","getFilteredTemplatePartBlocks","TEMPLATE_PART_POST_TYPE","unlock","isFeatureActive","select","_","featureName","since","alternative","get","__experimentalGetPreviewDeviceType","version","getDeviceType","getCanUserCreateMedia","canUser","getReusableBlocks","isWeb","OS","getEntityRecords","per_page","getSettings","state","settings","getHomeTemplateId","getEditedPostType","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","__experimentalGetInsertionPoint","getInsertionPoint","isListViewOpened","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateParts","clientIds","getBlocksByName","blocks","getBlocksByClientId","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":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,aAAa,QAAQ,sBAAsB;AAC7D,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASJ,KAAK,IAAIK,gBAAgB,QAAQ,wBAAwB;AAClE,SAASL,KAAK,IAAIM,gBAAgB,QAAQ,yBAAyB;AACnE,SAASN,KAAK,IAAIO,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASC,6BAA6B,QAAQ,SAAS;AACvD,SAASC,uBAAuB,QAAQ,oBAAoB;AAC5D,SAASC,MAAM,QAAQ,gBAAgB;;AAEvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAGT,sBAAsB,CAClDU,MAAM,IAAM,CAAEC,CAAC,EAAEC,WAAW,KAAM;EACnCX,UAAU,CAAG,4CAA2C,EAAE;IACzDY,KAAK,EAAE,KAAK;IACZC,WAAW,EAAG;EACf,CAAE,CAAC;EAEH,OAAO,CAAC,CAAEJ,MAAM,CAAEP,gBAAiB,CAAC,CAACY,GAAG,CACvC,gBAAgB,EAChBH,WACD,CAAC;AACF,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,kCAAkC,GAAGhB,sBAAsB,CACrEU,MAAM,IAAM,MAAM;EACnBT,UAAU,CACR,+DAA8D,EAC/D;IACCY,KAAK,EAAE,KAAK;IACZI,OAAO,EAAE,KAAK;IACdH,WAAW,EAAG;EACf,CACD,CAAC;EACD,OAAOJ,MAAM,CAAEL,WAAY,CAAC,CAACa,a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AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASqC,MAAMA,CAAE3B,KAAK,EAAG;EAC/B,OAAO,CAAC,CAAEA,KAAK,CAACI,UAAU,CAACK,OAAO,EAAEmB,MAAM;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAAA,EAAG;EACrCvD,UAAU,CAAG,gDAA+C,EAAE;IAC7DY,KAAK,EAAE;EACR,CAAE,CAAC;EAEH,OAAO,KAAK;AACb"}
1
+ {"version":3,"names":["store","coreDataStore","createRegistrySelector","deprecated","Platform","preferencesStore","editorStore","unlock","isFeatureActive","select","_","featureName","since","alternative","get","__experimentalGetPreviewDeviceType","version","getDeviceType","getCanUserCreateMedia","canUser","getReusableBlocks","isWeb","OS","getEntityRecords","per_page","getSettings","state","settings","getHomeTemplateId","getEditedPostType","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","__experimentalGetInsertionPoint","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":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,aAAa,QAAQ,sBAAsB;AAC7D,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASJ,KAAK,IAAIK,gBAAgB,QAAQ,wBAAwB;AAClE,SAASL,KAAK,IAAIM,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,gBAAgB;;AAEvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAGN,sBAAsB,CAClDO,MAAM,IAAM,CAAEC,CAAC,EAAEC,WAAW,KAAM;EACnCR,UAAU,CAAG,4CAA2C,EAAE;IACzDS,KAAK,EAAE,KAAK;IACZC,WAAW,EAAG;EACf,CAAE,CAAC;EAEH,OAAO,CAAC,CAAEJ,MAAM,CAAEJ,gBAAiB,CAAC,CAACS,GAAG,CACvC,gBAAgB,EAChBH,WACD,CAAC;AACF,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,kCAAkC,GAAGb,sBAAsB,CACrEO,MAAM,IAAM,MAAM;EACnBN,UAAU,CACR,+DAA8D,EAC/D;IACCS,KAAK,EAAE,KAAK;IACZI,OAAO,EAAE,KAAK;IACdH,WAAW,EAAG;EACf,CACD,CA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