@wordpress/edit-site 4.19.0 → 5.0.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 (319) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/components/add-new-template/add-custom-template-modal.js +1 -0
  3. package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
  4. package/build/components/add-new-template/index.js +8 -5
  5. package/build/components/add-new-template/index.js.map +1 -1
  6. package/build/components/add-new-template/new-template-part.js +21 -6
  7. package/build/components/add-new-template/new-template-part.js.map +1 -1
  8. package/build/components/add-new-template/new-template.js +12 -8
  9. package/build/components/add-new-template/new-template.js.map +1 -1
  10. package/build/components/app/index.js +15 -30
  11. package/build/components/app/index.js.map +1 -1
  12. package/build/components/block-editor/editor-canvas.js +64 -0
  13. package/build/components/block-editor/editor-canvas.js.map +1 -0
  14. package/build/components/block-editor/index.js +61 -59
  15. package/build/components/block-editor/index.js.map +1 -1
  16. package/build/components/block-editor/resizable-editor.js +10 -44
  17. package/build/components/block-editor/resizable-editor.js.map +1 -1
  18. package/build/components/editor/index.js +80 -127
  19. package/build/components/editor/index.js.map +1 -1
  20. package/build/components/global-styles/block-preview-panel.js +42 -0
  21. package/build/components/global-styles/block-preview-panel.js.map +1 -0
  22. package/build/components/global-styles/context-menu.js +6 -2
  23. package/build/components/global-styles/context-menu.js.map +1 -1
  24. package/build/components/global-styles/custom-css.js +61 -0
  25. package/build/components/global-styles/custom-css.js.map +1 -0
  26. package/build/components/global-styles/dimensions-panel.js +2 -6
  27. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  28. package/build/components/global-styles/global-styles-provider.js +15 -2
  29. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  30. package/build/components/global-styles/hooks.js +5 -2
  31. package/build/components/global-styles/hooks.js.map +1 -1
  32. package/build/components/global-styles/palette.js +1 -1
  33. package/build/components/global-styles/palette.js.map +1 -1
  34. package/build/components/global-styles/screen-block-list.js +2 -1
  35. package/build/components/global-styles/screen-block-list.js.map +1 -1
  36. package/build/components/global-styles/screen-block.js +10 -2
  37. package/build/components/global-styles/screen-block.js.map +1 -1
  38. package/build/components/global-styles/screen-border.js +43 -0
  39. package/build/components/global-styles/screen-border.js.map +1 -0
  40. package/build/components/global-styles/screen-colors.js +1 -1
  41. package/build/components/global-styles/screen-colors.js.map +1 -1
  42. package/build/components/global-styles/screen-css.js +42 -0
  43. package/build/components/global-styles/screen-css.js.map +1 -0
  44. package/build/components/global-styles/screen-layout.js +0 -5
  45. package/build/components/global-styles/screen-layout.js.map +1 -1
  46. package/build/components/global-styles/screen-root.js +14 -1
  47. package/build/components/global-styles/screen-root.js.map +1 -1
  48. package/build/components/global-styles/screen-style-variations.js +3 -3
  49. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  50. package/build/components/global-styles/ui.js +50 -4
  51. package/build/components/global-styles/ui.js.map +1 -1
  52. package/build/components/global-styles/use-global-styles-output.js +5 -1
  53. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  54. package/build/components/global-styles/utils.js +3 -3
  55. package/build/components/global-styles/utils.js.map +1 -1
  56. package/build/components/{editor/global-styles-renderer.js → global-styles-renderer/index.js} +4 -8
  57. package/build/components/global-styles-renderer/index.js.map +1 -0
  58. package/build/components/header-edit-mode/document-actions/index.js +12 -5
  59. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  60. package/build/components/header-edit-mode/index.js +19 -12
  61. package/build/components/header-edit-mode/index.js.map +1 -1
  62. package/build/components/keyboard-shortcuts/index.js +11 -1
  63. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  64. package/build/components/layout/index.js +231 -0
  65. package/build/components/layout/index.js.map +1 -0
  66. package/build/components/list/header.js +5 -1
  67. package/build/components/list/header.js.map +1 -1
  68. package/build/components/list/index.js +4 -22
  69. package/build/components/list/index.js.map +1 -1
  70. package/build/components/navigate-to-link/index.js +1 -3
  71. package/build/components/navigate-to-link/index.js.map +1 -1
  72. package/build/components/routes/index.js +1 -1
  73. package/build/components/routes/index.js.map +1 -1
  74. package/build/components/sidebar/index.js +42 -0
  75. package/build/components/sidebar/index.js.map +1 -0
  76. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +24 -4
  77. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  78. package/build/components/sidebar-edit-mode/index.js +1 -1
  79. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  80. package/build/components/sidebar-navigation-item/index.js +53 -0
  81. package/build/components/sidebar-navigation-item/index.js.map +1 -0
  82. package/build/components/sidebar-navigation-screen/index.js +49 -0
  83. package/build/components/sidebar-navigation-screen/index.js.map +1 -0
  84. package/build/components/sidebar-navigation-screen-main/index.js +76 -0
  85. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -0
  86. package/build/components/sidebar-navigation-screen-templates/index.js +188 -0
  87. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -0
  88. package/build/components/site-icon/index.js +70 -0
  89. package/build/components/site-icon/index.js.map +1 -0
  90. package/build/components/site-title/index.js +55 -0
  91. package/build/components/site-title/index.js.map +1 -0
  92. package/build/components/style-book/index.js +173 -0
  93. package/build/components/style-book/index.js.map +1 -0
  94. package/build/components/{url-query-controller/index.js → sync-state-with-url/use-init-edited-entity-from-url.js} +5 -4
  95. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -0
  96. package/build/components/sync-state-with-url/use-sync-sidebar-path-with-url.js +53 -0
  97. package/build/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +1 -0
  98. package/build/index.js +2 -45
  99. package/build/index.js.map +1 -1
  100. package/build/store/actions.js +93 -43
  101. package/build/store/actions.js.map +1 -1
  102. package/build/store/reducer.js +35 -107
  103. package/build/store/reducer.js.map +1 -1
  104. package/build/store/selectors.js +69 -78
  105. package/build/store/selectors.js.map +1 -1
  106. package/build-module/components/add-new-template/add-custom-template-modal.js +1 -0
  107. package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -1
  108. package/build-module/components/add-new-template/index.js +7 -5
  109. package/build-module/components/add-new-template/index.js.map +1 -1
  110. package/build-module/components/add-new-template/new-template-part.js +18 -6
  111. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  112. package/build-module/components/add-new-template/new-template.js +13 -9
  113. package/build-module/components/add-new-template/new-template.js.map +1 -1
  114. package/build-module/components/app/index.js +15 -28
  115. package/build-module/components/app/index.js.map +1 -1
  116. package/build-module/components/block-editor/editor-canvas.js +51 -0
  117. package/build-module/components/block-editor/editor-canvas.js.map +1 -0
  118. package/build-module/components/block-editor/index.js +61 -60
  119. package/build-module/components/block-editor/index.js.map +1 -1
  120. package/build-module/components/block-editor/resizable-editor.js +11 -40
  121. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  122. package/build-module/components/editor/index.js +81 -124
  123. package/build-module/components/editor/index.js.map +1 -1
  124. package/build-module/components/global-styles/block-preview-panel.js +32 -0
  125. package/build-module/components/global-styles/block-preview-panel.js.map +1 -0
  126. package/build-module/components/global-styles/context-menu.js +7 -3
  127. package/build-module/components/global-styles/context-menu.js.map +1 -1
  128. package/build-module/components/global-styles/custom-css.js +51 -0
  129. package/build-module/components/global-styles/custom-css.js.map +1 -0
  130. package/build-module/components/global-styles/dimensions-panel.js +3 -7
  131. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  132. package/build-module/components/global-styles/global-styles-provider.js +15 -2
  133. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  134. package/build-module/components/global-styles/hooks.js +5 -3
  135. package/build-module/components/global-styles/hooks.js.map +1 -1
  136. package/build-module/components/global-styles/palette.js +1 -1
  137. package/build-module/components/global-styles/palette.js.map +1 -1
  138. package/build-module/components/global-styles/screen-block-list.js +2 -1
  139. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  140. package/build-module/components/global-styles/screen-block.js +8 -2
  141. package/build-module/components/global-styles/screen-block.js.map +1 -1
  142. package/build-module/components/global-styles/screen-border.js +27 -0
  143. package/build-module/components/global-styles/screen-border.js.map +1 -0
  144. package/build-module/components/global-styles/screen-colors.js +1 -1
  145. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  146. package/build-module/components/global-styles/screen-css.js +28 -0
  147. package/build-module/components/global-styles/screen-css.js.map +1 -0
  148. package/build-module/components/global-styles/screen-layout.js +0 -4
  149. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  150. package/build-module/components/global-styles/screen-root.js +14 -1
  151. package/build-module/components/global-styles/screen-root.js.map +1 -1
  152. package/build-module/components/global-styles/screen-style-variations.js +2 -2
  153. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  154. package/build-module/components/global-styles/ui.js +48 -5
  155. package/build-module/components/global-styles/ui.js.map +1 -1
  156. package/build-module/components/global-styles/use-global-styles-output.js +5 -1
  157. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  158. package/build-module/components/global-styles/utils.js +4 -4
  159. package/build-module/components/global-styles/utils.js.map +1 -1
  160. package/build-module/components/{editor/global-styles-renderer.js → global-styles-renderer/index.js} +4 -7
  161. package/build-module/components/global-styles-renderer/index.js.map +1 -0
  162. package/build-module/components/header-edit-mode/document-actions/index.js +13 -6
  163. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  164. package/build-module/components/header-edit-mode/index.js +16 -11
  165. package/build-module/components/header-edit-mode/index.js.map +1 -1
  166. package/build-module/components/keyboard-shortcuts/index.js +10 -1
  167. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  168. package/build-module/components/layout/index.js +203 -0
  169. package/build-module/components/layout/index.js.map +1 -0
  170. package/build-module/components/list/header.js +5 -1
  171. package/build-module/components/list/header.js.map +1 -1
  172. package/build-module/components/list/index.js +4 -19
  173. package/build-module/components/list/index.js.map +1 -1
  174. package/build-module/components/navigate-to-link/index.js +1 -3
  175. package/build-module/components/navigate-to-link/index.js.map +1 -1
  176. package/build-module/components/routes/index.js +1 -1
  177. package/build-module/components/routes/index.js.map +1 -1
  178. package/build-module/components/sidebar/index.js +30 -0
  179. package/build-module/components/sidebar/index.js.map +1 -0
  180. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +27 -7
  181. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  182. package/build-module/components/sidebar-edit-mode/index.js +3 -3
  183. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  184. package/build-module/components/sidebar-navigation-item/index.js +40 -0
  185. package/build-module/components/sidebar-navigation-item/index.js.map +1 -0
  186. package/build-module/components/sidebar-navigation-screen/index.js +39 -0
  187. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -0
  188. package/build-module/components/sidebar-navigation-screen-main/index.js +57 -0
  189. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -0
  190. package/build-module/components/sidebar-navigation-screen-templates/index.js +165 -0
  191. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -0
  192. package/build-module/components/site-icon/index.js +55 -0
  193. package/build-module/components/site-icon/index.js.map +1 -0
  194. package/build-module/components/site-title/index.js +43 -0
  195. package/build-module/components/site-title/index.js.map +1 -0
  196. package/build-module/components/style-book/index.js +156 -0
  197. package/build-module/components/style-book/index.js.map +1 -0
  198. package/build-module/components/{url-query-controller/index.js → sync-state-with-url/use-init-edited-entity-from-url.js} +4 -3
  199. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -0
  200. package/build-module/components/sync-state-with-url/use-sync-sidebar-path-with-url.js +43 -0
  201. package/build-module/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +1 -0
  202. package/build-module/index.js +5 -36
  203. package/build-module/index.js.map +1 -1
  204. package/build-module/store/actions.js +87 -42
  205. package/build-module/store/actions.js.map +1 -1
  206. package/build-module/store/reducer.js +35 -102
  207. package/build-module/store/reducer.js.map +1 -1
  208. package/build-module/store/selectors.js +60 -72
  209. package/build-module/store/selectors.js.map +1 -1
  210. package/build-style/style-rtl.css +550 -346
  211. package/build-style/style.css +550 -346
  212. package/package.json +32 -31
  213. package/src/components/add-new-template/add-custom-template-modal.js +1 -0
  214. package/src/components/add-new-template/index.js +6 -3
  215. package/src/components/add-new-template/new-template-part.js +15 -3
  216. package/src/components/add-new-template/new-template.js +14 -7
  217. package/src/components/add-new-template/style.scss +0 -4
  218. package/src/components/app/index.js +14 -43
  219. package/src/components/block-editor/editor-canvas.js +69 -0
  220. package/src/components/block-editor/index.js +102 -87
  221. package/src/components/block-editor/resizable-editor.js +9 -64
  222. package/src/components/block-editor/style.scss +25 -1
  223. package/src/components/code-editor/style.scss +1 -1
  224. package/src/components/editor/index.js +170 -236
  225. package/src/components/editor/style.scss +0 -22
  226. package/src/components/global-styles/block-preview-panel.js +29 -0
  227. package/src/components/global-styles/context-menu.js +11 -2
  228. package/src/components/global-styles/custom-css.js +73 -0
  229. package/src/components/global-styles/dimensions-panel.js +2 -5
  230. package/src/components/global-styles/global-styles-provider.js +39 -17
  231. package/src/components/global-styles/hooks.js +8 -3
  232. package/src/components/global-styles/palette.js +1 -1
  233. package/src/components/global-styles/screen-block-list.js +2 -1
  234. package/src/components/global-styles/screen-block.js +9 -1
  235. package/src/components/global-styles/screen-border.js +23 -0
  236. package/src/components/global-styles/screen-colors.js +2 -1
  237. package/src/components/global-styles/screen-css.js +33 -0
  238. package/src/components/global-styles/screen-layout.js +0 -3
  239. package/src/components/global-styles/screen-root.js +30 -1
  240. package/src/components/global-styles/screen-style-variations.js +5 -2
  241. package/src/components/global-styles/style.scss +31 -2
  242. package/src/components/global-styles/ui.js +47 -4
  243. package/src/components/global-styles/use-global-styles-output.js +5 -0
  244. package/src/components/global-styles/utils.js +8 -5
  245. package/src/components/{editor/global-styles-renderer.js → global-styles-renderer/index.js} +3 -9
  246. package/src/components/header-edit-mode/document-actions/index.js +14 -9
  247. package/src/components/header-edit-mode/document-actions/style.scss +8 -1
  248. package/src/components/header-edit-mode/index.js +96 -78
  249. package/src/components/header-edit-mode/style.scss +5 -33
  250. package/src/components/keyboard-shortcuts/index.js +13 -0
  251. package/src/components/layout/index.js +278 -0
  252. package/src/components/layout/style.scss +176 -0
  253. package/src/components/list/header.js +5 -1
  254. package/src/components/list/index.js +12 -31
  255. package/src/components/list/style.scss +10 -4
  256. package/src/components/navigate-to-link/index.js +2 -8
  257. package/src/components/routes/index.js +1 -1
  258. package/src/components/sidebar/index.js +34 -0
  259. package/src/components/sidebar/style.scss +8 -0
  260. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +42 -7
  261. package/src/components/sidebar-edit-mode/index.js +3 -3
  262. package/src/components/sidebar-edit-mode/navigation-menu-sidebar/style.scss +21 -3
  263. package/src/components/sidebar-edit-mode/settings-header/style.scss +47 -34
  264. package/src/components/sidebar-edit-mode/style.scss +0 -13
  265. package/src/components/sidebar-navigation-item/index.js +51 -0
  266. package/src/components/sidebar-navigation-item/style.scss +17 -0
  267. package/src/components/sidebar-navigation-screen/index.js +55 -0
  268. package/src/components/sidebar-navigation-screen/style.scss +41 -0
  269. package/src/components/sidebar-navigation-screen-main/index.js +72 -0
  270. package/src/components/sidebar-navigation-screen-templates/index.js +181 -0
  271. package/src/components/sidebar-navigation-screen-templates/style.scss +9 -0
  272. package/src/components/site-icon/index.js +56 -0
  273. package/src/components/site-icon/style.scss +10 -0
  274. package/src/components/site-title/index.js +39 -0
  275. package/src/components/style-book/index.js +193 -0
  276. package/src/components/style-book/style.scss +78 -0
  277. package/src/components/{url-query-controller/index.js → sync-state-with-url/use-init-edited-entity-from-url.js} +3 -3
  278. package/src/components/sync-state-with-url/use-sync-sidebar-path-with-url.js +36 -0
  279. package/src/components/template-details/style.scss +4 -0
  280. package/src/index.js +3 -53
  281. package/src/store/actions.js +93 -48
  282. package/src/store/reducer.js +29 -91
  283. package/src/store/selectors.js +61 -101
  284. package/src/store/test/actions.js +3 -15
  285. package/src/store/test/reducer.js +8 -192
  286. package/src/store/test/selectors.js +3 -42
  287. package/src/style.scss +19 -3
  288. package/build/components/editor/global-styles-renderer.js.map +0 -1
  289. package/build/components/navigation-sidebar/index.js +0 -62
  290. package/build/components/navigation-sidebar/index.js.map +0 -1
  291. package/build/components/navigation-sidebar/navigation-panel/constants.js +0 -77
  292. package/build/components/navigation-sidebar/navigation-panel/constants.js.map +0 -1
  293. package/build/components/navigation-sidebar/navigation-panel/index.js +0 -152
  294. package/build/components/navigation-sidebar/navigation-panel/index.js.map +0 -1
  295. package/build/components/navigation-sidebar/navigation-panel/template-hierarchy.js +0 -81
  296. package/build/components/navigation-sidebar/navigation-panel/template-hierarchy.js.map +0 -1
  297. package/build/components/navigation-sidebar/navigation-toggle/index.js +0 -124
  298. package/build/components/navigation-sidebar/navigation-toggle/index.js.map +0 -1
  299. package/build/components/url-query-controller/index.js.map +0 -1
  300. package/build-module/components/editor/global-styles-renderer.js.map +0 -1
  301. package/build-module/components/navigation-sidebar/index.js +0 -45
  302. package/build-module/components/navigation-sidebar/index.js.map +0 -1
  303. package/build-module/components/navigation-sidebar/navigation-panel/constants.js +0 -49
  304. package/build-module/components/navigation-sidebar/navigation-panel/constants.js.map +0 -1
  305. package/build-module/components/navigation-sidebar/navigation-panel/index.js +0 -131
  306. package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +0 -1
  307. package/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js +0 -66
  308. package/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js.map +0 -1
  309. package/build-module/components/navigation-sidebar/navigation-toggle/index.js +0 -108
  310. package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +0 -1
  311. package/build-module/components/url-query-controller/index.js.map +0 -1
  312. package/src/components/navigation-sidebar/index.js +0 -46
  313. package/src/components/navigation-sidebar/navigation-panel/constants.js +0 -94
  314. package/src/components/navigation-sidebar/navigation-panel/index.js +0 -142
  315. package/src/components/navigation-sidebar/navigation-panel/style.scss +0 -152
  316. package/src/components/navigation-sidebar/navigation-panel/template-hierarchy.js +0 -81
  317. package/src/components/navigation-sidebar/navigation-toggle/index.js +0 -114
  318. package/src/components/navigation-sidebar/navigation-toggle/style.scss +0 -71
  319. package/src/components/navigation-sidebar/navigation-toggle/test/index.js +0 -65
@@ -0,0 +1,55 @@
1
+ import { createElement } from "@wordpress/element";
2
+
3
+ /**
4
+ * External dependencies
5
+ */
6
+ import classnames from 'classnames';
7
+ /**
8
+ * WordPress dependencies
9
+ */
10
+
11
+ import { useSelect } from '@wordpress/data';
12
+ import { Icon } from '@wordpress/components';
13
+ import { __ } from '@wordpress/i18n';
14
+ import { wordpress } from '@wordpress/icons';
15
+ import { store as coreDataStore } from '@wordpress/core-data';
16
+
17
+ function SiteIcon(_ref) {
18
+ let {
19
+ className
20
+ } = _ref;
21
+ const {
22
+ isRequestingSite,
23
+ siteIconUrl
24
+ } = useSelect(select => {
25
+ const {
26
+ getEntityRecord,
27
+ isResolving
28
+ } = select(coreDataStore);
29
+ const siteData = getEntityRecord('root', '__unstableBase', undefined) || {};
30
+ return {
31
+ isRequestingSite: isResolving('core', 'getEntityRecord', ['root', '__unstableBase', undefined]),
32
+ siteIconUrl: siteData.site_icon_url
33
+ };
34
+ }, []);
35
+
36
+ if (isRequestingSite && !siteIconUrl) {
37
+ return null;
38
+ }
39
+
40
+ const icon = siteIconUrl ? createElement("img", {
41
+ className: "edit-site-site-icon__image",
42
+ alt: __('Site Icon'),
43
+ src: siteIconUrl
44
+ }) : createElement(Icon, {
45
+ className: "edit-site-site-icon__icon",
46
+ size: "36px",
47
+ icon: wordpress
48
+ });
49
+ return createElement("div", {
50
+ className: classnames(className, 'edit-site-site-icon')
51
+ }, icon);
52
+ }
53
+
54
+ export default SiteIcon;
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/site-icon/index.js"],"names":["classnames","useSelect","Icon","__","wordpress","store","coreDataStore","SiteIcon","className","isRequestingSite","siteIconUrl","select","getEntityRecord","isResolving","siteData","undefined","site_icon_url","icon"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,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Press dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Icon } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { wordpress } from '@wordpress/icons';\nimport { store as coreDataStore } from '@wordpress/core-data';\n\nfunction SiteIcon( { className } ) {\n\tconst { isRequestingSite, siteIconUrl } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, isResolving } = select( coreDataStore );\n\t\tconst siteData =\n\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\treturn {\n\t\t\tisRequestingSite: isResolving( 'core', 'getEntityRecord', [\n\t\t\t\t'root',\n\t\t\t\t'__unstableBase',\n\t\t\t\tundefined,\n\t\t\t] ),\n\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t};\n\t}, [] );\n\n\tif ( isRequestingSite && ! siteIconUrl ) {\n\t\treturn null;\n\t}\n\n\tconst icon = siteIconUrl ? (\n\t\t<img\n\t\t\tclassName=\"edit-site-site-icon__image\"\n\t\t\talt={ __( 'Site Icon' ) }\n\t\t\tsrc={ siteIconUrl }\n\t\t/>\n\t) : (\n\t\t<Icon\n\t\t\tclassName=\"edit-site-site-icon__icon\"\n\t\t\tsize=\"36px\"\n\t\t\ticon={ wordpress }\n\t\t/>\n\t);\n\n\treturn (\n\t\t<div className={ classnames( className, 'edit-site-site-icon' ) }>\n\t\t\t{ icon }\n\t\t</div>\n\t);\n}\n\nexport default SiteIcon;\n"]}
@@ -0,0 +1,43 @@
1
+ import { createElement } from "@wordpress/element";
2
+
3
+ /**
4
+ * External dependencies
5
+ */
6
+ import classnames from 'classnames';
7
+ /**
8
+ * WordPress dependencies
9
+ */
10
+
11
+ import { useSelect } from '@wordpress/data';
12
+ import { store as coreDataStore } from '@wordpress/core-data';
13
+
14
+ function SiteTitle(_ref) {
15
+ let {
16
+ className
17
+ } = _ref;
18
+ const {
19
+ isRequestingSite,
20
+ siteTitle
21
+ } = useSelect(select => {
22
+ const {
23
+ getEntityRecord,
24
+ isResolving
25
+ } = select(coreDataStore);
26
+ const siteData = getEntityRecord('root', '__unstableBase', undefined) || {};
27
+ return {
28
+ isRequestingSite: isResolving('core', 'getEntityRecord', ['root', '__unstableBase', undefined]),
29
+ siteTitle: siteData.name
30
+ };
31
+ }, []);
32
+
33
+ if (isRequestingSite && !siteTitle) {
34
+ return null;
35
+ }
36
+
37
+ return createElement("div", {
38
+ className: classnames(className, 'edit-site-site-title')
39
+ }, siteTitle);
40
+ }
41
+
42
+ export default SiteTitle;
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/site-title/index.js"],"names":["classnames","useSelect","store","coreDataStore","SiteTitle","className","isRequestingSite","siteTitle","select","getEntityRecord","isResolving","siteData","undefined","name"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;;AAEA,SAASC,SAAT,OAAoC;AAAA,MAAhB;AAAEC,IAAAA;AAAF,GAAgB;AACnC,QAAM;AAAEC,IAAAA,gBAAF;AAAoBC,IAAAA;AAApB,MAAkCN,SAAS,CAAIO,MAAF,IAAc;AAChE,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA;AAAnB,QAAmCF,MAAM,CAAEL,aAAF,CAA/C;AACA,UAAMQ,QAAQ,GACbF,eAAe,CAAE,MAAF,EAAU,gBAAV,EAA4BG,SAA5B,CAAf,IAA0D,EAD3D;AAGA,WAAO;AACNN,MAAAA,gBAAgB,EAAEI,WAAW,CAAE,MAAF,EAAU,iBAAV,EAA6B,CACzD,MADyD,EAEzD,gBAFyD,EAGzDE,SAHyD,CAA7B,CADvB;AAMNL,MAAAA,SAAS,EAAEI,QAAQ,CAACE;AANd,KAAP;AAQA,GAbgD,EAa9C,EAb8C,CAAjD;;AAeA,MAAKP,gBAAgB,IAAI,CAAEC,SAA3B,EAAuC;AACtC,WAAO,IAAP;AACA;;AAED,SACC;AAAK,IAAA,SAAS,EAAGP,UAAU,CAAEK,SAAF,EAAa,sBAAb;AAA3B,KACGE,SADH,CADD;AAKA;;AAED,eAAeH,SAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\n\nfunction SiteTitle( { className } ) {\n\tconst { isRequestingSite, siteTitle } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, isResolving } = select( coreDataStore );\n\t\tconst siteData =\n\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\treturn {\n\t\t\tisRequestingSite: isResolving( 'core', 'getEntityRecord', [\n\t\t\t\t'root',\n\t\t\t\t'__unstableBase',\n\t\t\t\tundefined,\n\t\t\t] ),\n\t\t\tsiteTitle: siteData.name,\n\t\t};\n\t}, [] );\n\n\tif ( isRequestingSite && ! siteTitle ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className={ classnames( className, 'edit-site-site-title' ) }>\n\t\t\t{ siteTitle }\n\t\t</div>\n\t);\n}\n\nexport default SiteTitle;\n"]}
@@ -0,0 +1,156 @@
1
+ import { createElement } from "@wordpress/element";
2
+
3
+ /**
4
+ * External dependencies
5
+ */
6
+ import classnames from 'classnames';
7
+ /**
8
+ * WordPress dependencies
9
+ */
10
+
11
+ import { Button, TabPanel, createSlotFill, __experimentalUseSlotFills as useSlotFills } from '@wordpress/components';
12
+ import { __, sprintf } from '@wordpress/i18n';
13
+ import { getCategories, getBlockTypes, getBlockFromExample, createBlock } from '@wordpress/blocks';
14
+ import { BlockPreview } from '@wordpress/block-editor';
15
+ import { closeSmall } from '@wordpress/icons';
16
+ import { useResizeObserver } from '@wordpress/compose';
17
+ import { useMemo, memo } from '@wordpress/element';
18
+ /**
19
+ * Internal dependencies
20
+ */
21
+
22
+ import { useStyle } from '../global-styles';
23
+ const SLOT_FILL_NAME = 'EditSiteStyleBook';
24
+ const {
25
+ Slot: StyleBookSlot,
26
+ Fill: StyleBookFill
27
+ } = createSlotFill(SLOT_FILL_NAME);
28
+
29
+ function getExamples() {
30
+ // Use our own example for the Heading block so that we can show multiple
31
+ // heading levels.
32
+ const headingsExample = {
33
+ name: 'core/heading',
34
+ title: __('Headings'),
35
+ category: 'text',
36
+ blocks: [createBlock('core/heading', {
37
+ content: __('Code Is Poetry'),
38
+ level: 1
39
+ }), createBlock('core/heading', {
40
+ content: __('Code Is Poetry'),
41
+ level: 2
42
+ }), createBlock('core/heading', {
43
+ content: __('Code Is Poetry'),
44
+ level: 3
45
+ }), createBlock('core/heading', {
46
+ content: __('Code Is Poetry'),
47
+ level: 4
48
+ }), createBlock('core/heading', {
49
+ content: __('Code Is Poetry'),
50
+ level: 5
51
+ })]
52
+ };
53
+ const otherExamples = getBlockTypes().filter(blockType => blockType.name !== 'core/heading' && !!blockType.example).map(blockType => ({
54
+ name: blockType.name,
55
+ title: blockType.title,
56
+ category: blockType.category,
57
+ blocks: getBlockFromExample(blockType.name, blockType.example)
58
+ }));
59
+ return [headingsExample, ...otherExamples];
60
+ }
61
+
62
+ function StyleBook(_ref) {
63
+ let {
64
+ isSelected,
65
+ onSelect,
66
+ onClose
67
+ } = _ref;
68
+ const [resizeObserver, sizes] = useResizeObserver();
69
+ const [textColor] = useStyle('color.text');
70
+ const [backgroundColor] = useStyle('color.background');
71
+ const examples = useMemo(getExamples, []);
72
+ const tabs = useMemo(() => getCategories().filter(category => examples.some(example => example.category === category.slug)).map(category => ({
73
+ name: category.slug,
74
+ title: category.title,
75
+ icon: category.icon
76
+ })), [examples]);
77
+ return createElement(StyleBookFill, null, createElement("section", {
78
+ className: classnames('edit-site-style-book', {
79
+ 'is-wide': sizes.width > 600
80
+ }),
81
+ style: {
82
+ color: textColor,
83
+ background: backgroundColor
84
+ },
85
+ "aria-label": __('Style Book')
86
+ }, resizeObserver, createElement(Button, {
87
+ className: "edit-site-style-book__close-button",
88
+ icon: closeSmall,
89
+ label: __('Close Style Book'),
90
+ onClick: onClose
91
+ }), createElement(TabPanel, {
92
+ className: "edit-site-style-book__tab-panel",
93
+ tabs: tabs
94
+ }, tab => createElement(Examples, {
95
+ examples: examples,
96
+ category: tab.name,
97
+ isSelected: isSelected,
98
+ onSelect: onSelect
99
+ }))));
100
+ }
101
+
102
+ const Examples = memo(_ref2 => {
103
+ let {
104
+ examples,
105
+ category,
106
+ isSelected,
107
+ onSelect
108
+ } = _ref2;
109
+ return createElement("div", {
110
+ className: "edit-site-style-book__examples"
111
+ }, examples.filter(example => example.category === category).map(example => createElement(Example, {
112
+ key: example.name,
113
+ title: example.title,
114
+ blocks: example.blocks,
115
+ isSelected: isSelected(example.name),
116
+ onClick: () => {
117
+ onSelect(example.name);
118
+ }
119
+ })));
120
+ });
121
+ const Example = memo(_ref3 => {
122
+ let {
123
+ title,
124
+ blocks,
125
+ isSelected,
126
+ onClick
127
+ } = _ref3;
128
+ return createElement("button", {
129
+ className: classnames('edit-site-style-book__example', {
130
+ 'is-selected': isSelected
131
+ }),
132
+ "aria-label": sprintf( // translators: %s: Title of a block, e.g. Heading.
133
+ __('Open %s styles in Styles panel'), title),
134
+ onClick: onClick
135
+ }, createElement("span", {
136
+ className: "edit-site-style-book__example-title"
137
+ }, title), createElement("div", {
138
+ className: "edit-site-style-book__example-preview"
139
+ }, createElement(BlockPreview, {
140
+ blocks: blocks,
141
+ viewportWidth: 0,
142
+ __experimentalStyles: [{
143
+ css: '.wp-block:first-child { margin-top: 0; }' + '.wp-block:last-child { margin-bottom: 0; }'
144
+ }]
145
+ })));
146
+ });
147
+
148
+ function useHasStyleBook() {
149
+ const fills = useSlotFills(SLOT_FILL_NAME);
150
+ return !!(fills !== null && fills !== void 0 && fills.length);
151
+ }
152
+
153
+ StyleBook.Slot = StyleBookSlot;
154
+ export default StyleBook;
155
+ export { useHasStyleBook };
156
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/style-book/index.js"],"names":["classnames","Button","TabPanel","createSlotFill","__experimentalUseSlotFills","useSlotFills","__","sprintf","getCategories","getBlockTypes","getBlockFromExample","createBlock","BlockPreview","closeSmall","useResizeObserver","useMemo","memo","useStyle","SLOT_FILL_NAME","Slot","StyleBookSlot","Fill","StyleBookFill","getExamples","headingsExample","name","title","category","blocks","content","level","otherExamples","filter","blockType","example","map","StyleBook","isSelected","onSelect","onClose","resizeObserver","sizes","textColor","backgroundColor","examples","tabs","some","slug","icon","width","color","background","tab","Examples","Example","onClick","css","useHasStyleBook","fills","length"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,MADD,EAECC,QAFD,EAGCC,cAHD,EAICC,0BAA0B,IAAIC,YAJ/B,QAKO,uBALP;AAMA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SACCC,aADD,EAECC,aAFD,EAGCC,mBAHD,EAICC,WAJD,QAKO,mBALP;AAMA,SAASC,YAAT,QAA6B,yBAA7B;AACA,SAASC,UAAT,QAA2B,kBAA3B;AACA,SAASC,iBAAT,QAAkC,oBAAlC;AACA,SAASC,OAAT,EAAkBC,IAAlB,QAA8B,oBAA9B;AAEA;AACA;AACA;;AACA,SAASC,QAAT,QAAyB,kBAAzB;AAEA,MAAMC,cAAc,GAAG,mBAAvB;AACA,MAAM;AAAEC,EAAAA,IAAI,EAAEC,aAAR;AAAuBC,EAAAA,IAAI,EAAEC;AAA7B,IACLnB,cAAc,CAAEe,cAAF,CADf;;AAGA,SAASK,WAAT,GAAuB;AACtB;AACA;AACA,QAAMC,eAAe,GAAG;AACvBC,IAAAA,IAAI,EAAE,cADiB;AAEvBC,IAAAA,KAAK,EAAEpB,EAAE,CAAE,UAAF,CAFc;AAGvBqB,IAAAA,QAAQ,EAAE,MAHa;AAIvBC,IAAAA,MAAM,EAAE,CACPjB,WA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AAA,OAAO,EAAG6B;AATX,KAWC;AAAM,IAAA,SAAS,EAAC;AAAhB,KAAwD7B,KAAxD,CAXD,EAYC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,YAAD;AACC,IAAA,MAAM,EAAGE,MADV;AAEC,IAAA,aAAa,EAAG,CAFjB;AAGC,IAAA,oBAAoB,EAAG,CACtB;AACC4B,MAAAA,GAAG,EACF,6CACA;AAHF,KADsB;AAHxB,IADD,CAZD,CADqB;AAAA,CAAF,CAApB;;AA6BA,SAASC,eAAT,GAA2B;AAC1B,QAAMC,KAAK,GAAGrD,YAAY,CAAEa,cAAF,CAA1B;AACA,SAAO,CAAC,EAAEwC,KAAF,aAAEA,KAAF,eAAEA,KAAK,CAAEC,MAAT,CAAR;AACA;;AAEDvB,SAAS,CAACjB,IAAV,GAAiBC,aAAjB;AACA,eAAegB,SAAf;AACA,SAASqB,eAAT","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tTabPanel,\n\tcreateSlotFill,\n\t__experimentalUseSlotFills as useSlotFills,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tgetCategories,\n\tgetBlockTypes,\n\tgetBlockFromExample,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport { BlockPreview } from '@wordpress/block-editor';\nimport { closeSmall } from '@wordpress/icons';\nimport { useResizeObserver } from '@wordpress/compose';\nimport { useMemo, memo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useStyle } from '../global-styles';\n\nconst SLOT_FILL_NAME = 'EditSiteStyleBook';\nconst { Slot: StyleBookSlot, Fill: StyleBookFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\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(\n\t\t\t( blockType ) =>\n\t\t\t\tblockType.name !== 'core/heading' && !! blockType.example\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( { isSelected, onSelect, onClose } ) {\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst [ textColor ] = useStyle( 'color.text' );\n\tconst [ backgroundColor ] = useStyle( '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\treturn (\n\t\t<StyleBookFill>\n\t\t\t<section\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} ) }\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\taria-label={ __( 'Style Book' ) }\n\t\t\t>\n\t\t\t\t{ resizeObserver }\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"edit-site-style-book__close-button\"\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close Style Book' ) }\n\t\t\t\t\tonClick={ onClose }\n\t\t\t\t/>\n\t\t\t\t<TabPanel\n\t\t\t\t\tclassName=\"edit-site-style-book__tab-panel\"\n\t\t\t\t\ttabs={ tabs }\n\t\t\t\t>\n\t\t\t\t\t{ ( tab ) => (\n\t\t\t\t\t\t<Examples\n\t\t\t\t\t\t\texamples={ examples }\n\t\t\t\t\t\t\tcategory={ tab.name }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</TabPanel>\n\t\t\t</section>\n\t\t</StyleBookFill>\n\t);\n}\n\nconst Examples = memo( ( { examples, category, isSelected, onSelect } ) => (\n\t<div className=\"edit-site-style-book__examples\">\n\t\t{ examples\n\t\t\t.filter( ( example ) => example.category === category )\n\t\t\t.map( ( example ) => (\n\t\t\t\t<Example\n\t\t\t\t\tkey={ example.name }\n\t\t\t\t\ttitle={ example.title }\n\t\t\t\t\tblocks={ example.blocks }\n\t\t\t\t\tisSelected={ isSelected( example.name ) }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonSelect( example.name );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) ) }\n\t</div>\n) );\n\nconst Example = memo( ( { title, blocks, isSelected, onClick } ) => (\n\t<button\n\t\tclassName={ classnames( 'edit-site-style-book__example', {\n\t\t\t'is-selected': isSelected,\n\t\t} ) }\n\t\taria-label={ sprintf(\n\t\t\t// translators: %s: Title of a block, e.g. Heading.\n\t\t\t__( 'Open %s styles in Styles panel' ),\n\t\t\ttitle\n\t\t) }\n\t\tonClick={ onClick }\n\t>\n\t\t<span className=\"edit-site-style-book__example-title\">{ title }</span>\n\t\t<div className=\"edit-site-style-book__example-preview\">\n\t\t\t<BlockPreview\n\t\t\t\tblocks={ blocks }\n\t\t\t\tviewportWidth={ 0 }\n\t\t\t\t__experimentalStyles={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tcss:\n\t\t\t\t\t\t\t'.wp-block:first-child { margin-top: 0; }' +\n\t\t\t\t\t\t\t'.wp-block:last-child { margin-bottom: 0; }',\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t</div>\n\t</button>\n) );\n\nfunction useHasStyleBook() {\n\tconst fills = useSlotFills( SLOT_FILL_NAME );\n\treturn !! fills?.length;\n}\n\nStyleBook.Slot = StyleBookSlot;\nexport default StyleBook;\nexport { useHasStyleBook };\n"]}
@@ -9,7 +9,7 @@ import { useDispatch } from '@wordpress/data';
9
9
 
10
10
  import { useLocation } from '../routes';
11
11
  import { store as editSiteStore } from '../../store';
12
- export default function URLQueryController() {
12
+ export default function useInitEditedEntityFromURL() {
13
13
  const {
14
14
  setTemplate,
15
15
  setTemplatePart,
@@ -23,6 +23,8 @@ export default function URLQueryController() {
23
23
  } = useLocation(); // Set correct entity on page navigation.
24
24
 
25
25
  useEffect(() => {
26
+ // This URL scheme mean we can't open a template part with the context of a given post.
27
+ // Potentially posts and pages could be moved to a "context" query string instead.
26
28
  if ('page' === postType || 'post' === postType) {
27
29
  setPage({
28
30
  context: {
@@ -36,6 +38,5 @@ export default function URLQueryController() {
36
38
  setTemplatePart(postId);
37
39
  }
38
40
  }, [postId, postType]);
39
- return null;
40
41
  }
41
- //# sourceMappingURL=index.js.map
42
+ //# sourceMappingURL=use-init-edited-entity-from-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js"],"names":["useEffect","useDispatch","useLocation","store","editSiteStore","useInitEditedEntityFromURL","setTemplate","setTemplatePart","setPage","params","postId","postType","context"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,oBAA1B;AACA,SAASC,WAAT,QAA4B,iBAA5B;AAEA;AACA;AACA;;AACA,SAASC,WAAT,QAA4B,WAA5B;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AAEA,eAAe,SAASC,0BAAT,GAAsC;AACpD,QAAM;AAAEC,IAAAA,WAAF;AAAeC,IAAAA,eAAf;AAAgCC,IAAAA;AAAhC,MACLP,WAAW,CAAEG,aAAF,CADZ;AAEA,QAAM;AACLK,IAAAA,MAAM,EAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV;AADH,MAEFT,WAAW,EAFf,CAHoD,CAOpD;;AACAF,EAAAA,SAAS,CAAE,MAAM;AAChB;AACA;AACA,QAAK,WAAWW,QAAX,IAAuB,WAAWA,QAAvC,EAAkD;AACjDH,MAAAA,OAAO,CAAE;AAAEI,QAAAA,OAAO,EAAE;AAAED,UAAAA,QAAF;AAAYD,UAAAA;AAAZ;AAAX,OAAF,CAAP,CADiD,CACH;AAC9C,KAFD,MAEO,IAAK,kBAAkBC,QAAvB,EAAkC;AACxCL,MAAAA,WAAW,CAAEI,MAAF,CAAX;AACA,KAFM,MAEA,IAAK,uBAAuBC,QAA5B,EAAuC;AAC7CJ,MAAAA,eAAe,CAAEG,MAAF,CAAf;AACA;AACD,GAVQ,EAUN,CAAEA,MAAF,EAAUC,QAAV,CAVM,CAAT;AAWA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useLocation } from '../routes';\nimport { store as editSiteStore } from '../../store';\n\nexport default function useInitEditedEntityFromURL() {\n\tconst { setTemplate, setTemplatePart, setPage } =\n\t\tuseDispatch( editSiteStore );\n\tconst {\n\t\tparams: { postId, postType },\n\t} = useLocation();\n\n\t// Set correct entity on page navigation.\n\tuseEffect( () => {\n\t\t// This URL scheme mean we can't open a template part with the context of a given post.\n\t\t// Potentially posts and pages could be moved to a \"context\" query string instead.\n\t\tif ( 'page' === postType || 'post' === postType ) {\n\t\t\tsetPage( { context: { postType, postId } } ); // Resolves correct template based on ID.\n\t\t} else if ( 'wp_template' === postType ) {\n\t\t\tsetTemplate( postId );\n\t\t} else if ( 'wp_template_part' === postType ) {\n\t\t\tsetTemplatePart( postId );\n\t\t}\n\t}, [ postId, postType ] );\n}\n"]}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __experimentalUseNavigator as useNavigator } from '@wordpress/components';
5
+ import { useEffect, useRef } from '@wordpress/element';
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+
10
+ import { useLocation, useHistory } from '../routes';
11
+ export default function useSyncSidebarPathWithURL() {
12
+ const history = useHistory();
13
+ const {
14
+ params
15
+ } = useLocation();
16
+ const {
17
+ sidebar = '/'
18
+ } = params;
19
+ const {
20
+ location,
21
+ goTo
22
+ } = useNavigator();
23
+ const currentSidebar = useRef(sidebar);
24
+ const currentNavigatorLocation = useRef(location.path);
25
+ useEffect(() => {
26
+ currentSidebar.current = sidebar;
27
+
28
+ if (sidebar !== currentNavigatorLocation.current) {
29
+ goTo(sidebar);
30
+ }
31
+ }, [sidebar]);
32
+ useEffect(() => {
33
+ currentNavigatorLocation.current = location.path;
34
+
35
+ if (location.path !== currentSidebar.current) {
36
+ history.push({ ...params,
37
+ sidebar: location.path
38
+ });
39
+ }
40
+ }, [location.path, history]);
41
+ return sidebar;
42
+ }
43
+ //# sourceMappingURL=use-sync-sidebar-path-with-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sync-state-with-url/use-sync-sidebar-path-with-url.js"],"names":["__experimentalUseNavigator","useNavigator","useEffect","useRef","useLocation","useHistory","useSyncSidebarPathWithURL","history","params","sidebar","location","goTo","currentSidebar","currentNavigatorLocation","path","current","push"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,0BAA0B,IAAIC,YAAvC,QAA2D,uBAA3D;AACA,SAASC,SAAT,EAAoBC,MAApB,QAAkC,oBAAlC;AAEA;AACA;AACA;;AACA,SAASC,WAAT,EAAsBC,UAAtB,QAAwC,WAAxC;AAEA,eAAe,SAASC,yBAAT,GAAqC;AACnD,QAAMC,OAAO,GAAGF,UAAU,EAA1B;AACA,QAAM;AAAEG,IAAAA;AAAF,MAAaJ,WAAW,EAA9B;AACA,QAAM;AAAEK,IAAAA,OAAO,GAAG;AAAZ,MAAoBD,MAA1B;AACA,QAAM;AAAEE,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAqBV,YAAY,EAAvC;AACA,QAAMW,cAAc,GAAGT,MAAM,CAAEM,OAAF,CAA7B;AACA,QAAMI,wBAAwB,GAAGV,MAAM,CAAEO,QAAQ,CAACI,IAAX,CAAvC;AACAZ,EAAAA,SAAS,CAAE,MAAM;AAChBU,IAAAA,cAAc,CAACG,OAAf,GAAyBN,OAAzB;;AACA,QAAKA,OAAO,KAAKI,wBAAwB,CAACE,OAA1C,EAAoD;AACnDJ,MAAAA,IAAI,CAAEF,OAAF,CAAJ;AACA;AACD,GALQ,EAKN,CAAEA,OAAF,CALM,CAAT;AAMAP,EAAAA,SAAS,CAAE,MAAM;AAChBW,IAAAA,wBAAwB,CAACE,OAAzB,GAAmCL,QAAQ,CAACI,IAA5C;;AACA,QAAKJ,QAAQ,CAACI,IAAT,KAAkBF,cAAc,CAACG,OAAtC,EAAgD;AAC/CR,MAAAA,OAAO,CAACS,IAAR,CAAc,EACb,GAAGR,MADU;AAEbC,QAAAA,OAAO,EAAEC,QAAQ,CAACI;AAFL,OAAd;AAIA;AACD,GARQ,EAQN,CAAEJ,QAAQ,CAACI,IAAX,EAAiBP,OAAjB,CARM,CAAT;AAUA,SAAOE,OAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useLocation, useHistory } from '../routes';\n\nexport default function useSyncSidebarPathWithURL() {\n\tconst history = useHistory();\n\tconst { params } = useLocation();\n\tconst { sidebar = '/' } = params;\n\tconst { location, goTo } = useNavigator();\n\tconst currentSidebar = useRef( sidebar );\n\tconst currentNavigatorLocation = useRef( location.path );\n\tuseEffect( () => {\n\t\tcurrentSidebar.current = sidebar;\n\t\tif ( sidebar !== currentNavigatorLocation.current ) {\n\t\t\tgoTo( sidebar );\n\t\t}\n\t}, [ sidebar ] );\n\tuseEffect( () => {\n\t\tcurrentNavigatorLocation.current = location.path;\n\t\tif ( location.path !== currentSidebar.current ) {\n\t\t\thistory.push( {\n\t\t\t\t...params,\n\t\t\t\tsidebar: location.path,\n\t\t\t} );\n\t\t}\n\t}, [ location.path, history ] );\n\n\treturn sidebar;\n}\n"]}
@@ -5,15 +5,12 @@ import { createElement } from "@wordpress/element";
5
5
  */
6
6
  import { store as blocksStore } from '@wordpress/blocks';
7
7
  import { registerCoreBlocks, __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';
8
- import { dispatch, select } from '@wordpress/data';
8
+ import { dispatch } from '@wordpress/data';
9
9
  import { render, unmountComponentAtNode } from '@wordpress/element';
10
10
  import { __experimentalFetchLinkSuggestions as fetchLinkSuggestions, __experimentalFetchUrlData as fetchUrlData } from '@wordpress/core-data';
11
11
  import { store as editorStore } from '@wordpress/editor';
12
12
  import { store as interfaceStore } from '@wordpress/interface';
13
13
  import { store as preferencesStore } from '@wordpress/preferences';
14
- import { __ } from '@wordpress/i18n';
15
- import { store as viewportStore } from '@wordpress/viewport';
16
- import { getQueryArgs } from '@wordpress/url';
17
14
  import { addFilter } from '@wordpress/hooks';
18
15
  /**
19
16
  * Internal dependencies
@@ -21,9 +18,7 @@ import { addFilter } from '@wordpress/hooks';
21
18
 
22
19
  import './hooks';
23
20
  import { store as editSiteStore } from './store';
24
- import EditSiteApp from './components/app';
25
- import getIsListPage from './utils/get-is-list-page';
26
- import ErrorBoundaryWarning from './components/error-boundary/warning';
21
+ import App from './components/app';
27
22
  /**
28
23
  * Reinitializes the editor after the user chooses to reboot the editor after
29
24
  * an unhandled error occurs, replacing previously mounted editor element using
@@ -34,16 +29,6 @@ import ErrorBoundaryWarning from './components/error-boundary/warning';
34
29
  */
35
30
 
36
31
  export function reinitializeEditor(target, settings) {
37
- // Display warning if editor wasn't able to resolve homepage template.
38
- if (!settings.__unstableHomeTemplate) {
39
- var _settings$__experimen;
40
-
41
- render(createElement(ErrorBoundaryWarning, {
42
- message: __('The editor is unable to find a block template for the homepage.'),
43
- dashboardLink: (_settings$__experimen = settings.__experimentalDashboardLink) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : 'index.php'
44
- }), target);
45
- return;
46
- }
47
32
  /*
48
33
  * Prevent adding the Clasic block in the site editor.
49
34
  * Only add the filter when the site editor is initialized, not imported.
@@ -53,8 +38,6 @@ export function reinitializeEditor(target, settings) {
53
38
  * This usage here is inspired by previous usage of the filter in the post editor:
54
39
  * https://github.com/WordPress/gutenberg/pull/37157
55
40
  */
56
-
57
-
58
41
  addFilter('blockEditor.__unstableCanInsertBlockType', 'removeClassicBlockFromInserter', (canInsert, blockType) => {
59
42
  if (blockType.name === 'core/freeform') {
60
43
  return false;
@@ -76,12 +59,7 @@ export function reinitializeEditor(target, settings) {
76
59
  welcomeGuide: true,
77
60
  welcomeGuideStyles: true,
78
61
  showListViewByDefault: false
79
- }); // Check if the block list view should be open by default.
80
-
81
- if (select(preferencesStore).get('core/edit-site', 'showListViewByDefault')) {
82
- dispatch(editSiteStore).setIsListViewOpened(true);
83
- }
84
-
62
+ });
85
63
  dispatch(interfaceStore).setDefaultComplementaryArea('core/edit-site', 'edit-site/template');
86
64
  dispatch(editSiteStore).updateSettings(settings); // Keep the defaultTemplateTypes in the core/editor settings too,
87
65
  // so that they can be selected with core/editor selectors in any editor.
@@ -92,20 +70,12 @@ export function reinitializeEditor(target, settings) {
92
70
  defaultTemplateTypes: settings.defaultTemplateTypes,
93
71
  defaultTemplatePartAreas: settings.defaultTemplatePartAreas
94
72
  });
95
- const isLandingOnListPage = getIsListPage(getQueryArgs(window.location.href));
96
-
97
- if (isLandingOnListPage) {
98
- // Default the navigation panel to be opened when we're in a bigger
99
- // screen and land in the list screen.
100
- dispatch(editSiteStore).setIsNavigationPanelOpened(select(viewportStore).isViewportMatch('medium'));
101
- }
102
73
  } // Prevent the default browser action for files dropped outside of dropzones.
103
74
 
104
75
  window.addEventListener('dragover', e => e.preventDefault(), false);
105
76
  window.addEventListener('drop', e => e.preventDefault(), false);
106
- render(createElement(EditSiteApp, {
107
- reboot: reboot,
108
- homeTemplate: settings.__unstableHomeTemplate
77
+ render(createElement(App, {
78
+ reboot: reboot
109
79
  }), target);
110
80
  }
111
81
  /**
@@ -133,7 +103,6 @@ export function initializeEditor(id, settings) {
133
103
 
134
104
  reinitializeEditor(target, settings);
135
105
  }
136
- export { default as __experimentalNavigationToggle } from './components/navigation-sidebar/navigation-toggle';
137
106
  export { default as PluginSidebar } from './components/sidebar-edit-mode/plugin-sidebar';
138
107
  export { default as PluginSidebarMoreMenuItem } from './components/header-edit-mode/plugin-sidebar-more-menu-item';
139
108
  export { default as PluginMoreMenuItem } from './components/header-edit-mode/plugin-more-menu-item';
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","select","render","unmountComponentAtNode","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","editorStore","interfaceStore","preferencesStore","__","viewportStore","getQueryArgs","addFilter","editSiteStore","EditSiteApp","getIsListPage","ErrorBoundaryWarning","reinitializeEditor","target","settings","__unstableHomeTemplate","__experimentalDashboardLink","canInsert","blockType","name","reboot","bind","setDefaults","editorMode","fixedToolbar","focusMode","keepCaretInsideBlock","welcomeGuide","welcomeGuideStyles","showListViewByDefault","get","setIsListViewOpened","setDefaultComplementaryArea","updateSettings","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","isLandingOnListPage","window","location","href","setIsNavigationPanelOpened","isViewportMatch","addEventListener","e","preventDefault","initializeEditor","id","search","searchOptions","__experimentalFetchRichUrlData","document","getElementById","__experimentalReapplyBlockTypeFilters","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","default","__experimentalNavigationToggle","PluginSidebar","PluginSidebarMoreMenuItem","PluginMoreMenuItem"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SACCC,kBADD,EAECC,4CAFD,QAGO,0BAHP;AAIA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,iBAAjC;AACA,SAASC,MAAT,EAAiBC,sBAAjB,QAA+C,oBAA/C;AACA,SACCC,kCAAkC,IAAIC,oBADvC,EAECC,0BAA0B,IAAIC,YAF/B,QAGO,sBAHP;AAIA,SAASX,KAAK,IAAIY,WAAlB,QAAqC,mBAArC;AACA,SAASZ,KAAK,IAAIa,cAAlB,QAAwC,sBAAxC;AACA,SAASb,KAAK,IAAIc,gBAAlB,QAA0C,wBAA1C;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASf,KAAK,IAAIgB,aAAlB,QAAuC,qBAAvC;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,SAAT,QAA0B,kBAA1B;AAEA;AACA;AACA;;AACA,OAAO,SAAP;AACA,SAASlB,KAAK,IAAImB,aAAlB,QAAuC,SAAvC;AACA,OAAOC,WAAP,MAAwB,kBAAxB;AACA,OAAOC,aAAP,MAA0B,0BAA1B;AACA,OAAOC,oBAAP,MAAiC,qC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CAAEmD,MAAF,EAAUC,aAAV,KAC7CnD,oBAAoB,CAAEkD,MAAF,EAAUC,aAAV,EAAyBnC,QAAzB,CADrB;;AAEAA,EAAAA,QAAQ,CAACoC,8BAAT,GAA0ClD,YAA1C;AAEA,QAAMa,MAAM,GAAGsC,QAAQ,CAACC,cAAT,CAAyBL,EAAzB,CAAf;;AAEAtD,EAAAA,QAAQ,CAAEH,WAAF,CAAR,CAAwB+D,qCAAxB;;AACA9D,EAAAA,kBAAkB;;AAClB,MAAK+D,OAAO,CAACC,GAAR,CAAYC,mBAAjB,EAAuC;AACtChE,IAAAA,4CAA4C,CAAE;AAC7CiE,MAAAA,eAAe,EAAE;AAD4B,KAAF,CAA5C;AAGA;;AAED7C,EAAAA,kBAAkB,CAAEC,MAAF,EAAUC,QAAV,CAAlB;AACA;AAED,SAAS4C,OAAO,IAAIC,8BAApB,QAA0D,mDAA1D;AACA,SAASD,OAAO,IAAIE,aAApB,QAAyC,+CAAzC;AACA,SAASF,OAAO,IAAIG,yBAApB,QAAqD,6DAArD;AACA,SAASH,OAAO,IAAII,kBAApB,QAA8C,qDAA9C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch, select } from '@wordpress/data';\nimport { render, unmountComponentAtNode } from '@wordpress/element';\nimport {\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\nimport { store as viewportStore } from '@wordpress/viewport';\nimport { getQueryArgs } from '@wordpress/url';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport EditSiteApp from './components/app';\nimport getIsListPage from './utils/get-is-list-page';\nimport ErrorBoundaryWarning from './components/error-boundary/warning';\n\n/**\n * Reinitializes the editor after the user chooses to reboot the editor after\n * an unhandled error occurs, replacing previously mounted editor element using\n * an initial state from prior to the crash.\n *\n * @param {Element} target DOM node in which editor is rendered.\n * @param {?Object} settings Editor settings object.\n */\nexport function reinitializeEditor( target, settings ) {\n\t// Display warning if editor wasn't able to resolve homepage template.\n\tif ( ! settings.__unstableHomeTemplate ) {\n\t\trender(\n\t\t\t<ErrorBoundaryWarning\n\t\t\t\tmessage={ __(\n\t\t\t\t\t'The editor is unable to find a block template for the homepage.'\n\t\t\t\t) }\n\t\t\t\tdashboardLink={\n\t\t\t\t\tsettings.__experimentalDashboardLink ?? 'index.php'\n\t\t\t\t}\n\t\t\t/>,\n\t\t\ttarget\n\t\t);\n\t\treturn;\n\t}\n\n\t/*\n\t * Prevent adding the Clasic block in the site editor.\n\t * Only add the filter when the site editor is initialized, not imported.\n\t * Also only add the filter(s) after registerCoreBlocks()\n\t * so that common filters in the block library are not overwritten.\n\t *\n\t * This usage here is inspired by previous usage of the filter in the post editor:\n\t * https://github.com/WordPress/gutenberg/pull/37157\n\t */\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeClassicBlockFromInserter',\n\t\t( canInsert, blockType ) => {\n\t\t\tif ( blockType.name === 'core/freeform' ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn canInsert;\n\t\t}\n\t);\n\n\t// This will be a no-op if the target doesn't have any React nodes.\n\tunmountComponentAtNode( target );\n\tconst reboot = reinitializeEditor.bind( null, target, settings );\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\t{\n\t\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\t\teditorMode: 'visual',\n\t\t\tfixedToolbar: false,\n\t\t\tfocusMode: false,\n\t\t\tkeepCaretInsideBlock: false,\n\t\t\twelcomeGuide: true,\n\t\t\twelcomeGuideStyles: true,\n\t\t\tshowListViewByDefault: false,\n\t\t} );\n\n\t\t// Check if the block list view should be open by default.\n\t\tif (\n\t\t\tselect( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'showListViewByDefault'\n\t\t\t)\n\t\t) {\n\t\t\tdispatch( editSiteStore ).setIsListViewOpened( true );\n\t\t}\n\n\t\tdispatch( interfaceStore ).setDefaultComplementaryArea(\n\t\t\t'core/edit-site',\n\t\t\t'edit-site/template'\n\t\t);\n\n\t\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t\t// so that they can be selected with core/editor selectors in any editor.\n\t\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t\t// which internally uses updateEditorSettings as well.\n\t\tdispatch( editorStore ).updateEditorSettings( {\n\t\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t\t} );\n\n\t\tconst isLandingOnListPage = getIsListPage(\n\t\t\tgetQueryArgs( window.location.href )\n\t\t);\n\n\t\tif ( isLandingOnListPage ) {\n\t\t\t// Default the navigation panel to be opened when we're in a bigger\n\t\t\t// screen and land in the list screen.\n\t\t\tdispatch( editSiteStore ).setIsNavigationPanelOpened(\n\t\t\t\tselect( viewportStore ).isViewportMatch( 'medium' )\n\t\t\t);\n\t\t}\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\trender(\n\t\t<EditSiteApp\n\t\t\treboot={ reboot }\n\t\t\thomeTemplate={ settings.__unstableHomeTemplate }\n\t\t/>,\n\t\ttarget\n\t);\n}\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\n\tsettings.__experimentalFetchRichUrlData = fetchUrlData;\n\n\tconst target = document.getElementById( id );\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\tregisterCoreBlocks();\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\treinitializeEditor( target, settings );\n}\n\nexport { default as __experimentalNavigationToggle } from './components/navigation-sidebar/navigation-toggle';\nexport { default as PluginSidebar } from './components/sidebar-edit-mode/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header-edit-mode/plugin-sidebar-more-menu-item';\nexport { default as PluginMoreMenuItem } from './components/header-edit-mode/plugin-more-menu-item';\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","render","unmountComponentAtNode","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","editorStore","interfaceStore","preferencesStore","addFilter","editSiteStore","App","reinitializeEditor","target","settings","canInsert","blockType","name","reboot","bind","setDefaults","editorMode","fixedToolbar","focusMode","keepCaretInsideBlock","welcomeGuide","welcomeGuideStyles","showListViewByDefault","setDefaultComplementaryArea","updateSettings","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","initializeEditor","id","search","searchOptions","__experimentalFetchRichUrlData","document","getElementById","__experimentalReapplyBlockTypeFilters","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","default","PluginSidebar","PluginSidebarMoreMenuItem","PluginMoreMenuItem"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SACCC,kBADD,EAECC,4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A/C,EAAAA,kBAAkB;;AAClB,MAAKgD,OAAO,CAACC,GAAR,CAAYC,mBAAjB,EAAuC;AACtCjD,IAAAA,4CAA4C,CAAE;AAC7CkD,MAAAA,eAAe,EAAE;AAD4B,KAAF,CAA5C;AAGA;;AAEDpC,EAAAA,kBAAkB,CAAEC,MAAF,EAAUC,QAAV,CAAlB;AACA;AAED,SAASmC,OAAO,IAAIC,aAApB,QAAyC,+CAAzC;AACA,SAASD,OAAO,IAAIE,yBAApB,QAAqD,6DAArD;AACA,SAASF,OAAO,IAAIG,kBAApB,QAA8C,qDAA9C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport { render, unmountComponentAtNode } from '@wordpress/element';\nimport {\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport App from './components/app';\n\n/**\n * Reinitializes the editor after the user chooses to reboot the editor after\n * an unhandled error occurs, replacing previously mounted editor element using\n * an initial state from prior to the crash.\n *\n * @param {Element} target DOM node in which editor is rendered.\n * @param {?Object} settings Editor settings object.\n */\nexport function reinitializeEditor( target, settings ) {\n\t/*\n\t * Prevent adding the Clasic block in the site editor.\n\t * Only add the filter when the site editor is initialized, not imported.\n\t * Also only add the filter(s) after registerCoreBlocks()\n\t * so that common filters in the block library are not overwritten.\n\t *\n\t * This usage here is inspired by previous usage of the filter in the post editor:\n\t * https://github.com/WordPress/gutenberg/pull/37157\n\t */\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeClassicBlockFromInserter',\n\t\t( canInsert, blockType ) => {\n\t\t\tif ( blockType.name === 'core/freeform' ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn canInsert;\n\t\t}\n\t);\n\n\t// This will be a no-op if the target doesn't have any React nodes.\n\tunmountComponentAtNode( target );\n\tconst reboot = reinitializeEditor.bind( null, target, settings );\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\t{\n\t\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\t\teditorMode: 'visual',\n\t\t\tfixedToolbar: false,\n\t\t\tfocusMode: false,\n\t\t\tkeepCaretInsideBlock: false,\n\t\t\twelcomeGuide: true,\n\t\t\twelcomeGuideStyles: true,\n\t\t\tshowListViewByDefault: false,\n\t\t} );\n\n\t\tdispatch( interfaceStore ).setDefaultComplementaryArea(\n\t\t\t'core/edit-site',\n\t\t\t'edit-site/template'\n\t\t);\n\n\t\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t\t// so that they can be selected with core/editor selectors in any editor.\n\t\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t\t// which internally uses updateEditorSettings as well.\n\t\tdispatch( editorStore ).updateEditorSettings( {\n\t\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\trender( <App reboot={ reboot } />, target );\n}\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\n\tsettings.__experimentalFetchRichUrlData = fetchUrlData;\n\n\tconst target = document.getElementById( id );\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\tregisterCoreBlocks();\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\treinitializeEditor( target, settings );\n}\n\nexport { default as PluginSidebar } from './components/sidebar-edit-mode/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header-edit-mode/plugin-sidebar-more-menu-item';\nexport { default as PluginMoreMenuItem } from './components/header-edit-mode/plugin-more-menu-item';\n"]}