@wordpress/edit-site 3.0.6 → 3.0.10

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 (373) 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 +79 -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 +115 -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 +16 -17
  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 +4 -3
  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 +16 -13
  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 -13
  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 +4 -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 +55 -0
  85. package/build/components/list/index.js.map +1 -0
  86. package/build/components/list/table.js +128 -0
  87. package/build/components/list/table.js.map +1 -0
  88. package/build/components/main-dashboard-button/index.js +4 -3
  89. package/build/components/main-dashboard-button/index.js.map +1 -1
  90. package/build/components/navigate-to-link/index.js +7 -6
  91. package/build/components/navigate-to-link/index.js.map +1 -1
  92. package/build/components/navigation-sidebar/index.js +12 -11
  93. package/build/components/navigation-sidebar/index.js.map +1 -1
  94. package/build/components/navigation-sidebar/navigation-panel/constants.js +1 -1
  95. package/build/components/navigation-sidebar/navigation-panel/content-navigation-item.js +4 -3
  96. package/build/components/navigation-sidebar/navigation-panel/content-navigation-item.js.map +1 -1
  97. package/build/components/navigation-sidebar/navigation-panel/index.js +36 -55
  98. package/build/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
  99. package/build/components/navigation-sidebar/navigation-panel/menus/template-parts-sub.js +6 -5
  100. package/build/components/navigation-sidebar/navigation-panel/menus/template-parts-sub.js.map +1 -1
  101. package/build/components/navigation-sidebar/navigation-panel/menus/template-parts.js +26 -20
  102. package/build/components/navigation-sidebar/navigation-panel/menus/template-parts.js.map +1 -1
  103. package/build/components/navigation-sidebar/navigation-panel/menus/templates-sub.js +17 -10
  104. package/build/components/navigation-sidebar/navigation-panel/menus/templates-sub.js.map +1 -1
  105. package/build/components/navigation-sidebar/navigation-panel/menus/templates.js +11 -5
  106. package/build/components/navigation-sidebar/navigation-panel/menus/templates.js.map +1 -1
  107. package/build/components/navigation-sidebar/navigation-panel/navigation-entity-items.js +13 -11
  108. package/build/components/navigation-sidebar/navigation-panel/navigation-entity-items.js.map +1 -1
  109. package/build/components/navigation-sidebar/navigation-panel/new-template-dropdown.js +24 -18
  110. package/build/components/navigation-sidebar/navigation-panel/new-template-dropdown.js.map +1 -1
  111. package/build/components/navigation-sidebar/navigation-panel/search-results.js +14 -11
  112. package/build/components/navigation-sidebar/navigation-panel/search-results.js.map +1 -1
  113. package/build/components/navigation-sidebar/navigation-panel/template-hierarchy.js +8 -5
  114. package/build/components/navigation-sidebar/navigation-panel/template-hierarchy.js.map +1 -1
  115. package/build/components/navigation-sidebar/navigation-panel/template-navigation-item.js +4 -3
  116. package/build/components/navigation-sidebar/navigation-panel/template-navigation-item.js.map +1 -1
  117. package/build/components/navigation-sidebar/navigation-panel/template-preview.js +5 -4
  118. package/build/components/navigation-sidebar/navigation-panel/template-preview.js.map +1 -1
  119. package/build/components/navigation-sidebar/navigation-toggle/index.js +7 -27
  120. package/build/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
  121. package/build/components/save-button/index.js +5 -4
  122. package/build/components/save-button/index.js.map +1 -1
  123. package/build/components/sidebar/constants.js +1 -1
  124. package/build/components/sidebar/default-sidebar.js +11 -10
  125. package/build/components/sidebar/default-sidebar.js.map +1 -1
  126. package/build/components/sidebar/plugin-sidebar/index.js +5 -4
  127. package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
  128. package/build/components/sidebar/settings-header/index.js +4 -3
  129. package/build/components/sidebar/settings-header/index.js.map +1 -1
  130. package/build/components/sidebar/template-card/template-areas.js +17 -13
  131. package/build/components/sidebar/template-card/template-areas.js.map +1 -1
  132. package/build/components/template-details/index.js +14 -9
  133. package/build/components/template-details/index.js.map +1 -1
  134. package/build/components/template-details/template-areas.js +38 -29
  135. package/build/components/template-details/template-areas.js.map +1 -1
  136. package/build/components/template-part-converter/convert-to-regular.js +15 -11
  137. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  138. package/build/components/template-part-converter/convert-to-template-part.js +29 -86
  139. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  140. package/build/components/welcome-guide/editor.js +58 -0
  141. package/build/components/welcome-guide/editor.js.map +1 -0
  142. package/build/components/welcome-guide/image.js +27 -0
  143. package/build/components/welcome-guide/image.js.map +1 -0
  144. package/build/components/welcome-guide/index.js +49 -0
  145. package/build/components/welcome-guide/index.js.map +1 -0
  146. package/build/components/welcome-guide/styles.js +83 -0
  147. package/build/components/welcome-guide/styles.js.map +1 -0
  148. package/build/index.js +40 -16
  149. package/build/index.js.map +1 -1
  150. package/build/plugins/index.js +4 -2
  151. package/build/plugins/index.js.map +1 -1
  152. package/build/plugins/welcome-guide-menu-item.js +39 -0
  153. package/build/plugins/welcome-guide-menu-item.js.map +1 -0
  154. package/build/store/actions.js +24 -24
  155. package/build/store/actions.js.map +1 -1
  156. package/build/store/constants.js +1 -1
  157. package/build/store/defaults.js +4 -1
  158. package/build/store/defaults.js.map +1 -1
  159. package/build/store/index.js +5 -3
  160. package/build/store/index.js.map +1 -1
  161. package/build/store/reducer.js +36 -14
  162. package/build/store/reducer.js.map +1 -1
  163. package/build/store/selectors.js +27 -19
  164. package/build/store/selectors.js.map +1 -1
  165. package/build/utils/is-template-removable.js +21 -0
  166. package/build/utils/is-template-removable.js.map +1 -0
  167. package/build-module/components/add-new-template/index.js +36 -0
  168. package/build-module/components/add-new-template/index.js.map +1 -0
  169. package/build-module/components/add-new-template/new-template-part.js +66 -0
  170. package/build-module/components/add-new-template/new-template-part.js.map +1 -0
  171. package/build-module/components/add-new-template/new-template.js +98 -0
  172. package/build-module/components/add-new-template/new-template.js.map +1 -0
  173. package/build-module/components/block-editor/block-inspector-button.js +4 -3
  174. package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
  175. package/build-module/components/block-editor/index.js +12 -8
  176. package/build-module/components/block-editor/index.js.map +1 -1
  177. package/build-module/components/block-editor/resizable-editor.js +6 -5
  178. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  179. package/build-module/components/block-editor/resize-handle.js +6 -4
  180. package/build-module/components/block-editor/resize-handle.js.map +1 -1
  181. package/build-module/components/create-template-part-modal/index.js +102 -0
  182. package/build-module/components/create-template-part-modal/index.js.map +1 -0
  183. package/build-module/components/edit-template-part-menu-button/index.js +15 -11
  184. package/build-module/components/edit-template-part-menu-button/index.js.map +1 -1
  185. package/build-module/components/editor/index.js +14 -17
  186. package/build-module/components/editor/index.js.map +1 -1
  187. package/build-module/components/error-boundary/index.js +5 -4
  188. package/build-module/components/error-boundary/index.js.map +1 -1
  189. package/build-module/components/global-styles/border-panel.js +4 -3
  190. package/build-module/components/global-styles/border-panel.js.map +1 -1
  191. package/build-module/components/global-styles/color-palette-panel.js +4 -3
  192. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  193. package/build-module/components/global-styles/context-menu.js +5 -4
  194. package/build-module/components/global-styles/context-menu.js.map +1 -1
  195. package/build-module/components/global-styles/dimensions-panel.js +4 -3
  196. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  197. package/build-module/components/global-styles/global-styles-provider.js +16 -13
  198. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  199. package/build-module/components/global-styles/header.js +6 -5
  200. package/build-module/components/global-styles/header.js.map +1 -1
  201. package/build-module/components/global-styles/hooks.js +32 -28
  202. package/build-module/components/global-styles/hooks.js.map +1 -1
  203. package/build-module/components/global-styles/navigation-button.js +8 -7
  204. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  205. package/build-module/components/global-styles/palette.js +13 -9
  206. package/build-module/components/global-styles/palette.js.map +1 -1
  207. package/build-module/components/global-styles/screen-background-color.js +4 -3
  208. package/build-module/components/global-styles/screen-background-color.js.map +1 -1
  209. package/build-module/components/global-styles/screen-block-list.js +11 -4
  210. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  211. package/build-module/components/global-styles/screen-block.js +4 -3
  212. package/build-module/components/global-styles/screen-block.js.map +1 -1
  213. package/build-module/components/global-styles/screen-color-palette.js +4 -3
  214. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  215. package/build-module/components/global-styles/screen-colors.js +19 -15
  216. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  217. package/build-module/components/global-styles/screen-layout.js +4 -3
  218. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  219. package/build-module/components/global-styles/screen-link-color.js +4 -3
  220. package/build-module/components/global-styles/screen-link-color.js.map +1 -1
  221. package/build-module/components/global-styles/screen-text-color.js +4 -3
  222. package/build-module/components/global-styles/screen-text-color.js.map +1 -1
  223. package/build-module/components/global-styles/screen-typography.js +4 -3
  224. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  225. package/build-module/components/global-styles/subtitle.js +4 -3
  226. package/build-module/components/global-styles/subtitle.js.map +1 -1
  227. package/build-module/components/global-styles/typography-panel.js +9 -7
  228. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  229. package/build-module/components/global-styles/ui.js +4 -3
  230. package/build-module/components/global-styles/ui.js.map +1 -1
  231. package/build-module/components/global-styles/use-global-styles-output.js +60 -43
  232. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  233. package/build-module/components/global-styles/utils.js +3 -2
  234. package/build-module/components/global-styles/utils.js.map +1 -1
  235. package/build-module/components/header/document-actions/index.js +23 -19
  236. package/build-module/components/header/document-actions/index.js.map +1 -1
  237. package/build-module/components/header/feature-toggle/index.js +9 -7
  238. package/build-module/components/header/feature-toggle/index.js.map +1 -1
  239. package/build-module/components/header/index.js +15 -12
  240. package/build-module/components/header/index.js.map +1 -1
  241. package/build-module/components/header/more-menu/index.js +30 -27
  242. package/build-module/components/header/more-menu/index.js.map +1 -1
  243. package/build-module/components/header/tools-more-menu-group/index.js +10 -7
  244. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  245. package/build-module/components/keyboard-shortcuts/index.js +4 -3
  246. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  247. package/build-module/components/list/header.js +37 -0
  248. package/build-module/components/list/header.js.map +1 -0
  249. package/build-module/components/list/index.js +40 -0
  250. package/build-module/components/list/index.js.map +1 -0
  251. package/build-module/components/list/table.js +112 -0
  252. package/build-module/components/list/table.js.map +1 -0
  253. package/build-module/components/main-dashboard-button/index.js +4 -3
  254. package/build-module/components/main-dashboard-button/index.js.map +1 -1
  255. package/build-module/components/navigate-to-link/index.js +7 -6
  256. package/build-module/components/navigate-to-link/index.js.map +1 -1
  257. package/build-module/components/navigation-sidebar/index.js +12 -8
  258. package/build-module/components/navigation-sidebar/index.js.map +1 -1
  259. package/build-module/components/navigation-sidebar/navigation-panel/content-navigation-item.js +4 -3
  260. package/build-module/components/navigation-sidebar/navigation-panel/content-navigation-item.js.map +1 -1
  261. package/build-module/components/navigation-sidebar/navigation-panel/index.js +38 -55
  262. package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
  263. package/build-module/components/navigation-sidebar/navigation-panel/menus/template-parts-sub.js +6 -5
  264. package/build-module/components/navigation-sidebar/navigation-panel/menus/template-parts-sub.js.map +1 -1
  265. package/build-module/components/navigation-sidebar/navigation-panel/menus/template-parts.js +26 -20
  266. package/build-module/components/navigation-sidebar/navigation-panel/menus/template-parts.js.map +1 -1
  267. package/build-module/components/navigation-sidebar/navigation-panel/menus/templates-sub.js +17 -10
  268. package/build-module/components/navigation-sidebar/navigation-panel/menus/templates-sub.js.map +1 -1
  269. package/build-module/components/navigation-sidebar/navigation-panel/menus/templates.js +11 -5
  270. package/build-module/components/navigation-sidebar/navigation-panel/menus/templates.js.map +1 -1
  271. package/build-module/components/navigation-sidebar/navigation-panel/navigation-entity-items.js +13 -11
  272. package/build-module/components/navigation-sidebar/navigation-panel/navigation-entity-items.js.map +1 -1
  273. package/build-module/components/navigation-sidebar/navigation-panel/new-template-dropdown.js +24 -18
  274. package/build-module/components/navigation-sidebar/navigation-panel/new-template-dropdown.js.map +1 -1
  275. package/build-module/components/navigation-sidebar/navigation-panel/search-results.js +14 -11
  276. package/build-module/components/navigation-sidebar/navigation-panel/search-results.js.map +1 -1
  277. package/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js +6 -3
  278. package/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js.map +1 -1
  279. package/build-module/components/navigation-sidebar/navigation-panel/template-navigation-item.js +4 -3
  280. package/build-module/components/navigation-sidebar/navigation-panel/template-navigation-item.js.map +1 -1
  281. package/build-module/components/navigation-sidebar/navigation-panel/template-preview.js +5 -4
  282. package/build-module/components/navigation-sidebar/navigation-panel/template-preview.js.map +1 -1
  283. package/build-module/components/navigation-sidebar/navigation-toggle/index.js +8 -27
  284. package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
  285. package/build-module/components/save-button/index.js +5 -4
  286. package/build-module/components/save-button/index.js.map +1 -1
  287. package/build-module/components/sidebar/default-sidebar.js +11 -10
  288. package/build-module/components/sidebar/default-sidebar.js.map +1 -1
  289. package/build-module/components/sidebar/plugin-sidebar/index.js +5 -4
  290. package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
  291. package/build-module/components/sidebar/settings-header/index.js +4 -3
  292. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  293. package/build-module/components/sidebar/template-card/template-areas.js +17 -13
  294. package/build-module/components/sidebar/template-card/template-areas.js.map +1 -1
  295. package/build-module/components/template-details/index.js +14 -9
  296. package/build-module/components/template-details/index.js.map +1 -1
  297. package/build-module/components/template-details/template-areas.js +38 -29
  298. package/build-module/components/template-details/template-areas.js.map +1 -1
  299. package/build-module/components/template-part-converter/convert-to-regular.js +15 -11
  300. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  301. package/build-module/components/template-part-converter/convert-to-template-part.js +29 -86
  302. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  303. package/build-module/components/welcome-guide/editor.js +45 -0
  304. package/build-module/components/welcome-guide/editor.js.map +1 -0
  305. package/build-module/components/welcome-guide/image.js +19 -0
  306. package/build-module/components/welcome-guide/image.js.map +1 -0
  307. package/build-module/components/welcome-guide/index.js +35 -0
  308. package/build-module/components/welcome-guide/index.js.map +1 -0
  309. package/build-module/components/welcome-guide/styles.js +69 -0
  310. package/build-module/components/welcome-guide/styles.js.map +1 -0
  311. package/build-module/index.js +21 -1
  312. package/build-module/index.js.map +1 -1
  313. package/build-module/plugins/index.js +3 -2
  314. package/build-module/plugins/index.js.map +1 -1
  315. package/build-module/plugins/welcome-guide-menu-item.js +27 -0
  316. package/build-module/plugins/welcome-guide-menu-item.js.map +1 -0
  317. package/build-module/store/actions.js +11 -11
  318. package/build-module/store/actions.js.map +1 -1
  319. package/build-module/store/defaults.js +4 -1
  320. package/build-module/store/defaults.js.map +1 -1
  321. package/build-module/store/reducer.js +31 -10
  322. package/build-module/store/reducer.js.map +1 -1
  323. package/build-module/store/selectors.js +17 -10
  324. package/build-module/store/selectors.js.map +1 -1
  325. package/build-module/utils/is-template-removable.js +14 -0
  326. package/build-module/utils/is-template-removable.js.map +1 -0
  327. package/build-style/style-rtl.css +365 -40
  328. package/build-style/style.css +365 -40
  329. package/package.json +27 -27
  330. package/src/components/add-new-template/index.js +30 -0
  331. package/src/components/add-new-template/new-template-part.js +67 -0
  332. package/src/components/add-new-template/new-template.js +117 -0
  333. package/src/components/add-new-template/style.scss +11 -0
  334. package/src/components/create-template-part-modal/index.js +132 -0
  335. package/src/components/{template-part-converter → create-template-part-modal}/style.scss +9 -9
  336. package/src/components/editor/index.js +10 -14
  337. package/src/components/editor/style.scss +8 -0
  338. package/src/components/global-styles/global-styles-provider.js +4 -3
  339. package/src/components/global-styles/hooks.js +58 -26
  340. package/src/components/global-styles/screen-block-list.js +11 -1
  341. package/src/components/global-styles/test/use-global-styles-output.js +2 -2
  342. package/src/components/global-styles/use-global-styles-output.js +2 -2
  343. package/src/components/global-styles/utils.js +1 -1
  344. package/src/components/header/index.js +0 -3
  345. package/src/components/list/header.js +34 -0
  346. package/src/components/list/index.js +38 -0
  347. package/src/components/list/style.scss +113 -0
  348. package/src/components/list/table.js +133 -0
  349. package/src/components/navigation-sidebar/index.js +15 -8
  350. package/src/components/navigation-sidebar/navigation-panel/index.js +44 -55
  351. package/src/components/navigation-sidebar/navigation-panel/style.scss +4 -2
  352. package/src/components/navigation-sidebar/navigation-toggle/index.js +4 -28
  353. package/src/components/template-details/index.js +3 -2
  354. package/src/components/template-part-converter/convert-to-template-part.js +20 -140
  355. package/src/components/welcome-guide/editor.js +63 -0
  356. package/src/components/welcome-guide/image.js +11 -0
  357. package/src/components/welcome-guide/index.js +33 -0
  358. package/src/components/welcome-guide/style.scss +37 -0
  359. package/src/components/welcome-guide/styles.js +116 -0
  360. package/src/index.js +21 -1
  361. package/src/plugins/index.js +3 -1
  362. package/src/plugins/welcome-guide-menu-item.js +35 -0
  363. package/src/store/actions.js +11 -9
  364. package/src/store/defaults.js +4 -1
  365. package/src/store/test/actions.js +14 -20
  366. package/src/style.scss +11 -7
  367. package/src/utils/is-template-removable.js +13 -0
  368. package/build/components/header/navigation-link/index.js +0 -86
  369. package/build/components/header/navigation-link/index.js.map +0 -1
  370. package/build-module/components/header/navigation-link/index.js +0 -73
  371. package/build-module/components/header/navigation-link/index.js.map +0 -1
  372. package/src/components/header/navigation-link/index.js +0 -71
  373. package/src/components/header/navigation-link/style.scss +0 -69
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/utils.js"],"names":["ROOT_BLOCK_NAME","ROOT_BLOCK_SELECTOR","ROOT_BLOCK_SUPPORTS","PRESET_METADATA","path","valueKey","cssVarInfix","classes","classSuffix","propertyName","STYLE_PATH_TO_CSS_VAR_INFIX","findInPresetsBy","features","blockName","presetPath","presetProperty","presetValueValue","orderedPresetsByOrigin","presetByOrigin","origins","origin","presets","presetObject","preset","highestPresetObjectWithSameSlug","slug","undefined","getPresetVariableFromValue","variableStylePath","presetPropertyValue","metadata","getValueFromPresetVariable","variable","presetType","result","getValueFromVariable","getValueFromCustomVariable","USER_VALUE_PREFIX","THEME_VALUE_PREFIX","THEME_VALUE_SUFFIX","parsedVar","startsWith","slice","length","split","endsWith","type"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACO,MAAMA,eAAe,GAAG,MAAxB;;AACA,MAAMC,mBAAmB,GAAG,MAA5B;;AACA,MAAMC,mBAAmB,GAAG,CAClC,YADkC,EAElC,iBAFkC,EAGlC,OAHkC,EAIlC,WAJkC,EAKlC,YALkC,EAMlC,UANkC,EAOlC,WAPkC,EAQlC,YARkC,EASlC,YATkC,EAUlC,gBAVkC,EAWlC,eAXkC,EAYlC,SAZkC,CAA5B;;AAeA,MAAMC,eAAe,GAAG,CAC9B;AACCC,EAAAA,IAAI,EAAE,CAAE,OAAF,EAAW,SAAX,CADP;AAECC,EAAAA,QAAQ,EAAE,OAFX;AAGCC,EAAAA,WAAW,EAAE,OAHd;AAICC,EAAAA,OAAO,EAAE,CACR;AAAEC,IAAAA,WAAW,EAAE,OAAf;AAAwBC,IAAAA,YAAY,EAAE;AAAtC,GADQ,EAER;AACCD,IAAAA,WAAW,EAAE,kBADd;AAECC,IAAAA,YAAY,EAAE;AAFf,GAFQ,EAMR;AACCD,IAAAA,WAAW,EAAE,cADd;AAECC,IAAAA,YAAY,EAAE;AAFf,GANQ;AAJV,CAD8B,EAiB9B;AACCL,EAAAA,IAAI,EAAE,CAAE,OAAF,EAAW,WAAX,CADP;AAECC,EAAAA,QAAQ,EAAE,UAFX;AAGCC,EAAAA,WAAW,EAAE,UAHd;AAICC,EAAAA,OAAO,EAAE,CACR;AACCC,IAAAA,WAAW,EAAE,qBADd;AAECC,IAAAA,YAAY,EAAE;AAFf,GADQ;AAJV,CAjB8B,EA4B9B;AACCL,EAAAA,IAAI,EAAE,CAAE,YAAF,EAAgB,WAAhB,CADP;AAECC,EAAAA,QAAQ,EAAE,MAFX;AAGCC,EAAAA,WAAW,E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,CAACU,KAAT,CAAgBL,iBAAiB,CAACM,MAAlC,EAA2CC,KAA3C,CAAkD,GAAlD,CAAZ;AACA,GAFD,MAEO,IACNZ,QAAQ,CAACS,UAAT,CAAqBH,kBAArB,KACAN,QAAQ,CAACa,QAAT,CAAmBN,kBAAnB,CAFM,EAGL;AACDC,IAAAA,SAAS,GAAGR,QAAQ,CAClBU,KADU,CACHJ,kBAAkB,CAACK,MADhB,EACwB,CAACJ,kBAAkB,CAACI,MAD5C,EAEVC,KAFU,CAEH,IAFG,CAAZ;AAGA,GAPM,MAOA;AACN;AACA,WAAOZ,QAAP;AACA;;AAED,QAAM,CAAEc,IAAF,EAAQ,GAAG1C,IAAX,IAAoBoC,SAA1B;;AACA,MAAKM,IAAI,KAAK,QAAd,EAAyB;AACxB,WAAOf,0BAA0B,CAChCnB,QADgC,EAEhCC,SAFgC,EAGhCmB,QAHgC,EAIhC5B,IAJgC,CAAjC;AAMA;;AACD,MAAK0C,IAAI,KAAK,QAAd,EAAyB;AACxB,WAAOV,0BAA0B,CAChCxB,QADgC,EAEhCC,SAFgC,EAGhCmB,QAHgC,EAIhC5B,IAJgC,CAAjC;AAMA;;AACD,SAAO4B,QAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { get, find, isString } from 'lodash';\n\n/* Supporting data */\nexport const ROOT_BLOCK_NAME = 'root';\nexport const ROOT_BLOCK_SELECTOR = 'body';\nexport const ROOT_BLOCK_SUPPORTS = [\n\t'background',\n\t'backgroundColor',\n\t'color',\n\t'linkColor',\n\t'fontFamily',\n\t'fontSize',\n\t'fontStyle',\n\t'fontWeight',\n\t'lineHeight',\n\t'textDecoration',\n\t'textTransform',\n\t'padding',\n];\n\nexport const PRESET_METADATA = [\n\t{\n\t\tpath: [ 'color', 'palette' ],\n\t\tvalueKey: 'color',\n\t\tcssVarInfix: 'color',\n\t\tclasses: [\n\t\t\t{ classSuffix: 'color', propertyName: 'color' },\n\t\t\t{\n\t\t\t\tclassSuffix: 'background-color',\n\t\t\t\tpropertyName: 'background-color',\n\t\t\t},\n\t\t\t{\n\t\t\t\tclassSuffix: 'border-color',\n\t\t\t\tpropertyName: 'border-color',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tpath: [ 'color', 'gradients' ],\n\t\tvalueKey: 'gradient',\n\t\tcssVarInfix: 'gradient',\n\t\tclasses: [\n\t\t\t{\n\t\t\t\tclassSuffix: 'gradient-background',\n\t\t\t\tpropertyName: 'background',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tpath: [ 'typography', 'fontSizes' ],\n\t\tvalueKey: 'size',\n\t\tcssVarInfix: 'font-size',\n\t\tclasses: [ { classSuffix: 'font-size', propertyName: 'font-size' } ],\n\t},\n\t{\n\t\tpath: [ 'typography', 'fontFamilies' ],\n\t\tvalueKey: 'fontFamily',\n\t\tcssVarInfix: 'font-family',\n\t\tclasses: [\n\t\t\t{ classSuffix: 'font-family', propertyName: 'font-family' },\n\t\t],\n\t},\n];\n\nconst STYLE_PATH_TO_CSS_VAR_INFIX = {\n\t'color.background': 'color',\n\t'color.text': 'color',\n\t'elements.link.color.text': 'color',\n\t'color.gradient': 'gradient',\n\t'typography.fontSize': 'font-size',\n\t'typography.fontFamily': 'font-family',\n};\n\nfunction findInPresetsBy(\n\tfeatures,\n\tblockName,\n\tpresetPath,\n\tpresetProperty,\n\tpresetValueValue\n) {\n\t// Block presets take priority above root level presets.\n\tconst orderedPresetsByOrigin = [\n\t\tget( features, [ 'blocks', blockName, ...presetPath ] ),\n\t\tget( features, presetPath ),\n\t];\n\n\tfor ( const presetByOrigin of orderedPresetsByOrigin ) {\n\t\tif ( presetByOrigin ) {\n\t\t\t// Preset origins ordered by priority.\n\t\t\tconst origins = [ 'user', 'theme', 'core' ];\n\t\t\tfor ( const origin of origins ) {\n\t\t\t\tconst presets = presetByOrigin[ origin ];\n\t\t\t\tif ( presets ) {\n\t\t\t\t\tconst presetObject = find(\n\t\t\t\t\t\tpresets,\n\t\t\t\t\t\t( preset ) =>\n\t\t\t\t\t\t\tpreset[ presetProperty ] === presetValueValue\n\t\t\t\t\t);\n\t\t\t\t\tif ( presetObject ) {\n\t\t\t\t\t\tif ( presetProperty === 'slug' ) {\n\t\t\t\t\t\t\treturn presetObject;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// if there is a highest priority preset with the same slug but different value the preset we found was overwritten and should be ignored.\n\t\t\t\t\t\tconst highestPresetObjectWithSameSlug = findInPresetsBy(\n\t\t\t\t\t\t\tfeatures,\n\t\t\t\t\t\t\tblockName,\n\t\t\t\t\t\t\tpresetPath,\n\t\t\t\t\t\t\t'slug',\n\t\t\t\t\t\t\tpresetObject.slug\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\thighestPresetObjectWithSameSlug[\n\t\t\t\t\t\t\t\tpresetProperty\n\t\t\t\t\t\t\t] === presetObject[ presetProperty ]\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn presetObject;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function getPresetVariableFromValue(\n\tfeatures,\n\tblockName,\n\tvariableStylePath,\n\tpresetPropertyValue\n) {\n\tif ( ! presetPropertyValue ) {\n\t\treturn presetPropertyValue;\n\t}\n\n\tconst cssVarInfix = STYLE_PATH_TO_CSS_VAR_INFIX[ variableStylePath ];\n\n\tconst metadata = find( PRESET_METADATA, [ 'cssVarInfix', cssVarInfix ] );\n\n\tif ( ! metadata ) {\n\t\t// The property doesn't have preset data\n\t\t// so the value should be returned as it is.\n\t\treturn presetPropertyValue;\n\t}\n\tconst { valueKey, path } = metadata;\n\n\tconst presetObject = findInPresetsBy(\n\t\tfeatures,\n\t\tblockName,\n\t\tpath,\n\t\tvalueKey,\n\t\tpresetPropertyValue\n\t);\n\n\tif ( ! presetObject ) {\n\t\t// Value wasn't found in the presets,\n\t\t// so it must be a custom value.\n\t\treturn presetPropertyValue;\n\t}\n\n\treturn `var:preset|${ cssVarInfix }|${ presetObject.slug }`;\n}\n\nfunction getValueFromPresetVariable(\n\tfeatures,\n\tblockName,\n\tvariable,\n\t[ presetType, slug ]\n) {\n\tconst metadata = find( PRESET_METADATA, [ 'cssVarInfix', presetType ] );\n\tif ( ! metadata ) {\n\t\treturn variable;\n\t}\n\n\tconst presetObject = findInPresetsBy(\n\t\tfeatures,\n\t\tblockName,\n\t\tmetadata.path,\n\t\t'slug',\n\t\tslug\n\t);\n\n\tif ( presetObject ) {\n\t\tconst { valueKey } = metadata;\n\t\tconst result = presetObject[ valueKey ];\n\t\treturn getValueFromVariable( features, blockName, result );\n\t}\n\n\treturn variable;\n}\n\nfunction getValueFromCustomVariable( features, blockName, variable, path ) {\n\tconst result =\n\t\tget( features, [ 'blocks', blockName, 'custom', ...path ] ) ??\n\t\tget( features, [ 'custom', ...path ] );\n\tif ( ! result ) {\n\t\treturn variable;\n\t}\n\t// A variable may reference another variable so we need recursion until we find the value.\n\treturn getValueFromVariable( features, blockName, result );\n}\n\nexport function getValueFromVariable( features, blockName, variable ) {\n\tif ( ! variable || ! isString( variable ) ) {\n\t\treturn variable;\n\t}\n\tconst USER_VALUE_PREFIX = 'var:';\n\tconst THEME_VALUE_PREFIX = 'var(--wp--';\n\tconst THEME_VALUE_SUFFIX = ')';\n\n\tlet parsedVar;\n\n\tif ( variable.startsWith( USER_VALUE_PREFIX ) ) {\n\t\tparsedVar = variable.slice( USER_VALUE_PREFIX.length ).split( '|' );\n\t} else if (\n\t\tvariable.startsWith( THEME_VALUE_PREFIX ) &&\n\t\tvariable.endsWith( THEME_VALUE_SUFFIX )\n\t) {\n\t\tparsedVar = variable\n\t\t\t.slice( THEME_VALUE_PREFIX.length, -THEME_VALUE_SUFFIX.length )\n\t\t\t.split( '--' );\n\t} else {\n\t\t// We don't know how to parse the value: either is raw of uses complex CSS such as `calc(1px * var(--wp--variable) )`\n\t\treturn variable;\n\t}\n\n\tconst [ type, ...path ] = parsedVar;\n\tif ( type === 'preset' ) {\n\t\treturn getValueFromPresetVariable(\n\t\t\tfeatures,\n\t\t\tblockName,\n\t\t\tvariable,\n\t\t\tpath\n\t\t);\n\t}\n\tif ( type === 'custom' ) {\n\t\treturn getValueFromCustomVariable(\n\t\t\tfeatures,\n\t\t\tblockName,\n\t\t\tvariable,\n\t\t\tpath\n\t\t);\n\t}\n\treturn variable;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/utils.js"],"names":["ROOT_BLOCK_NAME","ROOT_BLOCK_SELECTOR","ROOT_BLOCK_SUPPORTS","PRESET_METADATA","path","valueKey","cssVarInfix","classes","classSuffix","propertyName","STYLE_PATH_TO_CSS_VAR_INFIX","findInPresetsBy","features","blockName","presetPath","presetProperty","presetValueValue","orderedPresetsByOrigin","presetByOrigin","origins","origin","presets","presetObject","preset","highestPresetObjectWithSameSlug","slug","undefined","getPresetVariableFromValue","variableStylePath","presetPropertyValue","metadata","getValueFromPresetVariable","variable","presetType","result","getValueFromVariable","getValueFromCustomVariable","USER_VALUE_PREFIX","THEME_VALUE_PREFIX","THEME_VALUE_SUFFIX","parsedVar","startsWith","slice","length","split","endsWith","type"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACO,MAAMA,eAAe,GAAG,MAAxB;;AACA,MAAMC,mBAAmB,GAAG,MAA5B;;AACA,MAAMC,mBAAmB,GAAG,CAClC,YADkC,EAElC,iBAFkC,EAGlC,OAHkC,EAIlC,WAJkC,EAKlC,YALkC,EAMlC,UANkC,EAOlC,WAPkC,EAQlC,YARkC,EASlC,YATkC,EAUlC,gBAVkC,EAWlC,eAXkC,EAYlC,SAZkC,CAA5B;;AAeA,MAAMC,eAAe,GAAG,CAC9B;AACCC,EAAAA,IAAI,EAAE,CAAE,OAAF,EAAW,SAAX,CADP;AAECC,EAAAA,QAAQ,EAAE,OAFX;AAGCC,EAAAA,WAAW,EAAE,OAHd;AAICC,EAAAA,OAAO,EA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xB,WAAOV,0BAA0B,CAChCxB,QADgC,EAEhCC,SAFgC,EAGhCmB,QAHgC,EAIhC5B,IAJgC,CAAjC;AAMA;;AACD,SAAO4B,QAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { get, find, isString } from 'lodash';\n\n/* Supporting data */\nexport const ROOT_BLOCK_NAME = 'root';\nexport const ROOT_BLOCK_SELECTOR = 'body';\nexport const ROOT_BLOCK_SUPPORTS = [\n\t'background',\n\t'backgroundColor',\n\t'color',\n\t'linkColor',\n\t'fontFamily',\n\t'fontSize',\n\t'fontStyle',\n\t'fontWeight',\n\t'lineHeight',\n\t'textDecoration',\n\t'textTransform',\n\t'padding',\n];\n\nexport const PRESET_METADATA = [\n\t{\n\t\tpath: [ 'color', 'palette' ],\n\t\tvalueKey: 'color',\n\t\tcssVarInfix: 'color',\n\t\tclasses: [\n\t\t\t{ classSuffix: 'color', propertyName: 'color' },\n\t\t\t{\n\t\t\t\tclassSuffix: 'background-color',\n\t\t\t\tpropertyName: 'background-color',\n\t\t\t},\n\t\t\t{\n\t\t\t\tclassSuffix: 'border-color',\n\t\t\t\tpropertyName: 'border-color',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tpath: [ 'color', 'gradients' ],\n\t\tvalueKey: 'gradient',\n\t\tcssVarInfix: 'gradient',\n\t\tclasses: [\n\t\t\t{\n\t\t\t\tclassSuffix: 'gradient-background',\n\t\t\t\tpropertyName: 'background',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tpath: [ 'typography', 'fontSizes' ],\n\t\tvalueKey: 'size',\n\t\tcssVarInfix: 'font-size',\n\t\tclasses: [ { classSuffix: 'font-size', propertyName: 'font-size' } ],\n\t},\n\t{\n\t\tpath: [ 'typography', 'fontFamilies' ],\n\t\tvalueKey: 'fontFamily',\n\t\tcssVarInfix: 'font-family',\n\t\tclasses: [\n\t\t\t{ classSuffix: 'font-family', propertyName: 'font-family' },\n\t\t],\n\t},\n];\n\nconst STYLE_PATH_TO_CSS_VAR_INFIX = {\n\t'color.background': 'color',\n\t'color.text': 'color',\n\t'elements.link.color.text': 'color',\n\t'color.gradient': 'gradient',\n\t'typography.fontSize': 'font-size',\n\t'typography.fontFamily': 'font-family',\n};\n\nfunction findInPresetsBy(\n\tfeatures,\n\tblockName,\n\tpresetPath,\n\tpresetProperty,\n\tpresetValueValue\n) {\n\t// Block presets take priority above root level presets.\n\tconst orderedPresetsByOrigin = [\n\t\tget( features, [ 'blocks', blockName, ...presetPath ] ),\n\t\tget( features, presetPath ),\n\t];\n\n\tfor ( const presetByOrigin of orderedPresetsByOrigin ) {\n\t\tif ( presetByOrigin ) {\n\t\t\t// Preset origins ordered by priority.\n\t\t\tconst origins = [ 'user', 'theme', 'default' ];\n\t\t\tfor ( const origin of origins ) {\n\t\t\t\tconst presets = presetByOrigin[ origin ];\n\t\t\t\tif ( presets ) {\n\t\t\t\t\tconst presetObject = find(\n\t\t\t\t\t\tpresets,\n\t\t\t\t\t\t( preset ) =>\n\t\t\t\t\t\t\tpreset[ presetProperty ] === presetValueValue\n\t\t\t\t\t);\n\t\t\t\t\tif ( presetObject ) {\n\t\t\t\t\t\tif ( presetProperty === 'slug' ) {\n\t\t\t\t\t\t\treturn presetObject;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// if there is a highest priority preset with the same slug but different value the preset we found was overwritten and should be ignored.\n\t\t\t\t\t\tconst highestPresetObjectWithSameSlug = findInPresetsBy(\n\t\t\t\t\t\t\tfeatures,\n\t\t\t\t\t\t\tblockName,\n\t\t\t\t\t\t\tpresetPath,\n\t\t\t\t\t\t\t'slug',\n\t\t\t\t\t\t\tpresetObject.slug\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\thighestPresetObjectWithSameSlug[\n\t\t\t\t\t\t\t\tpresetProperty\n\t\t\t\t\t\t\t] === presetObject[ presetProperty ]\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn presetObject;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function getPresetVariableFromValue(\n\tfeatures,\n\tblockName,\n\tvariableStylePath,\n\tpresetPropertyValue\n) {\n\tif ( ! presetPropertyValue ) {\n\t\treturn presetPropertyValue;\n\t}\n\n\tconst cssVarInfix = STYLE_PATH_TO_CSS_VAR_INFIX[ variableStylePath ];\n\n\tconst metadata = find( PRESET_METADATA, [ 'cssVarInfix', cssVarInfix ] );\n\n\tif ( ! metadata ) {\n\t\t// The property doesn't have preset data\n\t\t// so the value should be returned as it is.\n\t\treturn presetPropertyValue;\n\t}\n\tconst { valueKey, path } = metadata;\n\n\tconst presetObject = findInPresetsBy(\n\t\tfeatures,\n\t\tblockName,\n\t\tpath,\n\t\tvalueKey,\n\t\tpresetPropertyValue\n\t);\n\n\tif ( ! presetObject ) {\n\t\t// Value wasn't found in the presets,\n\t\t// so it must be a custom value.\n\t\treturn presetPropertyValue;\n\t}\n\n\treturn `var:preset|${ cssVarInfix }|${ presetObject.slug }`;\n}\n\nfunction getValueFromPresetVariable(\n\tfeatures,\n\tblockName,\n\tvariable,\n\t[ presetType, slug ]\n) {\n\tconst metadata = find( PRESET_METADATA, [ 'cssVarInfix', presetType ] );\n\tif ( ! metadata ) {\n\t\treturn variable;\n\t}\n\n\tconst presetObject = findInPresetsBy(\n\t\tfeatures,\n\t\tblockName,\n\t\tmetadata.path,\n\t\t'slug',\n\t\tslug\n\t);\n\n\tif ( presetObject ) {\n\t\tconst { valueKey } = metadata;\n\t\tconst result = presetObject[ valueKey ];\n\t\treturn getValueFromVariable( features, blockName, result );\n\t}\n\n\treturn variable;\n}\n\nfunction getValueFromCustomVariable( features, blockName, variable, path ) {\n\tconst result =\n\t\tget( features, [ 'blocks', blockName, 'custom', ...path ] ) ??\n\t\tget( features, [ 'custom', ...path ] );\n\tif ( ! result ) {\n\t\treturn variable;\n\t}\n\t// A variable may reference another variable so we need recursion until we find the value.\n\treturn getValueFromVariable( features, blockName, result );\n}\n\nexport function getValueFromVariable( features, blockName, variable ) {\n\tif ( ! variable || ! isString( variable ) ) {\n\t\treturn variable;\n\t}\n\tconst USER_VALUE_PREFIX = 'var:';\n\tconst THEME_VALUE_PREFIX = 'var(--wp--';\n\tconst THEME_VALUE_SUFFIX = ')';\n\n\tlet parsedVar;\n\n\tif ( variable.startsWith( USER_VALUE_PREFIX ) ) {\n\t\tparsedVar = variable.slice( USER_VALUE_PREFIX.length ).split( '|' );\n\t} else if (\n\t\tvariable.startsWith( THEME_VALUE_PREFIX ) &&\n\t\tvariable.endsWith( THEME_VALUE_SUFFIX )\n\t) {\n\t\tparsedVar = variable\n\t\t\t.slice( THEME_VALUE_PREFIX.length, -THEME_VALUE_SUFFIX.length )\n\t\t\t.split( '--' );\n\t} else {\n\t\t// We don't know how to parse the value: either is raw of uses complex CSS such as `calc(1px * var(--wp--variable) )`\n\t\treturn variable;\n\t}\n\n\tconst [ type, ...path ] = parsedVar;\n\tif ( type === 'preset' ) {\n\t\treturn getValueFromPresetVariable(\n\t\t\tfeatures,\n\t\t\tblockName,\n\t\t\tvariable,\n\t\t\tpath\n\t\t);\n\t}\n\tif ( type === 'custom' ) {\n\t\treturn getValueFromCustomVariable(\n\t\t\tfeatures,\n\t\t\tblockName,\n\t\t\tvariable,\n\t\t\tpath\n\t\t);\n\t}\n\treturn variable;\n}\n"]}
@@ -67,12 +67,13 @@ function useSecondaryText() {
67
67
  */
68
68
 
69
69
 
70
- function DocumentActions({
71
- entityTitle,
72
- entityLabel,
73
- isLoaded,
74
- children: dropdownContent
75
- }) {
70
+ function DocumentActions(_ref) {
71
+ let {
72
+ entityTitle,
73
+ entityLabel,
74
+ isLoaded,
75
+ children: dropdownContent
76
+ } = _ref;
76
77
  const {
77
78
  label
78
79
  } = useSecondaryText(); // The title ref is passed to the popover as the anchorRef so that the
@@ -120,19 +121,22 @@ function DocumentActions({
120
121
  anchorRef: titleRef.current
121
122
  },
122
123
  position: "bottom center",
123
- renderToggle: ({
124
- isOpen,
125
- onToggle
126
- }) => (0, _element.createElement)(_components.Button, {
127
- className: "edit-site-document-actions__get-info",
128
- icon: _icons.chevronDown,
129
- "aria-expanded": isOpen,
130
- "aria-haspopup": "true",
131
- onClick: onToggle,
132
- label: (0, _i18n.sprintf)(
133
- /* translators: %s: the entity to see details about, like "template"*/
134
- (0, _i18n.__)('Show %s details'), entityLabel)
135
- }),
124
+ renderToggle: _ref2 => {
125
+ let {
126
+ isOpen,
127
+ onToggle
128
+ } = _ref2;
129
+ return (0, _element.createElement)(_components.Button, {
130
+ className: "edit-site-document-actions__get-info",
131
+ icon: _icons.chevronDown,
132
+ "aria-expanded": isOpen,
133
+ "aria-haspopup": "true",
134
+ onClick: onToggle,
135
+ label: (0, _i18n.sprintf)(
136
+ /* translators: %s: the entity to see details about, like "template"*/
137
+ (0, _i18n.__)('Show %s details'), entityLabel)
138
+ });
139
+ },
136
140
  contentClassName: "edit-site-document-actions__info-dropdown",
137
141
  renderContent: dropdownContent
138
142
  })));
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/header/document-actions/index.js"],"names":["getBlockDisplayText","block","blockType","name","attributes","useSecondaryText","getBlock","blockEditorStore","activeEntityBlockId","select","__experimentalGetActiveBlockIdByBlockNames","label","isActive","DocumentActions","entityTitle","entityLabel","isLoaded","children","dropdownContent","titleRef","anchorRef","current","isOpen","onToggle","chevronDown"],"mappings":";;;;;;;;;AAqBA;;AAlBA;;AAKA;;AACA;;AAIA;;AACA;;AAMA;;AAEA;;AAtBA;AACA;AACA;;AAGA;AACA;AACA;AAiBA,SAASA,mBAAT,CAA8BC,KAA9B,EAAsC;AACrC,MAAKA,KAAL,EAAa;AACZ,UAAMC,SAAS,GAAG,0BAAcD,KAAK,CAACE,IAApB,CAAlB;AACA,WAAOD,SAAS,GAAG,yCAAeA,SAAf,EAA0BD,KAAK,CAACG,UAAhC,CAAH,GAAkD,IAAlE;AACA;;AACD,SAAO,IA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C,0BAAD;AAAgB,IAAA,EAAE,EAAC;AAAnB,KACG;AACD;AACA,gBAAI,aAAJ,CAFC,EAGDJ,WAHC,CADH,CAJD,CAJD,EAiBC,4BAAC,8BAAD;AACC,IAAA,IAAI,EAAC,MADN;AAEC,IAAA,SAAS,EAAC,mCAFX;AAGC,IAAA,EAAE,EAAC;AAHJ,KAKGD,WALH,CAjBD,EAyBC,4BAAC,8BAAD;AACC,IAAA,IAAI,EAAC,MADN;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGH,KAJH,aAIGA,KAJH,cAIGA,KAJH,GAIY,EAJZ,CAzBD,EAgCGO,eAAe,IAChB,4BAAC,oBAAD;AACC,IAAA,YAAY,EAAG;AACdE,MAAAA,SAAS,EAAED,QAAQ,CAACE;AADN,KADhB;AAIC,IAAA,QAAQ,EAAC,eAJV;AAKC,IAAA,YAAY,EAAG,CAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAF,KACd,4BAAC,kBAAD;AACC,MAAA,SAAS,EAAC,sCADX;AAEC,MAAA,IAAI,EAAGC,kBAFR;AAGC,uBAAgBF,MAHjB;AAIC,uBAAc,MAJf;AAKC,MAAA,OAAO,EAAGC,QALX;AAMC,MAAA,KAAK,EAAG;AACP;AACA,oBAAI,iBAAJ,CAFO,EAGPR,WAHO;AANT,MANF;AAmBC,IAAA,gBAAgB,EAAC,2CAnBlB;AAoBC,IAAA,aAAa,EAAGG;AApBjB,IAjCF,CALD,CADD;AAiEA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport {\n\t__experimentalGetBlockLabel as getBlockLabel,\n\tgetBlockType,\n} from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tDropdown,\n\tButton,\n\tVisuallyHidden,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { chevronDown } from '@wordpress/icons';\nimport { useRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction getBlockDisplayText( block ) {\n\tif ( block ) {\n\t\tconst blockType = getBlockType( block.name );\n\t\treturn blockType ? getBlockLabel( blockType, block.attributes ) : null;\n\t}\n\treturn null;\n}\n\nfunction useSecondaryText() {\n\tconst { getBlock } = useSelect( blockEditorStore );\n\tconst activeEntityBlockId = useSelect(\n\t\t( select ) =>\n\t\t\tselect(\n\t\t\t\tblockEditorStore\n\t\t\t).__experimentalGetActiveBlockIdByBlockNames( [\n\t\t\t\t'core/template-part',\n\t\t\t] ),\n\t\t[]\n\t);\n\n\tif ( activeEntityBlockId ) {\n\t\treturn {\n\t\t\tlabel: getBlockDisplayText( getBlock( activeEntityBlockId ) ),\n\t\t\tisActive: true,\n\t\t};\n\t}\n\n\treturn {};\n}\n\n/**\n * @param {Object} props Props for the DocumentActions component.\n * @param {string} props.entityTitle The title to display.\n * @param {string} props.entityLabel A label to use for entity-related options.\n * E.g. \"template\" would be used for \"edit\n * template\" and \"show template details\".\n * @param {boolean} props.isLoaded Whether the data is available.\n * @param {Function} props.children React component to use for the\n * information dropdown area. Should be a\n * function which accepts dropdown props.\n */\nexport default function DocumentActions( {\n\tentityTitle,\n\tentityLabel,\n\tisLoaded,\n\tchildren: dropdownContent,\n} ) {\n\tconst { label } = useSecondaryText();\n\n\t// The title ref is passed to the popover as the anchorRef so that the\n\t// dropdown is centered over the whole title area rather than just one\n\t// part of it.\n\tconst titleRef = useRef();\n\n\t// Return a simple loading indicator until we have information to show.\n\tif ( ! isLoaded ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Loading…' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Return feedback that the template does not seem to exist.\n\tif ( ! entityTitle ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Template not found' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'edit-site-document-actions', {\n\t\t\t\t'has-secondary-label': !! label,\n\t\t\t} ) }\n\t\t>\n\t\t\t<div\n\t\t\t\tref={ titleRef }\n\t\t\t\tclassName=\"edit-site-document-actions__title-wrapper\"\n\t\t\t>\n\t\t\t\t<Text\n\t\t\t\t\tsize=\"body\"\n\t\t\t\t\tclassName=\"edit-site-document-actions__title-prefix\"\n\t\t\t\t>\n\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t/* translators: %s: the entity being edited, like \"template\"*/\n\t\t\t\t\t\t\t__( 'Editing %s:' ),\n\t\t\t\t\t\t\tentityLabel\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t</Text>\n\n\t\t\t\t<Text\n\t\t\t\t\tsize=\"body\"\n\t\t\t\t\tclassName=\"edit-site-document-actions__title\"\n\t\t\t\t\tas=\"h1\"\n\t\t\t\t>\n\t\t\t\t\t{ entityTitle }\n\t\t\t\t</Text>\n\n\t\t\t\t<Text\n\t\t\t\t\tsize=\"body\"\n\t\t\t\t\tclassName=\"edit-site-document-actions__secondary-item\"\n\t\t\t\t>\n\t\t\t\t\t{ label ?? '' }\n\t\t\t\t</Text>\n\n\t\t\t\t{ dropdownContent && (\n\t\t\t\t\t<Dropdown\n\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\tanchorRef: titleRef.current,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tposition=\"bottom center\"\n\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"edit-site-document-actions__get-info\"\n\t\t\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: the entity to see details about, like \"template\"*/\n\t\t\t\t\t\t\t\t\t__( 'Show %s details' ),\n\t\t\t\t\t\t\t\t\tentityLabel\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tcontentClassName=\"edit-site-document-actions__info-dropdown\"\n\t\t\t\t\t\trenderContent={ dropdownContent }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/header/document-actions/index.js"],"names":["getBlockDisplayText","block","blockType","name","attributes","useSecondaryText","getBlock","blockEditorStore","activeEntityBlockId","select","__experimentalGetActiveBlockIdByBlockNames","label","isActive","DocumentActions","entityTitle","entityLabel","isLoaded","children","dropdownContent","titleRef","anchorRef","current","isOpen","onToggle","chevronDown"],"mappings":";;;;;;;;;AAqBA;;AAlBA;;AAKA;;AACA;;AAIA;;AACA;;AAMA;;AAEA;;AAtBA;AACA;AACA;;AAGA;AACA;AACA;AAiBA,SAASA,mBAAT,CAA8BC,KAA9B,EAAsC;AACrC,MAAKA,KAAL,EAAa;AACZ,UAAMC,SAAS,GAAG,0BAAcD,KAAK,CAACE,IAApB,CAAlB;AACA,WAAOD,SAAS,GAAG,yCAAeA,SAAf,EAA0BD,KAAK,CAACG,UAAhC,CAAH,GAAkD,IAAlE;AACA;;AACD,SAAO,IAAP;AACA;;AAED,SAASC,gBAAT,GAA4B;AAC3B,QAAM;AAAEC,IAAAA;AAAF,MAAe,qBAAWC,kBAAX,CAArB;AACA,QAAMC,mBAAmB,GAAG,qBACzBC,MAAF,IACCA,MAAM,CACLF,kBADK,CAAN,CAEEG,0CAFF,CAE8C,CAC7C,oBAD6C,CAF9C,CAF0B,EAO3B,EAP2B,CAA5B;;AAUA,MAAKF,mBAAL,EAA2B;AAC1B,WAAO;AACNG,MAAAA,KAAK,EAAEX,mBAAm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C;AAFX,KAIGH,KAJH,aAIGA,KAJH,cAIGA,KAJH,GAIY,EAJZ,CAzBD,EAgCGO,eAAe,IAChB,4BAAC,oBAAD;AACC,IAAA,YAAY,EAAG;AACdE,MAAAA,SAAS,EAAED,QAAQ,CAACE;AADN,KADhB;AAIC,IAAA,QAAQ,EAAC,eAJV;AAKC,IAAA,YAAY,EAAG;AAAA,UAAE;AAAEC,QAAAA,MAAF;AAAUC,QAAAA;AAAV,OAAF;AAAA,aACd,4BAAC,kBAAD;AACC,QAAA,SAAS,EAAC,sCADX;AAEC,QAAA,IAAI,EAAGC,kBAFR;AAGC,yBAAgBF,MAHjB;AAIC,yBAAc,MAJf;AAKC,QAAA,OAAO,EAAGC,QALX;AAMC,QAAA,KAAK,EAAG;AACP;AACA,sBAAI,iBAAJ,CAFO,EAGPR,WAHO;AANT,QADc;AAAA,KALhB;AAmBC,IAAA,gBAAgB,EAAC,2CAnBlB;AAoBC,IAAA,aAAa,EAAGG;AApBjB,IAjCF,CALD,CADD;AAiEA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport {\n\t__experimentalGetBlockLabel as getBlockLabel,\n\tgetBlockType,\n} from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tDropdown,\n\tButton,\n\tVisuallyHidden,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { chevronDown } from '@wordpress/icons';\nimport { useRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction getBlockDisplayText( block ) {\n\tif ( block ) {\n\t\tconst blockType = getBlockType( block.name );\n\t\treturn blockType ? getBlockLabel( blockType, block.attributes ) : null;\n\t}\n\treturn null;\n}\n\nfunction useSecondaryText() {\n\tconst { getBlock } = useSelect( blockEditorStore );\n\tconst activeEntityBlockId = useSelect(\n\t\t( select ) =>\n\t\t\tselect(\n\t\t\t\tblockEditorStore\n\t\t\t).__experimentalGetActiveBlockIdByBlockNames( [\n\t\t\t\t'core/template-part',\n\t\t\t] ),\n\t\t[]\n\t);\n\n\tif ( activeEntityBlockId ) {\n\t\treturn {\n\t\t\tlabel: getBlockDisplayText( getBlock( activeEntityBlockId ) ),\n\t\t\tisActive: true,\n\t\t};\n\t}\n\n\treturn {};\n}\n\n/**\n * @param {Object} props Props for the DocumentActions component.\n * @param {string} props.entityTitle The title to display.\n * @param {string} props.entityLabel A label to use for entity-related options.\n * E.g. \"template\" would be used for \"edit\n * template\" and \"show template details\".\n * @param {boolean} props.isLoaded Whether the data is available.\n * @param {Function} props.children React component to use for the\n * information dropdown area. Should be a\n * function which accepts dropdown props.\n */\nexport default function DocumentActions( {\n\tentityTitle,\n\tentityLabel,\n\tisLoaded,\n\tchildren: dropdownContent,\n} ) {\n\tconst { label } = useSecondaryText();\n\n\t// The title ref is passed to the popover as the anchorRef so that the\n\t// dropdown is centered over the whole title area rather than just one\n\t// part of it.\n\tconst titleRef = useRef();\n\n\t// Return a simple loading indicator until we have information to show.\n\tif ( ! isLoaded ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Loading…' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Return feedback that the template does not seem to exist.\n\tif ( ! entityTitle ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Template not found' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'edit-site-document-actions', {\n\t\t\t\t'has-secondary-label': !! label,\n\t\t\t} ) }\n\t\t>\n\t\t\t<div\n\t\t\t\tref={ titleRef }\n\t\t\t\tclassName=\"edit-site-document-actions__title-wrapper\"\n\t\t\t>\n\t\t\t\t<Text\n\t\t\t\t\tsize=\"body\"\n\t\t\t\t\tclassName=\"edit-site-document-actions__title-prefix\"\n\t\t\t\t>\n\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t/* translators: %s: the entity being edited, like \"template\"*/\n\t\t\t\t\t\t\t__( 'Editing %s:' ),\n\t\t\t\t\t\t\tentityLabel\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t</Text>\n\n\t\t\t\t<Text\n\t\t\t\t\tsize=\"body\"\n\t\t\t\t\tclassName=\"edit-site-document-actions__title\"\n\t\t\t\t\tas=\"h1\"\n\t\t\t\t>\n\t\t\t\t\t{ entityTitle }\n\t\t\t\t</Text>\n\n\t\t\t\t<Text\n\t\t\t\t\tsize=\"body\"\n\t\t\t\t\tclassName=\"edit-site-document-actions__secondary-item\"\n\t\t\t\t>\n\t\t\t\t\t{ label ?? '' }\n\t\t\t\t</Text>\n\n\t\t\t\t{ dropdownContent && (\n\t\t\t\t\t<Dropdown\n\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\tanchorRef: titleRef.current,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tposition=\"bottom center\"\n\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"edit-site-document-actions__get-info\"\n\t\t\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: the entity to see details about, like \"template\"*/\n\t\t\t\t\t\t\t\t\t__( 'Show %s details' ),\n\t\t\t\t\t\t\t\t\tentityLabel\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tcontentClassName=\"edit-site-document-actions__info-dropdown\"\n\t\t\t\t\t\trenderContent={ dropdownContent }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
@@ -32,13 +32,15 @@ var _store = require("../../../store");
32
32
  /**
33
33
  * Internal dependencies
34
34
  */
35
- function FeatureToggle({
36
- feature,
37
- label,
38
- info,
39
- messageActivated,
40
- messageDeactivated
41
- }) {
35
+ function FeatureToggle(_ref) {
36
+ let {
37
+ feature,
38
+ label,
39
+ info,
40
+ messageActivated,
41
+ messageDeactivated
42
+ } = _ref;
43
+
42
44
  const speakMessage = () => {
43
45
  if (isActive) {
44
46
  (0, _a11y.speak)(messageDeactivated || (0, _i18n.__)('Feature deactivated'));
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/header/feature-toggle/index.js"],"names":["FeatureToggle","feature","label","info","messageActivated","messageDeactivated","speakMessage","isActive","select","editSiteStore","isFeatureActive","toggleFeature","check","bind"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAjBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AAGe,SAASA,aAAT,CAAwB;AACtCC,EAAAA,OADsC;AAEtCC,EAAAA,KAFsC;AAGtCC,EAAAA,IAHsC;AAItCC,EAAAA,gBAJsC;AAKtCC,EAAAA;AALsC,CAAxB,EAMX;AACH,QAAMC,YAAY,GAAG,MAAM;AAC1B,QAAKC,QAAL,EAAgB;AACf,uBAAOF,kBAAkB,IAAI,cAAI,qBAAJ,CAA7B;AACA,KAFD,MAEO;AACN,uBAAOD,gBAAgB,IAAI,cAAI,mBAAJ,CAA3B;AACA;AACD,GAND;;AAQA,QAAMG,QAAQ,GAAG,qBAAaC,MAAF,IAAc;AACzC,WAAOA,MAAM,CAAEC,YAAF,CAAN,CAAwBC,eAAxB,CAAyCT,OAAzC,CAAP;AACA,GAFgB,EAEd,EAFc,CAAjB;AAIA,QAAM;AAAEU,IAAAA;AAAF,MAAoB,uBAAaF,YAAb,CAA1B;AAEA,SACC,4BAAC,oBAAD;AACC,IAAA,IAAI,EAAGF,QAAQ,IAAIK,YADpB;AAEC,IAAA,UAAU,EAAGL,QAFd;AAGC,IAAA,OAAO,EAAG,kBACTI,aAAa,CAACE,IAAd,CAAoB,IAApB,EAA0BZ,OAA1B,CADS,EAETK,YAFS,CAHX;AAOC,IAAA,IAAI,EAAC,kBAPN;AAQC,IAAA,IAAI,EAAGH;AARR,KAUGD,KAVH,CADD;AAcA","sourcesContent":["/**\n * External dependencies\n */\nimport { flow } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\n\nexport default function FeatureToggle( {\n\tfeature,\n\tlabel,\n\tinfo,\n\tmessageActivated,\n\tmessageDeactivated,\n} ) {\n\tconst speakMessage = () => {\n\t\tif ( isActive ) {\n\t\t\tspeak( messageDeactivated || __( 'Feature deactivated' ) );\n\t\t} else {\n\t\t\tspeak( messageActivated || __( 'Feature activated' ) );\n\t\t}\n\t};\n\n\tconst isActive = useSelect( ( select ) => {\n\t\treturn select( editSiteStore ).isFeatureActive( feature );\n\t}, [] );\n\n\tconst { toggleFeature } = useDispatch( editSiteStore );\n\n\treturn (\n\t\t<MenuItem\n\t\t\ticon={ isActive && check }\n\t\t\tisSelected={ isActive }\n\t\t\tonClick={ flow(\n\t\t\t\ttoggleFeature.bind( null, feature ),\n\t\t\t\tspeakMessage\n\t\t\t) }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tinfo={ info }\n\t\t>\n\t\t\t{ label }\n\t\t</MenuItem>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/header/feature-toggle/index.js"],"names":["FeatureToggle","feature","label","info","messageActivated","messageDeactivated","speakMessage","isActive","select","editSiteStore","isFeatureActive","toggleFeature","check","bind"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAjBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AAGe,SAASA,aAAT,OAMX;AAAA,MANmC;AACtCC,IAAAA,OADsC;AAEtCC,IAAAA,KAFsC;AAGtCC,IAAAA,IAHsC;AAItCC,IAAAA,gBAJsC;AAKtCC,IAAAA;AALsC,GAMnC;;AACH,QAAMC,YAAY,GAAG,MAAM;AAC1B,QAAKC,QAAL,EAAgB;AACf,uBAAOF,kBAAkB,IAAI,cAAI,qBAAJ,CAA7B;AACA,KAFD,MAEO;AACN,uBAAOD,gBAAgB,IAAI,cAAI,mBAAJ,CAA3B;AACA;AACD,GAND;;AAQA,QAAMG,QAAQ,GAAG,qBAAaC,MAAF,IAAc;AACzC,WAAOA,MAAM,CAAEC,YAAF,CAAN,CAAwBC,eAAxB,CAAyCT,OAAzC,CAAP;AACA,GAFgB,EAEd,EAFc,CAAjB;AAIA,QAAM;AAAEU,IAAAA;AAAF,MAAoB,uBAAaF,YAAb,CAA1B;AAEA,SACC,4BAAC,oBAAD;AACC,IAAA,IAAI,EAAGF,QAAQ,IAAIK,YADpB;AAEC,IAAA,UAAU,EAAGL,QAFd;AAGC,IAAA,OAAO,EAAG,kBACTI,aAAa,CAACE,IAAd,CAAoB,IAApB,EAA0BZ,OAA1B,CADS,EAETK,YAFS,CAHX;AAOC,IAAA,IAAI,EAAC,kBAPN;AAQC,IAAA,IAAI,EAAGH;AARR,KAUGD,KAVH,CADD;AAcA","sourcesContent":["/**\n * External dependencies\n */\nimport { flow } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\n\nexport default function FeatureToggle( {\n\tfeature,\n\tlabel,\n\tinfo,\n\tmessageActivated,\n\tmessageDeactivated,\n} ) {\n\tconst speakMessage = () => {\n\t\tif ( isActive ) {\n\t\t\tspeak( messageDeactivated || __( 'Feature deactivated' ) );\n\t\t} else {\n\t\t\tspeak( messageActivated || __( 'Feature activated' ) );\n\t\t}\n\t};\n\n\tconst isActive = useSelect( ( select ) => {\n\t\treturn select( editSiteStore ).isFeatureActive( feature );\n\t}, [] );\n\n\tconst { toggleFeature } = useDispatch( editSiteStore );\n\n\treturn (\n\t\t<MenuItem\n\t\t\ticon={ isActive && check }\n\t\t\tisSelected={ isActive }\n\t\t\tonClick={ flow(\n\t\t\t\ttoggleFeature.bind( null, feature ),\n\t\t\t\tspeakMessage\n\t\t\t) }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tinfo={ info }\n\t\t>\n\t\t\t{ label }\n\t\t</MenuItem>\n\t);\n}\n"]}
@@ -29,8 +29,6 @@ var _editor = require("@wordpress/editor");
29
29
 
30
30
  var _coreData = require("@wordpress/core-data");
31
31
 
32
- var _navigationLink = _interopRequireDefault(require("./navigation-link"));
33
-
34
32
  var _moreMenu = _interopRequireDefault(require("./more-menu"));
35
33
 
36
34
  var _saveButton = _interopRequireDefault(require("../save-button"));
@@ -56,10 +54,11 @@ const preventDefault = event => {
56
54
  event.preventDefault();
57
55
  };
58
56
 
59
- function Header({
60
- openEntitiesSavedStates,
61
- isEntitiesSavedStatesOpen
62
- }) {
57
+ function Header(_ref) {
58
+ let {
59
+ openEntitiesSavedStates,
60
+ isEntitiesSavedStatesOpen
61
+ } = _ref;
63
62
  const inserterButton = (0, _element.useRef)();
64
63
  const {
65
64
  deviceType,
@@ -124,7 +123,7 @@ function Header({
124
123
  className: "edit-site-header"
125
124
  }, (0, _element.createElement)("div", {
126
125
  className: "edit-site-header_start"
127
- }, (0, _element.createElement)(_navigationLink.default, null), (0, _element.createElement)("div", {
126
+ }, (0, _element.createElement)("div", {
128
127
  className: "edit-site-header__toolbar"
129
128
  }, (0, _element.createElement)(_components.Button, {
130
129
  ref: inserterButton,
@@ -150,12 +149,15 @@ function Header({
150
149
  entityTitle: entityTitle,
151
150
  entityLabel: templateType === 'wp_template_part' ? 'template part' : 'template',
152
151
  isLoaded: isLoaded
153
- }, ({
154
- onClose
155
- }) => (0, _element.createElement)(_templateDetails.default, {
156
- template: template,
157
- onClose: onClose
158
- }))), (0, _element.createElement)("div", {
152
+ }, _ref2 => {
153
+ let {
154
+ onClose
155
+ } = _ref2;
156
+ return (0, _element.createElement)(_templateDetails.default, {
157
+ template: template,
158
+ onClose: onClose
159
+ });
160
+ })), (0, _element.createElement)("div", {
159
161
  className: "edit-site-header_end"
160
162
  }, (0, _element.createElement)("div", {
161
163
  className: "edit-site-header__actions"
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/header/index.js"],"names":["preventDefault","event","Header","openEntitiesSavedStates","isEntitiesSavedStatesOpen","inserterButton","deviceType","entityTitle","template","templateType","isInserterOpen","isListViewOpen","listViewShortcut","isLoaded","select","__experimentalGetPreviewDeviceType","getEditedPostType","getEditedPostId","isInserterOpened","isListViewOpened","editSiteStore","getEditedEntityRecord","coreStore","__experimentalGetTemplateInfo","getTemplateInfo","editorStore","getShortcutRepresentation","keyboardShortcutsStore","postType","postId","record","_isLoaded","title","__experimentalSetPreviewDeviceType","setPreviewDeviceType","setIsInserterOpened","setIsListViewOpened","isLargeViewport","openInserter","current","focus","toggleListView","isFocusMode","plus","listView","onClose"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA5BA;AACA;AACA;;AAgBA;AACA;AACA;AAUA,MAAMA,cAAc,GAAKC,KAAF,IAAa;AACnCA,EAAAA,KAAK,CAACD,cAAN;AACA,CAFD;;AAIe,SAASE,MAAT,CAAiB;AAC/BC,EAAAA,uBAD+B;AAE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EAAGjC;AACZ;AAJD;AAKC,IAAA,KAAK,EAAG,cAAI,WAAJ,CALT;AAMC,IAAA,OAAO,EAAG8B,cANX;AAOC,IAAA,QAAQ,EAAG7B;AAPZ,IAJD,CAfF,CAHD,CADD,EAqCC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,wBAAD;AACC,IAAA,WAAW,EAAGL,WADf;AAEC,IAAA,WAAW,EACVE,YAAY,KAAK,kBAAjB,GACG,eADH,GAEG,UALL;AAOC,IAAA,QAAQ,EAAGI;AAPZ,KASG,CAAE;AAAEgC,IAAAA;AAAF,GAAF,KACD,4BAAC,wBAAD;AACC,IAAA,QAAQ,EAAGrC,QADZ;AAEC,IAAA,OAAO,EAAGqC;AAFX,IAVF,CADD,CArCD,EAwDC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACG,CAAEH,WAAF,IACD,4BAAC,yCAAD;AACC,IAAA,UAAU,EAAGpC,UADd;AAEC,IAAA,aAAa,EAAG4B;AAFjB,IAFF,EAOC,4BAAC,mBAAD;AACC,IAAA,uBAAuB,EAAG/B,uBAD3B;AAEC,IAAA,yBAAyB,EAAGC;AAF7B,IAPD,EAWC,4BAAC,sBAAD,CAAa,IAAb;AAAkB,IAAA,KAAK,EAAC;AAAxB,IAXD,EAYC,4BAAC,iBAAD,OAZD,CADD,CAxDD,CADD;AA2EA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useRef } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tToolSelector,\n\t__experimentalPreviewOptions as PreviewOptions,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { PinnedItems } from '@wordpress/interface';\nimport { _x, __ } from '@wordpress/i18n';\nimport { listView, plus } from '@wordpress/icons';\nimport { Button } from '@wordpress/components';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport NavigationLink from './navigation-link';\nimport MoreMenu from './more-menu';\nimport SaveButton from '../save-button';\nimport UndoButton from './undo-redo/undo';\nimport RedoButton from './undo-redo/redo';\nimport DocumentActions from './document-actions';\nimport TemplateDetails from '../template-details';\nimport { store as editSiteStore } from '../../store';\n\nconst preventDefault = ( event ) => {\n\tevent.preventDefault();\n};\n\nexport default function Header( {\n\topenEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n} ) {\n\tconst inserterButton = useRef();\n\tconst {\n\t\tdeviceType,\n\t\tentityTitle,\n\t\ttemplate,\n\t\ttemplateType,\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tisLoaded,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetPreviewDeviceType,\n\t\t\tgetEditedPostType,\n\t\t\tgetEditedPostId,\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t} = select( editSiteStore );\n\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\tconst { __experimentalGetTemplateInfo: getTemplateInfo } = select(\n\t\t\teditorStore\n\t\t);\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\n\t\tconst postType = getEditedPostType();\n\t\tconst postId = getEditedPostId();\n\t\tconst record = getEditedEntityRecord( 'postType', postType, postId );\n\t\tconst _isLoaded = !! postId;\n\n\t\treturn {\n\t\t\tdeviceType: __experimentalGetPreviewDeviceType(),\n\t\t\tentityTitle: getTemplateInfo( record ).title,\n\t\t\tisLoaded: _isLoaded,\n\t\t\ttemplate: record,\n\t\t\ttemplateType: postType,\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/edit-site/toggle-list-view'\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\t__experimentalSetPreviewDeviceType: setPreviewDeviceType,\n\t\tsetIsInserterOpened,\n\t\tsetIsListViewOpened,\n\t} = useDispatch( editSiteStore );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst openInserter = useCallback( () => {\n\t\tif ( isInserterOpen ) {\n\t\t\t// Focusing the inserter button closes the inserter popover\n\t\t\tinserterButton.current.focus();\n\t\t} else {\n\t\t\tsetIsInserterOpened( true );\n\t\t}\n\t}, [ isInserterOpen, setIsInserterOpened ] );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst isFocusMode = templateType === 'wp_template_part';\n\n\treturn (\n\t\t<div className=\"edit-site-header\">\n\t\t\t<div className=\"edit-site-header_start\">\n\t\t\t\t<NavigationLink />\n\n\t\t\t\t<div className=\"edit-site-header__toolbar\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tref={ inserterButton }\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tisPressed={ isInserterOpen }\n\t\t\t\t\t\tclassName=\"edit-site-header-toolbar__inserter-toggle\"\n\t\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\t\tonClick={ openInserter }\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t'Toggle block inserter',\n\t\t\t\t\t\t\t'Generic label for block inserter button'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToolSelector />\n\t\t\t\t\t\t\t<UndoButton />\n\t\t\t\t\t\t\t<RedoButton />\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"edit-site-header-toolbar__list-view-toggle\"\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ __( 'List View' ) }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div className=\"edit-site-header_center\">\n\t\t\t\t<DocumentActions\n\t\t\t\t\tentityTitle={ entityTitle }\n\t\t\t\t\tentityLabel={\n\t\t\t\t\t\ttemplateType === 'wp_template_part'\n\t\t\t\t\t\t\t? 'template part'\n\t\t\t\t\t\t\t: 'template'\n\t\t\t\t\t}\n\t\t\t\t\tisLoaded={ isLoaded }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<TemplateDetails\n\t\t\t\t\t\t\ttemplate={ template }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</DocumentActions>\n\t\t\t</div>\n\n\t\t\t<div className=\"edit-site-header_end\">\n\t\t\t\t<div className=\"edit-site-header__actions\">\n\t\t\t\t\t{ ! isFocusMode && (\n\t\t\t\t\t\t<PreviewOptions\n\t\t\t\t\t\t\tdeviceType={ deviceType }\n\t\t\t\t\t\t\tsetDeviceType={ setPreviewDeviceType }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<SaveButton\n\t\t\t\t\t\topenEntitiesSavedStates={ openEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={ isEntitiesSavedStatesOpen }\n\t\t\t\t\t/>\n\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-site\" />\n\t\t\t\t\t<MoreMenu />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/header/index.js"],"names":["preventDefault","event","Header","openEntitiesSavedStates","isEntitiesSavedStatesOpen","inserterButton","deviceType","entityTitle","template","templateType","isInserterOpen","isListViewOpen","listViewShortcut","isLoaded","select","__experimentalGetPreviewDeviceType","getEditedPostType","getEditedPostId","isInserterOpened","isListViewOpened","editSiteStore","getEditedEntityRecord","coreStore","__experimentalGetTemplateInfo","getTemplateInfo","editorStore","getShortcutRepresentation","keyboardShortcutsStore","postType","postId","record","_isLoaded","title","__experimentalSetPreviewDeviceType","setPreviewDeviceType","setIsInserterOpened","setIsListViewOpened","isLargeViewport","openInserter","current","focus","toggleListView","isFocusMode","plus","listView","onClose"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA3BA;AACA;AACA;;AAgBA;AACA;AACA;AASA,MAAMA,cAAc,GAAKC,KAAF,IAAa;AACnCA,EAAAA,KAAK,CAACD,cAAN;AACA,CAFD;;AAIe,SAASE,MAAT,OAGX;AAAA,MAH4B;AAC/BC,IAAAA,uBAD+B;AAE/BC,IAAAA;AAF+B,GAG5B;AACH,QAAMC,cAAc,GAAG,sBAAvB;AACA,QAAM;AACLC,IAAAA,UADK;AAELC,IAAAA,WAFK;AAGLC,IAAAA,QAHK;AAILC,IAAAA,YAJK;AAKLC,IAAAA,cALK;AAMLC,IAAAA,cANK;AAOLC,IAAAA,gBAPK;AAQLC,IAAAA;AARK,MASF,qBAAaC,MAAF,IAAc;AAC5B,UAAM;AACLC,MAAAA,kCADK;AAELC,MAAAA,iBAFK;AAGLC,MAAAA,eAHK;AAILC,MAAAA,gBAJK;AAKLC,MAAAA;AALK,QAMFL,MAAM,CAAEM,YAAF,CANV;AAOA,UAAM;AAAEC,MAAAA;AAAF,QAA4BP,MAAM,CAAEQ,eAAF,CAAxC;AACA,UAAM;AAAEC,MAAAA,6BAA6B,EAAEC;AAAjC,QAAqDV,MAAM,CAChEW,aADgE,CAAjE;AAG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AAF,IACD,4BAAC,yCAAD;AACC,IAAA,UAAU,EAAGpC,UADd;AAEC,IAAA,aAAa,EAAG4B;AAFjB,IAFF,EAOC,4BAAC,mBAAD;AACC,IAAA,uBAAuB,EAAG/B,uBAD3B;AAEC,IAAA,yBAAyB,EAAGC;AAF7B,IAPD,EAWC,4BAAC,sBAAD,CAAa,IAAb;AAAkB,IAAA,KAAK,EAAC;AAAxB,IAXD,EAYC,4BAAC,iBAAD,OAZD,CADD,CAtDD,CADD;AAyEA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useRef } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tToolSelector,\n\t__experimentalPreviewOptions as PreviewOptions,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { PinnedItems } from '@wordpress/interface';\nimport { _x, __ } from '@wordpress/i18n';\nimport { listView, plus } from '@wordpress/icons';\nimport { Button } from '@wordpress/components';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport MoreMenu from './more-menu';\nimport SaveButton from '../save-button';\nimport UndoButton from './undo-redo/undo';\nimport RedoButton from './undo-redo/redo';\nimport DocumentActions from './document-actions';\nimport TemplateDetails from '../template-details';\nimport { store as editSiteStore } from '../../store';\n\nconst preventDefault = ( event ) => {\n\tevent.preventDefault();\n};\n\nexport default function Header( {\n\topenEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n} ) {\n\tconst inserterButton = useRef();\n\tconst {\n\t\tdeviceType,\n\t\tentityTitle,\n\t\ttemplate,\n\t\ttemplateType,\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tisLoaded,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetPreviewDeviceType,\n\t\t\tgetEditedPostType,\n\t\t\tgetEditedPostId,\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t} = select( editSiteStore );\n\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\tconst { __experimentalGetTemplateInfo: getTemplateInfo } = select(\n\t\t\teditorStore\n\t\t);\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\n\t\tconst postType = getEditedPostType();\n\t\tconst postId = getEditedPostId();\n\t\tconst record = getEditedEntityRecord( 'postType', postType, postId );\n\t\tconst _isLoaded = !! postId;\n\n\t\treturn {\n\t\t\tdeviceType: __experimentalGetPreviewDeviceType(),\n\t\t\tentityTitle: getTemplateInfo( record ).title,\n\t\t\tisLoaded: _isLoaded,\n\t\t\ttemplate: record,\n\t\t\ttemplateType: postType,\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/edit-site/toggle-list-view'\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\t__experimentalSetPreviewDeviceType: setPreviewDeviceType,\n\t\tsetIsInserterOpened,\n\t\tsetIsListViewOpened,\n\t} = useDispatch( editSiteStore );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst openInserter = useCallback( () => {\n\t\tif ( isInserterOpen ) {\n\t\t\t// Focusing the inserter button closes the inserter popover\n\t\t\tinserterButton.current.focus();\n\t\t} else {\n\t\t\tsetIsInserterOpened( true );\n\t\t}\n\t}, [ isInserterOpen, setIsInserterOpened ] );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst isFocusMode = templateType === 'wp_template_part';\n\n\treturn (\n\t\t<div className=\"edit-site-header\">\n\t\t\t<div className=\"edit-site-header_start\">\n\t\t\t\t<div className=\"edit-site-header__toolbar\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tref={ inserterButton }\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tisPressed={ isInserterOpen }\n\t\t\t\t\t\tclassName=\"edit-site-header-toolbar__inserter-toggle\"\n\t\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\t\tonClick={ openInserter }\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t'Toggle block inserter',\n\t\t\t\t\t\t\t'Generic label for block inserter button'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToolSelector />\n\t\t\t\t\t\t\t<UndoButton />\n\t\t\t\t\t\t\t<RedoButton />\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"edit-site-header-toolbar__list-view-toggle\"\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ __( 'List View' ) }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div className=\"edit-site-header_center\">\n\t\t\t\t<DocumentActions\n\t\t\t\t\tentityTitle={ entityTitle }\n\t\t\t\t\tentityLabel={\n\t\t\t\t\t\ttemplateType === 'wp_template_part'\n\t\t\t\t\t\t\t? 'template part'\n\t\t\t\t\t\t\t: 'template'\n\t\t\t\t\t}\n\t\t\t\t\tisLoaded={ isLoaded }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<TemplateDetails\n\t\t\t\t\t\t\ttemplate={ template }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</DocumentActions>\n\t\t\t</div>\n\n\t\t\t<div className=\"edit-site-header_end\">\n\t\t\t\t<div className=\"edit-site-header__actions\">\n\t\t\t\t\t{ ! isFocusMode && (\n\t\t\t\t\t\t<PreviewOptions\n\t\t\t\t\t\t\tdeviceType={ deviceType }\n\t\t\t\t\t\t\tsetDeviceType={ setPreviewDeviceType }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<SaveButton\n\t\t\t\t\t\topenEntitiesSavedStates={ openEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={ isEntitiesSavedStatesOpen }\n\t\t\t\t\t/>\n\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-site\" />\n\t\t\t\t\t<MoreMenu />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
@@ -42,34 +42,37 @@ const MoreMenu = () => (0, _element.createElement)(_components.DropdownMenu, {
42
42
  label: (0, _i18n.__)('More tools & options'),
43
43
  popoverProps: POPOVER_PROPS,
44
44
  toggleProps: TOGGLE_PROPS
45
- }, ({
46
- onClose
47
- }) => (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.MenuGroup, {
48
- label: (0, _i18n._x)('View', 'noun')
49
- }, (0, _element.createElement)(_featureToggle.default, {
50
- feature: "fixedToolbar",
51
- label: (0, _i18n.__)('Top toolbar'),
52
- info: (0, _i18n.__)('Access all block and document tools in a single place'),
53
- messageActivated: (0, _i18n.__)('Top toolbar activated'),
54
- messageDeactivated: (0, _i18n.__)('Top toolbar deactivated')
55
- }), (0, _element.createElement)(_featureToggle.default, {
56
- feature: "focusMode",
57
- label: (0, _i18n.__)('Spotlight mode'),
58
- info: (0, _i18n.__)('Focus on one block at a time'),
59
- messageActivated: (0, _i18n.__)('Spotlight mode activated'),
60
- messageDeactivated: (0, _i18n.__)('Spotlight mode deactivated')
61
- }), (0, _element.createElement)(_interface.ActionItem.Slot, {
62
- name: "core/edit-site/plugin-more-menu",
63
- label: (0, _i18n.__)('Plugins'),
64
- as: _components.MenuGroup,
65
- fillProps: {
66
- onClick: onClose
67
- }
68
- })), (0, _element.createElement)(_toolsMoreMenuGroup.default.Slot, {
69
- fillProps: {
45
+ }, _ref => {
46
+ let {
70
47
  onClose
71
- }
72
- })));
48
+ } = _ref;
49
+ return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.MenuGroup, {
50
+ label: (0, _i18n._x)('View', 'noun')
51
+ }, (0, _element.createElement)(_featureToggle.default, {
52
+ feature: "fixedToolbar",
53
+ label: (0, _i18n.__)('Top toolbar'),
54
+ info: (0, _i18n.__)('Access all block and document tools in a single place'),
55
+ messageActivated: (0, _i18n.__)('Top toolbar activated'),
56
+ messageDeactivated: (0, _i18n.__)('Top toolbar deactivated')
57
+ }), (0, _element.createElement)(_featureToggle.default, {
58
+ feature: "focusMode",
59
+ label: (0, _i18n.__)('Spotlight mode'),
60
+ info: (0, _i18n.__)('Focus on one block at a time'),
61
+ messageActivated: (0, _i18n.__)('Spotlight mode activated'),
62
+ messageDeactivated: (0, _i18n.__)('Spotlight mode deactivated')
63
+ }), (0, _element.createElement)(_interface.ActionItem.Slot, {
64
+ name: "core/edit-site/plugin-more-menu",
65
+ label: (0, _i18n.__)('Plugins'),
66
+ as: _components.MenuGroup,
67
+ fillProps: {
68
+ onClick: onClose
69
+ }
70
+ })), (0, _element.createElement)(_toolsMoreMenuGroup.default.Slot, {
71
+ fillProps: {
72
+ onClose
73
+ }
74
+ }));
75
+ });
73
76
 
74
77
  var _default = MoreMenu;
75
78
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/header/more-menu/index.js"],"names":["POPOVER_PROPS","className","position","TOGGLE_PROPS","tooltipPosition","MoreMenu","moreVertical","onClose","MenuGroup","onClick"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAZA;AACA;AAC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AApB;AAAyB,EAAA,SAAS,EAAG;AAAEA,IAAAA;AAAF;AAArC,EA3BD,CARF,CADD;;eA0CeF,Q","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { moreVertical } from '@wordpress/icons';\nimport { DropdownMenu, MenuGroup } from '@wordpress/components';\nimport { ActionItem } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport FeatureToggle from '../feature-toggle';\nimport ToolsMoreMenuGroup from '../tools-more-menu-group';\n\nconst POPOVER_PROPS = {\n\tclassName: 'edit-site-more-menu__content',\n\tposition: 'bottom left',\n};\nconst TOGGLE_PROPS = {\n\ttooltipPosition: 'bottom',\n};\n\nconst MoreMenu = () => (\n\t<DropdownMenu\n\t\tclassName=\"edit-site-more-menu\"\n\t\ticon={ moreVertical }\n\t\tlabel={ __( 'More tools & options' ) }\n\t\tpopoverProps={ POPOVER_PROPS }\n\t\ttoggleProps={ TOGGLE_PROPS }\n\t>\n\t\t{ ( { onClose } ) => (\n\t\t\t<>\n\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t<FeatureToggle\n\t\t\t\t\t\tfeature=\"fixedToolbar\"\n\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tmessageActivated={ __( 'Top toolbar activated' ) }\n\t\t\t\t\t\tmessageDeactivated={ __( 'Top toolbar deactivated' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<FeatureToggle\n\t\t\t\t\t\tfeature=\"focusMode\"\n\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\t\t\tmessageActivated={ __( 'Spotlight mode activated' ) }\n\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t'Spotlight mode deactivated'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\tname=\"core/edit-site/plugin-more-menu\"\n\t\t\t\t\t\tlabel={ __( 'Plugins' ) }\n\t\t\t\t\t\tas={ MenuGroup }\n\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t/>\n\t\t\t\t</MenuGroup>\n\t\t\t\t<ToolsMoreMenuGroup.Slot fillProps={ { onClose } } />\n\t\t\t</>\n\t\t) }\n\t</DropdownMenu>\n);\n\nexport default MoreMenu;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/header/more-menu/index.js"],"names":["POPOVER_PROPS","className","position","TOGGLE_PROPS","tooltipPosition","MoreMenu","moreVertical","onClose","MenuGroup","onClick"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAZA;AACA;AACA;;AAMA;AACA;AACA;AAIA,MAAMA,aAAa,GAAG;AACrBC,EAAAA,SAAS,EAAE,8BADU;AAErBC,EAAAA,QAAQ,EAAE;AAFW,CAAtB;AAIA,MAAMC,YAAY,GAAG;AACpBC,EAAAA,eAAe,EAAE;AADG,CAArB;;AAIA,MAAMC,QAAQ,GAAG,MAChB,4BAAC,wBAAD;AACC,EAAA,SAAS,EAAC,qBADX;AAEC,EAAA,IAAI,EAAGC,mBAFR;AAGC,EAAA,KAAK,EAAG,cAAI,sBAAJ,CAHT;AAIC,EAAA,YAAY,EAAGN,aAJhB;AAKC,EAAA,WAAW,EAAGG;AALf,GAOG;AAAA,MAAE;AAAEI,IAAAA;AAAF,GAAF;AAAA,SACD,qDACC,4BAAC,qBAAD;AAAW,IAAA,KAAK,EAAG,cAAI,MAAJ,EAAY,MAAZ;AAAnB,KACC,4BAAC,sBAAD;AACC,IAAA,OAAO,EAAC,cADT;AAEC,IAAA,KAAK,EAAG,cAAI,aAAJ,CAFT;AAGC,IAAA,IAAI,EAAG,cACN,uDADM,CAHR;AAMC,IAAA,gBAAgB,EAAG,cAAI,uBAAJ,CANpB;AAOC,IAAA,kBAAkB,EAAG,cAAI,yBAAJ;AAPtB,IADD,EAUC,4BAAC,sBAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,KAAK,EAAG,cAAI,gBAAJ,CAFT;AAGC,IAAA,IAAI,EAAG,cAAI,8BAAJ,CAHR;AAIC,IAAA,gBAAgB,EAAG,cAAI,0BAAJ,CAJpB;AAKC,IAAA,kBAAkB,EAAG,cACpB,4BADoB;AALtB,IAVD,EAmBC,4BAAC,qBAAD,CAAY,IAAZ;AACC,IAAA,IAAI,EAAC,iCADN;AAEC,IAAA,KAAK,EAAG,cAAI,SAAJ,CAFT;AAGC,IAAA,EAAE,EAAGC,qBAHN;AAIC,IAAA,SAAS,EAAG;AAAEC,MAAAA,OAAO,EAAEF;AAAX;AAJb,IAnBD,CADD,EA2BC,4BAAC,2BAAD,CAAoB,IAApB;AAAyB,IAAA,SAAS,EAAG;AAAEA,MAAAA;AAAF;AAArC,IA3BD,CADC;AAAA,CAPH,CADD;;eA0CeF,Q","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { moreVertical } from '@wordpress/icons';\nimport { DropdownMenu, MenuGroup } from '@wordpress/components';\nimport { ActionItem } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport FeatureToggle from '../feature-toggle';\nimport ToolsMoreMenuGroup from '../tools-more-menu-group';\n\nconst POPOVER_PROPS = {\n\tclassName: 'edit-site-more-menu__content',\n\tposition: 'bottom left',\n};\nconst TOGGLE_PROPS = {\n\ttooltipPosition: 'bottom',\n};\n\nconst MoreMenu = () => (\n\t<DropdownMenu\n\t\tclassName=\"edit-site-more-menu\"\n\t\ticon={ moreVertical }\n\t\tlabel={ __( 'More tools & options' ) }\n\t\tpopoverProps={ POPOVER_PROPS }\n\t\ttoggleProps={ TOGGLE_PROPS }\n\t>\n\t\t{ ( { onClose } ) => (\n\t\t\t<>\n\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t<FeatureToggle\n\t\t\t\t\t\tfeature=\"fixedToolbar\"\n\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tmessageActivated={ __( 'Top toolbar activated' ) }\n\t\t\t\t\t\tmessageDeactivated={ __( 'Top toolbar deactivated' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<FeatureToggle\n\t\t\t\t\t\tfeature=\"focusMode\"\n\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\t\t\tmessageActivated={ __( 'Spotlight mode activated' ) }\n\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t'Spotlight mode deactivated'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\tname=\"core/edit-site/plugin-more-menu\"\n\t\t\t\t\t\tlabel={ __( 'Plugins' ) }\n\t\t\t\t\t\tas={ MenuGroup }\n\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t/>\n\t\t\t\t</MenuGroup>\n\t\t\t\t<ToolsMoreMenuGroup.Slot fillProps={ { onClose } } />\n\t\t\t</>\n\t\t) }\n\t</DropdownMenu>\n);\n\nexport default MoreMenu;\n"]}
@@ -25,13 +25,16 @@ const {
25
25
  Slot
26
26
  } = (0, _components.createSlotFill)('EditSiteToolsMoreMenuGroup');
27
27
 
28
- ToolsMoreMenuGroup.Slot = ({
29
- fillProps
30
- }) => (0, _element.createElement)(Slot, {
31
- fillProps: fillProps
32
- }, fills => !(0, _lodash.isEmpty)(fills) && (0, _element.createElement)(_components.MenuGroup, {
33
- label: (0, _i18n.__)('Tools')
34
- }, fills));
28
+ ToolsMoreMenuGroup.Slot = _ref => {
29
+ let {
30
+ fillProps
31
+ } = _ref;
32
+ return (0, _element.createElement)(Slot, {
33
+ fillProps: fillProps
34
+ }, fills => !(0, _lodash.isEmpty)(fills) && (0, _element.createElement)(_components.MenuGroup, {
35
+ label: (0, _i18n.__)('Tools')
36
+ }, fills));
37
+ };
35
38
 
36
39
  var _default = ToolsMoreMenuGroup;
37
40
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/header/tools-more-menu-group/index.js"],"names":["Fill","ToolsMoreMenuGroup","Slot","fillProps","fills"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA,IAAI,EAAEC,kBAAR;AAA4BC,EAAAA;AAA5B,IAAqC,gCAC1C,4BAD0C,CAA3C;;AAIAD,kBAAkB,CAACC,IAAnB,GAA0B,CAAE;AAAEC,EAAAA;AAAF,CAAF,KACzB,4BAAC,IAAD;AAAM,EAAA,SAAS,EAAGA;AAAlB,GACKC,KAAF,IACD,CAAE,qBAASA,KAAT,CAAF,IACC,4BAAC,qBAAD;AAAW,EAAA,KAAK,EAAG,cAAI,OAAJ;AAAnB,GAAqCA,KAArC,CAHH,CADD;;eAUeH,kB","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, MenuGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } = createSlotFill(\n\t'EditSiteToolsMoreMenuGroup'\n);\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) =>\n\t\t\t! isEmpty( fills ) && (\n\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>{ fills }</MenuGroup>\n\t\t\t)\n\t\t}\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/header/tools-more-menu-group/index.js"],"names":["Fill","ToolsMoreMenuGroup","Slot","fillProps","fills"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA,IAAI,EAAEC,kBAAR;AAA4BC,EAAAA;AAA5B,IAAqC,gCAC1C,4BAD0C,CAA3C;;AAIAD,kBAAkB,CAACC,IAAnB,GAA0B;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SACzB,4BAAC,IAAD;AAAM,IAAA,SAAS,EAAGA;AAAlB,KACKC,KAAF,IACD,CAAE,qBAASA,KAAT,CAAF,IACC,4BAAC,qBAAD;AAAW,IAAA,KAAK,EAAG,cAAI,OAAJ;AAAnB,KAAqCA,KAArC,CAHH,CADyB;AAAA,CAA1B;;eAUeH,kB","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, MenuGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } = createSlotFill(\n\t'EditSiteToolsMoreMenuGroup'\n);\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) =>\n\t\t\t! isEmpty( fills ) && (\n\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>{ fills }</MenuGroup>\n\t\t\t)\n\t\t}\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"]}
@@ -30,9 +30,10 @@ var _constants2 = require("../../store/constants");
30
30
  /**
31
31
  * Internal dependencies
32
32
  */
33
- function KeyboardShortcuts({
34
- openEntitiesSavedStates
35
- }) {
33
+ function KeyboardShortcuts(_ref) {
34
+ let {
35
+ openEntitiesSavedStates
36
+ } = _ref;
36
37
  const {
37
38
  __experimentalGetDirtyEntityRecords,
38
39
  isSavingEntityRecord
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/keyboard-shortcuts/index.js"],"names":["KeyboardShortcuts","openEntitiesSavedStates","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","isListViewOpen","select","editSiteStore","isListViewOpened","isBlockInspectorOpen","interfaceStore","getActiveComplementaryArea","name","SIDEBAR_BLOCK","redo","undo","setIsListViewOpened","enableComplementaryArea","disableComplementaryArea","event","preventDefault","dirtyEntityRecords","isDirty","length","isSaving","some","record","kind","key","STORE_NAME","KeyboardShortcutsRegister","registerShortcut","keyboardShortcutsStore","category","description","keyCombination","modifier","character","Register"],"mappings":";;;;;;;AAGA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAWA;AACA;AACA;AAKA,SAASA,iBAAT,CAA4B;AAAEC,EAAAA;AAAF,CAA5B,EAA0D;AACzD,QAAM;AACLC,IAAAA,mCADK;AAELC,IAAAA;AAFK,MAGF,qBAAWC,eAAX,CAHJ;AAIA,QAAMC,cAAc,GAAG,qBACpBC,MAAF,IAAcA,MAAM,CAAEC,YAAF,CAAN,CAAwBC,gBAAxB,EADQ,EAEtB,EAFsB,CAAvB;AAIA,QAAMC,oBAAoB,GAAG,qBAC1BH,MAAF,IACCA,MAAM,CAAEI,gBAAF,CAAN,CAAyBC,0BAAzB,CACCJ,aAAcK,IADf,MAEMC,wBAJqB,EAK5B,EAL4B,CAA7B;AAOA,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,MAAiB,uBAAaX,eAAb,CAAvB;AACA,QAAM;AAAEY,IAAAA;AAAF,MAA0B,uBAAaT,YAAb,CAAhC;AACA,QAAM;AAAEU,IAAAA,uBAAF;AAA2BC,IAAAA;AAA3B,MAAwD,uBAC7DR,gBAD6D,CAA9D;AAIA,sCAAa,qBAAb,EAAsCS,KAAF,IAAa;AAChDA,IAAAA,KAAK,CAACC,cAAN;;AAEA,UAAMC,kBAA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":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { SIDEBAR_BLOCK } from '../sidebar/constants';\nimport { STORE_NAME } from '../../store/constants';\n\nfunction KeyboardShortcuts( { openEntitiesSavedStates } ) {\n\tconst {\n\t\t__experimentalGetDirtyEntityRecords,\n\t\tisSavingEntityRecord,\n\t} = useSelect( coreStore );\n\tconst isListViewOpen = useSelect(\n\t\t( select ) => select( editSiteStore ).isListViewOpened(),\n\t\t[]\n\t);\n\tconst isBlockInspectorOpen = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t) === SIDEBAR_BLOCK,\n\t\t[]\n\t);\n\tconst { redo, undo } = useDispatch( coreStore );\n\tconst { setIsListViewOpened } = useDispatch( editSiteStore );\n\tconst { enableComplementaryArea, disableComplementaryArea } = useDispatch(\n\t\tinterfaceStore\n\t);\n\n\tuseShortcut( 'core/edit-site/save', ( event ) => {\n\t\tevent.preventDefault();\n\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst isDirty = !! dirtyEntityRecords.length;\n\t\tconst isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\n\t\tif ( ! isSaving && isDirty ) {\n\t\t\topenEntitiesSavedStates();\n\t\t}\n\t} );\n\n\tuseShortcut( 'core/edit-site/undo', ( event ) => {\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-site/redo', ( event ) => {\n\t\tredo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-site/toggle-list-view', () => {\n\t\tsetIsListViewOpened( ! isListViewOpen );\n\t} );\n\n\tuseShortcut( 'core/edit-site/toggle-block-settings-sidebar', ( event ) => {\n\t\t// This shortcut has no known clashes, but use preventDefault to prevent any\n\t\t// obscure shortcuts from triggering.\n\t\tevent.preventDefault();\n\n\t\tif ( isBlockInspectorOpen ) {\n\t\t\tdisableComplementaryArea( STORE_NAME );\n\t\t} else {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\t\t}\n\t} );\n\n\treturn null;\n}\n\nfunction KeyboardShortcutsRegister() {\n\t// Registering the shortcuts\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/toggle-list-view',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Open the block list view.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'o',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/toggle-block-settings-sidebar',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Show or hide the block settings sidebar.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: ',',\n\t\t\t},\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nKeyboardShortcuts.Register = KeyboardShortcutsRegister;\nexport default KeyboardShortcuts;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/keyboard-shortcuts/index.js"],"names":["KeyboardShortcuts","openEntitiesSavedStates","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","isListViewOpen","select","editSiteStore","isListViewOpened","isBlockInspectorOpen","interfaceStore","getActiveComplementaryArea","name","SIDEBAR_BLOCK","redo","undo","setIsListViewOpened","enableComplementaryArea","disableComplementaryArea","event","preventDefault","dirtyEntityRecords","isDirty","length","isSaving","some","record","kind","key","STORE_NAME","KeyboardShortcutsRegister","registerShortcut","keyboardShortcutsStore","category","description","keyCombination","modifier","character","Register"],"mappings":";;;;;;;AAGA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAWA;AACA;AACA;AAKA,SAASA,iBAAT,OAA0D;AAAA,MAA9B;AAAEC,IAAAA;AAAF,GAA8B;AACzD,QAAM;AACLC,IAAAA,mCADK;AAELC,IAAAA;AAFK,MAGF,qBAAWC,eAAX,CAHJ;AAIA,QAAMC,cAAc,GAAG,qBACpBC,MAAF,IAAcA,MAAM,CAAEC,YAAF,CAAN,CAAwBC,gBAAxB,EADQ,EAEtB,EAFsB,CAAvB;AAIA,QAAMC,oBAAoB,GAAG,qBAC1BH,MAAF,IACCA,MAAM,CAAEI,gBAAF,CAAN,CAAyBC,0BAAzB,CACCJ,aAAcK,IADf,MAEMC,wBAJqB,EAK5B,EAL4B,CAA7B;AAOA,QAAM;AAAEC,IAAAA,IAAF;AAAQC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C,MAAAA,WAAW,EAAE,cAAI,0CAAJ,CAHI;AAIjBC,MAAAA,cAAc,EAAE;AACfC,QAAAA,QAAQ,EAAE,cADK;AAEfC,QAAAA,SAAS,EAAE;AAFI;AAJC,KAAF,CAAhB;AASA,GAlDD,EAkDG,CAAEN,gBAAF,CAlDH;AAoDA,SAAO,IAAP;AACA;;AAED/B,iBAAiB,CAACsC,QAAlB,GAA6BR,yBAA7B;eACe9B,iB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { SIDEBAR_BLOCK } from '../sidebar/constants';\nimport { STORE_NAME } from '../../store/constants';\n\nfunction KeyboardShortcuts( { openEntitiesSavedStates } ) {\n\tconst {\n\t\t__experimentalGetDirtyEntityRecords,\n\t\tisSavingEntityRecord,\n\t} = useSelect( coreStore );\n\tconst isListViewOpen = useSelect(\n\t\t( select ) => select( editSiteStore ).isListViewOpened(),\n\t\t[]\n\t);\n\tconst isBlockInspectorOpen = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t) === SIDEBAR_BLOCK,\n\t\t[]\n\t);\n\tconst { redo, undo } = useDispatch( coreStore );\n\tconst { setIsListViewOpened } = useDispatch( editSiteStore );\n\tconst { enableComplementaryArea, disableComplementaryArea } = useDispatch(\n\t\tinterfaceStore\n\t);\n\n\tuseShortcut( 'core/edit-site/save', ( event ) => {\n\t\tevent.preventDefault();\n\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst isDirty = !! dirtyEntityRecords.length;\n\t\tconst isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\n\t\tif ( ! isSaving && isDirty ) {\n\t\t\topenEntitiesSavedStates();\n\t\t}\n\t} );\n\n\tuseShortcut( 'core/edit-site/undo', ( event ) => {\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-site/redo', ( event ) => {\n\t\tredo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-site/toggle-list-view', () => {\n\t\tsetIsListViewOpened( ! isListViewOpen );\n\t} );\n\n\tuseShortcut( 'core/edit-site/toggle-block-settings-sidebar', ( event ) => {\n\t\t// This shortcut has no known clashes, but use preventDefault to prevent any\n\t\t// obscure shortcuts from triggering.\n\t\tevent.preventDefault();\n\n\t\tif ( isBlockInspectorOpen ) {\n\t\t\tdisableComplementaryArea( STORE_NAME );\n\t\t} else {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\t\t}\n\t} );\n\n\treturn null;\n}\n\nfunction KeyboardShortcutsRegister() {\n\t// Registering the shortcuts\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/toggle-list-view',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Open the block list view.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'o',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/toggle-block-settings-sidebar',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Show or hide the block settings sidebar.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: ',',\n\t\t\t},\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nKeyboardShortcuts.Register = KeyboardShortcutsRegister;\nexport default KeyboardShortcuts;\n"]}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = Header;
9
+
10
+ var _element = require("@wordpress/element");
11
+
12
+ var _data = require("@wordpress/data");
13
+
14
+ var _coreData = require("@wordpress/core-data");
15
+
16
+ var _components = require("@wordpress/components");
17
+
18
+ var _addNewTemplate = _interopRequireDefault(require("../add-new-template"));
19
+
20
+ /**
21
+ * WordPress dependencies
22
+ */
23
+
24
+ /**
25
+ * Internal dependencies
26
+ */
27
+ function Header(_ref) {
28
+ var _postType$labels;
29
+
30
+ let {
31
+ templateType
32
+ } = _ref;
33
+ const postType = (0, _data.useSelect)(select => select(_coreData.store).getPostType(templateType), [templateType]);
34
+
35
+ if (!postType) {
36
+ return null;
37
+ }
38
+
39
+ return (0, _element.createElement)("header", {
40
+ className: "edit-site-list-header"
41
+ }, (0, _element.createElement)(_components.__experimentalHeading, {
42
+ level: 1,
43
+ className: "edit-site-list-header__title"
44
+ }, (_postType$labels = postType.labels) === null || _postType$labels === void 0 ? void 0 : _postType$labels.name), (0, _element.createElement)("div", {
45
+ className: "edit-site-list-header__right"
46
+ }, (0, _element.createElement)(_addNewTemplate.default, {
47
+ templateType: templateType
48
+ })));
49
+ }
50
+ //# sourceMappingURL=header.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/list/header.js"],"names":["Header","templateType","postType","select","coreStore","getPostType","labels","name"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;AAGe,SAASA,MAAT,OAAoC;AAAA;;AAAA,MAAnB;AAAEC,IAAAA;AAAF,GAAmB;AAClD,QAAMC,QAAQ,GAAG,qBACdC,MAAF,IAAcA,MAAM,CAAEC,eAAF,CAAN,CAAoBC,WAApB,CAAiCJ,YAAjC,CADE,EAEhB,CAAEA,YAAF,CAFgB,CAAjB;;AAKA,MAAK,CAAEC,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,SACC;AAAQ,IAAA,SAAS,EAAC;AAAlB,KACC,4BAAC,iCAAD;AAAS,IAAA,KAAK,EAAG,CAAjB;AAAqB,IAAA,SAAS,EAAC;AAA/B,yBACGA,QAAQ,CAACI,MADZ,qDACG,iBAAiBC,IADpB,CADD,EAKC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,uBAAD;AAAgB,IAAA,YAAY,EAAGN;AAA/B,IADD,CALD,CADD;AAWA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport AddNewTemplate from '../add-new-template';\n\nexport default function Header( { templateType } ) {\n\tconst postType = useSelect(\n\t\t( select ) => select( coreStore ).getPostType( templateType ),\n\t\t[ templateType ]\n\t);\n\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<header className=\"edit-site-list-header\">\n\t\t\t<Heading level={ 1 } className=\"edit-site-list-header__title\">\n\t\t\t\t{ postType.labels?.name }\n\t\t\t</Heading>\n\n\t\t\t<div className=\"edit-site-list-header__right\">\n\t\t\t\t<AddNewTemplate templateType={ templateType } />\n\t\t\t</div>\n\t\t</header>\n\t);\n}\n"]}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = List;
9
+
10
+ var _element = require("@wordpress/element");
11
+
12
+ var _interface = require("@wordpress/interface");
13
+
14
+ var _i18n = require("@wordpress/i18n");
15
+
16
+ var _compose = require("@wordpress/compose");
17
+
18
+ var _header = _interopRequireDefault(require("./header"));
19
+
20
+ var _navigationSidebar = _interopRequireDefault(require("../navigation-sidebar"));
21
+
22
+ var _table = _interopRequireDefault(require("./table"));
23
+
24
+ /**
25
+ * WordPress dependencies
26
+ */
27
+
28
+ /**
29
+ * Internal dependencies
30
+ */
31
+ function List(_ref) {
32
+ let {
33
+ templateType
34
+ } = _ref;
35
+ const isDesktopViewport = (0, _compose.useViewportMatch)('medium');
36
+ return (0, _element.createElement)(_interface.InterfaceSkeleton, {
37
+ className: "edit-site-list",
38
+ labels: {
39
+ drawer: (0, _i18n.__)('Navigation Sidebar')
40
+ },
41
+ header: (0, _element.createElement)(_header.default, {
42
+ templateType: templateType
43
+ }),
44
+ drawer: (0, _element.createElement)(_navigationSidebar.default, {
45
+ defaultIsOpen: isDesktopViewport,
46
+ activeTemplateType: templateType
47
+ }),
48
+ content: (0, _element.createElement)("main", {
49
+ className: "edit-site-list-main"
50
+ }, (0, _element.createElement)(_table.default, {
51
+ templateType: templateType
52
+ }))
53
+ });
54
+ }
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/list/index.js"],"names":["List","templateType","isDesktopViewport","drawer"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAZA;AACA;AACA;;AAKA;AACA;AACA;AAKe,SAASA,IAAT,OAAkC;AAAA,MAAnB;AAAEC,IAAAA;AAAF,GAAmB;AAChD,QAAMC,iBAAiB,GAAG,+BAAkB,QAAlB,CAA1B;AAEA,SACC,4BAAC,4BAAD;AACC,IAAA,SAAS,EAAC,gBADX;AAEC,IAAA,MAAM,EAAG;AACRC,MAAAA,MAAM,EAAE,cAAI,oBAAJ;AADA,KAFV;AAKC,IAAA,MAAM,EAAG,4BAAC,eAAD;AAAQ,MAAA,YAAY,EAAGF;AAAvB,MALV;AAMC,IAAA,MAAM,EACL,4BAAC,0BAAD;AACC,MAAA,aAAa,EAAGC,iBADjB;AAEC,MAAA,kBAAkB,EAAGD;AAFtB,MAPF;AAYC,IAAA,OAAO,EACN;AAAM,MAAA,SAAS,EAAC;AAAhB,OACC,4BAAC,cAAD;AAAO,MAAA,YAAY,EAAGA;AAAtB,MADD;AAbF,IADD;AAoBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { InterfaceSkeleton } from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Header from './header';\nimport NavigationSidebar from '../navigation-sidebar';\nimport Table from './table';\n\nexport default function List( { templateType } ) {\n\tconst isDesktopViewport = useViewportMatch( 'medium' );\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tclassName=\"edit-site-list\"\n\t\t\tlabels={ {\n\t\t\t\tdrawer: __( 'Navigation Sidebar' ),\n\t\t\t} }\n\t\t\theader={ <Header templateType={ templateType } /> }\n\t\t\tdrawer={\n\t\t\t\t<NavigationSidebar\n\t\t\t\t\tdefaultIsOpen={ isDesktopViewport }\n\t\t\t\t\tactiveTemplateType={ templateType }\n\t\t\t\t/>\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<main className=\"edit-site-list-main\">\n\t\t\t\t\t<Table templateType={ templateType } />\n\t\t\t\t</main>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}