@wordpress/edit-site 3.0.7 → 3.0.11

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 (380) hide show
  1. package/build/components/add-new-template/index.js +49 -0
  2. package/build/components/add-new-template/index.js.map +1 -0
  3. package/build/components/add-new-template/new-template-part.js +78 -0
  4. package/build/components/add-new-template/new-template-part.js.map +1 -0
  5. package/build/components/add-new-template/new-template.js +114 -0
  6. package/build/components/add-new-template/new-template.js.map +1 -0
  7. package/build/components/block-editor/block-inspector-button.js +4 -3
  8. package/build/components/block-editor/block-inspector-button.js.map +1 -1
  9. package/build/components/block-editor/index.js +12 -8
  10. package/build/components/block-editor/index.js.map +1 -1
  11. package/build/components/block-editor/resizable-editor.js +6 -5
  12. package/build/components/block-editor/resizable-editor.js.map +1 -1
  13. package/build/components/block-editor/resize-handle.js +6 -4
  14. package/build/components/block-editor/resize-handle.js.map +1 -1
  15. package/build/components/create-template-part-modal/index.js +115 -0
  16. package/build/components/create-template-part-modal/index.js.map +1 -0
  17. package/build/components/edit-template-part-menu-button/index.js +15 -11
  18. package/build/components/edit-template-part-menu-button/index.js.map +1 -1
  19. package/build/components/editor/index.js +25 -20
  20. package/build/components/editor/index.js.map +1 -1
  21. package/build/components/error-boundary/index.js +5 -4
  22. package/build/components/error-boundary/index.js.map +1 -1
  23. package/build/components/global-styles/border-panel.js +5 -4
  24. package/build/components/global-styles/border-panel.js.map +1 -1
  25. package/build/components/global-styles/color-palette-panel.js +33 -9
  26. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  27. package/build/components/global-styles/context-menu.js +5 -4
  28. package/build/components/global-styles/context-menu.js.map +1 -1
  29. package/build/components/global-styles/dimensions-panel.js +5 -4
  30. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  31. package/build/components/global-styles/global-styles-provider.js +11 -46
  32. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  33. package/build/components/global-styles/header.js +6 -5
  34. package/build/components/global-styles/header.js.map +1 -1
  35. package/build/components/global-styles/hooks.js +34 -30
  36. package/build/components/global-styles/hooks.js.map +1 -1
  37. package/build/components/global-styles/index.js +6 -6
  38. package/build/components/global-styles/navigation-button.js +8 -7
  39. package/build/components/global-styles/navigation-button.js.map +1 -1
  40. package/build/components/global-styles/palette.js +13 -9
  41. package/build/components/global-styles/palette.js.map +1 -1
  42. package/build/components/global-styles/screen-background-color.js +4 -3
  43. package/build/components/global-styles/screen-background-color.js.map +1 -1
  44. package/build/components/global-styles/screen-block-list.js +13 -4
  45. package/build/components/global-styles/screen-block-list.js.map +1 -1
  46. package/build/components/global-styles/screen-block.js +4 -3
  47. package/build/components/global-styles/screen-block.js.map +1 -1
  48. package/build/components/global-styles/screen-color-palette.js +4 -3
  49. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  50. package/build/components/global-styles/screen-colors.js +19 -15
  51. package/build/components/global-styles/screen-colors.js.map +1 -1
  52. package/build/components/global-styles/screen-layout.js +8 -5
  53. package/build/components/global-styles/screen-layout.js.map +1 -1
  54. package/build/components/global-styles/screen-link-color.js +4 -3
  55. package/build/components/global-styles/screen-link-color.js.map +1 -1
  56. package/build/components/global-styles/screen-text-color.js +4 -3
  57. package/build/components/global-styles/screen-text-color.js.map +1 -1
  58. package/build/components/global-styles/screen-typography.js +4 -3
  59. package/build/components/global-styles/screen-typography.js.map +1 -1
  60. package/build/components/global-styles/subtitle.js +4 -3
  61. package/build/components/global-styles/subtitle.js.map +1 -1
  62. package/build/components/global-styles/typography-panel.js +10 -8
  63. package/build/components/global-styles/typography-panel.js.map +1 -1
  64. package/build/components/global-styles/ui.js +4 -3
  65. package/build/components/global-styles/ui.js.map +1 -1
  66. package/build/components/global-styles/use-global-styles-output.js +61 -44
  67. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  68. package/build/components/global-styles/utils.js +4 -3
  69. package/build/components/global-styles/utils.js.map +1 -1
  70. package/build/components/header/document-actions/index.js +23 -19
  71. package/build/components/header/document-actions/index.js.map +1 -1
  72. package/build/components/header/feature-toggle/index.js +9 -7
  73. package/build/components/header/feature-toggle/index.js.map +1 -1
  74. package/build/components/header/index.js +15 -15
  75. package/build/components/header/index.js.map +1 -1
  76. package/build/components/header/more-menu/index.js +30 -27
  77. package/build/components/header/more-menu/index.js.map +1 -1
  78. package/build/components/header/tools-more-menu-group/index.js +10 -7
  79. package/build/components/header/tools-more-menu-group/index.js.map +1 -1
  80. package/build/components/keyboard-shortcuts/index.js +30 -3
  81. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  82. package/build/components/list/header.js +50 -0
  83. package/build/components/list/header.js.map +1 -0
  84. package/build/components/list/index.js +87 -0
  85. package/build/components/list/index.js.map +1 -0
  86. package/build/components/list/table.js +127 -0
  87. package/build/components/list/table.js.map +1 -0
  88. package/build/components/list/use-register-shortcuts.js +52 -0
  89. package/build/components/list/use-register-shortcuts.js.map +1 -0
  90. package/build/components/main-dashboard-button/index.js +4 -3
  91. package/build/components/main-dashboard-button/index.js.map +1 -1
  92. package/build/components/navigate-to-link/index.js +7 -6
  93. package/build/components/navigate-to-link/index.js.map +1 -1
  94. package/build/components/navigation-sidebar/index.js +25 -10
  95. package/build/components/navigation-sidebar/index.js.map +1 -1
  96. package/build/components/navigation-sidebar/navigation-panel/constants.js +1 -1
  97. package/build/components/navigation-sidebar/navigation-panel/content-navigation-item.js +4 -3
  98. package/build/components/navigation-sidebar/navigation-panel/content-navigation-item.js.map +1 -1
  99. package/build/components/navigation-sidebar/navigation-panel/index.js +37 -55
  100. package/build/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
  101. package/build/components/navigation-sidebar/navigation-panel/menus/template-parts-sub.js +6 -5
  102. package/build/components/navigation-sidebar/navigation-panel/menus/template-parts-sub.js.map +1 -1
  103. package/build/components/navigation-sidebar/navigation-panel/menus/template-parts.js +26 -20
  104. package/build/components/navigation-sidebar/navigation-panel/menus/template-parts.js.map +1 -1
  105. package/build/components/navigation-sidebar/navigation-panel/menus/templates-sub.js +17 -10
  106. package/build/components/navigation-sidebar/navigation-panel/menus/templates-sub.js.map +1 -1
  107. package/build/components/navigation-sidebar/navigation-panel/menus/templates.js +11 -5
  108. package/build/components/navigation-sidebar/navigation-panel/menus/templates.js.map +1 -1
  109. package/build/components/navigation-sidebar/navigation-panel/navigation-entity-items.js +13 -11
  110. package/build/components/navigation-sidebar/navigation-panel/navigation-entity-items.js.map +1 -1
  111. package/build/components/navigation-sidebar/navigation-panel/new-template-dropdown.js +24 -18
  112. package/build/components/navigation-sidebar/navigation-panel/new-template-dropdown.js.map +1 -1
  113. package/build/components/navigation-sidebar/navigation-panel/search-results.js +14 -11
  114. package/build/components/navigation-sidebar/navigation-panel/search-results.js.map +1 -1
  115. package/build/components/navigation-sidebar/navigation-panel/template-hierarchy.js +8 -5
  116. package/build/components/navigation-sidebar/navigation-panel/template-hierarchy.js.map +1 -1
  117. package/build/components/navigation-sidebar/navigation-panel/template-navigation-item.js +4 -3
  118. package/build/components/navigation-sidebar/navigation-panel/template-navigation-item.js.map +1 -1
  119. package/build/components/navigation-sidebar/navigation-panel/template-preview.js +5 -4
  120. package/build/components/navigation-sidebar/navigation-panel/template-preview.js.map +1 -1
  121. package/build/components/navigation-sidebar/navigation-toggle/index.js +7 -27
  122. package/build/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
  123. package/build/components/save-button/index.js +5 -4
  124. package/build/components/save-button/index.js.map +1 -1
  125. package/build/components/sidebar/constants.js +1 -1
  126. package/build/components/sidebar/default-sidebar.js +11 -10
  127. package/build/components/sidebar/default-sidebar.js.map +1 -1
  128. package/build/components/sidebar/plugin-sidebar/index.js +5 -4
  129. package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
  130. package/build/components/sidebar/settings-header/index.js +4 -3
  131. package/build/components/sidebar/settings-header/index.js.map +1 -1
  132. package/build/components/sidebar/template-card/template-areas.js +17 -13
  133. package/build/components/sidebar/template-card/template-areas.js.map +1 -1
  134. package/build/components/template-details/index.js +14 -9
  135. package/build/components/template-details/index.js.map +1 -1
  136. package/build/components/template-details/template-areas.js +38 -29
  137. package/build/components/template-details/template-areas.js.map +1 -1
  138. package/build/components/template-part-converter/convert-to-regular.js +15 -11
  139. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  140. package/build/components/template-part-converter/convert-to-template-part.js +29 -86
  141. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  142. package/build/components/welcome-guide/editor.js +58 -0
  143. package/build/components/welcome-guide/editor.js.map +1 -0
  144. package/build/components/welcome-guide/image.js +27 -0
  145. package/build/components/welcome-guide/image.js.map +1 -0
  146. package/build/components/welcome-guide/index.js +49 -0
  147. package/build/components/welcome-guide/index.js.map +1 -0
  148. package/build/components/welcome-guide/styles.js +83 -0
  149. package/build/components/welcome-guide/styles.js.map +1 -0
  150. package/build/index.js +40 -16
  151. package/build/index.js.map +1 -1
  152. package/build/plugins/index.js +4 -2
  153. package/build/plugins/index.js.map +1 -1
  154. package/build/plugins/welcome-guide-menu-item.js +39 -0
  155. package/build/plugins/welcome-guide-menu-item.js.map +1 -0
  156. package/build/store/actions.js +24 -24
  157. package/build/store/actions.js.map +1 -1
  158. package/build/store/constants.js +1 -1
  159. package/build/store/defaults.js +4 -1
  160. package/build/store/defaults.js.map +1 -1
  161. package/build/store/index.js +5 -3
  162. package/build/store/index.js.map +1 -1
  163. package/build/store/reducer.js +36 -14
  164. package/build/store/reducer.js.map +1 -1
  165. package/build/store/selectors.js +27 -19
  166. package/build/store/selectors.js.map +1 -1
  167. package/build/utils/is-template-removable.js +21 -0
  168. package/build/utils/is-template-removable.js.map +1 -0
  169. package/build-module/components/add-new-template/index.js +36 -0
  170. package/build-module/components/add-new-template/index.js.map +1 -0
  171. package/build-module/components/add-new-template/new-template-part.js +65 -0
  172. package/build-module/components/add-new-template/new-template-part.js.map +1 -0
  173. package/build-module/components/add-new-template/new-template.js +97 -0
  174. package/build-module/components/add-new-template/new-template.js.map +1 -0
  175. package/build-module/components/block-editor/block-inspector-button.js +4 -3
  176. package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
  177. package/build-module/components/block-editor/index.js +12 -8
  178. package/build-module/components/block-editor/index.js.map +1 -1
  179. package/build-module/components/block-editor/resizable-editor.js +6 -5
  180. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  181. package/build-module/components/block-editor/resize-handle.js +6 -4
  182. package/build-module/components/block-editor/resize-handle.js.map +1 -1
  183. package/build-module/components/create-template-part-modal/index.js +102 -0
  184. package/build-module/components/create-template-part-modal/index.js.map +1 -0
  185. package/build-module/components/edit-template-part-menu-button/index.js +15 -11
  186. package/build-module/components/edit-template-part-menu-button/index.js.map +1 -1
  187. package/build-module/components/editor/index.js +24 -21
  188. package/build-module/components/editor/index.js.map +1 -1
  189. package/build-module/components/error-boundary/index.js +5 -4
  190. package/build-module/components/error-boundary/index.js.map +1 -1
  191. package/build-module/components/global-styles/border-panel.js +4 -3
  192. package/build-module/components/global-styles/border-panel.js.map +1 -1
  193. package/build-module/components/global-styles/color-palette-panel.js +33 -10
  194. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  195. package/build-module/components/global-styles/context-menu.js +5 -4
  196. package/build-module/components/global-styles/context-menu.js.map +1 -1
  197. package/build-module/components/global-styles/dimensions-panel.js +4 -3
  198. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  199. package/build-module/components/global-styles/global-styles-provider.js +12 -42
  200. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  201. package/build-module/components/global-styles/header.js +6 -5
  202. package/build-module/components/global-styles/header.js.map +1 -1
  203. package/build-module/components/global-styles/hooks.js +32 -28
  204. package/build-module/components/global-styles/hooks.js.map +1 -1
  205. package/build-module/components/global-styles/navigation-button.js +8 -7
  206. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  207. package/build-module/components/global-styles/palette.js +13 -9
  208. package/build-module/components/global-styles/palette.js.map +1 -1
  209. package/build-module/components/global-styles/screen-background-color.js +4 -3
  210. package/build-module/components/global-styles/screen-background-color.js.map +1 -1
  211. package/build-module/components/global-styles/screen-block-list.js +11 -4
  212. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  213. package/build-module/components/global-styles/screen-block.js +4 -3
  214. package/build-module/components/global-styles/screen-block.js.map +1 -1
  215. package/build-module/components/global-styles/screen-color-palette.js +4 -3
  216. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  217. package/build-module/components/global-styles/screen-colors.js +19 -15
  218. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  219. package/build-module/components/global-styles/screen-layout.js +4 -3
  220. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  221. package/build-module/components/global-styles/screen-link-color.js +4 -3
  222. package/build-module/components/global-styles/screen-link-color.js.map +1 -1
  223. package/build-module/components/global-styles/screen-text-color.js +4 -3
  224. package/build-module/components/global-styles/screen-text-color.js.map +1 -1
  225. package/build-module/components/global-styles/screen-typography.js +4 -3
  226. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  227. package/build-module/components/global-styles/subtitle.js +4 -3
  228. package/build-module/components/global-styles/subtitle.js.map +1 -1
  229. package/build-module/components/global-styles/typography-panel.js +9 -7
  230. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  231. package/build-module/components/global-styles/ui.js +4 -3
  232. package/build-module/components/global-styles/ui.js.map +1 -1
  233. package/build-module/components/global-styles/use-global-styles-output.js +60 -43
  234. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  235. package/build-module/components/global-styles/utils.js +3 -2
  236. package/build-module/components/global-styles/utils.js.map +1 -1
  237. package/build-module/components/header/document-actions/index.js +23 -19
  238. package/build-module/components/header/document-actions/index.js.map +1 -1
  239. package/build-module/components/header/feature-toggle/index.js +9 -7
  240. package/build-module/components/header/feature-toggle/index.js.map +1 -1
  241. package/build-module/components/header/index.js +15 -13
  242. package/build-module/components/header/index.js.map +1 -1
  243. package/build-module/components/header/more-menu/index.js +30 -27
  244. package/build-module/components/header/more-menu/index.js.map +1 -1
  245. package/build-module/components/header/tools-more-menu-group/index.js +10 -7
  246. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  247. package/build-module/components/keyboard-shortcuts/index.js +30 -3
  248. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  249. package/build-module/components/list/header.js +37 -0
  250. package/build-module/components/list/header.js.map +1 -0
  251. package/build-module/components/list/index.js +69 -0
  252. package/build-module/components/list/index.js.map +1 -0
  253. package/build-module/components/list/table.js +111 -0
  254. package/build-module/components/list/table.js.map +1 -0
  255. package/build-module/components/list/use-register-shortcuts.js +41 -0
  256. package/build-module/components/list/use-register-shortcuts.js.map +1 -0
  257. package/build-module/components/main-dashboard-button/index.js +4 -3
  258. package/build-module/components/main-dashboard-button/index.js.map +1 -1
  259. package/build-module/components/navigate-to-link/index.js +7 -6
  260. package/build-module/components/navigate-to-link/index.js.map +1 -1
  261. package/build-module/components/navigation-sidebar/index.js +25 -8
  262. package/build-module/components/navigation-sidebar/index.js.map +1 -1
  263. package/build-module/components/navigation-sidebar/navigation-panel/content-navigation-item.js +4 -3
  264. package/build-module/components/navigation-sidebar/navigation-panel/content-navigation-item.js.map +1 -1
  265. package/build-module/components/navigation-sidebar/navigation-panel/index.js +39 -55
  266. package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
  267. package/build-module/components/navigation-sidebar/navigation-panel/menus/template-parts-sub.js +6 -5
  268. package/build-module/components/navigation-sidebar/navigation-panel/menus/template-parts-sub.js.map +1 -1
  269. package/build-module/components/navigation-sidebar/navigation-panel/menus/template-parts.js +26 -20
  270. package/build-module/components/navigation-sidebar/navigation-panel/menus/template-parts.js.map +1 -1
  271. package/build-module/components/navigation-sidebar/navigation-panel/menus/templates-sub.js +17 -10
  272. package/build-module/components/navigation-sidebar/navigation-panel/menus/templates-sub.js.map +1 -1
  273. package/build-module/components/navigation-sidebar/navigation-panel/menus/templates.js +11 -5
  274. package/build-module/components/navigation-sidebar/navigation-panel/menus/templates.js.map +1 -1
  275. package/build-module/components/navigation-sidebar/navigation-panel/navigation-entity-items.js +13 -11
  276. package/build-module/components/navigation-sidebar/navigation-panel/navigation-entity-items.js.map +1 -1
  277. package/build-module/components/navigation-sidebar/navigation-panel/new-template-dropdown.js +24 -18
  278. package/build-module/components/navigation-sidebar/navigation-panel/new-template-dropdown.js.map +1 -1
  279. package/build-module/components/navigation-sidebar/navigation-panel/search-results.js +14 -11
  280. package/build-module/components/navigation-sidebar/navigation-panel/search-results.js.map +1 -1
  281. package/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js +6 -3
  282. package/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js.map +1 -1
  283. package/build-module/components/navigation-sidebar/navigation-panel/template-navigation-item.js +4 -3
  284. package/build-module/components/navigation-sidebar/navigation-panel/template-navigation-item.js.map +1 -1
  285. package/build-module/components/navigation-sidebar/navigation-panel/template-preview.js +5 -4
  286. package/build-module/components/navigation-sidebar/navigation-panel/template-preview.js.map +1 -1
  287. package/build-module/components/navigation-sidebar/navigation-toggle/index.js +8 -27
  288. package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
  289. package/build-module/components/save-button/index.js +5 -4
  290. package/build-module/components/save-button/index.js.map +1 -1
  291. package/build-module/components/sidebar/default-sidebar.js +11 -10
  292. package/build-module/components/sidebar/default-sidebar.js.map +1 -1
  293. package/build-module/components/sidebar/plugin-sidebar/index.js +5 -4
  294. package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
  295. package/build-module/components/sidebar/settings-header/index.js +4 -3
  296. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  297. package/build-module/components/sidebar/template-card/template-areas.js +17 -13
  298. package/build-module/components/sidebar/template-card/template-areas.js.map +1 -1
  299. package/build-module/components/template-details/index.js +14 -9
  300. package/build-module/components/template-details/index.js.map +1 -1
  301. package/build-module/components/template-details/template-areas.js +38 -29
  302. package/build-module/components/template-details/template-areas.js.map +1 -1
  303. package/build-module/components/template-part-converter/convert-to-regular.js +15 -11
  304. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  305. package/build-module/components/template-part-converter/convert-to-template-part.js +29 -86
  306. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  307. package/build-module/components/welcome-guide/editor.js +45 -0
  308. package/build-module/components/welcome-guide/editor.js.map +1 -0
  309. package/build-module/components/welcome-guide/image.js +19 -0
  310. package/build-module/components/welcome-guide/image.js.map +1 -0
  311. package/build-module/components/welcome-guide/index.js +35 -0
  312. package/build-module/components/welcome-guide/index.js.map +1 -0
  313. package/build-module/components/welcome-guide/styles.js +69 -0
  314. package/build-module/components/welcome-guide/styles.js.map +1 -0
  315. package/build-module/index.js +21 -1
  316. package/build-module/index.js.map +1 -1
  317. package/build-module/plugins/index.js +3 -2
  318. package/build-module/plugins/index.js.map +1 -1
  319. package/build-module/plugins/welcome-guide-menu-item.js +27 -0
  320. package/build-module/plugins/welcome-guide-menu-item.js.map +1 -0
  321. package/build-module/store/actions.js +11 -11
  322. package/build-module/store/actions.js.map +1 -1
  323. package/build-module/store/defaults.js +4 -1
  324. package/build-module/store/defaults.js.map +1 -1
  325. package/build-module/store/reducer.js +31 -10
  326. package/build-module/store/reducer.js.map +1 -1
  327. package/build-module/store/selectors.js +17 -10
  328. package/build-module/store/selectors.js.map +1 -1
  329. package/build-module/utils/is-template-removable.js +14 -0
  330. package/build-module/utils/is-template-removable.js.map +1 -0
  331. package/build-style/style-rtl.css +348 -32
  332. package/build-style/style.css +348 -32
  333. package/package.json +27 -27
  334. package/src/components/add-new-template/index.js +30 -0
  335. package/src/components/add-new-template/new-template-part.js +66 -0
  336. package/src/components/add-new-template/new-template.js +116 -0
  337. package/src/components/add-new-template/style.scss +11 -0
  338. package/src/components/create-template-part-modal/index.js +132 -0
  339. package/src/components/{template-part-converter → create-template-part-modal}/style.scss +9 -9
  340. package/src/components/editor/index.js +22 -15
  341. package/src/components/editor/style.scss +8 -0
  342. package/src/components/global-styles/color-palette-panel.js +64 -7
  343. package/src/components/global-styles/global-styles-provider.js +7 -36
  344. package/src/components/global-styles/hooks.js +58 -26
  345. package/src/components/global-styles/screen-block-list.js +11 -1
  346. package/src/components/global-styles/test/use-global-styles-output.js +2 -2
  347. package/src/components/global-styles/use-global-styles-output.js +2 -2
  348. package/src/components/global-styles/utils.js +1 -1
  349. package/src/components/header/index.js +0 -6
  350. package/src/components/keyboard-shortcuts/index.js +32 -0
  351. package/src/components/list/header.js +34 -0
  352. package/src/components/list/index.js +80 -0
  353. package/src/components/list/style.scss +113 -0
  354. package/src/components/list/table.js +132 -0
  355. package/src/components/list/use-register-shortcuts.js +45 -0
  356. package/src/components/navigation-sidebar/index.js +31 -8
  357. package/src/components/navigation-sidebar/navigation-panel/index.js +45 -55
  358. package/src/components/navigation-sidebar/navigation-panel/style.scss +4 -2
  359. package/src/components/navigation-sidebar/navigation-toggle/index.js +4 -28
  360. package/src/components/template-details/index.js +3 -2
  361. package/src/components/template-part-converter/convert-to-template-part.js +20 -140
  362. package/src/components/welcome-guide/editor.js +63 -0
  363. package/src/components/welcome-guide/image.js +11 -0
  364. package/src/components/welcome-guide/index.js +33 -0
  365. package/src/components/welcome-guide/style.scss +37 -0
  366. package/src/components/welcome-guide/styles.js +116 -0
  367. package/src/index.js +21 -1
  368. package/src/plugins/index.js +3 -1
  369. package/src/plugins/welcome-guide-menu-item.js +35 -0
  370. package/src/store/actions.js +11 -9
  371. package/src/store/defaults.js +4 -1
  372. package/src/store/test/actions.js +14 -20
  373. package/src/style.scss +9 -6
  374. package/src/utils/is-template-removable.js +13 -0
  375. package/build/components/header/navigation-link/index.js +0 -86
  376. package/build/components/header/navigation-link/index.js.map +0 -1
  377. package/build-module/components/header/navigation-link/index.js +0 -73
  378. package/build-module/components/header/navigation-link/index.js.map +0 -1
  379. package/src/components/header/navigation-link/index.js +0 -71
  380. package/src/components/header/navigation-link/style.scss +0 -69
@@ -36,11 +36,12 @@ var _contentNavigationItem = _interopRequireDefault(require("./content-navigatio
36
36
  /**
37
37
  * Internal dependencies
38
38
  */
39
- function SearchResults({
40
- items,
41
- search,
42
- disableFilter
43
- }) {
39
+ function SearchResults(_ref) {
40
+ let {
41
+ items,
42
+ search,
43
+ disableFilter
44
+ } = _ref;
44
45
  let itemType = null;
45
46
 
46
47
  if ((items === null || items === void 0 ? void 0 : items.length) > 0) {
@@ -94,9 +95,10 @@ function SearchResults({
94
95
  return items;
95
96
  }
96
97
 
97
- return items.filter(({
98
- slug
99
- }) => {
98
+ return items.filter(_ref2 => {
99
+ let {
100
+ slug
101
+ } = _ref2;
100
102
  const {
101
103
  title,
102
104
  description
@@ -109,9 +111,10 @@ function SearchResults({
109
111
  return [];
110
112
  }
111
113
 
112
- return (0, _lodash.sortBy)(itemsFiltered, [({
113
- slug
114
- }) => {
114
+ return (0, _lodash.sortBy)(itemsFiltered, [_ref3 => {
115
+ let {
116
+ slug
117
+ } = _ref3;
115
118
  const {
116
119
  title
117
120
  } = itemInfosMap[slug];
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/search-results.js"],"names":["SearchResults","items","search","disableFilter","itemType","length","taxonomy","type","itemInfos","select","__experimentalGetTemplateInfo","getTemplateInfo","editorStore","map","item","slug","title","name","description","rendered","excerpt","itemInfosMap","itemsFiltered","filter","itemsSorted","ItemComponent","TemplateNavigationItem","ContentNavigationItem","id"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport { map, sortBy, keyBy } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __experimentalNavigationGroup as NavigationGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { normalizedSearch } from './utils';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport TemplateNavigationItem from './template-navigation-item';\nimport ContentNavigationItem from './content-navigation-item';\n\nexport default function SearchResults( { items, search, disableFilter } ) {\n\tlet itemType = null;\n\tif ( items?.length > 0 ) {\n\t\tif ( items[ 0 ].taxonomy ) {\n\t\t\titemType = 'taxonomy';\n\t\t} else {\n\t\t\titemType = items[ 0 ].type;\n\t\t}\n\t}\n\n\tconst itemInfos = useSelect(\n\t\t( select ) => {\n\t\t\tif ( itemType === null || items === null ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tif ( itemType === 'wp_template' ) {\n\t\t\t\tconst {\n\t\t\t\t\t__experimentalGetTemplateInfo: getTemplateInfo,\n\t\t\t\t} = select( editorStore );\n\n\t\t\t\treturn items.map( ( item ) => ( {\n\t\t\t\t\tslug: item.slug,\n\t\t\t\t\t...getTemplateInfo( item ),\n\t\t\t\t} ) );\n\t\t\t}\n\n\t\t\tif ( itemType === 'taxonomy' ) {\n\t\t\t\treturn items.map( ( item ) => ( {\n\t\t\t\t\tslug: item.slug,\n\t\t\t\t\ttitle: item.name,\n\t\t\t\t\tdescription: item.description,\n\t\t\t\t} ) );\n\t\t\t}\n\n\t\t\treturn items.map( ( item ) => ( {\n\t\t\t\tslug: item.slug,\n\t\t\t\ttitle: item.title?.rendered,\n\t\t\t\tdescription: item.excerpt?.rendered,\n\t\t\t} ) );\n\t\t},\n\t\t[ items, itemType ]\n\t);\n\tconst itemInfosMap = useMemo( () => keyBy( itemInfos, 'slug' ), [\n\t\titemInfos,\n\t] );\n\n\tconst itemsFiltered = useMemo( () => {\n\t\tif ( items === null || search.length === 0 ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tif ( disableFilter ) {\n\t\t\treturn items;\n\t\t}\n\n\t\treturn items.filter( ( { slug } ) => {\n\t\t\tconst { title, description } = itemInfosMap[ slug ];\n\n\t\t\treturn (\n\t\t\t\tnormalizedSearch( slug, search ) ||\n\t\t\t\tnormalizedSearch( title, search ) ||\n\t\t\t\tnormalizedSearch( description, search )\n\t\t\t);\n\t\t} );\n\t}, [ items, itemInfos, search ] );\n\n\tconst itemsSorted = useMemo( () => {\n\t\tif ( ! itemsFiltered ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn sortBy( itemsFiltered, [\n\t\t\t( { slug } ) => {\n\t\t\t\tconst { title } = itemInfosMap[ slug ];\n\t\t\t\treturn ! normalizedSearch( title, search );\n\t\t\t},\n\t\t] );\n\t}, [ itemsFiltered, search ] );\n\n\tconst ItemComponent =\n\t\titemType === 'wp_template' || itemType === 'wp_template_part'\n\t\t\t? TemplateNavigationItem\n\t\t\t: ContentNavigationItem;\n\n\treturn (\n\t\t<NavigationGroup title={ __( 'Search results' ) }>\n\t\t\t{ map( itemsSorted, ( item ) => (\n\t\t\t\t<ItemComponent\n\t\t\t\t\titem={ item }\n\t\t\t\t\tkey={ `${ item.taxonomy || item.type }-${ item.id }` }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</NavigationGroup>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/search-results.js"],"names":["SearchResults","items","search","disableFilter","itemType","length","taxonomy","type","itemInfos","select","__experimentalGetTemplateInfo","getTemplateInfo","editorStore","map","item","slug","title","name","description","rendered","excerpt","itemInfosMap","itemsFiltered","filter","itemsSorted","ItemComponent","TemplateNavigationItem","ContentNavigationItem","id"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport { map, sortBy, keyBy } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __experimentalNavigationGroup as NavigationGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { normalizedSearch } from './utils';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport TemplateNavigationItem from './template-navigation-item';\nimport ContentNavigationItem from './content-navigation-item';\n\nexport default function SearchResults( { items, search, disableFilter } ) {\n\tlet itemType = null;\n\tif ( items?.length > 0 ) {\n\t\tif ( items[ 0 ].taxonomy ) {\n\t\t\titemType = 'taxonomy';\n\t\t} else {\n\t\t\titemType = items[ 0 ].type;\n\t\t}\n\t}\n\n\tconst itemInfos = useSelect(\n\t\t( select ) => {\n\t\t\tif ( itemType === null || items === null ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tif ( itemType === 'wp_template' ) {\n\t\t\t\tconst {\n\t\t\t\t\t__experimentalGetTemplateInfo: getTemplateInfo,\n\t\t\t\t} = select( editorStore );\n\n\t\t\t\treturn items.map( ( item ) => ( {\n\t\t\t\t\tslug: item.slug,\n\t\t\t\t\t...getTemplateInfo( item ),\n\t\t\t\t} ) );\n\t\t\t}\n\n\t\t\tif ( itemType === 'taxonomy' ) {\n\t\t\t\treturn items.map( ( item ) => ( {\n\t\t\t\t\tslug: item.slug,\n\t\t\t\t\ttitle: item.name,\n\t\t\t\t\tdescription: item.description,\n\t\t\t\t} ) );\n\t\t\t}\n\n\t\t\treturn items.map( ( item ) => ( {\n\t\t\t\tslug: item.slug,\n\t\t\t\ttitle: item.title?.rendered,\n\t\t\t\tdescription: item.excerpt?.rendered,\n\t\t\t} ) );\n\t\t},\n\t\t[ items, itemType ]\n\t);\n\tconst itemInfosMap = useMemo( () => keyBy( itemInfos, 'slug' ), [\n\t\titemInfos,\n\t] );\n\n\tconst itemsFiltered = useMemo( () => {\n\t\tif ( items === null || search.length === 0 ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tif ( disableFilter ) {\n\t\t\treturn items;\n\t\t}\n\n\t\treturn items.filter( ( { slug } ) => {\n\t\t\tconst { title, description } = itemInfosMap[ slug ];\n\n\t\t\treturn (\n\t\t\t\tnormalizedSearch( slug, search ) ||\n\t\t\t\tnormalizedSearch( title, search ) ||\n\t\t\t\tnormalizedSearch( description, search )\n\t\t\t);\n\t\t} );\n\t}, [ items, itemInfos, search ] );\n\n\tconst itemsSorted = useMemo( () => {\n\t\tif ( ! itemsFiltered ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn sortBy( itemsFiltered, [\n\t\t\t( { slug } ) => {\n\t\t\t\tconst { title } = itemInfosMap[ slug ];\n\t\t\t\treturn ! normalizedSearch( title, search );\n\t\t\t},\n\t\t] );\n\t}, [ itemsFiltered, search ] );\n\n\tconst ItemComponent =\n\t\titemType === 'wp_template' || itemType === 'wp_template_part'\n\t\t\t? TemplateNavigationItem\n\t\t\t: ContentNavigationItem;\n\n\treturn (\n\t\t<NavigationGroup title={ __( 'Search results' ) }>\n\t\t\t{ map( itemsSorted, ( item ) => (\n\t\t\t\t<ItemComponent\n\t\t\t\t\titem={ item }\n\t\t\t\t\tkey={ `${ item.taxonomy || item.type }-${ item.id }` }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</NavigationGroup>\n\t);\n}\n"]}
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.isTemplateSuperseded = isTemplateSuperseded;
7
6
  exports.getTemplateLocation = getTemplateLocation;
8
- exports.getUnusedTemplates = getUnusedTemplates;
9
7
  exports.getTemplatesLocationMap = getTemplatesLocationMap;
8
+ exports.getUnusedTemplates = getUnusedTemplates;
9
+ exports.isTemplateSuperseded = isTemplateSuperseded;
10
10
 
11
11
  var _lodash = require("lodash");
12
12
 
@@ -63,9 +63,12 @@ function getTemplateLocation(slug) {
63
63
 
64
64
  function getUnusedTemplates(templates, showOnFront) {
65
65
  const templateSlugs = (0, _lodash.map)(templates, 'slug');
66
- const supersededTemplates = templates.filter(({
67
- slug
68
- }) => isTemplateSuperseded(slug, templateSlugs, showOnFront));
66
+ const supersededTemplates = templates.filter(_ref => {
67
+ let {
68
+ slug
69
+ } = _ref;
70
+ return isTemplateSuperseded(slug, templateSlugs, showOnFront);
71
+ });
69
72
  return supersededTemplates;
70
73
  }
71
74
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/template-hierarchy.js"],"names":["isTemplateSuperseded","slug","existingSlugs","showOnFront","TEMPLATE_OVERRIDES","every","overrideSlug","includes","getTemplateLocation","isTopLevelTemplate","TEMPLATES_TOP_LEVEL","MENU_TEMPLATES","isGeneralTemplate","TEMPLATES_GENERAL","MENU_TEMPLATES_GENERAL","isPostsTemplate","TEMPLATES_POSTS_PREFIXES","some","prefix","startsWith","MENU_TEMPLATES_POSTS","isPagesTemplate","TEMPLATES_PAGES_PREFIXES","MENU_TEMPLATES_PAGES","getUnusedTemplates","templates","templateSlugs","supersededTemplates","filter","getTemplatesLocationMap","reduce","obj","template"],"mappings":";;;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAaO,SAASA,oBAAT,CAA+BC,IAA/B,EAAqCC,aAArC,EAAoDC,WAApD,EAAkE;AACxE,MAAK,CAAEC,8BAAoBH,IAApB,CAAP,EAAoC;AACnC,WAAO,KAAP;AACA,GAHuE,CAKxE;AACA;;;AACA,MAAKA,IAAI,KAAK,MAAT,IAAmBE,WAAW,KAAK,OAAxC,EAAkD;AACjD,WAAO,IAAP;AACA;;AAED,SAAOC,8BAAoBH,IAApB,EAA2BI,KAA3B,CACJC,YAAF,IACCJ,aAAa,CAACK,QAAd,CAAwBD,YAAxB,KACAN,oBAAoB,CAAEM,YAAF,EAAgBJ,aAAhB,EAA+BC,WAA/B,CAHf,CAAP;AAKA;;AAEM,SAASK,mBAAT,CAA8BP,IAA9B,EAAqC;AAC3C,QAAMQ,kBAAkB,GAAGC,+BAAoBH,QAApB,CAA8BN,IAA9B,CAA3B;;AACA,MAAKQ,kBAAL,EAA0B;AACzB,WAAOE,yBAAP;AACA;;AAED,QAAMC,iBAAiB,GAAGC,6BAAkBN,QAAlB,CAA4BN,IAA5B,CAA1B;;AACA,MAAKW,iBAAL,EAAyB;AACxB,WAAOE,iCAAP;AACA;;AAED,QAAMC,eAAe,GAAGC,oCAAyBC,IAAzB,CAAiCC,MAAF,IACtDjB,IAAI,CAACkB,UAAL,CAAiBD,MAAjB,CADuB,CAAxB;;AAGA,MAAKH,eAAL,EAAuB;AACtB,WAAOK,+BAAP;AACA;;AAED,QAAMC,eAAe,GAAGC,oCAAyBL,IAAzB,CAAiCC,MAAF,IACtDjB,IAAI,CAACkB,UAAL,CAAiBD,MAAjB,CADuB,CAAxB;;AAGA,MAAKG,eAAL,EAAuB;AACtB,WAAOE,+BAAP;AACA;;AAED,SAAOT,iCAAP;AACA;;AAEM,SAASU,kBAAT,CAA6BC,SAA7B,EAAwCtB,WAAxC,EAAsD;AAC5D,QAAMuB,aAAa,GAAG,iBAAKD,SAAL,EAAgB,MAAhB,CAAtB;AACA,QAAME,mBAAmB,GAAGF,SAAS,CAACG,MAAV,CAAkB,CAAE;AAAE3B,IAAAA;AAAF,GAAF,KAC7CD,oBAAoB,CAAEC,IAAF,EAAQyB,aAAR,EAAuBvB,WAAvB,CADO,CAA5B;AAIA,SAAOwB,mBAAP;AACA;;AAEM,SAASE,uBAAT,CAAkCJ,SAAlC,EAA8C;AACpD,SAAOA,SAAS,CAACK,MAAV,CAAkB,CAAEC,GAAF,EAAOC,QAAP,KAAqB;AAC7CD,IAAAA,GAAG,CAAEC,QAAQ,CAAC/B,IAAX,CAAH,GAAuBO,mBAAmB,CAAEwB,QAAQ,CAAC/B,IAAX,CAA1C;AACA,WAAO8B,GAAP;AACA,GAHM,EAGJ,EAHI,CAAP;AAIA","sourcesContent":["/**\n * External dependencies\n */\nimport { map } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport {\n\tMENU_TEMPLATES,\n\tMENU_TEMPLATES_GENERAL,\n\tMENU_TEMPLATES_PAGES,\n\tMENU_TEMPLATES_POSTS,\n\tTEMPLATE_OVERRIDES,\n\tTEMPLATES_GENERAL,\n\tTEMPLATES_PAGES_PREFIXES,\n\tTEMPLATES_POSTS_PREFIXES,\n\tTEMPLATES_TOP_LEVEL,\n} from './constants';\n\nexport function isTemplateSuperseded( slug, existingSlugs, showOnFront ) {\n\tif ( ! TEMPLATE_OVERRIDES[ slug ] ) {\n\t\treturn false;\n\t}\n\n\t// `home` template is unused if it is superseded by `front-page`\n\t// or \"show on front\" is set to show a page rather than blog posts.\n\tif ( slug === 'home' && showOnFront !== 'posts' ) {\n\t\treturn true;\n\t}\n\n\treturn TEMPLATE_OVERRIDES[ slug ].every(\n\t\t( overrideSlug ) =>\n\t\t\texistingSlugs.includes( overrideSlug ) ||\n\t\t\tisTemplateSuperseded( overrideSlug, existingSlugs, showOnFront )\n\t);\n}\n\nexport function getTemplateLocation( slug ) {\n\tconst isTopLevelTemplate = TEMPLATES_TOP_LEVEL.includes( slug );\n\tif ( isTopLevelTemplate ) {\n\t\treturn MENU_TEMPLATES;\n\t}\n\n\tconst isGeneralTemplate = TEMPLATES_GENERAL.includes( slug );\n\tif ( isGeneralTemplate ) {\n\t\treturn MENU_TEMPLATES_GENERAL;\n\t}\n\n\tconst isPostsTemplate = TEMPLATES_POSTS_PREFIXES.some( ( prefix ) =>\n\t\tslug.startsWith( prefix )\n\t);\n\tif ( isPostsTemplate ) {\n\t\treturn MENU_TEMPLATES_POSTS;\n\t}\n\n\tconst isPagesTemplate = TEMPLATES_PAGES_PREFIXES.some( ( prefix ) =>\n\t\tslug.startsWith( prefix )\n\t);\n\tif ( isPagesTemplate ) {\n\t\treturn MENU_TEMPLATES_PAGES;\n\t}\n\n\treturn MENU_TEMPLATES_GENERAL;\n}\n\nexport function getUnusedTemplates( templates, showOnFront ) {\n\tconst templateSlugs = map( templates, 'slug' );\n\tconst supersededTemplates = templates.filter( ( { slug } ) =>\n\t\tisTemplateSuperseded( slug, templateSlugs, showOnFront )\n\t);\n\n\treturn supersededTemplates;\n}\n\nexport function getTemplatesLocationMap( templates ) {\n\treturn templates.reduce( ( obj, template ) => {\n\t\tobj[ template.slug ] = getTemplateLocation( template.slug );\n\t\treturn obj;\n\t}, {} );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/template-hierarchy.js"],"names":["isTemplateSuperseded","slug","existingSlugs","showOnFront","TEMPLATE_OVERRIDES","every","overrideSlug","includes","getTemplateLocation","isTopLevelTemplate","TEMPLATES_TOP_LEVEL","MENU_TEMPLATES","isGeneralTemplate","TEMPLATES_GENERAL","MENU_TEMPLATES_GENERAL","isPostsTemplate","TEMPLATES_POSTS_PREFIXES","some","prefix","startsWith","MENU_TEMPLATES_POSTS","isPagesTemplate","TEMPLATES_PAGES_PREFIXES","MENU_TEMPLATES_PAGES","getUnusedTemplates","templates","templateSlugs","supersededTemplates","filter","getTemplatesLocationMap","reduce","obj","template"],"mappings":";;;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAaO,SAASA,oBAAT,CAA+BC,IAA/B,EAAqCC,aAArC,EAAoDC,WAApD,EAAkE;AACxE,MAAK,CAAEC,8BAAoBH,IAApB,CAAP,EAAoC;AACnC,WAAO,KAAP;AACA,GAHuE,CAKxE;AACA;;;AACA,MAAKA,IAAI,KAAK,MAAT,IAAmBE,WAAW,KAAK,OAAxC,EAAkD;AACjD,WAAO,IAAP;AACA;;AAED,SAAOC,8BAAoBH,IAApB,EAA2BI,KAA3B,CACJC,YAAF,IACCJ,aAAa,CAACK,QAAd,CAAwBD,YAAxB,KACAN,oBAAoB,CAAEM,YAAF,EAAgBJ,aAAhB,EAA+BC,WAA/B,CAHf,CAAP;AAKA;;AAEM,SAASK,mBAAT,CAA8BP,IAA9B,EAAqC;AAC3C,QAAMQ,kBAAkB,GAAGC,+BAAoBH,QAApB,CAA8BN,IAA9B,CAA3B;;AACA,MAAKQ,kBAAL,EAA0B;AACzB,WAAOE,yBAAP;AACA;;AAED,QAAMC,iBAAiB,GAAGC,6BAAkBN,QAAlB,CAA4BN,IAA5B,CAA1B;;AACA,MAAKW,iBAAL,EAAyB;AACxB,WAAOE,iCAAP;AACA;;AAED,QAAMC,eAAe,GAAGC,oCAAyBC,IAAzB,CAAiCC,MAAF,IACtDjB,IAAI,CAACkB,UAAL,CAAiBD,MAAjB,CADuB,CAAxB;;AAGA,MAAKH,eAAL,EAAuB;AACtB,WAAOK,+BAAP;AACA;;AAED,QAAMC,eAAe,GAAGC,oCAAyBL,IAAzB,CAAiCC,MAAF,IACtDjB,IAAI,CAACkB,UAAL,CAAiBD,MAAjB,CADuB,CAAxB;;AAGA,MAAKG,eAAL,EAAuB;AACtB,WAAOE,+BAAP;AACA;;AAED,SAAOT,iCAAP;AACA;;AAEM,SAASU,kBAAT,CAA6BC,SAA7B,EAAwCtB,WAAxC,EAAsD;AAC5D,QAAMuB,aAAa,GAAG,iBAAKD,SAAL,EAAgB,MAAhB,CAAtB;AACA,QAAME,mBAAmB,GAAGF,SAAS,CAACG,MAAV,CAAkB;AAAA,QAAE;AAAE3B,MAAAA;AAAF,KAAF;AAAA,WAC7CD,oBAAoB,CAAEC,IAAF,EAAQyB,aAAR,EAAuBvB,WAAvB,CADyB;AAAA,GAAlB,CAA5B;AAIA,SAAOwB,mBAAP;AACA;;AAEM,SAASE,uBAAT,CAAkCJ,SAAlC,EAA8C;AACpD,SAAOA,SAAS,CAACK,MAAV,CAAkB,CAAEC,GAAF,EAAOC,QAAP,KAAqB;AAC7CD,IAAAA,GAAG,CAAEC,QAAQ,CAAC/B,IAAX,CAAH,GAAuBO,mBAAmB,CAAEwB,QAAQ,CAAC/B,IAAX,CAA1C;AACA,WAAO8B,GAAP;AACA,GAHM,EAGJ,EAHI,CAAP;AAIA","sourcesContent":["/**\n * External dependencies\n */\nimport { map } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport {\n\tMENU_TEMPLATES,\n\tMENU_TEMPLATES_GENERAL,\n\tMENU_TEMPLATES_PAGES,\n\tMENU_TEMPLATES_POSTS,\n\tTEMPLATE_OVERRIDES,\n\tTEMPLATES_GENERAL,\n\tTEMPLATES_PAGES_PREFIXES,\n\tTEMPLATES_POSTS_PREFIXES,\n\tTEMPLATES_TOP_LEVEL,\n} from './constants';\n\nexport function isTemplateSuperseded( slug, existingSlugs, showOnFront ) {\n\tif ( ! TEMPLATE_OVERRIDES[ slug ] ) {\n\t\treturn false;\n\t}\n\n\t// `home` template is unused if it is superseded by `front-page`\n\t// or \"show on front\" is set to show a page rather than blog posts.\n\tif ( slug === 'home' && showOnFront !== 'posts' ) {\n\t\treturn true;\n\t}\n\n\treturn TEMPLATE_OVERRIDES[ slug ].every(\n\t\t( overrideSlug ) =>\n\t\t\texistingSlugs.includes( overrideSlug ) ||\n\t\t\tisTemplateSuperseded( overrideSlug, existingSlugs, showOnFront )\n\t);\n}\n\nexport function getTemplateLocation( slug ) {\n\tconst isTopLevelTemplate = TEMPLATES_TOP_LEVEL.includes( slug );\n\tif ( isTopLevelTemplate ) {\n\t\treturn MENU_TEMPLATES;\n\t}\n\n\tconst isGeneralTemplate = TEMPLATES_GENERAL.includes( slug );\n\tif ( isGeneralTemplate ) {\n\t\treturn MENU_TEMPLATES_GENERAL;\n\t}\n\n\tconst isPostsTemplate = TEMPLATES_POSTS_PREFIXES.some( ( prefix ) =>\n\t\tslug.startsWith( prefix )\n\t);\n\tif ( isPostsTemplate ) {\n\t\treturn MENU_TEMPLATES_POSTS;\n\t}\n\n\tconst isPagesTemplate = TEMPLATES_PAGES_PREFIXES.some( ( prefix ) =>\n\t\tslug.startsWith( prefix )\n\t);\n\tif ( isPagesTemplate ) {\n\t\treturn MENU_TEMPLATES_PAGES;\n\t}\n\n\treturn MENU_TEMPLATES_GENERAL;\n}\n\nexport function getUnusedTemplates( templates, showOnFront ) {\n\tconst templateSlugs = map( templates, 'slug' );\n\tconst supersededTemplates = templates.filter( ( { slug } ) =>\n\t\tisTemplateSuperseded( slug, templateSlugs, showOnFront )\n\t);\n\n\treturn supersededTemplates;\n}\n\nexport function getTemplatesLocationMap( templates ) {\n\treturn templates.reduce( ( obj, template ) => {\n\t\tobj[ template.slug ] = getTemplateLocation( template.slug );\n\t\treturn obj;\n\t}, {} );\n}\n"]}
@@ -30,9 +30,10 @@ var _store = require("../../../store");
30
30
  /**
31
31
  * Internal dependencies
32
32
  */
33
- function TemplateNavigationItem({
34
- item
35
- }) {
33
+ function TemplateNavigationItem(_ref) {
34
+ let {
35
+ item
36
+ } = _ref;
36
37
  const {
37
38
  title,
38
39
  description
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/template-navigation-item.js"],"names":["TemplateNavigationItem","item","title","description","select","type","editorStore","__experimentalGetTemplateInfo","rendered","slug","setTemplate","setTemplatePart","setIsNavigationPanelOpened","editSiteStore","isPreviewVisible","setIsPreviewVisible","onActivateItem","id","status","content","raw"],"mappings":";;;;;;;;;AAQA;;AALA;;AAIA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAUA;AACA;AACA;AAKe,SAASA,sBAAT,CAAiC;AAAEC,EAAAA;AAAF,CAAjC,EAA4C;AAC1D,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAyB,qBAC5BC,MAAF;AAAA;;AAAA,WACC,kBAAkBH,IAAI,CAACI,IAAvB,GACGD,MAAM,CAAEE,aAAF,CAAN,CAAsBC,6BAAtB,CAAqDN,IAArD,CADH,GAEG;AACAC,MAAAA,KAAK,EAAE,CAAAD,IAAI,SAAJ,IAAAA,IAAI,WAAJ,2BAAAA,IAAI,CAAEC,KAAN,4DAAaM,QAAb,MAAyBP,IAAzB,aAAyBA,IAAzB,uBAAyBA,IAAI,CAAEQ,IAA/B,CADP;AAEAN,MAAAA,WAAW,EAAE;AAFb,KAHJ;AAAA,GAD8B,EAQ9B,EAR8B,CAA/B;AAUA,QAAM;AACLO,IAAAA,WADK;AAELC,IAAAA,eAFK;AAGLC,IAAAA;AAHK,MAIF,uBAAaC,YAAb,CAJJ;AAKA,QAAM,CAAEC,gBAAF,EAAoBC,mBAApB,IAA4C,uBAAU,KAAV,CAAlD;;AAEA,MAAK,CAAEd,IAAP,EAAc;AACb,WAAO,IAAP;AACA;;AAED,QAAMe,cAAc,GAAG,MAAM;AAC5B,QAAK,kBAAkBf,IAAI,CAACI,IAA5B,EAAmC;AAClCK,MAAAA,WAAW,CAAET,IAAI,CAACgB,EAAP,EAAWhB,IAAI,CAACQ,IAAhB,CAAX;AACA,KAFD,MAEO;AACNE,MAAAA,eAAe,CAAEV,IAAI,CAACgB,EAAP,CAAf;AACA;;AACDL,IAAAA,0BAA0B,CAAE,KAAF,CAA1B;AACA,GAPD;;AASA,SACC,4BAAC,wCAAD;AACC,IAAA,SAAS,EAAC,2CADX;AAEC,IAAA,IAAI,EAAI,GAAGX,IAAI,CAACI,IAAM,IAAIJ,IAAI,CAACgB,EAAI;AAFpC,KAIC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGD,cADX;AAEC,IAAA,YAAY,EAAG,MAAMD,mBAAmB,CAAE,IAAF,CAFzC;AAGC,IAAA,YAAY,EAAG,MAAMA,mBAAmB,CAAE,KAAF;AAHzC,KAKC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACG,YAAYd,IAAI,CAACiB,MAAjB,IACD,wCAAM,cAAI,SAAJ,CAAN,CAFF,EAIGhB,KAJH,CADD,EAOGC,WAAW,IACZ;AAAK,IAAA,SAAS,EAAC;AAAf,KACGA,WADH,CARF,CALD,CAJD,EAwBGW,gBAAgB,IACjB,4BAAC,iCAAD,QACC,4BAAC,wBAAD;AAAiB,IAAA,UAAU,EAAGb,IAAI,CAACkB,OAAL,CAAaC;AAA3C,IADD,CAzBF,CADD;AAgCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\t__experimentalNavigationItem as NavigationItem,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport TemplatePreview from './template-preview';\nimport { NavigationPanelPreviewFill } from '../index';\nimport { store as editSiteStore } from '../../../store';\n\nexport default function TemplateNavigationItem( { item } ) {\n\tconst { title, description } = useSelect(\n\t\t( select ) =>\n\t\t\t'wp_template' === item.type\n\t\t\t\t? select( editorStore ).__experimentalGetTemplateInfo( item )\n\t\t\t\t: {\n\t\t\t\t\t\ttitle: item?.title?.rendered || item?.slug,\n\t\t\t\t\t\tdescription: '',\n\t\t\t\t },\n\t\t[]\n\t);\n\tconst {\n\t\tsetTemplate,\n\t\tsetTemplatePart,\n\t\tsetIsNavigationPanelOpened,\n\t} = useDispatch( editSiteStore );\n\tconst [ isPreviewVisible, setIsPreviewVisible ] = useState( false );\n\n\tif ( ! item ) {\n\t\treturn null;\n\t}\n\n\tconst onActivateItem = () => {\n\t\tif ( 'wp_template' === item.type ) {\n\t\t\tsetTemplate( item.id, item.slug );\n\t\t} else {\n\t\t\tsetTemplatePart( item.id );\n\t\t}\n\t\tsetIsNavigationPanelOpened( false );\n\t};\n\n\treturn (\n\t\t<NavigationItem\n\t\t\tclassName=\"edit-site-navigation-panel__template-item\"\n\t\t\titem={ `${ item.type }-${ item.id }` }\n\t\t>\n\t\t\t<Button\n\t\t\t\tonClick={ onActivateItem }\n\t\t\t\tonMouseEnter={ () => setIsPreviewVisible( true ) }\n\t\t\t\tonMouseLeave={ () => setIsPreviewVisible( false ) }\n\t\t\t>\n\t\t\t\t<span className=\"edit-site-navigation-panel__info-wrapper\">\n\t\t\t\t\t<div className=\"edit-site-navigation-panel__template-item-title\">\n\t\t\t\t\t\t{ 'draft' === item.status && (\n\t\t\t\t\t\t\t<em>{ __( '[Draft]' ) }</em>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</div>\n\t\t\t\t\t{ description && (\n\t\t\t\t\t\t<div className=\"edit-site-navigation-panel__template-item-description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</span>\n\t\t\t</Button>\n\n\t\t\t{ isPreviewVisible && (\n\t\t\t\t<NavigationPanelPreviewFill>\n\t\t\t\t\t<TemplatePreview rawContent={ item.content.raw } />\n\t\t\t\t</NavigationPanelPreviewFill>\n\t\t\t) }\n\t\t</NavigationItem>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/template-navigation-item.js"],"names":["TemplateNavigationItem","item","title","description","select","type","editorStore","__experimentalGetTemplateInfo","rendered","slug","setTemplate","setTemplatePart","setIsNavigationPanelOpened","editSiteStore","isPreviewVisible","setIsPreviewVisible","onActivateItem","id","status","content","raw"],"mappings":";;;;;;;;;AAQA;;AALA;;AAIA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAUA;AACA;AACA;AAKe,SAASA,sBAAT,OAA4C;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AAC1D,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAyB,qBAC5BC,MAAF;AAAA;;AAAA,WACC,kBAAkBH,IAAI,CAACI,IAAvB,GACGD,MAAM,CAAEE,aAAF,CAAN,CAAsBC,6BAAtB,CAAqDN,IAArD,CADH,GAEG;AACAC,MAAAA,KAAK,EAAE,CAAAD,IAAI,SAAJ,IAAAA,IAAI,WAAJ,2BAAAA,IAAI,CAAEC,KAAN,4DAAaM,QAAb,MAAyBP,IAAzB,aAAyBA,IAAzB,uBAAyBA,IAAI,CAAEQ,IAA/B,CADP;AAEAN,MAAAA,WAAW,EAAE;AAFb,KAHJ;AAAA,GAD8B,EAQ9B,EAR8B,CAA/B;AAUA,QAAM;AACLO,IAAAA,WADK;AAELC,IAAAA,eAFK;AAGLC,IAAAA;AAHK,MAIF,uBAAaC,YAAb,CAJJ;AAKA,QAAM,CAAEC,gBAAF,EAAoBC,mBAApB,IAA4C,uBAAU,KAAV,CAAlD;;AAEA,MAAK,CAAEd,IAAP,EAAc;AACb,WAAO,IAAP;AACA;;AAED,QAAMe,cAAc,GAAG,MAAM;AAC5B,QAAK,kBAAkBf,IAAI,CAACI,IAA5B,EAAmC;AAClCK,MAAAA,WAAW,CAAET,IAAI,CAACgB,EAAP,EAAWhB,IAAI,CAACQ,IAAhB,CAAX;AACA,KAFD,MAEO;AACNE,MAAAA,eAAe,CAAEV,IAAI,CAACgB,EAAP,CAAf;AACA;;AACDL,IAAAA,0BAA0B,CAAE,KAAF,CAA1B;AACA,GAPD;;AASA,SACC,4BAAC,wCAAD;AACC,IAAA,SAAS,EAAC,2CADX;AAEC,IAAA,IAAI,EAAI,GAAGX,IAAI,CAACI,IAAM,IAAIJ,IAAI,CAACgB,EAAI;AAFpC,KAIC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGD,cADX;AAEC,IAAA,YAAY,EAAG,MAAMD,mBAAmB,CAAE,IAAF,CAFzC;AAGC,IAAA,YAAY,EAAG,MAAMA,mBAAmB,CAAE,KAAF;AAHzC,KAKC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACG,YAAYd,IAAI,CAACiB,MAAjB,IACD,wCAAM,cAAI,SAAJ,CAAN,CAFF,EAIGhB,KAJH,CADD,EAOGC,WAAW,IACZ;AAAK,IAAA,SAAS,EAAC;AAAf,KACGA,WADH,CARF,CALD,CAJD,EAwBGW,gBAAgB,IACjB,4BAAC,iCAAD,QACC,4BAAC,wBAAD;AAAiB,IAAA,UAAU,EAAGb,IAAI,CAACkB,OAAL,CAAaC;AAA3C,IADD,CAzBF,CADD;AAgCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\t__experimentalNavigationItem as NavigationItem,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport TemplatePreview from './template-preview';\nimport { NavigationPanelPreviewFill } from '../index';\nimport { store as editSiteStore } from '../../../store';\n\nexport default function TemplateNavigationItem( { item } ) {\n\tconst { title, description } = useSelect(\n\t\t( select ) =>\n\t\t\t'wp_template' === item.type\n\t\t\t\t? select( editorStore ).__experimentalGetTemplateInfo( item )\n\t\t\t\t: {\n\t\t\t\t\t\ttitle: item?.title?.rendered || item?.slug,\n\t\t\t\t\t\tdescription: '',\n\t\t\t\t },\n\t\t[]\n\t);\n\tconst {\n\t\tsetTemplate,\n\t\tsetTemplatePart,\n\t\tsetIsNavigationPanelOpened,\n\t} = useDispatch( editSiteStore );\n\tconst [ isPreviewVisible, setIsPreviewVisible ] = useState( false );\n\n\tif ( ! item ) {\n\t\treturn null;\n\t}\n\n\tconst onActivateItem = () => {\n\t\tif ( 'wp_template' === item.type ) {\n\t\t\tsetTemplate( item.id, item.slug );\n\t\t} else {\n\t\t\tsetTemplatePart( item.id );\n\t\t}\n\t\tsetIsNavigationPanelOpened( false );\n\t};\n\n\treturn (\n\t\t<NavigationItem\n\t\t\tclassName=\"edit-site-navigation-panel__template-item\"\n\t\t\titem={ `${ item.type }-${ item.id }` }\n\t\t>\n\t\t\t<Button\n\t\t\t\tonClick={ onActivateItem }\n\t\t\t\tonMouseEnter={ () => setIsPreviewVisible( true ) }\n\t\t\t\tonMouseLeave={ () => setIsPreviewVisible( false ) }\n\t\t\t>\n\t\t\t\t<span className=\"edit-site-navigation-panel__info-wrapper\">\n\t\t\t\t\t<div className=\"edit-site-navigation-panel__template-item-title\">\n\t\t\t\t\t\t{ 'draft' === item.status && (\n\t\t\t\t\t\t\t<em>{ __( '[Draft]' ) }</em>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</div>\n\t\t\t\t\t{ description && (\n\t\t\t\t\t\t<div className=\"edit-site-navigation-panel__template-item-description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</span>\n\t\t\t</Button>\n\n\t\t\t{ isPreviewVisible && (\n\t\t\t\t<NavigationPanelPreviewFill>\n\t\t\t\t\t<TemplatePreview rawContent={ item.content.raw } />\n\t\t\t\t</NavigationPanelPreviewFill>\n\t\t\t) }\n\t\t</NavigationItem>\n\t);\n}\n"]}
@@ -14,10 +14,11 @@ var _blockEditor = require("@wordpress/block-editor");
14
14
  /**
15
15
  * WordPress dependencies
16
16
  */
17
- function TemplatePreview({
18
- rawContent,
19
- blockContext
20
- }) {
17
+ function TemplatePreview(_ref) {
18
+ let {
19
+ rawContent,
20
+ blockContext
21
+ } = _ref;
21
22
  const blocks = (0, _element.useMemo)(() => rawContent ? (0, _blocks.parse)(rawContent) : [], [rawContent]);
22
23
 
23
24
  if (!blocks || blocks.length === 0) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/template-preview.js"],"names":["TemplatePreview","rawContent","blockContext","blocks","length"],"mappings":";;;;;;;AAKA;;AAFA;;AACA;;AAJA;AACA;AACA;AAKe,SAASA,eAAT,CAA0B;AAAEC,EAAAA,UAAF;AAAcC,EAAAA;AAAd,CAA1B,EAAyD;AACvE,QAAMC,MAAM,GAAG,sBAAS,MAAQF,UAAU,GAAG,mBAAOA,UAAP,CAAH,GAAyB,EAApD,EAA0D,CACxEA,UADwE,CAA1D,CAAf;;AAIA,MAAK,CAAEE,MAAF,IAAYA,MAAM,CAACC,MAAP,KAAkB,CAAnC,EAAuC;AACtC,WAAO,IAAP;AACA;;AAED,MAAKF,YAAL,EAAoB;AACnB,WACC;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,iCAAD;AAAsB,MAAA,KAAK,EAAGA;AAA9B,OACC,4BAAC,yBAAD;AAAc,MAAA,MAAM,EAAGC,MAAvB;AAAgC,MAAA,aAAa,EAAG;AAAhD,MADD,CADD,CADD;AAOA;;AAED,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,yBAAD;AAAc,IAAA,MAAM,EAAGA,MAAvB;AAAgC,IAAA,aAAa,EAAG;AAAhD,IADD,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { parse } from '@wordpress/blocks';\nimport { BlockPreview, BlockContextProvider } from '@wordpress/block-editor';\nimport { useMemo } from '@wordpress/element';\n\nexport default function TemplatePreview( { rawContent, blockContext } ) {\n\tconst blocks = useMemo( () => ( rawContent ? parse( rawContent ) : [] ), [\n\t\trawContent,\n\t] );\n\n\tif ( ! blocks || blocks.length === 0 ) {\n\t\treturn null;\n\t}\n\n\tif ( blockContext ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-navigation-panel__preview\">\n\t\t\t\t<BlockContextProvider value={ blockContext }>\n\t\t\t\t\t<BlockPreview blocks={ blocks } viewportWidth={ 1200 } />\n\t\t\t\t</BlockContextProvider>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"edit-site-navigation-panel__preview\">\n\t\t\t<BlockPreview blocks={ blocks } viewportWidth={ 1200 } />\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/template-preview.js"],"names":["TemplatePreview","rawContent","blockContext","blocks","length"],"mappings":";;;;;;;AAKA;;AAFA;;AACA;;AAJA;AACA;AACA;AAKe,SAASA,eAAT,OAAyD;AAAA,MAA/B;AAAEC,IAAAA,UAAF;AAAcC,IAAAA;AAAd,GAA+B;AACvE,QAAMC,MAAM,GAAG,sBAAS,MAAQF,UAAU,GAAG,mBAAOA,UAAP,CAAH,GAAyB,EAApD,EAA0D,CACxEA,UADwE,CAA1D,CAAf;;AAIA,MAAK,CAAEE,MAAF,IAAYA,MAAM,CAACC,MAAP,KAAkB,CAAnC,EAAuC;AACtC,WAAO,IAAP;AACA;;AAED,MAAKF,YAAL,EAAoB;AACnB,WACC;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,iCAAD;AAAsB,MAAA,KAAK,EAAGA;AAA9B,OACC,4BAAC,yBAAD;AAAc,MAAA,MAAM,EAAGC,MAAvB;AAAgC,MAAA,aAAa,EAAG;AAAhD,MADD,CADD,CADD;AAOA;;AAED,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,yBAAD;AAAc,IAAA,MAAM,EAAGA,MAAvB;AAAgC,IAAA,aAAa,EAAG;AAAhD,IADD,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { parse } from '@wordpress/blocks';\nimport { BlockPreview, BlockContextProvider } from '@wordpress/block-editor';\nimport { useMemo } from '@wordpress/element';\n\nexport default function TemplatePreview( { rawContent, blockContext } ) {\n\tconst blocks = useMemo( () => ( rawContent ? parse( rawContent ) : [] ), [\n\t\trawContent,\n\t] );\n\n\tif ( ! blocks || blocks.length === 0 ) {\n\t\treturn null;\n\t}\n\n\tif ( blockContext ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-navigation-panel__preview\">\n\t\t\t\t<BlockContextProvider value={ blockContext }>\n\t\t\t\t\t<BlockPreview blocks={ blocks } viewportWidth={ 1200 } />\n\t\t\t\t</BlockContextProvider>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"edit-site-navigation-panel__preview\">\n\t\t\t<BlockPreview blocks={ blocks } viewportWidth={ 1200 } />\n\t\t</div>\n\t);\n}\n"]}
@@ -19,27 +19,19 @@ var _coreData = require("@wordpress/core-data");
19
19
 
20
20
  var _compose = require("@wordpress/compose");
21
21
 
22
- var _store = require("../../../store");
23
-
24
22
  /**
25
23
  * WordPress dependencies
26
24
  */
27
-
28
- /**
29
- * Internal dependencies
30
- */
31
- function NavigationToggle({
32
- icon,
33
- isOpen
34
- }) {
25
+ function NavigationToggle(_ref) {
26
+ let {
27
+ icon,
28
+ isOpen,
29
+ setIsOpen
30
+ } = _ref;
35
31
  const {
36
32
  isRequestingSiteIcon,
37
- navigationPanelMenu,
38
33
  siteIconUrl
39
34
  } = (0, _data.useSelect)(select => {
40
- const {
41
- getCurrentTemplateNavigationPanelSubMenu
42
- } = select(_store.store);
43
35
  const {
44
36
  getEntityRecord,
45
37
  isResolving
@@ -47,24 +39,12 @@ function NavigationToggle({
47
39
  const siteData = getEntityRecord('root', '__unstableBase', undefined) || {};
48
40
  return {
49
41
  isRequestingSiteIcon: isResolving('core', 'getEntityRecord', ['root', '__unstableBase', undefined]),
50
- navigationPanelMenu: getCurrentTemplateNavigationPanelSubMenu(),
51
42
  siteIconUrl: siteData.site_icon_url
52
43
  };
53
44
  }, []);
54
- const {
55
- openNavigationPanelToMenu,
56
- setIsNavigationPanelOpened
57
- } = (0, _data.useDispatch)(_store.store);
58
45
  const disableMotion = (0, _compose.useReducedMotion)();
59
46
 
60
- const toggleNavigationPanel = () => {
61
- if (isOpen) {
62
- setIsNavigationPanelOpened(false);
63
- return;
64
- }
65
-
66
- openNavigationPanelToMenu(navigationPanelMenu);
67
- };
47
+ const toggleNavigationPanel = () => setIsOpen(open => !open);
68
48
 
69
49
  let buttonIcon = (0, _element.createElement)(_components.Icon, {
70
50
  size: "36px",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-toggle/index.js"],"names":["NavigationToggle","icon","isOpen","isRequestingSiteIcon","navigationPanelMenu","siteIconUrl","select","getCurrentTemplateNavigationPanelSubMenu","editSiteStore","getEntityRecord","isResolving","coreDataStore","siteData","undefined","site_icon_url","openNavigationPanelToMenu","setIsNavigationPanelOpened","disableMotion","toggleNavigationPanel","buttonIcon","wordpress","effect","expand","scale","borderRadius","transition","type","duration"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AAjBA;AACA;AACA;;AAYA;AACA;AACA;AAGA,SAASA,gBAAT,CAA2B;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,CAA3B,EAA8C;AAC7C,QAAM;AACLC,IAAAA,oBADK;AAELC,IAAAA,mBAFK;AAGLC,IAAAA;AAHK,MAIF,qBAAaC,MAAF,IAAc;AAC5B,UAAM;AAAEC,MAAAA;AAAF,QAA+CD,MAAM,CAC1DE,YAD0D,CAA3D;AAGA,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA;AAAnB,QAAmCJ,MAAM,CAAEK,eAAF,CAA/C;AACA,UAAMC,QAAQ,GACbH,eAAe,CAAE,MAAF,EAAU,gBAAV,EAA4BI,SAA5B,CAAf,IAA0D,EAD3D;AAGA,WAAO;AACNV,MAAAA,oBAAoB,EAAEO,WAAW,CAAE,MAAF,EAAU,iBAAV,EAA6B,CAC7D,MAD6D,EAE7D,gBAF6D,EAG7DG,SAH6D,CAA7B,CAD3B;AAMNT,MAAAA,mBAAmB,EAAEG,wCAAwC,EANvD;AAONF,MAAAA,WAAW,EAAEO,QAAQ,CAACE;AAPhB,KAAP;AASA,GAjBG,EAiBD,EAjBC,CAJJ;AAuBA,QAAM;AACLC,IAAAA,yBADK;AAELC,IAAAA;AAFK,MAGF,uBAAaR,YAAb,CAHJ;AAKA,QAAMS,aAAa,GAAG,gCAAtB;;AAEA,QAAMC,qBAAqB,GAAG,MAAM;AACnC,QAAKhB,MAAL,EAAc;AACbc,MAAAA,0BAA0B,CAAE,KAAF,CAA1B;AACA;AACA;;AACDD,IAAAA,yBAAyB,CAAEX,mBAAF,CAAzB;AACA,GAND;;AAQA,MAAIe,UAAU,GAAG,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAC,MAAX;AAAkB,IAAA,IAAI,EAAGC;AAAzB,IAAjB;AAEA,QAAMC,MAAM,GAAG;AACdC,IAAAA,MAAM,EAAE;AACPC,MAAAA,KAAK,EAAE,GADA;AAEPC,MAAAA,YAAY,EAAE,CAFP;AAGPC,MAAAA,UAAU,EAAE;AAAEC,QAAAA,IAAI,EAAE,OAAR;AAAiBC,QAAAA,QAAQ,EAAE;AAA3B;AAHL;AADM,GAAf;;AAQA,MAAKtB,WAAL,EAAmB;AAClBc,IAAAA,UAAU,GACT,4BAAC,4BAAD,CAAQ,GAAR;AACC,MAAA,QAAQ,EAAG,CAAEF,aAAF,IAAmBI,MAD/B;AAEC,MAAA,GAAG,EAAG,cAAI,WAAJ,CAFP;AAGC,MAAA,SAAS,EAAC,wCAHX;AAIC,MAAA,GAAG,EAAGhB;AAJP,MADD;AAQA,GATD,MASO,IAAKF,oBAAL,EAA4B;AAClCgB,IAAAA,UAAU,GAAG,IAAb;AACA,GAFM,MAEA,IAAKlB,IAAL,EAAY;AAClBkB,IAAAA,UAAU,GAAG,4BAAC,gBAAD;AAAM,MAAA,IAAI,EAAC,MAAX;AAAkB,MAAA,IAAI,EAAGlB;AAAzB,MAAb;AACA;;AAED,SACC,4BAAC,4BAAD,CAAQ,GAAR;AACC,IAAA,SAAS,EACR,iCAAkCC,MAAM,GAAG,UAAH,GAAgB,EAAxD,CAFF;AAIC,IAAA,UAAU,EAAC;AAJZ,KAMC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,8CADX;AAEC,IAAA,KAAK,EAAG,cAAI,mBAAJ,CAFT;AAGC,IAAA,OAAO,EAAGgB,qBAHX;AAIC,IAAA,WAAW;AAJZ,KAMGC,UANH,CAND,CADD;AAiBA;;eAEcnB,gB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { wordpress } from '@wordpress/icons';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\n\nfunction NavigationToggle( { icon, isOpen } ) {\n\tconst {\n\t\tisRequestingSiteIcon,\n\t\tnavigationPanelMenu,\n\t\tsiteIconUrl,\n\t} = useSelect( ( select ) => {\n\t\tconst { getCurrentTemplateNavigationPanelSubMenu } = select(\n\t\t\teditSiteStore\n\t\t);\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\tisRequestingSiteIcon: 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\tnavigationPanelMenu: getCurrentTemplateNavigationPanelSubMenu(),\n\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\topenNavigationPanelToMenu,\n\t\tsetIsNavigationPanelOpened,\n\t} = useDispatch( editSiteStore );\n\n\tconst disableMotion = useReducedMotion();\n\n\tconst toggleNavigationPanel = () => {\n\t\tif ( isOpen ) {\n\t\t\tsetIsNavigationPanelOpened( false );\n\t\t\treturn;\n\t\t}\n\t\topenNavigationPanelToMenu( navigationPanelMenu );\n\t};\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.7,\n\t\t\tborderRadius: 0,\n\t\t\ttransition: { type: 'tween', duration: '0.2' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-site-navigation-toggle__site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t} else if ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t} else if ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\treturn (\n\t\t<motion.div\n\t\t\tclassName={\n\t\t\t\t'edit-site-navigation-toggle' + ( isOpen ? ' is-open' : '' )\n\t\t\t}\n\t\t\twhileHover=\"expand\"\n\t\t>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-navigation-toggle__button has-icon\"\n\t\t\t\tlabel={ __( 'Toggle navigation' ) }\n\t\t\t\tonClick={ toggleNavigationPanel }\n\t\t\t\tshowTooltip\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default NavigationToggle;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-toggle/index.js"],"names":["NavigationToggle","icon","isOpen","setIsOpen","isRequestingSiteIcon","siteIconUrl","select","getEntityRecord","isResolving","coreDataStore","siteData","undefined","site_icon_url","disableMotion","toggleNavigationPanel","open","buttonIcon","wordpress","effect","expand","scale","borderRadius","transition","type","duration"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAZA;AACA;AACA;AAYA,SAASA,gBAAT,OAAyD;AAAA,MAA9B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,MAAR;AAAgBC,IAAAA;AAAhB,GAA8B;AACxD,QAAM;AAAEC,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MAAwC,qBAAaC,MAAF,IAAc;AACtE,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA;AAAnB,QAAmCF,MAAM,CAAEG,eAAF,CAA/C;AACA,UAAMC,QAAQ,GACbH,eAAe,CAAE,MAAF,EAAU,gBAAV,EAA4BI,SAA5B,CAAf,IAA0D,EAD3D;AAGA,WAAO;AACNP,MAAAA,oBAAoB,EAAEI,WAAW,CAAE,MAAF,EAAU,iBAAV,EAA6B,CAC7D,MAD6D,EAE7D,gBAF6D,EAG7DG,SAH6D,CAA7B,CAD3B;AAMNN,MAAAA,WAAW,EAAEK,QAAQ,CAACE;AANhB,KAAP;AAQA,GAb6C,EAa3C,EAb2C,CAA9C;AAeA,QAAMC,aAAa,GAAG,gCAAtB;;AAEA,QAAMC,qBAAqB,GAAG,MAAMX,SAAS,CAAIY,IAAF,IAAY,CAAEA,IAAhB,CAA7C;;AAEA,MAAIC,UAAU,GAAG,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAC,MAAX;AAAkB,IAAA,IAAI,EAAGC;AAAzB,IAAjB;AAEA,QAAMC,MAAM,GAAG;AACdC,IAAAA,MAAM,EAAE;AACPC,MAAAA,KAAK,EAAE,GADA;AAEPC,MAAAA,YAAY,EAAE,CAFP;AAGPC,MAAAA,UAAU,EAAE;AAAEC,QAAAA,IAAI,EAAE,OAAR;AAAiBC,QAAAA,QAAQ,EAAE;AAA3B;AAHL;AADM,GAAf;;AAQA,MAAKnB,WAAL,EAAmB;AAClBW,IAAAA,UAAU,GACT,4BAAC,4BAAD,CAAQ,GAAR;AACC,MAAA,QAAQ,EAAG,CAAEH,aAAF,IAAmBK,MAD/B;AAEC,MAAA,GAAG,EAAG,cAAI,WAAJ,CAFP;AAGC,MAAA,SAAS,EAAC,wCAHX;AAIC,MAAA,GAAG,EAAGb;AAJP,MADD;AAQA,GATD,MASO,IAAKD,oBAAL,EAA4B;AAClCY,IAAAA,UAAU,GAAG,IAAb;AACA,GAFM,MAEA,IAAKf,IAAL,EAAY;AAClBe,IAAAA,UAAU,GAAG,4BAAC,gBAAD;AAAM,MAAA,IAAI,EAAC,MAAX;AAAkB,MAAA,IAAI,EAAGf;AAAzB,MAAb;AACA;;AAED,SACC,4BAAC,4BAAD,CAAQ,GAAR;AACC,IAAA,SAAS,EACR,iCAAkCC,MAAM,GAAG,UAAH,GAAgB,EAAxD,CAFF;AAIC,IAAA,UAAU,EAAC;AAJZ,KAMC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,8CADX;AAEC,IAAA,KAAK,EAAG,cAAI,mBAAJ,CAFT;AAGC,IAAA,OAAO,EAAGY,qBAHX;AAIC,IAAA,WAAW;AAJZ,KAMGE,UANH,CAND,CADD;AAiBA;;eAEchB,gB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { wordpress } from '@wordpress/icons';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\nfunction NavigationToggle( { icon, isOpen, setIsOpen } ) {\n\tconst { isRequestingSiteIcon, 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\tisRequestingSiteIcon: 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\tconst disableMotion = useReducedMotion();\n\n\tconst toggleNavigationPanel = () => setIsOpen( ( open ) => ! open );\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.7,\n\t\t\tborderRadius: 0,\n\t\t\ttransition: { type: 'tween', duration: '0.2' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-site-navigation-toggle__site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t} else if ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t} else if ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\treturn (\n\t\t<motion.div\n\t\t\tclassName={\n\t\t\t\t'edit-site-navigation-toggle' + ( isOpen ? ' is-open' : '' )\n\t\t\t}\n\t\t\twhileHover=\"expand\"\n\t\t>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-navigation-toggle__button has-icon\"\n\t\t\t\tlabel={ __( 'Toggle navigation' ) }\n\t\t\t\tonClick={ toggleNavigationPanel }\n\t\t\t\tshowTooltip\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default NavigationToggle;\n"]}
@@ -24,10 +24,11 @@ var _coreData = require("@wordpress/core-data");
24
24
  /**
25
25
  * WordPress dependencies
26
26
  */
27
- function SaveButton({
28
- openEntitiesSavedStates,
29
- isEntitiesSavedStatesOpen
30
- }) {
27
+ function SaveButton(_ref) {
28
+ let {
29
+ openEntitiesSavedStates,
30
+ isEntitiesSavedStatesOpen
31
+ } = _ref;
31
32
  const {
32
33
  isDirty,
33
34
  isSaving
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"names":["SaveButton","openEntitiesSavedStates","isEntitiesSavedStatesOpen","isDirty","isSaving","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","length","record","kind","name","key","disabled","undefined"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMe,SAASA,UAAT,CAAqB;AACnCC,EAAAA,uBADmC;AAEnCC,EAAAA;AAFmC,CAArB,EAGX;AACH,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,MAAwB,qBAAaC,MAAF,IAAc;AACtD,UAAM;AACLC,MAAAA,mCADK;AAELC,MAAAA;AAFK,QAGFF,MAAM,CAAEG,eAAF,CAHV;;AAIA,UAAMC,kBAAkB,GAAGH,mCAAmC,EAA9D;;AACA,WAAO;AACNH,MAAAA,OAAO,EAAEM,kBAAkB,CAACC,MAAnB,GAA4B,CAD/B;AAENN,MAAAA,QAAQ,EAAE,kBAAMK,kBAAN,EAA4BE,MAAF,IACnCJ,oBAAoB,CAAEI,MAAM,CAACC,IAAT,EAAeD,MAAM,CAACE,IAAtB,EAA4BF,MAAM,CAACG,GAAnC,CADX;AAFJ,KAAP;AAMA,GAZ6B,EAY3B,EAZ2B,CAA9B;AAcA,QAAMC,QAAQ,GAAG,CAAEZ,OAAF,IAAaC,QAA9B;AAEA,SACC,qDACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,SAAS,EAAC,+BAFX;AAGC,qBAAgBW,QAHjB;AAIC,qBAAgBb,yBAJjB;AAKC,IAAA,QAAQ,EAAGa,QALZ;AAMC,IAAA,MAAM,EAAGX,QANV;AAOC,IAAA,OAAO,EAAGW,QAAQ,GAAGC,SAAH,GAAef;AAPlC,KASG,cAAI,MAAJ,CATH,CADD,CADD;AAeA","sourcesContent":["/**\n * External dependencies\n */\nimport { some } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function SaveButton( {\n\topenEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n} ) {\n\tconst { isDirty, isSaving } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tisSavingEntityRecord,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\treturn {\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving: some( dirtyEntityRecords, ( record ) =>\n\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tconst disabled = ! isDirty || isSaving;\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tclassName=\"edit-site-save-button__button\"\n\t\t\t\taria-disabled={ disabled }\n\t\t\t\taria-expanded={ isEntitiesSavedStatesOpen }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tisBusy={ isSaving }\n\t\t\t\tonClick={ disabled ? undefined : openEntitiesSavedStates }\n\t\t\t>\n\t\t\t\t{ __( 'Save' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"names":["SaveButton","openEntitiesSavedStates","isEntitiesSavedStatesOpen","isDirty","isSaving","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","length","record","kind","name","key","disabled","undefined"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMe,SAASA,UAAT,OAGX;AAAA,MAHgC;AACnCC,IAAAA,uBADmC;AAEnCC,IAAAA;AAFmC,GAGhC;AACH,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,MAAwB,qBAAaC,MAAF,IAAc;AACtD,UAAM;AACLC,MAAAA,mCADK;AAELC,MAAAA;AAFK,QAGFF,MAAM,CAAEG,eAAF,CAHV;;AAIA,UAAMC,kBAAkB,GAAGH,mCAAmC,EAA9D;;AACA,WAAO;AACNH,MAAAA,OAAO,EAAEM,kBAAkB,CAACC,MAAnB,GAA4B,CAD/B;AAENN,MAAAA,QAAQ,EAAE,kBAAMK,kBAAN,EAA4BE,MAAF,IACnCJ,oBAAoB,CAAEI,MAAM,CAACC,IAAT,EAAeD,MAAM,CAACE,IAAtB,EAA4BF,MAAM,CAACG,GAAnC,CADX;AAFJ,KAAP;AAMA,GAZ6B,EAY3B,EAZ2B,CAA9B;AAcA,QAAMC,QAAQ,GAAG,CAAEZ,OAAF,IAAaC,QAA9B;AAEA,SACC,qDACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,SAAS,EAAC,+BAFX;AAGC,qBAAgBW,QAHjB;AAIC,qBAAgBb,yBAJjB;AAKC,IAAA,QAAQ,EAAGa,QALZ;AAMC,IAAA,MAAM,EAAGX,QANV;AAOC,IAAA,OAAO,EAAGW,QAAQ,GAAGC,SAAH,GAAef;AAPlC,KASG,cAAI,MAAJ,CATH,CADD,CADD;AAeA","sourcesContent":["/**\n * External dependencies\n */\nimport { some } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function SaveButton( {\n\topenEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n} ) {\n\tconst { isDirty, isSaving } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tisSavingEntityRecord,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\treturn {\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving: some( dirtyEntityRecords, ( record ) =>\n\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tconst disabled = ! isDirty || isSaving;\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tclassName=\"edit-site-save-button__button\"\n\t\t\t\taria-disabled={ disabled }\n\t\t\t\taria-expanded={ isEntitiesSavedStatesOpen }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tisBusy={ isSaving }\n\t\t\t\tonClick={ disabled ? undefined : openEntitiesSavedStates }\n\t\t\t>\n\t\t\t\t{ __( 'Save' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SIDEBAR_BLOCK = exports.SIDEBAR_TEMPLATE = void 0;
6
+ exports.SIDEBAR_TEMPLATE = exports.SIDEBAR_BLOCK = void 0;
7
7
  const SIDEBAR_TEMPLATE = 'edit-site/template';
8
8
  exports.SIDEBAR_TEMPLATE = SIDEBAR_TEMPLATE;
9
9
  const SIDEBAR_BLOCK = 'edit-site/block-inspector';
@@ -12,16 +12,17 @@ var _interface = require("@wordpress/interface");
12
12
  /**
13
13
  * WordPress dependencies
14
14
  */
15
- function DefaultSidebar({
16
- className,
17
- identifier,
18
- title,
19
- icon,
20
- children,
21
- closeLabel,
22
- header,
23
- headerClassName
24
- }) {
15
+ function DefaultSidebar(_ref) {
16
+ let {
17
+ className,
18
+ identifier,
19
+ title,
20
+ icon,
21
+ children,
22
+ closeLabel,
23
+ header,
24
+ headerClassName
25
+ } = _ref;
25
26
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_interface.ComplementaryArea, {
26
27
  className: className,
27
28
  scope: "core/edit-site",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/default-sidebar.js"],"names":["DefaultSidebar","className","identifier","title","icon","children","closeLabel","header","headerClassName"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAMe,SAASA,cAAT,CAAyB;AACvCC,EAAAA,SADuC;AAEvCC,EAAAA,UAFuC;AAGvCC,EAAAA,KAHuC;AAIvCC,EAAAA,IAJuC;AAKvCC,EAAAA,QALuC;AAMvCC,EAAAA,UANuC;AAOvCC,EAAAA,MAPuC;AAQvCC,EAAAA;AARuC,CAAzB,EASX;AACH,SACC,qDACC,4BAAC,4BAAD;AACC,IAAA,SAAS,EAAGP,SADb;AAEC,IAAA,KAAK,EAAC,gBAFP;AAGC,IAAA,UAAU,EAAGC,UAHd;AAIC,IAAA,KAAK,EAAGC,KAJT;AAKC,IAAA,IAAI,EAAGC,IALR;AAMC,IAAA,UAAU,EAAGE,UANd;AAOC,IAAA,MAAM,EAAGC,MAPV;AAQC,IAAA,eAAe,EAAGC;AARnB,KAUGH,QAVH,CADD,EAaC,4BAAC,wCAAD;AACC,IAAA,KAAK,EAAC,gBADP;AAEC,IAAA,UAAU,EAAGH,UAFd;AAGC,IAAA,IAAI,EAAGE;AAHR,KAKGD,KALH,CAbD,CADD;AAuBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tComplementaryArea,\n\tComplementaryAreaMoreMenuItem,\n} from '@wordpress/interface';\n\nexport default function DefaultSidebar( {\n\tclassName,\n\tidentifier,\n\ttitle,\n\ticon,\n\tchildren,\n\tcloseLabel,\n\theader,\n\theaderClassName,\n} ) {\n\treturn (\n\t\t<>\n\t\t\t<ComplementaryArea\n\t\t\t\tclassName={ className }\n\t\t\t\tscope=\"core/edit-site\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ttitle={ title }\n\t\t\t\ticon={ icon }\n\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\theader={ header }\n\t\t\t\theaderClassName={ headerClassName }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</ComplementaryArea>\n\t\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t\tscope=\"core/edit-site\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ticon={ icon }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</ComplementaryAreaMoreMenuItem>\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/default-sidebar.js"],"names":["DefaultSidebar","className","identifier","title","icon","children","closeLabel","header","headerClassName"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAMe,SAASA,cAAT,OASX;AAAA,MAToC;AACvCC,IAAAA,SADuC;AAEvCC,IAAAA,UAFuC;AAGvCC,IAAAA,KAHuC;AAIvCC,IAAAA,IAJuC;AAKvCC,IAAAA,QALuC;AAMvCC,IAAAA,UANuC;AAOvCC,IAAAA,MAPuC;AAQvCC,IAAAA;AARuC,GASpC;AACH,SACC,qDACC,4BAAC,4BAAD;AACC,IAAA,SAAS,EAAGP,SADb;AAEC,IAAA,KAAK,EAAC,gBAFP;AAGC,IAAA,UAAU,EAAGC,UAHd;AAIC,IAAA,KAAK,EAAGC,KAJT;AAKC,IAAA,IAAI,EAAGC,IALR;AAMC,IAAA,UAAU,EAAGE,UANd;AAOC,IAAA,MAAM,EAAGC,MAPV;AAQC,IAAA,eAAe,EAAGC;AARnB,KAUGH,QAVH,CADD,EAaC,4BAAC,wCAAD;AACC,IAAA,KAAK,EAAC,gBADP;AAEC,IAAA,UAAU,EAAGH,UAFd;AAGC,IAAA,IAAI,EAAGE;AAHR,KAKGD,KALH,CAbD,CADD;AAuBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tComplementaryArea,\n\tComplementaryAreaMoreMenuItem,\n} from '@wordpress/interface';\n\nexport default function DefaultSidebar( {\n\tclassName,\n\tidentifier,\n\ttitle,\n\ticon,\n\tchildren,\n\tcloseLabel,\n\theader,\n\theaderClassName,\n} ) {\n\treturn (\n\t\t<>\n\t\t\t<ComplementaryArea\n\t\t\t\tclassName={ className }\n\t\t\t\tscope=\"core/edit-site\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ttitle={ title }\n\t\t\t\ticon={ icon }\n\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\theader={ header }\n\t\t\t\theaderClassName={ headerClassName }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</ComplementaryArea>\n\t\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t\tscope=\"core/edit-site\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ticon={ icon }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</ComplementaryAreaMoreMenuItem>\n\t\t</>\n\t);\n}\n"]}
@@ -82,10 +82,11 @@ var _interface = require("@wordpress/interface");
82
82
  * );
83
83
  * ```
84
84
  */
85
- function PluginSidebarEditSite({
86
- className,
87
- ...props
88
- }) {
85
+ function PluginSidebarEditSite(_ref) {
86
+ let {
87
+ className,
88
+ ...props
89
+ } = _ref;
89
90
  return (0, _element.createElement)(_interface.ComplementaryArea, (0, _extends2.default)({
90
91
  panelClassName: className,
91
92
  className: "edit-site-sidebar",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/plugin-sidebar/index.js"],"names":["PluginSidebarEditSite","className","props"],"mappings":";;;;;;;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,qBAAT,CAAgC;AAAEC,EAAAA,SAAF;AAAa,KAAGC;AAAhB,CAAhC,EAA0D;AACxE,SACC,4BAAC,4BAAD;AACC,IAAA,cAAc,EAAGD,SADlB;AAEC,IAAA,SAAS,EAAC,mBAFX;AAGC,IAAA,KAAK,EAAC;AAHP,KAIMC,KAJN,EADD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ComplementaryArea } from '@wordpress/interface';\n\n/**\n * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.\n * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.\n * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:\n *\n * ```js\n * wp.data.dispatch( 'core/edit-site' ).openGeneralSidebar( 'plugin-name/sidebar-name' );\n * ```\n *\n * @see PluginSidebarMoreMenuItem\n *\n * @param {Object} props Element props.\n * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.\n * @param {string} [props.className] An optional class name added to the sidebar body.\n * @param {string} props.title Title displayed at the top of the sidebar.\n * @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var el = wp.element.createElement;\n * var PanelBody = wp.components.PanelBody;\n * var PluginSidebar = wp.editSite.PluginSidebar;\n * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.\n *\n * function MyPluginSidebar() {\n * \treturn el(\n * \t\t\tPluginSidebar,\n * \t\t\t{\n * \t\t\t\tname: 'my-sidebar',\n * \t\t\t\ttitle: 'My sidebar title',\n * \t\t\t\ticon: moreIcon,\n * \t\t\t},\n * \t\t\tel(\n * \t\t\t\tPanelBody,\n * \t\t\t\t{},\n * \t\t\t\t__( 'My sidebar content' )\n * \t\t\t)\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PanelBody } from '@wordpress/components';\n * import { PluginSidebar } from '@wordpress/edit-site';\n * import { more } from '@wordpress/icons';\n *\n * const MyPluginSidebar = () => (\n * \t<PluginSidebar\n * \t\tname=\"my-sidebar\"\n * \t\ttitle=\"My sidebar title\"\n * \t\ticon={ more }\n * \t>\n * \t\t<PanelBody>\n * \t\t\t{ __( 'My sidebar content' ) }\n * \t\t</PanelBody>\n * \t</PluginSidebar>\n * );\n * ```\n */\nexport default function PluginSidebarEditSite( { className, ...props } ) {\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tpanelClassName={ className }\n\t\t\tclassName=\"edit-site-sidebar\"\n\t\t\tscope=\"core/edit-site\"\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/plugin-sidebar/index.js"],"names":["PluginSidebarEditSite","className","props"],"mappings":";;;;;;;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,qBAAT,OAA0D;AAAA,MAA1B;AAAEC,IAAAA,SAAF;AAAa,OAAGC;AAAhB,GAA0B;AACxE,SACC,4BAAC,4BAAD;AACC,IAAA,cAAc,EAAGD,SADlB;AAEC,IAAA,SAAS,EAAC,mBAFX;AAGC,IAAA,KAAK,EAAC;AAHP,KAIMC,KAJN,EADD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ComplementaryArea } from '@wordpress/interface';\n\n/**\n * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.\n * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.\n * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:\n *\n * ```js\n * wp.data.dispatch( 'core/edit-site' ).openGeneralSidebar( 'plugin-name/sidebar-name' );\n * ```\n *\n * @see PluginSidebarMoreMenuItem\n *\n * @param {Object} props Element props.\n * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.\n * @param {string} [props.className] An optional class name added to the sidebar body.\n * @param {string} props.title Title displayed at the top of the sidebar.\n * @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var el = wp.element.createElement;\n * var PanelBody = wp.components.PanelBody;\n * var PluginSidebar = wp.editSite.PluginSidebar;\n * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.\n *\n * function MyPluginSidebar() {\n * \treturn el(\n * \t\t\tPluginSidebar,\n * \t\t\t{\n * \t\t\t\tname: 'my-sidebar',\n * \t\t\t\ttitle: 'My sidebar title',\n * \t\t\t\ticon: moreIcon,\n * \t\t\t},\n * \t\t\tel(\n * \t\t\t\tPanelBody,\n * \t\t\t\t{},\n * \t\t\t\t__( 'My sidebar content' )\n * \t\t\t)\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PanelBody } from '@wordpress/components';\n * import { PluginSidebar } from '@wordpress/edit-site';\n * import { more } from '@wordpress/icons';\n *\n * const MyPluginSidebar = () => (\n * \t<PluginSidebar\n * \t\tname=\"my-sidebar\"\n * \t\ttitle=\"My sidebar title\"\n * \t\ticon={ more }\n * \t>\n * \t\t<PanelBody>\n * \t\t\t{ __( 'My sidebar content' ) }\n * \t\t</PanelBody>\n * \t</PluginSidebar>\n * );\n * ```\n */\nexport default function PluginSidebarEditSite( { className, ...props } ) {\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tpanelClassName={ className }\n\t\t\tclassName=\"edit-site-sidebar\"\n\t\t\tscope=\"core/edit-site\"\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"]}
@@ -26,9 +26,10 @@ var _constants2 = require("../constants");
26
26
  /**
27
27
  * Internal dependencies
28
28
  */
29
- const SettingsHeader = ({
30
- sidebarName
31
- }) => {
29
+ const SettingsHeader = _ref => {
30
+ let {
31
+ sidebarName
32
+ } = _ref;
32
33
  const {
33
34
  enableComplementaryArea
34
35
  } = (0, _data.useDispatch)(_interface.store);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/settings-header/index.js"],"names":["SettingsHeader","sidebarName","enableComplementaryArea","interfaceStore","openTemplateSettings","STORE_NAME","SIDEBAR_TEMPLATE","openBlockSettings","SIDEBAR_BLOCK","templateAriaLabel","templateActiveClass","blockAriaLabel","blockActiveClass"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAZA;AACA;AACA;;AAMA;AACA;AACA;AAIA,MAAMA,cAAc,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF,KAAuB;AAC7C,QAAM;AAAEC,IAAAA;AAAF,MAA8B,uBAAaC,gBAAb,CAApC;;AACA,QAAMC,oBAAoB,GAAG,MAC5BF,uBAAuB,CAAEG,qBAAF,EAAcC,4BAAd,CADxB;;AAEA,QAAMC,iBAAiB,GAAG,MACzBL,uBAAuB,CAAEG,qBAAF,EAAcG,yBAAd,CADxB;;AAGA,QAAM,CAAEC,iBAAF,EAAqBC,mBAArB,IACLT,WAAW,KAAKK,4BAAhB,GACG;AACA,GAAE,cAAI,qBAAJ,CAAF,EAA+B,WAA/B,CAFH,GAGG;AACA,GAAE,cAAI,UAAJ,CAAF,EAAoB,EAApB,CALJ;AAOA,QAAM,CAAEK,cAAF,EAAkBC,gBAAlB,IACLX,WAAW,KAAKO,yBAAhB,GACG;AACA,GAAE,cAAI,kBAAJ,CAAF,EAA4B,WAA5B,CAFH,GAGG;AACA,GAAE,cAAI,OAAJ,CAAF,EAAiB,EAAjB,CALJ;AAOA;;AACA,SACC,wCACC,wCACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGJ,oBADX;AAEC,IAAA,SAAS,EAAI,gCAAgCM,mBAAqB,EAFnE;AAGC,kBAAaD,iBAHd,CAIC;AAJD;AAKC,kBAAa,cAAI,UAAJ;AALd,KAQE;AACA,gBAAI,UAAJ,CATF,CADD,CADD,EAeC,wCACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGF,iBADX;AAEC,IAAA,SAAS,EAAI,gCAAgCK,gBAAkB,EAFhE;AAGC,kBAAaD,cAHd,CAIC;AAJD;AAKC,kBAAa,cAAI,OAAJ;AALd,KAQE;AACA,gBAAI,OAAJ,CATF,CADD,CAfD,CADD;AAgCA,CAtDD;;eAwDeX,c","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME } from '../../../store/constants';\nimport { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from '../constants';\n\nconst SettingsHeader = ( { sidebarName } ) => {\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst openTemplateSettings = () =>\n\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );\n\tconst openBlockSettings = () =>\n\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\n\tconst [ templateAriaLabel, templateActiveClass ] =\n\t\tsidebarName === SIDEBAR_TEMPLATE\n\t\t\t? // translators: ARIA label for the Template sidebar tab, selected.\n\t\t\t [ __( 'Template (selected)' ), 'is-active' ]\n\t\t\t: // translators: ARIA label for the Template Settings Sidebar tab, not selected.\n\t\t\t [ __( 'Template' ), '' ];\n\n\tconst [ blockAriaLabel, blockActiveClass ] =\n\t\tsidebarName === SIDEBAR_BLOCK\n\t\t\t? // translators: ARIA label for the Block Settings Sidebar tab, selected.\n\t\t\t [ __( 'Block (selected)' ), 'is-active' ]\n\t\t\t: // translators: ARIA label for the Block Settings Sidebar tab, not selected.\n\t\t\t [ __( 'Block' ), '' ];\n\n\t/* Use a list so screen readers will announce how many tabs there are. */\n\treturn (\n\t\t<ul>\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openTemplateSettings }\n\t\t\t\t\tclassName={ `edit-site-sidebar__panel-tab ${ templateActiveClass }` }\n\t\t\t\t\taria-label={ templateAriaLabel }\n\t\t\t\t\t// translators: Data label for the Template Settings Sidebar tab.\n\t\t\t\t\tdata-label={ __( 'Template' ) }\n\t\t\t\t>\n\t\t\t\t\t{\n\t\t\t\t\t\t// translators: Text label for the Template Settings Sidebar tab.\n\t\t\t\t\t\t__( 'Template' )\n\t\t\t\t\t}\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openBlockSettings }\n\t\t\t\t\tclassName={ `edit-site-sidebar__panel-tab ${ blockActiveClass }` }\n\t\t\t\t\taria-label={ blockAriaLabel }\n\t\t\t\t\t// translators: Data label for the Block Settings Sidebar tab.\n\t\t\t\t\tdata-label={ __( 'Block' ) }\n\t\t\t\t>\n\t\t\t\t\t{\n\t\t\t\t\t\t// translators: Text label for the Block Settings Sidebar tab.\n\t\t\t\t\t\t__( 'Block' )\n\t\t\t\t\t}\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t</ul>\n\t);\n};\n\nexport default SettingsHeader;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/settings-header/index.js"],"names":["SettingsHeader","sidebarName","enableComplementaryArea","interfaceStore","openTemplateSettings","STORE_NAME","SIDEBAR_TEMPLATE","openBlockSettings","SIDEBAR_BLOCK","templateAriaLabel","templateActiveClass","blockAriaLabel","blockActiveClass"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAZA;AACA;AACA;;AAMA;AACA;AACA;AAIA,MAAMA,cAAc,GAAG,QAAuB;AAAA,MAArB;AAAEC,IAAAA;AAAF,GAAqB;AAC7C,QAAM;AAAEC,IAAAA;AAAF,MAA8B,uBAAaC,gBAAb,CAApC;;AACA,QAAMC,oBAAoB,GAAG,MAC5BF,uBAAuB,CAAEG,qBAAF,EAAcC,4BAAd,CADxB;;AAEA,QAAMC,iBAAiB,GAAG,MACzBL,uBAAuB,CAAEG,qBAAF,EAAcG,yBAAd,CADxB;;AAGA,QAAM,CAAEC,iBAAF,EAAqBC,mBAArB,IACLT,WAAW,KAAKK,4BAAhB,GACG;AACA,GAAE,cAAI,qBAAJ,CAAF,EAA+B,WAA/B,CAFH,GAGG;AACA,GAAE,cAAI,UAAJ,CAAF,EAAoB,EAApB,CALJ;AAOA,QAAM,CAAEK,cAAF,EAAkBC,gBAAlB,IACLX,WAAW,KAAKO,yBAAhB,GACG;AACA,GAAE,cAAI,kBAAJ,CAAF,EAA4B,WAA5B,CAFH,GAGG;AACA,GAAE,cAAI,OAAJ,CAAF,EAAiB,EAAjB,CALJ;AAOA;;AACA,SACC,wCACC,wCACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGJ,oBADX;AAEC,IAAA,SAAS,EAAI,gCAAgCM,mBAAqB,EAFnE;AAGC,kBAAaD,iBAHd,CAIC;AAJD;AAKC,kBAAa,cAAI,UAAJ;AALd,KAQE;AACA,gBAAI,UAAJ,CATF,CADD,CADD,EAeC,wCACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGF,iBADX;AAEC,IAAA,SAAS,EAAI,gCAAgCK,gBAAkB,EAFhE;AAGC,kBAAaD,cAHd,CAIC;AAJD;AAKC,kBAAa,cAAI,OAAJ;AALd,KAQE;AACA,gBAAI,OAAJ,CATF,CADD,CAfD,CADD;AAgCA,CAtDD;;eAwDeX,c","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME } from '../../../store/constants';\nimport { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from '../constants';\n\nconst SettingsHeader = ( { sidebarName } ) => {\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst openTemplateSettings = () =>\n\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );\n\tconst openBlockSettings = () =>\n\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\n\tconst [ templateAriaLabel, templateActiveClass ] =\n\t\tsidebarName === SIDEBAR_TEMPLATE\n\t\t\t? // translators: ARIA label for the Template sidebar tab, selected.\n\t\t\t [ __( 'Template (selected)' ), 'is-active' ]\n\t\t\t: // translators: ARIA label for the Template Settings Sidebar tab, not selected.\n\t\t\t [ __( 'Template' ), '' ];\n\n\tconst [ blockAriaLabel, blockActiveClass ] =\n\t\tsidebarName === SIDEBAR_BLOCK\n\t\t\t? // translators: ARIA label for the Block Settings Sidebar tab, selected.\n\t\t\t [ __( 'Block (selected)' ), 'is-active' ]\n\t\t\t: // translators: ARIA label for the Block Settings Sidebar tab, not selected.\n\t\t\t [ __( 'Block' ), '' ];\n\n\t/* Use a list so screen readers will announce how many tabs there are. */\n\treturn (\n\t\t<ul>\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openTemplateSettings }\n\t\t\t\t\tclassName={ `edit-site-sidebar__panel-tab ${ templateActiveClass }` }\n\t\t\t\t\taria-label={ templateAriaLabel }\n\t\t\t\t\t// translators: Data label for the Template Settings Sidebar tab.\n\t\t\t\t\tdata-label={ __( 'Template' ) }\n\t\t\t\t>\n\t\t\t\t\t{\n\t\t\t\t\t\t// translators: Text label for the Template Settings Sidebar tab.\n\t\t\t\t\t\t__( 'Template' )\n\t\t\t\t\t}\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openBlockSettings }\n\t\t\t\t\tclassName={ `edit-site-sidebar__panel-tab ${ blockActiveClass }` }\n\t\t\t\t\taria-label={ blockAriaLabel }\n\t\t\t\t\t// translators: Data label for the Block Settings Sidebar tab.\n\t\t\t\t\tdata-label={ __( 'Block' ) }\n\t\t\t\t>\n\t\t\t\t\t{\n\t\t\t\t\t\t// translators: Text label for the Block Settings Sidebar tab.\n\t\t\t\t\t\t__( 'Block' )\n\t\t\t\t\t}\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t</ul>\n\t);\n};\n\nexport default SettingsHeader;\n"]}
@@ -28,10 +28,11 @@ var _constants = require("../../../store/constants");
28
28
  /**
29
29
  * Internal dependencies
30
30
  */
31
- function TemplateAreaItem({
32
- area,
33
- clientId
34
- }) {
31
+ function TemplateAreaItem(_ref) {
32
+ let {
33
+ area,
34
+ clientId
35
+ } = _ref;
35
36
  const {
36
37
  selectBlock,
37
38
  toggleBlockHighlight
@@ -68,14 +69,17 @@ function TemplateAreas() {
68
69
  className: "edit-site-template-card__template-areas-title"
69
70
  }, (0, _i18n.__)('Areas')), (0, _element.createElement)("ul", {
70
71
  className: "edit-site-template-card__template-areas-list"
71
- }, templateParts.map(({
72
- templatePart,
73
- block
74
- }) => (0, _element.createElement)("li", {
75
- key: templatePart.slug
76
- }, (0, _element.createElement)(TemplateAreaItem, {
77
- area: templatePart.area,
78
- clientId: block.clientId
79
- })))));
72
+ }, templateParts.map(_ref2 => {
73
+ let {
74
+ templatePart,
75
+ block
76
+ } = _ref2;
77
+ return (0, _element.createElement)("li", {
78
+ key: templatePart.slug
79
+ }, (0, _element.createElement)(TemplateAreaItem, {
80
+ area: templatePart.area,
81
+ clientId: block.clientId
82
+ }));
83
+ })));
80
84
  }
81
85
  //# sourceMappingURL=template-areas.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/template-card/template-areas.js"],"names":["TemplateAreaItem","area","clientId","selectBlock","toggleBlockHighlight","blockEditorStore","highlightBlock","cancelHighlightBlock","TEMPLATE_PART_AREA_TO_NAME","TemplateAreas","templateParts","select","editSiteStore","getCurrentTemplateTemplateParts","length","map","templatePart","block","slug"],"mappings":";;;;;;;;;AAGA;;AACA;;AAIA;;AACA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIA,SAASA,gBAAT,CAA2B;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,CAA3B,EAAgD;AAC/C,QAAM;AAAEC,IAAAA,WAAF;AAAeC,IAAAA;AAAf,MAAwC,uBAC7CC,kBAD6C,CAA9C;;AAGA,QAAMC,cAAc,GAAG,MAAMF,oBAAoB,CAAEF,QAAF,EAAY,IAAZ,CAAjD;;AACA,QAAMK,oBAAoB,GAAG,MAAMH,oBAAoB,CAAEF,QAAF,EAAY,KAAZ,CAAvD;;AAEA,SACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,8CADX;AAEC,IAAA,IAAI,EAAG,iCAAqBD,IAArB,CAFR;AAGC,IAAA,WAAW,EAAGK,cAHf;AAIC,IAAA,YAAY,EAAGC,oBAJhB;AAKC,IAAA,OAAO,EAAGD,cALX;AAMC,IAAA,MAAM,EAAGC,oBANV;AAOC,IAAA,OAAO,EAAG,MAAM;AACfJ,MAAAA,WAAW,CAAED,QAAF,CAAX;AACA;AATF,KAWGM,sCAA4BP,IAA5B,CAXH,CADD;AAeA;;AAEc,SAASQ,aAAT,GAAyB;AACvC,QAAMC,aAAa,GAAG,qBACnBC,MAAF,IAAcA,MAAM,CAAEC,YAAF,CAAN,CAAwBC,+BAAxB,EADO,EAErB,EAFqB,CAAtB;;AAKA,MAAK,CAAEH,aAAa,CAACI,MAArB,EAA8B;AAC7B,WAAO,IAAP;AACA;;AAED,SACC;AAAS,IAAA,SAAS,EAAC;AAAnB,KACC,4BAAC,iCAAD;AACC,IAAA,KAAK,EAAG,CADT;AAEC,IAAA,SAAS,EAAC;AAFX,KAIG,cAAI,OAAJ,CAJH,CADD,EAQC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGJ,aAAa,CAACK,GAAd,CAAmB,CAAE;AAAEC,IAAAA,YAAF;AAAgBC,IAAAA;AAAhB,GAAF,KACpB;AAAI,IAAA,GAAG,EAAGD,YAAY,CAACE;AAAvB,KACC,4BAAC,gBAAD;AACC,IAAA,IAAI,EAAGF,YAAY,CAACf,IADrB;AAEC,IAAA,QAAQ,EAAGgB,KAAK,CAACf;AAFlB,IADD,CADC,CADH,CARD,CADD;AAqBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalHeading as Heading,\n} from '@wordpress/components';\nimport { getTemplatePartIcon } from '@wordpress/editor';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\nimport { TEMPLATE_PART_AREA_TO_NAME } from '../../../store/constants';\n\nfunction TemplateAreaItem( { area, clientId } ) {\n\tconst { selectBlock, toggleBlockHighlight } = useDispatch(\n\t\tblockEditorStore\n\t);\n\tconst highlightBlock = () => toggleBlockHighlight( clientId, true );\n\tconst cancelHighlightBlock = () => toggleBlockHighlight( clientId, false );\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-site-template-card__template-areas-item\"\n\t\t\ticon={ getTemplatePartIcon( area ) }\n\t\t\tonMouseOver={ highlightBlock }\n\t\t\tonMouseLeave={ cancelHighlightBlock }\n\t\t\tonFocus={ highlightBlock }\n\t\t\tonBlur={ cancelHighlightBlock }\n\t\t\tonClick={ () => {\n\t\t\t\tselectBlock( clientId );\n\t\t\t} }\n\t\t>\n\t\t\t{ TEMPLATE_PART_AREA_TO_NAME[ area ] }\n\t\t</Button>\n\t);\n}\n\nexport default function TemplateAreas() {\n\tconst templateParts = useSelect(\n\t\t( select ) => select( editSiteStore ).getCurrentTemplateTemplateParts(),\n\t\t[]\n\t);\n\n\tif ( ! templateParts.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<section className=\"edit-site-template-card__template-areas\">\n\t\t\t<Heading\n\t\t\t\tlevel={ 3 }\n\t\t\t\tclassName=\"edit-site-template-card__template-areas-title\"\n\t\t\t>\n\t\t\t\t{ __( 'Areas' ) }\n\t\t\t</Heading>\n\n\t\t\t<ul className=\"edit-site-template-card__template-areas-list\">\n\t\t\t\t{ templateParts.map( ( { templatePart, block } ) => (\n\t\t\t\t\t<li key={ templatePart.slug }>\n\t\t\t\t\t\t<TemplateAreaItem\n\t\t\t\t\t\t\tarea={ templatePart.area }\n\t\t\t\t\t\t\tclientId={ block.clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t</section>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/template-card/template-areas.js"],"names":["TemplateAreaItem","area","clientId","selectBlock","toggleBlockHighlight","blockEditorStore","highlightBlock","cancelHighlightBlock","TEMPLATE_PART_AREA_TO_NAME","TemplateAreas","templateParts","select","editSiteStore","getCurrentTemplateTemplateParts","length","map","templatePart","block","slug"],"mappings":";;;;;;;;;AAGA;;AACA;;AAIA;;AACA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIA,SAASA,gBAAT,OAAgD;AAAA,MAArB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAqB;AAC/C,QAAM;AAAEC,IAAAA,WAAF;AAAeC,IAAAA;AAAf,MAAwC,uBAC7CC,kBAD6C,CAA9C;;AAGA,QAAMC,cAAc,GAAG,MAAMF,oBAAoB,CAAEF,QAAF,EAAY,IAAZ,CAAjD;;AACA,QAAMK,oBAAoB,GAAG,MAAMH,oBAAoB,CAAEF,QAAF,EAAY,KAAZ,CAAvD;;AAEA,SACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,8CADX;AAEC,IAAA,IAAI,EAAG,iCAAqBD,IAArB,CAFR;AAGC,IAAA,WAAW,EAAGK,cAHf;AAIC,IAAA,YAAY,EAAGC,oBAJhB;AAKC,IAAA,OAAO,EAAGD,cALX;AAMC,IAAA,MAAM,EAAGC,oBANV;AAOC,IAAA,OAAO,EAAG,MAAM;AACfJ,MAAAA,WAAW,CAAED,QAAF,CAAX;AACA;AATF,KAWGM,sCAA4BP,IAA5B,CAXH,CADD;AAeA;;AAEc,SAASQ,aAAT,GAAyB;AACvC,QAAMC,aAAa,GAAG,qBACnBC,MAAF,IAAcA,MAAM,CAAEC,YAAF,CAAN,CAAwBC,+BAAxB,EADO,EAErB,EAFqB,CAAtB;;AAKA,MAAK,CAAEH,aAAa,CAACI,MAArB,EAA8B;AAC7B,WAAO,IAAP;AACA;;AAED,SACC;AAAS,IAAA,SAAS,EAAC;AAAnB,KACC,4BAAC,iCAAD;AACC,IAAA,KAAK,EAAG,CADT;AAEC,IAAA,SAAS,EAAC;AAFX,KAIG,cAAI,OAAJ,CAJH,CADD,EAQC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGJ,aAAa,CAACK,GAAd,CAAmB;AAAA,QAAE;AAAEC,MAAAA,YAAF;AAAgBC,MAAAA;AAAhB,KAAF;AAAA,WACpB;AAAI,MAAA,GAAG,EAAGD,YAAY,CAACE;AAAvB,OACC,4BAAC,gBAAD;AACC,MAAA,IAAI,EAAGF,YAAY,CAACf,IADrB;AAEC,MAAA,QAAQ,EAAGgB,KAAK,CAACf;AAFlB,MADD,CADoB;AAAA,GAAnB,CADH,CARD,CADD;AAqBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalHeading as Heading,\n} from '@wordpress/components';\nimport { getTemplatePartIcon } from '@wordpress/editor';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\nimport { TEMPLATE_PART_AREA_TO_NAME } from '../../../store/constants';\n\nfunction TemplateAreaItem( { area, clientId } ) {\n\tconst { selectBlock, toggleBlockHighlight } = useDispatch(\n\t\tblockEditorStore\n\t);\n\tconst highlightBlock = () => toggleBlockHighlight( clientId, true );\n\tconst cancelHighlightBlock = () => toggleBlockHighlight( clientId, false );\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-site-template-card__template-areas-item\"\n\t\t\ticon={ getTemplatePartIcon( area ) }\n\t\t\tonMouseOver={ highlightBlock }\n\t\t\tonMouseLeave={ cancelHighlightBlock }\n\t\t\tonFocus={ highlightBlock }\n\t\t\tonBlur={ cancelHighlightBlock }\n\t\t\tonClick={ () => {\n\t\t\t\tselectBlock( clientId );\n\t\t\t} }\n\t\t>\n\t\t\t{ TEMPLATE_PART_AREA_TO_NAME[ area ] }\n\t\t</Button>\n\t);\n}\n\nexport default function TemplateAreas() {\n\tconst templateParts = useSelect(\n\t\t( select ) => select( editSiteStore ).getCurrentTemplateTemplateParts(),\n\t\t[]\n\t);\n\n\tif ( ! templateParts.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<section className=\"edit-site-template-card__template-areas\">\n\t\t\t<Heading\n\t\t\t\tlevel={ 3 }\n\t\t\t\tclassName=\"edit-site-template-card__template-areas-title\"\n\t\t\t>\n\t\t\t\t{ __( 'Areas' ) }\n\t\t\t</Heading>\n\n\t\t\t<ul className=\"edit-site-template-card__template-areas-list\">\n\t\t\t\t{ templateParts.map( ( { templatePart, block } ) => (\n\t\t\t\t\t<li key={ templatePart.slug }>\n\t\t\t\t\t\t<TemplateAreaItem\n\t\t\t\t\t\t\tarea={ templatePart.area }\n\t\t\t\t\t\t\tclientId={ block.clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t</section>\n\t);\n}\n"]}
@@ -34,10 +34,11 @@ var _templateAreas = _interopRequireDefault(require("./template-areas"));
34
34
  /**
35
35
  * Internal dependencies
36
36
  */
37
- function TemplateDetails({
38
- template,
39
- onClose
40
- }) {
37
+ function TemplateDetails(_ref) {
38
+ let {
39
+ template,
40
+ onClose
41
+ } = _ref;
41
42
  const {
42
43
  title,
43
44
  description
@@ -53,9 +54,12 @@ function TemplateDetails({
53
54
  };
54
55
  }
55
56
 
56
- return _constants.TEMPLATE_PARTS_SUB_MENUS.find(({
57
- area
58
- }) => area === (template === null || template === void 0 ? void 0 : template.area));
57
+ return _constants.TEMPLATE_PARTS_SUB_MENUS.find(_ref2 => {
58
+ let {
59
+ area
60
+ } = _ref2;
61
+ return area === (template === null || template === void 0 ? void 0 : template.area);
62
+ });
59
63
  }, [template]);
60
64
 
61
65
  if (!template) {
@@ -89,9 +93,10 @@ function TemplateDetails({
89
93
  onClick: revert
90
94
  }, (0, _i18n.__)('Clear customizations'))), (0, _element.createElement)(_components.Button, {
91
95
  className: "edit-site-template-details__show-all-button",
92
- href: (0, _url.addQueryArgs)('edit.php', {
96
+ href: (0, _url.addQueryArgs)(window.location.href, {
93
97
  // TODO: We should update this to filter by template part's areas as well.
94
- post_type: template.type
98
+ postId: undefined,
99
+ postType: template.type
95
100
  })
96
101
  }, (0, _i18n.sprintf)(
97
102
  /* translators: the template part's area name ("Headers", "Sidebars") or "templates". */
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/template-details/index.js"],"names":["TemplateDetails","template","onClose","title","description","select","editorStore","__experimentalGetTemplateInfo","revertTemplate","editSiteStore","templateSubMenu","type","menu","MENU_TEMPLATES","TEMPLATE_PARTS_SUB_MENUS","find","area","revert","post_type"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AAKA;;AACA;;AAIA;;AACA;;AAzBA;AACA;AACA;;AAcA;AACA;AACA;AASe,SAASA,eAAT,CAA0B;AAAEC,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,CAA1B,EAAkD;AAChE,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAyB,qBAC5BC,MAAF,IACCA,MAAM,CAAEC,aAAF,CAAN,CAAsBC,6BAAtB,CAAqDN,QAArD,CAF6B,EAG9B,EAH8B,CAA/B;AAKA,QAAM;AAAEO,IAAAA;AAAF,MAAqB,uBAAaC,YAAb,CAA3B;AAEA,QAAMC,eAAe,GAAG,sBAAS,MAAM;AACtC,QAAK,CAAAT,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAEU,IAAV,MAAmB,aAAxB,EAAwC;AACvC,aAAO;AAAER,QAAAA,KAAK,EAAE,cAAI,WAAJ,CAAT;AAA4BS,QAAAA,IAAI,EAAEC;AAAlC,OAAP;AACA;;AAED,WAAOC,oCAAyBC,IAAzB,CACN,CAAE;AAAEC,MAAAA;AAAF,KAAF,KAAgBA,IAAI,MAAKf,QAAL,aAAKA,QAAL,uBAAKA,QAAQ,CAAEe,IAAf,CADd,CAAP;AAGA,GARuB,EAQrB,CAAEf,QAAF,CARqB,CAAxB;;AAUA,MAAK,CAAEA,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,QAAMgB,MAAM,GAAG,MAAM;AACpBT,IAAAA,cAAc,CAAEP,QAAF,CAAd;AACAC,IAAAA,OAAO;AACP,GAHD;;AAKA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,iCAAD;AACC,IAAA,KAAK,EAAG,CADT;AAEC,IAAA,MAAM,EAAG,GAFV;AAGC,IAAA,SAAS,EAAC;AAHX,KAKGC,KALH,CADD,EASGC,WAAW,IACZ,4BAAC,8BAAD;AACC,IAAA,IAAI,EAAC,MADN;AAEC,IAAA,SAAS,EAAC,yCAFX;AAGC,IAAA,EAAE,EAAC;AAHJ,KAKGA,WALH,CAVF,CADD,EAqBC,4BAAC,sBAAD;AAAe,IAAA,4BAA4B,EAAGF;AAA9C,IArBD,EAuBG,mCAAsBD,QAAtB,KACD,4BAAC,qBAAD;AAAW,IAAA,SAAS,EAAC;AAArB,KACC,4BAAC,oBAAD;AACC,IAAA,SAAS,EAAC,2CADX;AAEC,IAAA,IAAI,EAAG,cAAI,mCAAJ,CAFR;AAGC,IAAA,OAAO,EAAGgB;AAHX,KAKG,cAAI,sBAAJ,CALH,CADD,CAxBF,EAmCC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,6CADX;AAEC,IAAA,IAAI,EAAG,uBAAc,UAAd,EAA0B;AAChC;AACAC,MAAAA,SAAS,EAAEjB,QAAQ,CAACU;AAFY,KAA1B;AAFR,KAOG;AACD;AACA,gBAAI,eAAJ,CAFC,EAGDD,eAAe,CAACP,KAHf,CAPH,CAnCD,CADD;AAmDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tMenuGroup,\n\tMenuItem,\n\t__experimentalHeading as Heading,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport {\n\tMENU_TEMPLATES,\n\tTEMPLATE_PARTS_SUB_MENUS,\n} from '../navigation-sidebar/navigation-panel/constants';\nimport { store as editSiteStore } from '../../store';\nimport TemplateAreas from './template-areas';\n\nexport default function TemplateDetails( { template, onClose } ) {\n\tconst { title, description } = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetTemplateInfo( template ),\n\t\t[]\n\t);\n\tconst { revertTemplate } = useDispatch( editSiteStore );\n\n\tconst templateSubMenu = useMemo( () => {\n\t\tif ( template?.type === 'wp_template' ) {\n\t\t\treturn { title: __( 'templates' ), menu: MENU_TEMPLATES };\n\t\t}\n\n\t\treturn TEMPLATE_PARTS_SUB_MENUS.find(\n\t\t\t( { area } ) => area === template?.area\n\t\t);\n\t}, [ template ] );\n\n\tif ( ! template ) {\n\t\treturn null;\n\t}\n\n\tconst revert = () => {\n\t\trevertTemplate( template );\n\t\tonClose();\n\t};\n\n\treturn (\n\t\t<div className=\"edit-site-template-details\">\n\t\t\t<div className=\"edit-site-template-details__group\">\n\t\t\t\t<Heading\n\t\t\t\t\tlevel={ 4 }\n\t\t\t\t\tweight={ 600 }\n\t\t\t\t\tclassName=\"edit-site-template-details__title\"\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</Heading>\n\n\t\t\t\t{ description && (\n\t\t\t\t\t<Text\n\t\t\t\t\t\tsize=\"body\"\n\t\t\t\t\t\tclassName=\"edit-site-template-details__description\"\n\t\t\t\t\t\tas=\"p\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ description }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t</div>\n\n\t\t\t<TemplateAreas closeTemplateDetailsDropdown={ onClose } />\n\n\t\t\t{ isTemplateRevertable( template ) && (\n\t\t\t\t<MenuGroup className=\"edit-site-template-details__group edit-site-template-details__revert\">\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tclassName=\"edit-site-template-details__revert-button\"\n\t\t\t\t\t\tinfo={ __( 'Restore template to theme default' ) }\n\t\t\t\t\t\tonClick={ revert }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Clear customizations' ) }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-template-details__show-all-button\"\n\t\t\t\thref={ addQueryArgs( 'edit.php', {\n\t\t\t\t\t// TODO: We should update this to filter by template part's areas as well.\n\t\t\t\t\tpost_type: template.type,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t/* translators: the template part's area name (\"Headers\", \"Sidebars\") or \"templates\". */\n\t\t\t\t\t__( 'Browse all %s' ),\n\t\t\t\t\ttemplateSubMenu.title\n\t\t\t\t) }\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/template-details/index.js"],"names":["TemplateDetails","template","onClose","title","description","select","editorStore","__experimentalGetTemplateInfo","revertTemplate","editSiteStore","templateSubMenu","type","menu","MENU_TEMPLATES","TEMPLATE_PARTS_SUB_MENUS","find","area","revert","window","location","href","postId","undefined","postType"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AAKA;;AACA;;AAIA;;AACA;;AAzBA;AACA;AACA;;AAcA;AACA;AACA;AASe,SAASA,eAAT,OAAkD;AAAA,MAAxB;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAwB;AAChE,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAyB,qBAC5BC,MAAF,IACCA,MAAM,CAAEC,aAAF,CAAN,CAAsBC,6BAAtB,CAAqDN,QAArD,CAF6B,EAG9B,EAH8B,CAA/B;AAKA,QAAM;AAAEO,IAAAA;AAAF,MAAqB,uBAAaC,YAAb,CAA3B;AAEA,QAAMC,eAAe,GAAG,sBAAS,MAAM;AACtC,QAAK,CAAAT,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAEU,IAAV,MAAmB,aAAxB,EAAwC;AACvC,aAAO;AAAER,QAAAA,KAAK,EAAE,cAAI,WAAJ,CAAT;AAA4BS,QAAAA,IAAI,EAAEC;AAAlC,OAAP;AACA;;AAED,WAAOC,oCAAyBC,IAAzB,CACN;AAAA,UAAE;AAAEC,QAAAA;AAAF,OAAF;AAAA,aAAgBA,IAAI,MAAKf,QAAL,aAAKA,QAAL,uBAAKA,QAAQ,CAAEe,IAAf,CAApB;AAAA,KADM,CAAP;AAGA,GARuB,EAQrB,CAAEf,QAAF,CARqB,CAAxB;;AAUA,MAAK,CAAEA,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,QAAMgB,MAAM,GAAG,MAAM;AACpBT,IAAAA,cAAc,CAAEP,QAAF,CAAd;AACAC,IAAAA,OAAO;AACP,GAHD;;AAKA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,iCAAD;AACC,IAAA,KAAK,EAAG,CADT;AAEC,IAAA,MAAM,EAAG,GAFV;AAGC,IAAA,SAAS,EAAC;AAHX,KAKGC,KALH,CADD,EASGC,WAAW,IACZ,4BAAC,8BAAD;AACC,IAAA,IAAI,EAAC,MADN;AAEC,IAAA,SAAS,EAAC,yCAFX;AAGC,IAAA,EAAE,EAAC;AAHJ,KAKGA,WALH,CAVF,CADD,EAqBC,4BAAC,sBAAD;AAAe,IAAA,4BAA4B,EAAGF;AAA9C,IArBD,EAuBG,mCAAsBD,QAAtB,KACD,4BAAC,qBAAD;AAAW,IAAA,SAAS,EAAC;AAArB,KACC,4BAAC,oBAAD;AACC,IAAA,SAAS,EAAC,2CADX;AAEC,IAAA,IAAI,EAAG,cAAI,mCAAJ,CAFR;AAGC,IAAA,OAAO,EAAGgB;AAHX,KAKG,cAAI,sBAAJ,CALH,CADD,CAxBF,EAmCC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,6CADX;AAEC,IAAA,IAAI,EAAG,uBAAcC,MAAM,CAACC,QAAP,CAAgBC,IAA9B,EAAoC;AAC1C;AACAC,MAAAA,MAAM,EAAEC,SAFkC;AAG1CC,MAAAA,QAAQ,EAAEtB,QAAQ,CAACU;AAHuB,KAApC;AAFR,KAQG;AACD;AACA,gBAAI,eAAJ,CAFC,EAGDD,eAAe,CAACP,KAHf,CARH,CAnCD,CADD;AAoDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tMenuGroup,\n\tMenuItem,\n\t__experimentalHeading as Heading,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport {\n\tMENU_TEMPLATES,\n\tTEMPLATE_PARTS_SUB_MENUS,\n} from '../navigation-sidebar/navigation-panel/constants';\nimport { store as editSiteStore } from '../../store';\nimport TemplateAreas from './template-areas';\n\nexport default function TemplateDetails( { template, onClose } ) {\n\tconst { title, description } = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetTemplateInfo( template ),\n\t\t[]\n\t);\n\tconst { revertTemplate } = useDispatch( editSiteStore );\n\n\tconst templateSubMenu = useMemo( () => {\n\t\tif ( template?.type === 'wp_template' ) {\n\t\t\treturn { title: __( 'templates' ), menu: MENU_TEMPLATES };\n\t\t}\n\n\t\treturn TEMPLATE_PARTS_SUB_MENUS.find(\n\t\t\t( { area } ) => area === template?.area\n\t\t);\n\t}, [ template ] );\n\n\tif ( ! template ) {\n\t\treturn null;\n\t}\n\n\tconst revert = () => {\n\t\trevertTemplate( template );\n\t\tonClose();\n\t};\n\n\treturn (\n\t\t<div className=\"edit-site-template-details\">\n\t\t\t<div className=\"edit-site-template-details__group\">\n\t\t\t\t<Heading\n\t\t\t\t\tlevel={ 4 }\n\t\t\t\t\tweight={ 600 }\n\t\t\t\t\tclassName=\"edit-site-template-details__title\"\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</Heading>\n\n\t\t\t\t{ description && (\n\t\t\t\t\t<Text\n\t\t\t\t\t\tsize=\"body\"\n\t\t\t\t\t\tclassName=\"edit-site-template-details__description\"\n\t\t\t\t\t\tas=\"p\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ description }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t</div>\n\n\t\t\t<TemplateAreas closeTemplateDetailsDropdown={ onClose } />\n\n\t\t\t{ isTemplateRevertable( template ) && (\n\t\t\t\t<MenuGroup className=\"edit-site-template-details__group edit-site-template-details__revert\">\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tclassName=\"edit-site-template-details__revert-button\"\n\t\t\t\t\t\tinfo={ __( 'Restore template to theme default' ) }\n\t\t\t\t\t\tonClick={ revert }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Clear customizations' ) }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-template-details__show-all-button\"\n\t\t\t\thref={ addQueryArgs( window.location.href, {\n\t\t\t\t\t// TODO: We should update this to filter by template part's areas as well.\n\t\t\t\t\tpostId: undefined,\n\t\t\t\t\tpostType: template.type,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t/* translators: the template part's area name (\"Headers\", \"Sidebars\") or \"templates\". */\n\t\t\t\t\t__( 'Browse all %s' ),\n\t\t\t\t\ttemplateSubMenu.title\n\t\t\t\t) }\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n"]}